Raspberry pi not detecting arduino (potential undervoltage issues?)

Hi,

I’m trying to set up a custom bot, in particular it has a custom size and uses a RAMPS V1.4 board with TMC2130 stepper drivers in SPI mode.

To achieve this, I’ve made slight modifications to the farmware based on the current head on github:
In particular I added the disjunct “defined(RAMPS_V14)” to all the #if pragmas that were relevant to driving the TMC2130s and I have added the appropriate SPI pin numbers to the pins.h file for RAMPS_V14 as well as the chip select pins for each individual TMC2130. The SPI busses have also been appropriately wired to the RAMPS board.

This results in apparently functional farmware:
if I connect the Arduino to my laptop via USB and send the codes “F22 P2 V1 Q0” to approve the
configuration, then some G00 command, the farmbot’s motors move it to the appropriate position.
Note that I have not tested any other codes,
however, as my changes only pertained to driving
the TMC2130s, which appear to work, I imagine
the rest still works.

However, when I connect the Arduino to the raspberry pi 3 running v9.2.2 of farmbot os for rpi3 and after connecting it to the internet, the farmbot web interface indicates that it is unable to connect to the Arduino (error 30).

When connected, the LED on the Arduino lights up and it is quite clearly powered.
However, the interface also notifies me that the rpi is undervolted (due to it being powered by a rather poor quality usb power supply). Could this possibly be the cause of the rpi being unable to detect the Arduino?

When powered by the raspberry pi, the Arduino still appears to function as it usually does before the configuration is approved when powered by my laptop, i.e. by locking up the z-axis motor. Could it alternatively be the case that my changes to the farmware have caused this problem, despite the fact that it appears to accept commands as normal when powered by my laptop?

Any thoughts or advice on what could be causing this would be most welcome.

Thank you.

This was a huge problem in the <v1.2 days. My suggestion is that you find a better powersupply before proceeding.

1 Like

Hey Rick!

Thank you very much for your advice, I will give it a try with a better quality
power supply and see if that works :slight_smile:

Thanks,

Jules

1 Like

Hey Rick,

I’ve since tried supplying power to the rpi3 with a stock rpi PSU.
This fixed the under-voltage issue, however, the connectivity
issue with the Arduino remains (code 30), despite the fact that as before
it appears powered and, when sent commands from my laptop appears to function correctly.
(with of course the caveat that I have only tested a small subset of commands as described above)

The USB cable used to connect the laptop and the rpi3 to the Arduino was the same, so that
shouldn’t be the issue and I’ve repeatedly checked they are correctly connected.

I’ve also had a look through the logs and saw a few things that might be relevant;
a few errors when I tried to move the farmbot with the web app interface:

  • “Movement failed. “timeout waiting for request to complete: {“12”, {:parameter_read, [:movement_max_spd_x]}}””
  • “Movement failed. “timeout waiting for request to complete: {“14”, {:parameter_read, [:movement_max_spd_x]}}””
  • “Movement failed. “timeout waiting for request to complete: {“35”, {:parameter_read, [:movement_max_spd_x]}}””

and occasional warnings:

  • “Firmware hardware unset. Not flashing” a number of times
  • other warnings to do with connectivity that were due to
    me moving the wifi router it was connected to around.

Everything that I’ve found on “Movement failed” errors seems to
reference mechanical issues, so I guess these are only a side effect
of the lack of connectivity and do not give any diagnostic information.

I see that it’s not possible to ssh into Farmbot OS, is there any other way
I can extract information about what’s happening or do you have
any other suggestions as to what might be causing this?

Thanks for your help,

Jules

@Julek, SSH is possible and works well, but you land into the Elixir “shell” IEx, not an OS shell. From IEx, though, you can do all the Linux ( raspbian ) commands that BusyBox provides and a lot of others.

To setup SSH you usually enter your Public SSH Key when you configure Farmbot for the first time. Password Authentication method is not available.
Enter the key value literally. You have to open ADVANCED SETTINGS to see the input field.

1 Like

What have you set in the WebApp for FIRMWARE ? ( see my Device page below )

1 Like

Hey John,

Thank you very much for your reply and advice.

For the moment I have not updated the webapp with my custom firmware,
I only manually programmed the Arduino with it using another computer,
and it seems to be persistent. I’ll upload it and see if it clears anything up.

I’ll also have a look into the elixir interactive shell, as an aside, the documentation
here on the farmbot webapp is out of date, stating that it is not possible to SSH into farmbot os.
Is there someone I can notify?

But first, I think I will install Raspbian on the rpi3 and try and
manually send commands to the Arduino from it to rule out any possible
hardware issues.

Thanks,

Jules

Very good !

We’ll notify 50% of the FarmBot Dev. Team, @RickCarlino, about this :slightly_smiling_face:
I think that Documentation page is slightly “nuanced” :wink:

Man, You’re thorough !! :heart:

1 Like

Hey @Julek did changing the raspberry power supply to original work?
I use RAMPS v1.4 and raspberry has some issues with connecting to it.

@Konrad FBOS > v10 does not yet work with DIY devices. You may need to downgrade to v9.2.2.

A fix is planned for v10.1.1

Thanks for quick response. I’ll check this tomorrow and let you know about the results.

With v9.2.2 works without any issues thank you for response.

2 Likes