bug with 1.3.6

30-12-2017 à 01:18:45
hello,
happy to see a french developper on such a project :)
since the 1.3.6 version of octoprint, using the rest API causes a crashs... the octopi (and btw octoprint) dont answer, neither via web interface. even pinging octopi don't wirk. i post a bug on octoprint ( https://github.com/foosel/OctoPrint/issues/2330 ). it seemed to be relative to the webcam, but apparently even with cam service down, it still frozes.
your app is not the only one in cause, this is the same with octodroid or octoandroid... once you connect to octoprint with the app, send a few command and launch a print, the print continues but all connection with octopi is lost...
may be something changes about the API in 1.3.6...
best regards
Jacques
02-01-2018 à 10:15:48
Hello Jacques!

Thank you for your message.

I've already seen this issue, you're not the only one to have this. A few other users reported me that their Raspberry Pi became unreachable after some actions.

Here's a post I've published on Printoid.net about that, may it can helps you:
https://printoid.net/2017/09/27/trick-21-my-raspberry-pi-becomes-unreachable-wireless-connection-lost/

To summarize a bit, this issue does not seem to be relative to OctoPrint, nor Printoid or other thirdpart apps but rather to a kernel issue on Raspian... needs more investigations.

One thing to try first is to disable the power management on your Raspberry Pi. Seems to help some users to solve the issue, depending on your Raspbian version.

You can also update your OS version (check on the internet how to do that)

Anthony

Developer of Printoid for OctoPrint, administrator of this forum
06-01-2018 à 18:23:21
Hi,
hard reboot is effectively the onliest solution... but it don't resolve the issue... in y opinion, there's a problem in the API (tornado) which makes the pi network fonction crashes... may be the devs are using a more recent kernel.
effectively, i should apt-get uddate all the pi... if python dist or kernel dist are in cause, the pb will vanish...
anyway i just put
wireless-power off
at the end of my /etc/network/interfaces (sudo nano /etc/network/interfaces) and we'll see :) if it woks, i'll put the info on octoprint git.

now it looks like this :
interfaces(5) file used by ifup(8) and ifdown(8)

# Please note that this file is written to be used with dhcpcd
# For static IP, consult /etc/dhcpcd.conf and 'man dhcpcd.conf'

# Include files from /etc/network/interfaces.d:
source-directory /etc/network/interfaces.d

auto lo
iface lo inet loopback

iface eth0 inet manual

allow-hotplug wlan0
iface wlan0-raspbian inet manual
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

allow-hotplug wlan1
iface wlan1-raspbian inet manual
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
mapping wlan0
script /root/bin/map_iface
mapping wlan1
script /root/bin/map_iface
source /boot/octopi-network.txt

#resoudre des soucis d'interface avec octoprint
wireless-power off
06-01-2018 à 21:20:35
ok issue solved : i notice with iwconfig that something was wrong on my PI :
pi@octopi:~ $ iwconfig
lo no wireless extensions.

wlan0 IEEE 802.11 ESSID:"Livebox-19B0"
Mode:Managed Frequency:2.412 GHz Access Point: 90:4D:4A:F7:50:50
Bit Rate=5.5 Mb/s Tx-Power=31 dBm
Retry short limit:7 RTS thr:off Fragment thr:off
Power Management:on
Link Quality=59/70 Signal level=-51 dBm
Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
Tx excessive retries:45366 Invalid misc:0 Missed beacon:0

and 1 minute after :
pi@octopi:~ $ iwconfig
lo no wireless extensions.

wlan0 IEEE 802.11 ESSID:"Livebox-19B0"
Mode:Managed Frequency:2.412 GHz Access Point: 90:4D:4A:F7:50:50
Bit Rate=96.1 Mb/s Tx-Power=31 dBm
Retry short limit:7 RTS thr:off Fragment thr:off
Power Management:off
Link Quality=60/70 Signal level=-50 dBm
Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
Tx excessive retries:59256 Invalid misc:0 Missed beacon:0


as you can see, wifi interface as a very high Tx excessive retrries (14k in minutes...)
that should explain the problem : may be thin changes in API charge more the network and when i updated it overflow the wifi and causes the bug...
if its true, its not really a bug, but my advice is that users who experienced (under octopi distribution) same problem may :
ssh octopi and type :
sudo iwconfig wlan0 power off
test if its ok
then edit /etc/network/interface :
sudo nano /etc/network/interfaces
by putting (on the wan part) :
wireless-power off
then CTRL + x
and it should worlk...

to verify : iwconfig shows me no more Tx excessive retries
08-01-2018 à 11:30:28
Hello Jacques,

Thank you so much for your great contribution. I've added a note to this article https://printoid.net/2017/09/27/trick-21-my-raspberry-pi-becomes-unreachable-wireless-connection-lost/ with your observations and your fix ;)

Kind regards,

Anthony

Developer of Printoid for OctoPrint, administrator of this forum