Fly Gemini Board: Adding a webcam stream

Before I published my final review of the Fly Gemini board (Available from Aliexpress) I wanted to really check what the Core side was capable of (on paper it should be similar to a raspberry pi a) and typically my experience is that it is the webcam support that lets down the less capable boards.

Typically, the image I use (Mainsail os) comes with the required bits installed and all you need to do is plug in the webcam and configure it. Unfortunately as per every stage so far with this controller, the base image provided is lacking somewhat. That said I knew I could install the mjpeg streamer using Kiauh. However, what I didn’t account for was that it wouldn’t tell me it wasn’t installed correctly! As it turns out there is some background work you need to do to get it ready – It’s not hard so here we go!

By now you will be used to this but first thing is first you will need to SSH into the board. Next we need to install cmake because it is used to build mjpeg streamer by kiauh or if you were to clone the repo and build it yourself. Kiauh should check for this dependency but there seems to be a bug (I’ve raised an ticket on github you can follow that here). Run the command below – it may take a little while.

sudo apt install cmake

List usb webcam devices using the code below. Hopefully you will be able to see your camera!

ls  /dev/v4l/by-id/

For some reason my camera creates two video devices when connected to this board and the one that works is not the one at index 0 (the default). Test the webcam works by using the command below. Note depending on your webcam you may need to alter the code below to try the other video options that appears from using the previous command. If you have an error here run the command “ls” and check if your folder structure uses mjpg_streamer or mjpg-streamer. adjust the commands bellow accordingly

cd mjpg_streamer
./mjpg_streamer -i "./input_uvc.so -d /dev/video1" -o "./output_http.so -w ./www"

Hopefully you should now be able to open mainsail and see a preview of the stream in the webcam window.

End the process by using Ctrl+C in the command line. Next we need to edit the webcam.txt file. Using the video input that worked on the previous device. Set the camera to usb and update the additional options to limit the resolution, frame rate. Lastly Set the device path to the one you used above.

### Configure which camera to use
#
# Available options are:
# - auto: tries first usb webcam, if that's not available tries raspi cam
# - usb: only tries usb webcam
# - raspi: only tries raspi cam
#
# Defaults to auto
#
camera="usb"

### Additional options to supply to MJPG Streamer for the USB camera
#
# See https://faq.octoprint.org/mjpg-streamer-config for available options
#
# Defaults to a resolution of 640x480 px and a framerate of 10 fps
#
camera_usb_options="-r 640x480 -f 10 -d /dev/video1"

Now safely shutdown the printer using the power icon in the top right hand corner of Mainsail and choosing powerdown (under host options). Turn off the power supply and turn it back on. If everything has worked correctly your webcam should be showing up when Mainsail reconnects.

My experience so far shows quite a fluctuating FPS. While printing I didn’t notice the load or memory usage on the Host get particularly high. Good luck and let me know how you get on!

Join the discord to keep up to date and get involved in the upcoming projects! https://discord.gg/mH3kMArY

One thought on “Fly Gemini Board: Adding a webcam stream

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: