RPi Zero W and cameras

I'm waiting to get my Prusa Mark 3 and planning on adding a Zero W with OctoPi on it.

I've seen that people have added cameras to the setup (I'd prefer to use the RPi native camera), but also lots of reports about slow performance, stuttering, etc. on the single-core Zero W using the on-board WiFi.

Is this still the case? Or have these problems been resolved in current build versions?

Thanks!

From everything that I've read, the Pi Zero W will be hard pressed to handle the duties of OctoPrint without a camera. Adding the camera may be too much for it to handle esp. at higher resolutions.

1 Like

Yep. The included wifi interfaces is attached to the system in such a way that your CPU will be busy just pushing the webcam stream out to the network. There's not much left with regards to system resources to actually run a print job. Don't use a Zero W, it's not recommended and more trouble than worth it in most cases.

The idea of a Zero for OctoPrint is kinda baked into the concept for the Prusa, isn't it?
https://help.prusa3d.com/l/en/article/Loz15FAgEk-octo-print-raspberry-pi-zero-w

@tedder42 yep, and if they had bothered asking me before deciding on that I'd have told them what a really bad idea that was. But I sadly learnt about it from their press release when it was already too late. My own MK3 runs on a Pi3.

oh snap. I appreciate hearing 'the rest of the story'.

I believe we need tell the Raspberry Pi folks that they need to design a "Pi Zero W+" that does a better job with WiFi so it could actually be useful. The form factor has appeal but the performance sucks :grin:

It just has one core. That's it. The form factor is sexy since it's so small but you can't expect it to do what a Raspi3 does, I'm sorry.

I routinely watch my cores since I've got Conky running on my printer and I can tell that you need the beef for OctoPrint + webcam if you're monitoring it remotely.

Looks like there's been plenty of replies to your question but I'll share my experience anyway.

I just finished building my Mk3 and I bought a Pi Zero and a generic Raspian camera that uses the native camera interface before stumbling into the performance issues with the camera and Wi-Fi.

In short, it works wonderfully with a USB-Ethernet adapter. I'm using an Edimax EU-4208 plugged into a USB hub along with the serial connection to the Mk3. Prints fine and streams video perfectly.

When I use the wi-fi interface the video grinds to a halt. There is a lag of approximately 8 seconds and the frame rate is really slow. The quality of the time-lapse videos is okay because it's just snapping a single photo on z-axis change or at a defined interval.

I'm going to run it off the wired interface because I plan to put the printer in the garage and want to monitor prints without having to go out and check on the machine.

I do have a wired Ethernet line in my garage so no problems there. Out of curiosity I tested the performance with powerline Ethernet adapters and it worked fine. So if you already have the Pi Zero and don't mind dangling a USB hub and Ethernet adapter, it'll work.

1 Like

Thanks 'Wook'. Looking forward to my MK3 arriving.

No problem, have fun with it. I'm loving mine. Every day I find new, practical things to design and make.

Funny thing about the performance on wi-fi...I've been having issues with the throughput of my 2.4GHz wi-fi over the last week. Speedtest showing 250-300Mbps on the 5.8GHz band and 1-5Mbps on the 2.4GHz band. Ping times are 2-4ms on 5.8GHz and 75+ on 2.4GHz. Rubbish!

I have a Netgear router and according to a lot of boards the solution is to restore the factory defaults then load your configuration file back into it. And if that doesn't work people recommended going back a couple of firmware versions, thinking the issues are a result of a dodgy updates that Netgear has been rolling out.

I tried restoring the defaults and that didn't fix my problem. I don't want to roll the firmware back because the last two releases contain security fixes. Anyway, during my troubleshooting I was testing the various wi-fi config options. When I disabled the "Enable 20/40 MHz coexistence" option my throughput increased to 12-20Mbps on the 2.4GHz band, a slight improvement. Apparently this option allows compatibility with legacy 801.11b devices. I'm not worried about that, 802.11g was released more than 10 years ago and I know I don't have any wi-fi devices that old on my network.

I configured my Pi Zero (operates on 2.4GHz only) back to wi-fi back and the lag and smoothness of the video stream is MUCH better. Maybe just a coincidence, or perhaps the wireless access point forcing clients to operate in this mode lessens the load on the Pi's processor.

Anyway, heres a link to a Chrome browser screen capture of my Mk3 in the middle of a print while connected to my wireless network. Again, WAY better than before. Notice that when I click on the control tab to bring up the video the refresh is almost instant. When the Pi Zero was on wi-fi with the old router settings it would take several seconds for the page to load. When it finally loaded a stream of buffered video would play really quickly and then it would play "live" but with a really long lag and a slow frame rate.

So, update: Despite advice here, I decided to give it a try, since I already had a Zero W on hand. I used the Prusa image (and then immediately updated to current release OctoPrint) and the Pi native camera with a Zero-compatible cable.

Works reasonably well. No problem at all printing from OctoPrint (not SD) while streaming video and doing a timelapse all at the same time.

Only issue is startup. Takes around 5 minutes from powering up the printer to get to a point where I can access the web interface.

So while I'm sure a Pi 3 will do way better, this is quite acceptable, and more convenient - the board is inside the printer controller board (I printed a version with an easy access door), no separate power, just one extra cable to the camera. I'm going to call it 90% successful.

1 Like

Same, the convenience of no extra cables or power adapters is key. My low res stream works fine without issue. I prefer a USB webcam with an OTG adapter since the Pi camera ribbon is such a pain to manage.