geoffwhittington / meshtastic-matrix-relay

A relay between a Matrix.org room and a Meshtastic radio. This relay extends your Matrix.org-based communication with a LoRa-based Meshtastic radio mesh. This is not an official product of Matrix.org or Meshtastic.
MIT License
75 stars 9 forks source link

Error occurring with communication problem to node, connection renewal would be useful #56

Closed mate71pl closed 1 year ago

mate71pl commented 1 year ago

It would be useful to handle the error to renew the connection.

Exception in thread Thread-161: Traceback (most recent call last): File "/usr/lib/python3.11/[threading.py](http://threading.py/)", line 1038, in _bootstrap_inner [self.run](http://self.run/)() File "/usr/lib/python3.11/[threading.py](http://threading.py/)", line 1394, in run self.function(*self.args, **self.kwargs) File "/home/mate/meshtastic/meshtastic-matrix-relay/.pyenv/lib/python3.11/site-packages/meshtastic/mesh_[interface.py](http://interface.py/)", line 561, in callback self._sendToRadio(p) File "/home/mate/meshtastic/meshtastic-matrix-relay/.pyenv/lib/python3.11/site-packages/meshtastic/mesh_[interface.py](http://interface.py/)", line 619, in _sendToRadio self._sendToRadioImpl(toRadio) File "/home/mate/meshtastic/meshtastic-matrix-relay/.pyenv/lib/python3.11/site-packages/meshtastic/stream_[interface.py](http://interface.py/)", line 115, in _sendToRadioImpl self._writeBytes(header + b) File "/home/mate/meshtastic/meshtastic-matrix-relay/.pyenv/lib/python3.11/site-packages/meshtastic/tcp_[interface.py](http://interface.py/)", line 72, in _writeBytes self.socket.send(b) BrokenPipeError: [Errno 32] Broken pipe

mate71pl commented 1 year ago

Screenshot_20230819_130548_JuiceSSH

mate71pl commented 1 year ago

Strace output: .... 13:06:58.740570 recvfrom(3, "", 1, 0, NULL, NULL) = 0 <0.000007> 13:06:58.740607 recvfrom(3, "", 1, 0, NULL, NULL) = 0 <0.000010> 13:06:58.740644 recvfrom(3, "", 1, 0, NULL, NULL) = 0 <0.000007> 13:06:58.740675 recvfrom(3, "", 1, 0, NULL, NULL) = 0 <0.000006> 13:06:58.740703 recvfrom(3, "", 1, 0, NULL, NULL) = 0 <0.000006> 13:06:58.740730 recvfrom(3, "", 1, 0, NULL, NULL) = 0 <0.000006> ....

mate71pl commented 1 year ago

Now I see that it is more of a bug with the meshtastic client itself.