markwal / OctoPrint-PortLister

An OctoPrint plugin that notices when a new serial port appears and refreshes the port list without a page refresh
GNU Affero General Public License v3.0
26 stars 10 forks source link

PortLister will not auto-connect on Serial Port /dev/ttyAMA0 #14

Open Jimmy8881 opened 4 years ago

Jimmy8881 commented 4 years ago

I have my RaspberryPI 3b connected through the serial GPIO pins to the Serial port (AUX1) on my SKR 1.3 through port /dev/ttyAMA0 instead of using the external usb port, I can connect Octoprint manually to my printer when pressing the Connect button but it will not Auto-connect. Using Octoprint Version 1.4.2

brjhaverkamp commented 4 years ago

What type of printer are you using? I have a Prusa mk3, connected to /dev/ttyAMA0 and it also will not auto-connect

geekyboi commented 4 years ago

Did you manage to solve this issue. I'm having the same problem with a BTT SKR 1.4 Turbo

Jimmy8881 commented 3 years ago

What type of printer are you using? I have a Prusa mk3, connected to /dev/ttyAMA0 and it also will not auto-connect

Sorry for the late reply, my printer is a cr-10s but upgraded to a skr 1.3 motherboard. The only workaround I found was to use a fork of the PSU control plugin that includes an auto connect function that can be set up with dev/ttyAMA0

geekyboi commented 3 years ago

So I've spent a while trying to figure this one out.

This plugin only works for USB serial devices as it relies on a watchdog looking for new /dev/tty* files being created when a devices is connected. The GPIO serial file /dev/ttyAMA0 is always permanently there so the watchdog never starts the auto connect script.

You can detect when a serial device is attached to ttyAMA0 by using the serial.in_waiting command instead. Just need to add another function to trigger the on_port_created function when this occurs

cowboy commented 2 years ago

You can detect when a serial device is attached to ttyAMA0 by using the serial.in_waiting command instead. Just need to add another function to trigger the on_port_created function when this occurs

Did you ever happen to do this? If so, can you share what you did?