OctoPrint-TFT
OctoPrint-TFT copied to clipboard
OctoPrint-TFT Constant connection attempts
My printer is typically "off", and I use the GPIO of the Pi to turn it on when needed. OctoPrint understands and respects this, maintaining a blank display in the "Terminal" tab of the web interface.
Once I install OctoPrint-TFT, it is constantly attempting to connect to the printer, and the Terminal tab shows a constant scroll of:
Serial port list: [] Changing monitoring state from 'Detecting serial port' to 'Error: Failed to autodetect serial port, please set it manually.' Failed to autodetect serial port, please set it manually. Changing monitoring state from 'Offline' to 'Detecting serial port' Serial port list: [] Changing monitoring state from 'Detecting serial port' to 'Error: Failed to autodetect serial port, please set it manually.' Failed to autodetect serial port, please set it manually. Changing monitoring state from 'Offline' to 'Detecting serial port'
Syslog fills up with the following message: Feb 25 17:36:57 octopi xinit[8420]: time="2018-02-25T17:36:57Z" level=info msg="Connection offline, connecting: Error: Failed to autodetect serial port, please set it manually." file=ui.go func="ui.(*UI).verifyConnection" line=132 Feb 25 17:37:02 octopi xinit[8420]: time="2018-02-25T17:37:02Z" level=info msg="Connection offline, connecting: Error: Failed to autodetect serial port, please set it manually." file=ui.go func="ui.(*UI).verifyConnection" line=132
I believe OctoPrint-TFT should actually be getting the printer connection from OctoPrint, rather than trying to connect independently. However, I am uncertain what would need to change for this to happen.
I confirm that issue.
Unfortunately, I have zero knowledge of Go, and only marginal knowledge of most programming. Looking at the file indicated by the syslog messages (ui.go), lines 131 through 138 appear to be the ones at fault. I have no idea how to tell the system to wait for OctoPrint to connect on its own, how to tell OctoPrint to tell this program when connected, or whatever the appropriate solution would be. It does not seem to me that constant checking and attempting the connection would be the "best" solution... At least, not for my particular use-case...
@mcuadros Do you have any tips or tricks on where I could start, as far as figuring out exactly what causes this, or where in the code changes would need to be made? I'm not much of a coder, but I could take a look and see (if I had a starting point).
Alternately, if you think it is something you could knock out in a few minutes, I am more than willing to be a tester, and assist however I can.
You Octoprint, is connected to the printer? The errors that you have are from the octoprint, saying that your printer is offline.
Actually, the issue is only when OctoPrint-TFT is installed.
I have the power supply for my printer being controlled by the GPIO on the Pi, using the PSU Control Plugin. When I have OctoPi running, without installing OctoPrint-TFT, everything works fine. No error messages or anything. When I power on the printer, OctoPrint does not automatically connect, but I can connect without problem.
Once OctoPrint-TFT is installed, the Terminal tab of the web interface constantly scrolls the indicated errors (trying to connect to the printer). Additionally, the errors are constantly getting sent to syslog. As soon as I power on the printer, OctoPrint attempts to connect, rather than waiting for a manual connection to be initiated.
Basically, it appears that OctoPrint-TFT does not support the fact that OctoPrint could be running on a Pi, with the printer in an offline state.
That is the issue that I am seeing.
Yes, it expects to have a printer online, if it's offline, tries to connect, otherwise, the Octoprint-TFT, is useless.
Can you clarify your use case? Why you want the printer off?
For my use case, I have my printer power off when a print is finished, while keeping the Pi powered on. Then I can use the web interface to power the printer back on whenever I'm ready to print the next object. I do my slicing on my desktop, and just send stuff over to the Pi when I'm wanting to print it.
I would imagine that, when the printer isn't connected, OctoPrint-TFT would simply wait for a connection. Isn't there some element of the API that would send the information the octoprint has connected to a printer?
@mcuadros Would the "flags.operational" value from the API be what would tell if the printer was turned on or not? (http://docs.octoprint.org/en/master/api/datamodel.html#printer-related) Any hints how it could be integrated into OctoPrint-TFT to solve this?
Yep, this can be solved easily, but I need the time, and currently, I don't have it.
I've actually had to stop using this recently, due to to the following discovery: If I have a print that finishes, and the printer powers down, the above referenced loop occurs. After some time (if I'm sleeping/at work/otherwise occupied), the system becomes unresponsive and requires a reboot. Removing this addon resolves the issue. As best I can figure, there is a buffer or a logfile or something being overrun with the logging of the constant connection attempts. Rebooting the Pi gets things working again, but is far from a permanent solution.
I have the same issue. I like this much more than TouchUI but my Octopi is always running while, obviously, my printer is not.
@mcuadros do you have time to address this issue?
+1 Would love to see this added. if I get time I'll fork and try to add it my self.
This causes issues here. https://github.com/Z-Bolt/OctoScreen/issues/56