tiny-pilot / tinypilot

Use your Raspberry Pi as a browser-based KVM.
https://tinypilotkvm.com
MIT License
3k stars 252 forks source link

I'm having serious reliability issues #201

Closed danmed closed 4 years ago

danmed commented 4 years ago

Straight after install things seem to work great.. then i'll go back to it a week later and the page just endlessly loads.. Sometimes i get everything but the video output, sometimes it just stays completely white.

i reboot the pi, and the same thing happens again..

Normaly a couple of reboots or a new quickinstall will fix it for a while..

but this time i can't get any of it back..just got a white screen with a spinning wheel in the middle of the screen.

danmed commented 4 years ago

As an aside, tonight i've done a apt update && apt upgrade.. and rebooted and i still can't get anything to work..

In chrome, i get everything looking nice, including the video, but it's not intercepting any of the commands (or atleast it's not updating the video).

In firefox the menu's are screwed up..

iexplore is just a no go completely.

Is there a way to uninstall completely and reinstall?

mtlynch commented 4 years ago

Sorry it's gone so crazy. Can you share some logs?

sudo journalctl -u tinypilot
sudo journalctl -u nginx

Also, can you post screenshots of what you're seeing and any output you're getting in the developer console?

image

The cleanest way to start over would be to start with a fresh Raspberry Pi OS install and just run the quick-install.

danmed commented 4 years ago

HI, so this morning in firefox it is taking forever to load, but when it does it looks OK, but i can't use the keyboard.

here are the logs : http://paste.debian.net/1163146/

image

Chrome loads much faster, but again I can't control anything.. I'll try and find some time later to redo the OS.

It seems that after a reboot, it fills the log up with this mouse errors. It does it again every time i click the browser window.

mtlynch commented 4 years ago

It looks like TinyPilot is failing to send keystrokes and mouse events through the USB cable to the target computer. The delay you're seeing is probably TinyPilot getting backed up waiting on all the events to go through (it waits 0.5s for each keystroke or mouse movement to succeed).

Can you try writing directly to the keyboard interface from the Pi on the command-line?

# Should type 'Hi' to the target computer.
echo -ne "\x20\0\xb\0\0\0\0\0" > /dev/hidg0 && \
  echo -ne "\0\0\xc\0\0\0\0\0" > /dev/hidg0 && \
  echo -ne "\0\0\0\0\0\0\0\0" > /dev/hidg0

I've seen the behavior you're experiencing when:

  1. The USB cable between the Pi and the target computer is disconnected
  2. The USB cable between the Pi and target computer doesn't support USB OTG (some cables don't)

It could also be that the cable got damaged (stepped on, rolled over by a chair). Do you have a spare cable you could test?

danmed commented 4 years ago

So this is weird, i reseated everything and i it's working perfectly.. on 1 other machine i access it from.. from everything else it's still problematic..

All using firefox.. really not sure whats going on here.

mtlynch commented 4 years ago

Can you share logs and screenshots from the machines where it's not working?

danmed commented 4 years ago

The only thing that appears not to be working is keyboard input.. what logs do you want?

This is from the console of one thats not working :

Some cookies are misusing the recommended “SameSite“ attribute 2 Cookie “session” will be soon rejected because it has the “SameSite” attribute set to “None” or an invalid value, without the “secure” attribute. To know more about the “SameSite“ attribute, read https://developer.mozilla.org/docs/Web/HTTP/Headers/Set-Cookie/SameSite 192.168.2.11 Cookie “io” will be soon rejected because it has the “SameSite” attribute set to “None” or an invalid value, without the “secure” attribute. To know more about the “SameSite“ attribute, read https://developer.mozilla.org/docs/Web/HTTP/Headers/Set-Cookie/SameSite 2 socket.io Uncaught TypeError: document.getElementById(...) is null showElementById http://192.168.2.11/js/app.js:25 onSocketConnect http://192.168.2.11/js/app.js:212 emit http://192.168.2.11/third-party/socket.io/2.3.0/socket.io.js:6 emit http://192.168.2.11/third-party/socket.io/2.3.0/socket.io.js:8 onconnect http://192.168.2.11/third-party/socket.io/2.3.0/socket.io.js:8 onpacket http://192.168.2.11/third-party/socket.io/2.3.0/socket.io.js:8 exports http://192.168.2.11/third-party/socket.io/2.3.0/socket.io.js:8 emit http://192.168.2.11/third-party/socket.io/2.3.0/socket.io.js:6 ondecoded http://192.168.2.11/third-party/socket.io/2.3.0/socket.io.js:6 exports http://192.168.2.11/third-party/socket.io/2.3.0/socket.io.js:8 emit http://192.168.2.11/third-party/socket.io/2.3.0/socket.io.js:6 add http://192.168.2.11/third-party/socket.io/2.3.0/socket.io.js:6 ondata http://192.168.2.11/third-party/socket.io/2.3.0/socket.io.js:6 exports http://192.168.2.11/third-party/socket.io/2.3.0/socket.io.js:8 emit http://192.168.2.11/third-party/socket.io/2.3.0/socket.io.js:6 onPacket http://192.168.2.11/third-party/socket.io/2.3.0/socket.io.js:7 setTransport http://192.168.2.11/third-party/socket.io/2.3.0/socket.io.js:7 emit http://192.168.2.11/third-party/socket.io/2.3.0/socket.io.js:6 onPacket http://192.168.2.11/third-party/socket.io/2.3.0/socket.io.js:7 n http://192.168.2.11/third-party/socket.io/2.3.0/socket.io.js:7 decodePayloadAsBinary http://192.168.2.11/third-party/socket.io/2.3.0/socket.io.js:7 decodePayloadAsBinary http://192.168.2.11/third-party/socket.io/2.3.0/socket.io.js:7 decodePayload http://192.168.2.11/third-party/socket.io/2.3.0/socket.io.js:7 onData http://192.168.2.11/third-party/socket.io/2.3.0/socket.io.js:7 doPoll http://192.168.2.11/third-party/socket.io/2.3.0/socket.io.js:7 emit http://192.168.2.11/third-party/socket.io/2.3.0/socket.io.js:6 onData http://192.168.2.11/third-party/socket.io/2.3.0/socket.io.js:7 onLoad http://192.168.2.11/third-party/socket.io/2.3.0/socket.io.js:7 onreadystatechange http://192.168.2.11/third-party/socket.io/2.3.0/socket.io.js:7 app.js:25:12 Uncaught TypeError: document.getElementById(...) is null hideElementById http://192.168.2.11/js/app.js:21 onSocketDisconnect http://192.168.2.11/js/app.js:220 emit http://192.168.2.11/third-party/socket.io/2.3.0/socket.io.js:6 emit http://192.168.2.11/third-party/socket.io/2.3.0/socket.io.js:8 onclose http://192.168.2.11/third-party/socket.io/2.3.0/socket.io.js:8 exports http://192.168.2.11/third-party/socket.io/2.3.0/socket.io.js:8 emit http://192.168.2.11/third-party/socket.io/2.3.0/socket.io.js:6 onclose http://192.168.2.11/third-party/socket.io/2.3.0/socket.io.js:6 exports http://192.168.2.11/third-party/socket.io/2.3.0/socket.io.js:8 emit http://192.168.2.11/third-party/socket.io/2.3.0/socket.io.js:6 onClose http://192.168.2.11/third-party/socket.io/2.3.0/socket.io.js:7 pingTimeoutTimer http://192.168.2.11/third-party/socket.io/2.3.0/socket.io.js:7 app.js:21:12 Some cookies are misusing the recommended “SameSite“ attribute 2

mtlynch commented 4 years ago

Looks like it might be a caching issue. Can you hit Ctrl+Refresh in the browsers where it's not working and try again?

If that doesn't work, can you run this command from the Pi so that I can see what version you're running?

cd /opt/tinypilot
sudo git show | head -n 1
danmed commented 4 years ago

While im waiting for it to load enough for me to do that, here's the output

commit 56af6cadca456b45881b69a3d30099decda87a6c

danmed commented 4 years ago

Ah.. that might of worked... ctrl+f5.. thank you :)

danmed commented 4 years ago

Hmm im still getting a lot of errors about the mouse though... is that normal?

mtlynch commented 4 years ago

Can you try upgrading to the latest version with quick-install? I disabled caching so we can rule that out as a possibility.

danmed commented 4 years ago

run the upgrade and now nothing is being captured.. but it loads very fast lol

edit : A reboot of the pi fixed that problem :)

mtlynch commented 4 years ago

Glad it's working!