random freezes on raspberrypi 3
Hi! I has raspberrypi 3 and random freezes when i have print. Log of the print in attachmend files ( https://dropmefiles.com/V9Oxl ).
I has install image for raspberrypi. Printer motherboard is mks gen l with repetier-firmware 1.0.3. Repetier-server is 0.91.2.
Comments
< 18:06:40.691: N278038 G1 X76.424 Y85.736 E1989.07437
What you see is that the server sends new commands as soon as it receives the "ok" but they seem to get delayed which you see as firmware also sends wait, so firmware had already send them correctly but it took time to be received.
Please connect during print with your pi and check with "top" cpu and memory usage. See if memory gets too high so it starts swapping or if some processes take too much cpu time so it will delay communication. It might also be a bandwidth problem with usb especially if you have a webcam with high resolution and view it. Network and printer go all over same usb bus so they may block communication to each other. Especially if you have a webcam without mjpg compression.
Good thing is there are no communication errors, so that is ok. It is not a baud rate thing.
One thing to improve might be use 32 moves buffer in firmware instead of default 16. That reduces the pauses and likelyhood to happen.
The fact that console also freezes at the times shows clearly it is no server issue but complete linux freezes for some reason. Explains why everything continues without errors as there are no errors leading to the problem.
The big question is what is linux doing that no processes run. A normal process can not do it I think so it must be something with high priority. Memory swapping is such a thing but total memory usage shows less then 10% are used, no swap. So must be something different. It might be wlan dependent. Can you test with ethernet connection and wlan completely disabled or set to always access point mode. Maybe it is loosing connection and reconnection blocks apps until it back again.
If it i snot wlan you could try running in console
tail -f /var/log/syslog
and see messages just before/after freezes. If you always see the same on freezes you have a hint what is causing it.
Run
sudo chmod a-x /usr/local/Repetier-Setup/bin/wlanscanner
to disable it so it not executabel.chmod a+x /usr/local/Repetier-Setup/bin/wlanscanner
makes it executeable again.If it does not execute it can not block. Should at least show if that is the reason. If it is enable it so you can select your wifi and once wifi works you can make it not executeable again. wifi should still work but you prevent extra scants requested by server. Then question would still stay why it blocks for you and not for me, but first lets see if it really the reason.
May 19 18:09:57 Repetier-Server wpa_supplicant[456]: wlan0: Failed to initiate sched scan
it is clear it is not our scanner causing the messages that you said to coincide with the freezes. wpa_supplicant is the software doing it. So try to disable wlan0 completely to stop it from doing it (requires ethernet connection)
sudo ifconfig wlan0 down
hopefully stops it. See ifconfig afterwards.
If you mean sd card on printer it is clear it does not freeze. If you are right and wpa_supplicant causes the problems a usb cable is not the solution. Also since you had no communication error there is no reason to thing it is the problem.
How good is the sd card?
Here a short code sequence to test speed:
Here my results for a normal working card:
pi@Repetier-Server:~ $ dd if=/dev/zero of=~/test.tmp bs=500K count=1024
1024+0 records in
1024+0 records out
524288000 bytes (524 MB, 500 MiB) copied, 41.5075 s, 12.6 MB/s
pi@Repetier-Server:~ $ sync; echo 3 | sudo tee /proc/sys/vm/drop_caches
3
pi@Repetier-Server:~ $ dd if=~/test.tmp of=/dev/null bs=500K count=1024
1024+0 records in
1024+0 records out
524288000 bytes (524 MB, 500 MiB) copied, 24.1094 s, 21.7 MB/s
pi@Repetier-Server:~ $ rm ~/test.tmp
First speed 12.6MB/s is write speed. Second (21.7MB) is read speed. Maybe a slow card can produce the freezes.
Do you have logging enabled? Then try without logging as it means many writes. Also the rescue system does many writes so disable it. Then there is nearly no write left and reading is only at speed of printing.
1024+0 records in
1024+0 records out
524288000 bytes (524 MB, 500 MiB) copied, 32.0775 s, 16.3 MB/s
pi@Repetier-Server:~ $ sync; echo 3 | sudo tee /proc/sys/vm/drop_caches
3
pi@Repetier-Server:~ $ dd if=~/test.tmp of=/dev/null bs=500K count=1024
1024+0 records in
1024+0 records out
524288000 bytes (524 MB, 500 MiB) copied, 35.7277 s, 14.7 MB/s
I should check if the library for log file does flush it all the time. That would increase time and writes and is not required. But I think it does not.