Remotely executing Python scripts on a battery powered T-Beam

Hello everyone,

So I am currently working on this project where we are going to set up some Meshtastic nodes in a remote area(No WiFi or cell coverage). These nodes are going to read some environmental sensors and transfer that data to a gateway some 60 miles away.

Now I have some python code to read the sensor data and transfer it over the mesh using the Meshtastic Python API. However, the problem is that I can only execute the Python scripts when the T-beams are connected via USB to my laptop. If I disconnect the USB and run the T-beams via a battery, the code does not execute.

I used to think that the code is flashed into the non-volatile memory and is executed on boot, but apparently that’s not the case.

So now I am wondering if there is a way to remotely SSH into a battery powered T-beam and execute the script.

The closest thing I could find on the Meshtastic website was “Remote Nodes” but apparently remote nodes are just used to configure the nodes.

There’s a few ways you can go about this, but if you’re using typical environmental sensors, consider using the Telemetry module, which is documented here:

If you just need a plain on/off style sensor, consider the detection sensor module instead:

For a general purpose way to remotely control facilities on Meshtastic, there is also the GPIO plugin/API:

We are actually using some sensors to measure water level in a river, among other things, for flood predictions.

The GPIO plugin looks interesting. I will have to look into it as a way of sending messages.