Repetier Server keeps failing, bad gateway 502
I've been trying for days to get Repetier Server working on my Raspberry Pi 3 B+. Pi has been running great for 2 years with OctoPrint but I have 2 more printers now and I want to manage them. I set Repetier Server up on a Pi a year ago for a school and it's been working flawlessly with 3 printers. However, now I can't even get it to run with 1.
My issue is that as soon as I have 2 printers connected, I can't connect the third. As soon as I do, I get the "Connection Lost" and then eventually "Bad Gateway502". I restart the Pi, same bad gateway. The only way to fix it is to reimage the Pi. Then as soon as I get the second printer set up, I get connection lost. Sometimes I get it when I'm trying to install the 3rd printer, sometimes I get it with just two. This last time, I had one printer on and connected, and connected the second printer by USB but had not turned it on yet. LCD on printer lit up and then RS lost connection.
I'm not sure where to go from here. I've upgraded RS to the latest version, switched USB cables. I tried restarting the web server from the command line and it loaded and then said "Connection Lost" again. Here's the log from the last attempt:
My issue is that as soon as I have 2 printers connected, I can't connect the third. As soon as I do, I get the "Connection Lost" and then eventually "Bad Gateway502". I restart the Pi, same bad gateway. The only way to fix it is to reimage the Pi. Then as soon as I get the second printer set up, I get connection lost. Sometimes I get it when I'm trying to install the 3rd printer, sometimes I get it with just two. This last time, I had one printer on and connected, and connected the second printer by USB but had not turned it on yet. LCD on printer lit up and then RS lost connection.
I'm not sure where to go from here. I've upgraded RS to the latest version, switched USB cables. I tried restarting the web server from the command line and it loaded and then said "Connection Lost" again. Here's the log from the last attempt:
2020-08-10 18:35:04: Webserver started. 2020-08-10 18:35:05: Connection started: WALL-E 2020-08-10 18:35:05: Reset printer WALL-E 2020-08-10 18:35:05: Connection started: Number 5 2020-08-10 18:35:05: Reset printer Number 5 2020-08-10 18:35:05: Register LUA cloud services 2020-08-10 18:35:05: add G-Code-Renderer 2020-08-10 18:35:05: LUA initalization finished. 2020-08-10 18:35:05: Websocket opened 2020-08-10 18:35:06: New SSID BierleinNetwork 2020-08-10 18:35:04: Reading printer config /var/lib/Repetier-Server/configs/Number_5.xml 2020-08-10 18:35:04: Starting printjob manager thread for Number_5 2020-08-10 18:35:04: Starting printer threads ... 2020-08-10 18:35:04: Starting printer thread for WALL-E 2020-08-10 18:35:04: Starting printer thread for Number 5 2020-08-10 18:35:04: Starting work dispatcher subsystem ... 2020-08-10 18:35:04: Starting user database ... 2020-08-10 18:35:04: Importing projects ... 2020-08-10 18:35:04: Importing wifi connections from /var/lib/Repetier-Server/database/repetier-network.xml 2020-08-10 18:35:04: Importing wifi connections from /var/lib/Repetier-Server/database/repetier-network-stored.xml 2020-08-10 18:35:04: Initializing LUA ... 2020-08-10 18:35:04: Register LUA cloud services 2020-08-10 18:35:04: add G-Code-Renderer 2020-08-10 18:35:04: LUA initalization finished. 2020-08-10 18:35:04: Work dispatcher thread started. 2020-08-10 18:35:04: Starting web server ... 2020-08-10 18:35:04: Internal work dispatcher thread started. 2020-08-10 18:35:04: Starting wifi watcher ... 2020-08-10 18:35:04: Webserver started. 2020-08-10 18:35:05: Connection started: WALL-E 2020-08-10 18:35:05: Reset printer WALL-E 2020-08-10 18:35:05: Connection started: Number 5 2020-08-10 18:35:05: Reset printer Number 5 2020-08-10 18:35:05: Register LUA cloud services 2020-08-10 18:35:05: add G-Code-Renderer 2020-08-10 18:35:05: LUA initalization finished. 2020-08-10 18:35:05: Websocket opened 2020-08-10 18:35:06: New SSID BierleinNetwork 2020-08-10 18:35:05: Register LUA cloud services 2020-08-10 18:35:05: add G-Code-Renderer 2020-08-10 18:35:05: LUA initalization finished. 2020-08-10 18:35:05: Websocket opened 2020-08-10 18:35:06: New SSID BierleinNetwork
Then it loses connection and goes to bad gateway. Please help!
Comments
https://www.repetier-server.com/knowledgebase/undervoltage-and-throtteling-of-pi/
Especially try taping the 5V line as you described you power the printers 5V line over the pi which can easily draw 400mA per printer in addition.
Also even with older images you still can update the server version using the auto updater. This just updates the server version and not the linux kernel/packages.