#UI breaking when accessed from wifi access point

96 messages · Page 1 of 1 (latest)

gilded zodiac
#

Hi
I already asked on klipper dc but didn't get any response so let me repost here as well.
I have the following setup:

  • rpi hosts an access point
  • the ethernet connection is shared to that wifi
    when I connect mainsail through ethernet cable, it works fine, but when I do so through wifi ap, the UI crashes after ~10s. here is what journal on rpi says:
Jan 27 13:50:51 promatprusa python[779]: [websockets.py:open()] - Websocket Opened: ID: 547503807312, Proxied: True, User Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/144.0.0.0 Safari/537.36, Host >
Jan 27 13:50:51 promatprusa python[779]: [websockets.py:_handle_identify()] - Websocket 547503807312 Client Identified - Name: mainsail, Version: 2.17.0, Type: web
Jan 27 13:50:53 promatprusa python[779]: [websockets.py:on_close()] - Websocket Closed: ID: 547503807312 Close Code: None, Close Reason: None, Pong Time Elapsed: 1.66
Jan 27 13:50:53 promatprusa python[779]: [application.py:log_request()] - 101 GET /websocket (10.42.0.76) [_TRUSTED_USER_] 1.16ms
Jan 27 13:50:53 promatprusa python[779]: [websockets.py:open()] - Websocket Opened: ID: 547503644048, Proxied: True, User Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/144.0.0.0 Safari/537.36, Host >
Jan 27 13:50:53 promatprusa python[779]: [websockets.py:_handle_identify()] - Websocket 547503644048 Client Identified - Name: mainsail, Version: 2.17.0, Type: web
Jan 27 13:51:00 promatprusa systemd[1]: NetworkManager-dispatcher.service: Deactivated successfully.
Jan 27 13:51:04 promatprusa python[779]: [websockets.py:on_close()] - Websocket Closed: ID: 547503644048 Close Code: None, Close Reason: None, Pong Time Elapsed: 11.51
Jan 27 13:51:14 promatprusa systemd-networkd[307]: eth0: Gained carrier

I'd appreciate any help!
thank you in advance

uneven hawkBOT
#

Ahoi @gilded zodiac!
It looks like you did not provide all the necessary information we need to help you.
Please upload your logfiles and a detailed description of your problem.
For further information see: https://docs.mainsail.xyz/faq/getting-help/discord#provide-information
Note: We only accept .log and .txt files as log files.
This is an automated message

We are glad to help and chat with you on our Community Discord, but if you need help and want the best support possible you should, follow a few simple rules:

velvet terrace
#

do you have sonar enabled?

gilded zodiac
#

seems it is enabled but not active right now:

knpromat@promatprusa:~ $ systemctl status sonar
○ sonar.service - Sonar - A WiFi Keepalive daemon
     Loaded: loaded (/etc/systemd/system/sonar.service; enabled; preset: enabled)
     Active: inactive (dead) since Tue 2026-01-27 13:03:10 CET; 1h 13min ago
   Duration: 806ms
       Docs: https://github.com/mainsail-crew/sonar
   Main PID: 783 (code=exited, status=0/SUCCESS)
        CPU: 182ms

Jan 27 13:03:10 promatprusa python3[783]: [01/27/2026 13:03:10] Configuration loaded:
Jan 27 13:03:10 promatprusa python3[783]: [01/27/2026 13:03:10]   enable: False
Jan 27 13:03:10 promatprusa python3[783]: [01/27/2026 13:03:10]   debug_log: False
Jan 27 13:03:10 promatprusa python3[783]: [01/27/2026 13:03:10]   persistent_log: False
Jan 27 13:03:10 promatprusa python3[783]: [01/27/2026 13:03:10]   target: auto
Jan 27 13:03:10 promatprusa python3[783]: [01/27/2026 13:03:10]   count: 3
Jan 27 13:03:10 promatprusa python3[783]: [01/27/2026 13:03:10]   interval: 60
Jan 27 13:03:10 promatprusa python3[783]: [01/27/2026 13:03:10]   restart_threshold: 10
Jan 27 13:03:10 promatprusa python3[783]: [01/27/2026 13:03:10] Sonar is disabled in the configuration. Exiting.
Jan 27 13:03:10 promatprusa systemd[1]: sonar.service: Deactivated successfully.
velvet terrace
#
Jan 27 13:03:10 promatprusa python3[783]: [01/27/2026 13:03:10]   enable: False

its not enabled. this could create your issue in your setup, thats why i asked

#

pls upload you complete moonraker.log + the nginx log

gilded zodiac
#

but I'm experimenting with this setup since 3h so there might be a ton of crap in there

#

when current print ends I can restart everything and generate clean logs

gilded zodiac
#

btw here is my ip a s config:

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host noprefixroute 
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether d8:3a:dd:71:f1:f8 brd ff:ff:ff:ff:ff:ff
    inet 192.168.0.155/24 brd 192.168.0.255 scope global dynamic noprefixroute eth0
       valid_lft 3348sec preferred_lft 3348sec
    inet6 fe80::8e2a:6847:cabe:9147/64 scope link noprefixroute 
       valid_lft forever preferred_lft forever
3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether d8:3a:dd:71:f1:f9 brd ff:ff:ff:ff:ff:ff
    inet 10.42.0.1/24 brd 10.42.0.255 scope global noprefixroute wlan0
       valid_lft forever preferred_lft forever
    inet6 fe80::3f67:5af5:7dfe:4b64/64 scope link noprefixroute 
       valid_lft forever preferred_lft forever
velvet terrace
#

can you post your mainsail config from nginx?

gilded zodiac
#

generally I tought its a problem with nginx auth but disabling it didn't help

velvet terrace
#

can you try to ping it continuily and check if the ping also breaks when the gui break?

gilded zodiac
#

sure, will do that in ~1h

#

sounds like something worth checking

#

tbh, I oticed one more thing (idk if related) but when ssh via wifi and trying to start vim, it sometimes just doesn't start and my ssh session gets stuck

#

that might mean missing pings tbh

gilded zodiac
#

and, when I'm notconnecting mainsail ping is just fine

#

but when I try to connect the webgui

#

it becomes "uneven"

#

sometimes there are packets lost

#

sometimes not

#

I tried to check cpu load with top but I had no physical access to the rpi and top via ssh over wifi freezed

#

I can check tomorrow

velvet terrace
#

with 1-2sec for a ping, it could just be a websocket issue. so the latency is just too high and it drops the connection. pls check the console output if you see "socket closed" connections

gilded zodiac
#

what do you mean by "console output"? browser console?

velvet terrace
#

every browser has also a console. if you press F12, it should open it

gilded zodiac
#

I'll check tomorrow. I can't get to the lab now

#

btw, Is it mainsail who closes the connection due to timeout? maybe I can somehow increase this timeout or something?

velvet terrace
#

websocket is for "real time" data transfer. this will just be closed, when it get stuck

#

its more a technical dependency issue

gilded zodiac
#

it says this but that message does not have "instant" impact on the UI

#

it is responsive till it crashes

#

ah, yeah, because this is for the webcam

#

which is absent atm

#

btw, it suddenly stopped crashing for some reason

#

maybe this happens only when the print is going and the rpi processor is under load?

gilded zodiac
#

well, idk what happened but it still works fine

gilded zodiac
#

nevermind, still crashes

velvet terrace
#

it could be just possible, that your printer creates wifi issues and it just drop the wifi

gilded zodiac
#

well but my printer does not have wifi at all

#

also, I've checked and cpu usage when connecting mainsail is not too high

velvet terrace
#

where did you install klipper & moonraker?

gilded zodiac
#

Default locations

#

But they just found a funny interaction when I plug my AC adapter to my laptop and the socket it's suddenly stops crashing so now I suppose it's just the hardware issue

#

Maybe my raspberry misses a valid antenna or something

velvet terrace
#

and your pi is not in/near your printer?

gilded zodiac
#

it is

#

sec

#

here is my setup

#

the pi is behind the screen

velvet terrace
gilded zodiac
#

Well ive checked

#

I put my pi like this

#

With nothing connected to it except power

#

And it still crashes

#

Maybe thats some pi hardware issue

velvet terrace
#

pi has horrible wifi HW and driver... maybe just this is your issue

gilded zodiac
#

Possible

gilded zodiac
gilded zodiac
#

I even tried to use another AC adapter for my pi but the same result

gilded zodiac
#

What the f***

#

I just found out that when I ping the RPI

#

Every 0.2 seconds

#

It stops crashing

#

But it must be exactly 0.2 second not more

#

Update 0.3 works as well

#

But .4 doesn't

#

Nvm, must be .2

gilded zodiac
# gilded zodiac

And one more interesting thing is that the ping is almost instant (no spikes like here)

#

I will not work on like everything together and check if this work around still works

thin minnow
#

How many devices are on your wifi network? Wifi is a pretty weird thing, that it basically can only connect to one device at a time. If there is a lot of traffic on your wifi, the pi maybe crashes, due to not getting a connection fast enough?
That's just a theory

gilded zodiac
#

I'm the onlly device connecting to it

#

also, this doesn't explain why pinging it every 0.2 sec fixes the problem...

thin minnow
#

Like I said, just a theory. But the 0.2s could be treated as a "static" enough stream.

The weirdest thing we saw, was a connection drop, if an iPhone was near the pi.

I would also bet that the Pi isn't just the only device connecting to the AP, as e.g. your Smartphone is most likely not tethered or connected to a different AP, unless you bought a router just for that Pi.

gilded zodiac
#

the PI is the access point

#

and my laptop is the only device connected to that AP

thin minnow
#

Oh, sry, I didn't read through the whole thread. So I missed that point

#

I just read the last few messages

gilded zodiac
#

I suppose there might be something wrong with driver/networkmanager

#

but no idea what that could be

gilded zodiac
#

Hi, Let me repost here as I got some new info. My workaround (idk if mentioned above) was to ping -i 0.2 10.42.0.1 (ping my rpi and this fixed my issue)

#

Today I asked my friend to check some logs while I was pinging the rpi

#

and turned out that his connection is unstable as well

#

till he started his own ping

velvet terrace
#

So it's more a network issue in general?

gilded zodiac
#

Also found out that it affects ssh

#

Is mainsailos "officially supported" (whatever that means 😁 ) by debian?

#

If so, I think I should report this issue to debian

thin minnow
#

MainsailOS is just a Raspberry Pi OS Image with the Klipper stack preinstalled, and some extra things, like the networkmanager configuration through a text file, like wpa_supplicant.conf