Issues Reading Packets from AP

I’ve been working on adding TCP communications to the Go CLI and I think there may be an issue with the device when it’s operating in AP mode. Anytime I try to read from the device (with the Python CLI or my code) I get a connection reset by peer error.

meshtastic --host 192.168.42.1 --info                                                                                                                                                                                                                   ─╯
ERROR:root:Unexpected OSError, terminating meshtastic reader... [Errno 54] Connection reset by peer
Traceback (most recent call last):
  File "/usr/local/bin/meshtastic", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.9/site-packages/meshtastic/__main__.py", line 663, in main
    common()
  File "/usr/local/lib/python3.9/site-packages/meshtastic/__main__.py", line 505, in common
    client = TCPInterface(
  File "/usr/local/lib/python3.9/site-packages/meshtastic/__init__.py", line 983, in __init__
    StreamInterface.__init__(
  File "/usr/local/lib/python3.9/site-packages/meshtastic/__init__.py", line 773, in __init__
    self.connect()
  File "/usr/local/lib/python3.9/site-packages/meshtastic/__init__.py", line 795, in connect
    self._waitConnected()
  File "/usr/local/lib/python3.9/site-packages/meshtastic/__init__.py", line 424, in _waitConnected
    raise Exception("Timed out waiting for connection completion")
Exception: Timed out waiting for connection completion

I’m using "firmwareVersion": "1.2.39.06892c4" with the T-BEAM 1.1. Does anyone have an idea why this might be happening?

1 Like

Can you try the same test over wifi but not having the node be the AP (as a station instead)? That would help track down the bug.

I completely forgot to include that part :grinning_face_with_smiling_eyes:. Everything works fine (including my new code) when I use the device as a client to another wifi network. It’s only the AP mode that causes issues.

Ooh yah that’s probably an easy bug then. Can you open a bug on meshtastic-device GitHub and include a link to this thread? I’ll look into it soon.

Sweet. Here’s a link to the issue: Connection Reset By Peer Error With Device as AP · Issue #817 · meshtastic/Meshtastic-device · GitHub

1 Like