Python TCP API rebooting device on every connection?

Evening all - noticing some behavior that’s unexpected.

I’ve got a simple script. It’s sole purpose is to be executed on a schedule and just dump details to stdout.
(Almost verbatim from the example provided)

import meshtastic
from pubsub import pub
def onConnection(interface, topic=pub.AUTO_TOPIC): # called when we (re)connect to the radio
    print(interface.myInfo)
    interface.close()
pub.subscribe(onConnection, "meshtastic.connection.established")
interface = meshtastic.TCPInterface(sys.argv[1])

Each time I run this script, the target device seems to reboot right after the script closes the interface. I can’t tell if it’s actually rebooting or if the splash screen is just getting redisplayed.

Here’s a link to the behavior on video - sorry for the dirty desk :slight_smile:

ooh - that looks not good. can you open a bug on meshtastic-python and link to this thead? I’ll use your code to repro it in the next couple of days. I bet the device is printing an exception stacktrace on the serial port before rebooting and I’ll be able to use that to quickly find the bug.

1 Like

You betcha. Thanks for confirming.