Express XL Error 30. No connection between raspi and farmduino

I just did a test with the bore camera running through the cable chain (normal setup), but plugged the bore camera USB into my laptop instead of the FarmBot.

I was able to see the camera on the first try, no problem with the laptop. So I don’t think the problem is the camera itself, nor the cable run, but something in the FarmBot OS that isn’t working. I ran this command successfully on the laptop with the bore camera:

mplayer \
	-nosound \
	-vo xv \
	-tv device=/dev/video2:driver=v4l2:width=640:height=480 \
	tv://

At present, when I take pictures with the FarmBot and bore camera, it just returns a black image.

@roryaronson

I got a micro usb to usb adapter for my computer and the camera does show up in my computer in the terminal. But plugging it into the raspi shows nothing. Not sure what to do to proceed.

EDIT: despite being undetected in ssh the camera can take pictures. The line is not strung through the Y axis snake though or the solenoid wire bundle. Does that mean i should try the ferrite route?

Generally, they are referred to as an “RF choke.” They filter higher frequencies. Something like this is meant to shield a cable from a larger range of frequencies:


No guarantee it will help though.
1 Like

@aronrubin

Thanks for the link. I may get some of that.

@roryaronson

So i managed to take one photo, but subsequently the camera isn’t detected and doesn’t take pictures. Will the farmbot OS work with off the shelf webcams etc? I would like to get this working consistently and if that means i have to go 3rd party camera so be it. Just unsure of what my next steps should be here.

1 Like

For sure it works with this one even if the cable is 3 ft short and the lens needs to be refocused
https://amazon.com/dp/B07FCQ6N8T

I have a setup and working borescope camera on my FB, but the focal length is so short, that the camera needs to be almost touching the plant for the picture to be in focus. You said, when suggesting a camera

How do you do that? I looked and there doesn’t seem to be any option to move the lens on my existing camera. The only way I can think of doing it is to add a lens to alter the focal length. I was going to change cameras to get a different focal length.

You have to turn the lens. It may be difficult to do without breaking the camera. Typically this is done with a little bit of heat to weaken the adhesive and a fair amount of finesse. You can also use secondary lens. There is a calculator somewhere on the internet. I will also release all information I gather while making my cheap infagram setup. My day job has been pretty intense for the past few weeks so I have not had the time for FB

1 Like

I should have mentioned that the external shielding is not necessary if the cable is shielded.

@dmbgo Thanks for the insight into what its like with a working camera :slight_smile:

@aronrubin I definitely don’t trust myself with heating a camera lens like that lol.

I’m wondering if i can go with a wireless camera. Since i have the express XL i only have micro usb. And because i already run the fb through the command line, i probably could stitch the camera data and take photo trigger in. Although i dont know how much work that would be :grimacing:

2 Likes

I tried some ferrites and I didn’t see a difference. The camera worked when I had it in the FarmBot cable chain, but used with my laptop. So I don’t think (at the moment…) it is interference, since it works ok when I use my laptop.

That said, I was having issues with my vacuum pump turning off while in use. Debugging that, unplugging the camera USB, and the vacuum stopped failing. Those two cables run next to one another the whole run. Still unresolved…

I made an SD card with the latest Raspbian (Debian for Raspberry Pi), and I booted it on my FarmBot. It too had problems with the camera, whereas my x86_64 Debian laptops work with the camera. I’m starting to think this is a Raspberry Pi issue.

The best picture I could get with Raspbian was by adding this file for the module:

echo options uvcvideo nodrop=1 > /etc/modprobe.d/uvcvideo.conf

Then playing a really small mplayer:

mplayer -vo xv -tv device=/dev/video0:driver=v4l2:width=160:height=120 tv://

This would get me a picture like this:

Screenshot from 2020-07-01 19-31-39

So…Not sure what to do at this point…

@roryaronson @RickCarlino

I can detect the camera on my laptop (although only in one usb port) but raspi is unable to. Even if i just plug it in directly now. That would suggest that it might be a raspi issue? Are there any other tests you want me to run? What would you suggest i do to get this working?

Also would you be able to speak to hooking up a wireless camera and pulling the images directly to my computer? Am i looking at quite a bit of work to use the openCV system you have set up if i have the images stored locally, for localizing plants etc. Currently i interact with the farmbot via command line so that seems like a possibility for me.

1 Like

We’ve noted some driver issues in a small subset of 1.5 cameras. Another possibility is a burnt USB port, which is also something we see from time-to-time. If either is the case, the part can be replaced under warranty. I will pass this along to the Rory and Gabe when they are in the office on Monday (I not based out of California and as such do not handle matters relating to warehouse goods).

I have never tried to plug a wireless camera into a FarmBot, so I cannot say. What I can say though is that many (but not all) off-the-shelf webcams will plug and play with FBOS. As an alternative, some advanced users will wire in a second RPi that runs custom software in tandem with the FamBot’s RPi. This is advantageous because FBOS is an embedded Linux system that does not have many of the tools you would find on a traditional desktop Linux OS (eg: There is no Bash, package manager, etc…).

I’m not sure I understand your use case, but here’s a Bash script to download a list of all device images if you want to store them locally:

# STEP ZERO: Install Curl, JQ
sudo apt-get install curl jq --yes

# STEP ONE: Extract "token.encoded" from auth token:
TOKEN=`curl -H "Content-Type: application/json" \
     -X POST \
     -d '{"user":{"email":"YOUR_EMAIL","password":"YOUR_EMAIL"}}' \
     https://my.farm.bot/api/tokens | jq ".token.encoded" --raw-output`

# STEP TWO: Download images from /api/images endpoint and print URL:
curl -H "Authorization: Bearer ${TOKEN}" https://my.farm.bot/api/images | jq 'map(.attachment_url)'

Does this answer your question or were you trying to do something else?

EDIT, MARCH 2021: A newer script is available here.

3 Likes

Thank you for all the info and the bash script! I will see if replacing the raspi fixes the issue.
Do you have any additional info on wiring in a second RPi? I’m not a hardware expert so not sure where to start for that.

When i mentioned storing the images locally, i was thinking along the lines of connecting to the camera directly with my laptop and triggering the camera captures programmatically

We don’t have any official recommendations, but there are a few people on the forum who have done this already:

As far as the software goes, since the secondary Pi is not dependant on FBOS for anything other than commands, you are free to choose whichever tools you prefer for the job.

OK, I was under the impression you wanted to call the “TAKE PHOTO” command (either via sequence + Farm Event or via external tool such as FBJS).

Once your camera issues are resolved, downloading the images off of the API might be a simpler solution and would not require a second camera (although there definitely are some users that still install a second camera).

1 Like

I ordered this: “Genesis v1.2 - v1.4 Camera”

I got it today and plugged it into my Genesis v1.5 XL and it worked first try no problems. The camera that shipped with the FarmBot still doesn’t work with it, I haven’t figured out why.

Congrats! The tomato plants took over so i tabled the camera issue. But the season is nearing so i’ll open it up again

@RickCarlino I’m having an code 30 error with a DIY Express 1.0…could there be similar issue with my account as well that Shuza had?

@FarmDano The cause of a code 30 is a lack of connectivity to an Arduino microcontroller. That could be caused by:

  • A physical issue (bad cable, unplugged, defective device)
  • You have a microcontroller with a different device path than the default Arduino that ships with official kits.

I am no longer actively involved with the development of FBOS though so I can’t provide more recent details beyond that, unfortunately.

1 Like

AH! I see the “Former” under your name. thanks for taking the time to tell tho