Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error: expected START_HEADER0 0xfe, got nothing #22

Closed
Savedyou opened this issue Apr 11, 2020 · 5 comments · May be fixed by #23
Closed

error: expected START_HEADER0 0xfe, got nothing #22

Savedyou opened this issue Apr 11, 2020 · 5 comments · May be fixed by #23

Comments

@Savedyou
Copy link

Having issues with btmon in client mode hanging up and giving

expected START_HEADER0 0xfe, got nothing

restarting the btmon.py seems to fix it for awhile but eventually comes back after a few days.

@mroch
Copy link
Contributor

mroch commented Oct 20, 2020

same. this line in SocketServerCollector is reading 0 bytes, which I believe means the socket is closed:

data = self._conn.recv(count)

@mroch
Copy link
Contributor

mroch commented Oct 20, 2020

in 7 hours, it spewed 155GB in logs until it filled up my disk 🤪

-rw-r-----  1 root root 155757776896 Oct 20 13:35 2bc0985e43cf35390a19950caf1fecd261f9c4e359bf5845bda31146824e2757-json.log

@mroch
Copy link
Contributor

mroch commented Oct 20, 2020

interesting. mine goes bad because a port scanner on my network (an ovrc hub) hits the listening socket and sends garbage. I dunno what would cause an issue like that with client mode.

2020/10/20 19:16:34 SOCKET: waiting for connection
2020/10/20 19:16:34 SOCKET: got connection from 192.168.1.67:52460
2020/10/20 19:16:34 waiting for data from device
2020/10/20 19:16:34 reading 1 of 1 packets
2020/10/20 19:16:34 SOCKET: read 1 of 1 bytes from socket: 47
2020/10/20 19:16:34 read failed: expected START_HEADER0 0xfe, got 0x47
2020/10/20 19:16:34 reading 1 of 1 packets
2020/10/20 19:16:34 SOCKET: read 1 of 1 bytes from socket: 45
2020/10/20 19:16:34 read failed: expected START_HEADER0 0xfe, got 0x45
2020/10/20 19:16:34 reading 1 of 1 packets
2020/10/20 19:16:34 SOCKET: read 1 of 1 bytes from socket: 54
2020/10/20 19:16:34 read failed: expected START_HEADER0 0xfe, got 0x54
2020/10/20 19:16:34 reading 1 of 1 packets
2020/10/20 19:16:34 SOCKET: read 1 of 1 bytes from socket: 20
2020/10/20 19:16:34 read failed: expected START_HEADER0 0xfe, got 0x20
2020/10/20 19:16:34 reading 1 of 1 packets
2020/10/20 19:16:34 SOCKET: read 1 of 1 bytes from socket: 2f
2020/10/20 19:16:34 read failed: expected START_HEADER0 0xfe, got 0x2f
2020/10/20 19:16:34 reading 1 of 1 packets
2020/10/20 19:16:34 SOCKET: read 1 of 1 bytes from socket: 20
2020/10/20 19:16:34 read failed: expected START_HEADER0 0xfe, got 0x20
2020/10/20 19:16:34 reading 1 of 1 packets
2020/10/20 19:16:34 SOCKET: read 1 of 1 bytes from socket: 48
2020/10/20 19:16:34 read failed: expected START_HEADER0 0xfe, got 0x48
2020/10/20 19:16:34 reading 1 of 1 packets
2020/10/20 19:16:34 SOCKET: read 1 of 1 bytes from socket: 54
2020/10/20 19:16:34 read failed: expected START_HEADER0 0xfe, got 0x54
2020/10/20 19:16:34 reading 1 of 1 packets
2020/10/20 19:16:34 SOCKET: read 1 of 1 bytes from socket: 54
2020/10/20 19:16:34 read failed: expected START_HEADER0 0xfe, got 0x54
2020/10/20 19:16:34 reading 1 of 1 packets
2020/10/20 19:16:34 SOCKET: read 1 of 1 bytes from socket: 50
2020/10/20 19:16:34 read failed: expected START_HEADER0 0xfe, got 0x50
2020/10/20 19:16:34 reading 1 of 1 packets
2020/10/20 19:16:34 SOCKET: read 1 of 1 bytes from socket: 2f
2020/10/20 19:16:34 read failed: expected START_HEADER0 0xfe, got 0x2f
2020/10/20 19:16:34 reading 1 of 1 packets
2020/10/20 19:16:34 SOCKET: read 1 of 1 bytes from socket: 31
2020/10/20 19:16:34 read failed: expected START_HEADER0 0xfe, got 0x31
2020/10/20 19:16:34 reading 1 of 1 packets
2020/10/20 19:16:34 SOCKET: read 1 of 1 bytes from socket: 2e
2020/10/20 19:16:34 read failed: expected START_HEADER0 0xfe, got 0x2e
2020/10/20 19:16:34 reading 1 of 1 packets
2020/10/20 19:16:34 SOCKET: read 1 of 1 bytes from socket: 31
2020/10/20 19:16:34 read failed: expected START_HEADER0 0xfe, got 0x31
2020/10/20 19:16:34 reading 1 of 1 packets
2020/10/20 19:16:34 SOCKET: read 1 of 1 bytes from socket: 0d
2020/10/20 19:16:34 read failed: expected START_HEADER0 0xfe, got 0xd
2020/10/20 19:16:34 reading 1 of 1 packets
2020/10/20 19:16:34 SOCKET: read 1 of 1 bytes from socket: 0a
2020/10/20 19:16:34 read failed: expected START_HEADER0 0xfe, got 0xa
2020/10/20 19:16:34 reading 1 of 1 packets
2020/10/20 19:16:34 SOCKET: read 1 of 1 bytes from socket: 55
2020/10/20 19:16:34 read failed: expected START_HEADER0 0xfe, got 0x55
2020/10/20 19:16:34 reading 1 of 1 packets
2020/10/20 19:16:34 SOCKET: read 1 of 1 bytes from socket: 73
2020/10/20 19:16:34 read failed: expected START_HEADER0 0xfe, got 0x73
2020/10/20 19:16:34 reading 1 of 1 packets
2020/10/20 19:16:34 SOCKET: read 1 of 1 bytes from socket: 65
2020/10/20 19:16:34 read failed: expected START_HEADER0 0xfe, got 0x65
2020/10/20 19:16:34 reading 1 of 1 packets
2020/10/20 19:16:34 SOCKET: read 1 of 1 bytes from socket: 72
2020/10/20 19:16:34 read failed: expected START_HEADER0 0xfe, got 0x72
2020/10/20 19:16:34 reading 1 of 1 packets
2020/10/20 19:16:34 SOCKET: read 1 of 1 bytes from socket: 2d
2020/10/20 19:16:34 read failed: expected START_HEADER0 0xfe, got 0x2d
2020/10/20 19:16:34 reading 1 of 1 packets
2020/10/20 19:16:34 SOCKET: read 1 of 1 bytes from socket: 41
2020/10/20 19:16:34 read failed: expected START_HEADER0 0xfe, got 0x41
2020/10/20 19:16:34 reading 1 of 1 packets
2020/10/20 19:16:34 SOCKET: read 1 of 1 bytes from socket: 67
2020/10/20 19:16:34 read failed: expected START_HEADER0 0xfe, got 0x67
2020/10/20 19:16:34 reading 1 of 1 packets
2020/10/20 19:16:34 SOCKET: read 1 of 1 bytes from socket: 65
2020/10/20 19:16:34 read failed: expected START_HEADER0 0xfe, got 0x65
2020/10/20 19:16:34 reading 1 of 1 packets
2020/10/20 19:16:34 SOCKET: read 1 of 1 bytes from socket: 6e
2020/10/20 19:16:34 read failed: expected START_HEADER0 0xfe, got 0x6e
2020/10/20 19:16:34 reading 1 of 1 packets
2020/10/20 19:16:34 SOCKET: read 1 of 1 bytes from socket: 74
2020/10/20 19:16:34 read failed: expected START_HEADER0 0xfe, got 0x74
2020/10/20 19:16:34 reading 1 of 1 packets
2020/10/20 19:16:34 SOCKET: read 1 of 1 bytes from socket: 3a
2020/10/20 19:16:34 read failed: expected START_HEADER0 0xfe, got 0x3a
2020/10/20 19:16:34 reading 1 of 1 packets
2020/10/20 19:16:34 SOCKET: read 1 of 1 bytes from socket: 20
2020/10/20 19:16:34 read failed: expected START_HEADER0 0xfe, got 0x20
2020/10/20 19:16:34 reading 1 of 1 packets
2020/10/20 19:16:34 SOCKET: read 1 of 1 bytes from socket: 4f
2020/10/20 19:16:34 read failed: expected START_HEADER0 0xfe, got 0x4f
2020/10/20 19:16:34 reading 1 of 1 packets
2020/10/20 19:16:34 SOCKET: read 1 of 1 bytes from socket: 76
2020/10/20 19:16:34 read failed: expected START_HEADER0 0xfe, got 0x76
2020/10/20 19:16:34 reading 1 of 1 packets
2020/10/20 19:16:34 SOCKET: read 1 of 1 bytes from socket: 72
2020/10/20 19:16:34 read failed: expected START_HEADER0 0xfe, got 0x72
2020/10/20 19:16:34 reading 1 of 1 packets
2020/10/20 19:16:34 SOCKET: read 1 of 1 bytes from socket: 43
2020/10/20 19:16:34 read failed: expected START_HEADER0 0xfe, got 0x43
2020/10/20 19:16:34 reading 1 of 1 packets
2020/10/20 19:16:34 SOCKET: read 1 of 1 bytes from socket: 2d
2020/10/20 19:16:34 read failed: expected START_HEADER0 0xfe, got 0x2d
2020/10/20 19:16:34 reading 1 of 1 packets
2020/10/20 19:16:34 SOCKET: read 1 of 1 bytes from socket: 48
2020/10/20 19:16:34 read failed: expected START_HEADER0 0xfe, got 0x48
2020/10/20 19:16:34 reading 1 of 1 packets
2020/10/20 19:16:34 SOCKET: read 1 of 1 bytes from socket: 75
2020/10/20 19:16:34 read failed: expected START_HEADER0 0xfe, got 0x75
2020/10/20 19:16:34 reading 1 of 1 packets
2020/10/20 19:16:34 SOCKET: read 1 of 1 bytes from socket: 62
2020/10/20 19:16:34 read failed: expected START_HEADER0 0xfe, got 0x62
2020/10/20 19:16:34 reading 1 of 1 packets
2020/10/20 19:16:34 SOCKET: read 1 of 1 bytes from socket: 0d
2020/10/20 19:16:34 read failed: expected START_HEADER0 0xfe, got 0xd
2020/10/20 19:16:34 reading 1 of 1 packets
2020/10/20 19:16:34 SOCKET: read 1 of 1 bytes from socket: 0a
2020/10/20 19:16:34 read failed: expected START_HEADER0 0xfe, got 0xa
2020/10/20 19:16:34 reading 1 of 1 packets
2020/10/20 19:16:34 SOCKET: read 1 of 1 bytes from socket: 48
2020/10/20 19:16:34 read failed: expected START_HEADER0 0xfe, got 0x48
2020/10/20 19:16:34 reading 1 of 1 packets
2020/10/20 19:16:34 SOCKET: read 1 of 1 bytes from socket: 6f
2020/10/20 19:16:34 read failed: expected START_HEADER0 0xfe, got 0x6f
2020/10/20 19:16:34 reading 1 of 1 packets
2020/10/20 19:16:34 SOCKET: read 1 of 1 bytes from socket: 73
2020/10/20 19:16:34 read failed: expected START_HEADER0 0xfe, got 0x73
2020/10/20 19:16:34 reading 1 of 1 packets
2020/10/20 19:16:34 SOCKET: read 1 of 1 bytes from socket: 74
2020/10/20 19:16:34 read failed: expected START_HEADER0 0xfe, got 0x74
2020/10/20 19:16:34 reading 1 of 1 packets
2020/10/20 19:16:34 SOCKET: read 1 of 1 bytes from socket: 3a
2020/10/20 19:16:34 read failed: expected START_HEADER0 0xfe, got 0x3a
2020/10/20 19:16:34 reading 1 of 1 packets
2020/10/20 19:16:34 SOCKET: read 1 of 1 bytes from socket: 20
2020/10/20 19:16:34 read failed: expected START_HEADER0 0xfe, got 0x20
2020/10/20 19:16:34 reading 1 of 1 packets
2020/10/20 19:16:34 SOCKET: read 1 of 1 bytes from socket: 31
2020/10/20 19:16:34 read failed: expected START_HEADER0 0xfe, got 0x31
2020/10/20 19:16:34 reading 1 of 1 packets
2020/10/20 19:16:34 SOCKET: read 1 of 1 bytes from socket: 39
2020/10/20 19:16:34 read failed: expected START_HEADER0 0xfe, got 0x39
2020/10/20 19:16:34 reading 1 of 1 packets
2020/10/20 19:16:34 SOCKET: read 1 of 1 bytes from socket: 32
2020/10/20 19:16:34 read failed: expected START_HEADER0 0xfe, got 0x32
2020/10/20 19:16:34 reading 1 of 1 packets
2020/10/20 19:16:34 SOCKET: read 1 of 1 bytes from socket: 2e
2020/10/20 19:16:34 read failed: expected START_HEADER0 0xfe, got 0x2e
2020/10/20 19:16:34 reading 1 of 1 packets
2020/10/20 19:16:34 SOCKET: read 1 of 1 bytes from socket: 31
2020/10/20 19:16:34 read failed: expected START_HEADER0 0xfe, got 0x31
2020/10/20 19:16:34 reading 1 of 1 packets
2020/10/20 19:16:34 SOCKET: read 1 of 1 bytes from socket: 36
2020/10/20 19:16:34 read failed: expected START_HEADER0 0xfe, got 0x36
2020/10/20 19:16:34 reading 1 of 1 packets
2020/10/20 19:16:34 SOCKET: read 1 of 1 bytes from socket: 38
2020/10/20 19:16:34 read failed: expected START_HEADER0 0xfe, got 0x38
2020/10/20 19:16:34 reading 1 of 1 packets
2020/10/20 19:16:34 SOCKET: read 1 of 1 bytes from socket: 2e
2020/10/20 19:16:34 read failed: expected START_HEADER0 0xfe, got 0x2e
2020/10/20 19:16:34 reading 1 of 1 packets
2020/10/20 19:16:34 SOCKET: read 1 of 1 bytes from socket: 31
2020/10/20 19:16:34 read failed: expected START_HEADER0 0xfe, got 0x31
2020/10/20 19:16:34 reading 1 of 1 packets
2020/10/20 19:16:34 SOCKET: read 1 of 1 bytes from socket: 2e
2020/10/20 19:16:34 read failed: expected START_HEADER0 0xfe, got 0x2e
2020/10/20 19:16:34 reading 1 of 1 packets
2020/10/20 19:16:34 SOCKET: read 1 of 1 bytes from socket: 36
2020/10/20 19:16:34 read failed: expected START_HEADER0 0xfe, got 0x36
2020/10/20 19:16:34 reading 1 of 1 packets
2020/10/20 19:16:34 SOCKET: read 1 of 1 bytes from socket: 0d
2020/10/20 19:16:34 read failed: expected START_HEADER0 0xfe, got 0xd
2020/10/20 19:16:34 reading 1 of 1 packets
2020/10/20 19:16:34 SOCKET: read 1 of 1 bytes from socket: 0a
2020/10/20 19:16:34 read failed: expected START_HEADER0 0xfe, got 0xa
2020/10/20 19:16:34 reading 1 of 1 packets
2020/10/20 19:16:34 SOCKET: read 1 of 1 bytes from socket: 43
2020/10/20 19:16:34 read failed: expected START_HEADER0 0xfe, got 0x43
2020/10/20 19:16:34 reading 1 of 1 packets
2020/10/20 19:16:34 SOCKET: read 1 of 1 bytes from socket: 6f
2020/10/20 19:16:34 read failed: expected START_HEADER0 0xfe, got 0x6f
2020/10/20 19:16:34 reading 1 of 1 packets
2020/10/20 19:16:34 SOCKET: read 1 of 1 bytes from socket: 6e
2020/10/20 19:16:34 read failed: expected START_HEADER0 0xfe, got 0x6e
2020/10/20 19:16:34 reading 1 of 1 packets
2020/10/20 19:16:34 SOCKET: read 1 of 1 bytes from socket: 6e
2020/10/20 19:16:34 read failed: expected START_HEADER0 0xfe, got 0x6e
2020/10/20 19:16:34 reading 1 of 1 packets
2020/10/20 19:16:34 SOCKET: read 1 of 1 bytes from socket: 65
2020/10/20 19:16:34 read failed: expected START_HEADER0 0xfe, got 0x65
2020/10/20 19:16:34 reading 1 of 1 packets
2020/10/20 19:16:34 SOCKET: read 1 of 1 bytes from socket: 63
2020/10/20 19:16:34 read failed: expected START_HEADER0 0xfe, got 0x63
2020/10/20 19:16:34 reading 1 of 1 packets
2020/10/20 19:16:34 SOCKET: read 1 of 1 bytes from socket: 74
2020/10/20 19:16:34 read failed: expected START_HEADER0 0xfe, got 0x74
2020/10/20 19:16:34 reading 1 of 1 packets
2020/10/20 19:16:34 SOCKET: read 1 of 1 bytes from socket: 69
2020/10/20 19:16:34 read failed: expected START_HEADER0 0xfe, got 0x69
2020/10/20 19:16:34 reading 1 of 1 packets
2020/10/20 19:16:34 SOCKET: read 1 of 1 bytes from socket: 6f
2020/10/20 19:16:34 read failed: expected START_HEADER0 0xfe, got 0x6f
2020/10/20 19:16:34 reading 1 of 1 packets
2020/10/20 19:16:34 SOCKET: read 1 of 1 bytes from socket: 6e
2020/10/20 19:16:34 read failed: expected START_HEADER0 0xfe, got 0x6e
2020/10/20 19:16:34 reading 1 of 1 packets
2020/10/20 19:16:34 SOCKET: read 1 of 1 bytes from socket: 3a
2020/10/20 19:16:34 read failed: expected START_HEADER0 0xfe, got 0x3a
2020/10/20 19:16:34 reading 1 of 1 packets
2020/10/20 19:16:34 SOCKET: read 1 of 1 bytes from socket: 20
2020/10/20 19:16:34 read failed: expected START_HEADER0 0xfe, got 0x20
2020/10/20 19:16:34 reading 1 of 1 packets
2020/10/20 19:16:34 SOCKET: read 1 of 1 bytes from socket: 63
2020/10/20 19:16:34 read failed: expected START_HEADER0 0xfe, got 0x63
2020/10/20 19:16:34 reading 1 of 1 packets
2020/10/20 19:16:34 SOCKET: read 1 of 1 bytes from socket: 6c
2020/10/20 19:16:34 read failed: expected START_HEADER0 0xfe, got 0x6c
2020/10/20 19:16:34 reading 1 of 1 packets
2020/10/20 19:16:34 SOCKET: read 1 of 1 bytes from socket: 6f
2020/10/20 19:16:34 read failed: expected START_HEADER0 0xfe, got 0x6f
2020/10/20 19:16:34 reading 1 of 1 packets
2020/10/20 19:16:34 SOCKET: read 1 of 1 bytes from socket: 73
2020/10/20 19:16:34 read failed: expected START_HEADER0 0xfe, got 0x73
2020/10/20 19:16:34 reading 1 of 1 packets
2020/10/20 19:16:34 SOCKET: read 1 of 1 bytes from socket: 65
2020/10/20 19:16:34 read failed: expected START_HEADER0 0xfe, got 0x65
2020/10/20 19:16:34 reading 1 of 1 packets
2020/10/20 19:16:34 SOCKET: read 1 of 1 bytes from socket: 0d
2020/10/20 19:16:34 read failed: expected START_HEADER0 0xfe, got 0xd
2020/10/20 19:16:34 reading 1 of 1 packets
2020/10/20 19:16:34 SOCKET: read 1 of 1 bytes from socket: 0a
2020/10/20 19:16:34 read failed: expected START_HEADER0 0xfe, got 0xa
2020/10/20 19:16:34 reading 1 of 1 packets
2020/10/20 19:16:34 SOCKET: read 1 of 1 bytes from socket: 0d
2020/10/20 19:16:34 read failed: expected START_HEADER0 0xfe, got 0xd
2020/10/20 19:16:34 reading 1 of 1 packets
2020/10/20 19:16:34 SOCKET: read 1 of 1 bytes from socket: 0a
2020/10/20 19:16:34 read failed: expected START_HEADER0 0xfe, got 0xa
2020/10/20 19:16:34 reading 1 of 1 packets
2020/10/20 19:16:34 SOCKET: read 0 of 1 bytes from socket:
2020/10/20 19:16:34 failed read 1 of 0
2020/10/20 19:16:34 expected START_HEADER0 0xfe, got nothing
Traceback (most recent call last):
  File "./btmon.py", line 2351, in _blockingread
    self._read(packet_format)
  File "./btmon.py", line 2338, in _read
    packets.extend(packet_format.read(self))
  File "./btmon.py", line 1681, in read
    return self._read1(collector, self.DATA_BYTES_LENGTH, self.PACKET_ID)
  File "./btmon.py", line 1569, in _read1
    self._checkbyte(data, 'START_HEADER0', self.START_HEADER0)
  File "./btmon.py", line 1560, in _checkbyte
    (label, hex(evalue)))
EmptyReadError: expected START_HEADER0 0xfe, got nothing

after that, it loops forever with EmptyReadError: expected START_HEADER0 0xfe, got nothing exceptions.

(these logs from --debug --print, with a patch to make it print the address of the connection)

@Savedyou
Copy link
Author

Savedyou commented Oct 23, 2020

I ended up forcing a restart on error as a temp solution but am curious in why it's happening. I see you have a pending commit and will try the change.

@Savedyou
Copy link
Author

adding the PR stated by mroch seems to have fixed the problem so I am closing this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants