FreeBSD Jail No Prinnter Connection

What is the problem?

Unable to make a connection to the printer. The serial port /dev/cuaU0 is detected by OctoPrint. Receiving this on connection attempts:

Offline after error
SerialException: device reports readiness to read but returned no data.

What did you already try to solve it?

Used two USB cables and both connect the printer to my laptop, rPi and Firewall without errors. Communication occurs as expected.

Reinstalled Jail using these instructions: SOLVED - Setting up OctoPrint on truenas 12 server inside iocage jails

Modified host OS (TrueNAS on FreeBSD) using these instructions: SOLVED - Can I use serial interface (RS-232) into a Jail | TrueNAS Community

Attempted connection with and without Malyan/Monoprice Connection Fix (0.1.3) plugin.

Installed on rPi400 and it works there, but can't run from that device long term. Also installed on OpenWRT and again, it works, but can't remain there due to flash wear.

Have you tried running in safe mode?

Yes.

Did running in safe mode solve the problem?

No.

Systeminfo Bundle

octoprint-systeminfo-20230608192329.zip (26.2 KB)

Additional information about your setup

Octoprint 1.9.0 (clean install)
Monoprice Select Mini V2 (latest fw for this version
FreeBSD Jail (12.4-Release) inside TrueNAS Core 12U8

Thanks in advance for any assistance,

Mike

usually we don't want users to ask the same question in multiple threads - but this is such an edge case that you may also ask the question in this thread Setting up OctoPrint on TrueNAS 12 server inside iocage Jails

I also tested it last year and it worked for me

Btw afaik freenas also supports vms and containers. If the jail thing isn't working out I would try it that way.

Thanks PrintedWeezl. I have the same distaste for duplicate posts. I posted here first because FreeBSD is on the supported OS list. I may need to post in the FreeBSD support forums as well. This clearly feels like a configuration on that side.

What Flavor of TrueNAS did you test on? CORE, SCALE or Enterprise? Scale runs on Debian and has container support. VM support on CORE (my case) is rough due to bhyve. Passing a PCI device to a VM is not possible for me due to lack of CPU support.

That's true, but the jail adds another layer of complexity :wink:

Pretty sure it was CORE. It was just a quick test with a spare pc.

Yeah that might be the best solution since there aren't much people using a physical usb connection in a jail in general - let alone here.

This is 100% an issue between FreeBSD and the printer. At least I can report it is not OctoPrint.

I plugged in a serial programmer that will echo everything it receives. OctoPrint immediately connects to it and attempts to "Hello" the printer. I can see commands echoing.

There's an oddity though. When plugging in, the serial lights flicker as if something it being sent on the connection. It's only for a moment, but that's all it really takes to send something awful to the printer. I'll have to look into serial debugging to see what's up or connect the RX pin to another computer.

I'll leave this open and report back what I find in hopes it will help someone else.

1 Like

Short version: Monoprice Select Mini V2 ( aka Malyan M200 ) doesn't have a supported driver in FreeBSD.

Longer version,

I tried the ser2net and socat utilities and was able to connect to the printer from the jail. Socat closes the link every time the printer disconnects AND spews garbage that disabled the printer requiring a printer restart each time. That could be caused by socat or set2net and is very likely a result of my inexperience with both. The final nail is that video would not work at all.

My solution turned out to be my firewall, FriendlyElec nanoPi r6s, supports Docker. I made an NFS share to TrueNAS and moved all docker related storage to it to avoid flash wear. Had to install Video4Linux, docker-compose, and modify the docker-compose.yml to resolve a couple of problems, however this went very quickly. Only question unanswered is making Cura talk directly to OctoPrint and I suspect that has something to do with exposed ports from Docker. That's a task for another day.

Once I digest the myriad of notes and .bash_history, I'll try to post a guide.

Super Thanks to the OctoPrint Docker folks!! This was by far the easiest install with working video!!

Mike

1 Like

Glad to hear it works :slight_smile:

Just my two cents: I think you're a bit too concerned about flash wear.
A lot of us run OctoPrint or other software on sd cards for years without issues.
What's the worst that can happen? You buy a new sd card and flash it again and start over.
Create a backup from time to time and everything is fine.
If you really want to reduce wear you could use /dev/shm as temp folder for snapshots and mount the gcode folder from the nas.

But if you are happy with it, so am I. :slight_smile:
Happy printing :tentacle:

For systems with removable flash, I 100% agree. This runs off an internal 32GB eMMC. I could of course plug in a USB stick, however the NAS is just sitting there with TBs of space.

1 Like

SD cards in general (not the enterprise kind - just the normal sandisk $5-$20 card) don't have a long life expectancy compared to internal flash.
Pi compute modules and other sbc also come with internal flash and I haven't seen a lot of failing yet.

Don't get me wrong . I completely understand your point and I'm also trying to reduce wear whenever possible and want my devices to work as long as possible.

In the end the most important thing is that you're happy with the solution :slight_smile:

2 Likes

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.