How to log data?

On the Meshtastic app (Android phone) I can see telemetry data such as temp and humid and altitude on devices such as the T-Echo with the sensor included. But HOW can I transfer that data to a file so I can create a temperature chart like shown below?
Screenshot_2024-03-30_22-40-00

If you plug your device into the serial port (aka usb) of a computer, you can read the log data submitted over the serial interface via the python API. However you have to sort out the lines yourself that contains the data you’re interested in. Then extract the data and put it into a data stream or database of your liking.

On an android device that might not be possible, unless you figure out how to configure the usb port into a serial port and how to install a python environment. It will definitely not work via bluetooth.

1 Like

If you have a node with activeted MQTT in your mesh, you can use something like mqtt-logger [1] to record all messages to a file or database. If you have homeassistant running, you can integrate a sensor with the examples [2] provided in the meshtastic docs.

1: GitHub - stevecope/mqtt-data-logger: Logs MQTT Data to a file
2: Home Assistant | Meshtastic

2 Likes

Fairly simple if you can program. Basic concept is writing a program to read from serial port and match the temperature string you’d expect. Then parsing the line and storing the data over a period of time. That data could then be stored to file, or you could use a graphing library to make plots, or get real fancy and create a server to read the incoming data and plot it in real time.

I can help you with the coding if you’d like to take a crack at it.

1 Like

Thank you so much everyone for your kind replies!!

I’m running Arch Linuxand I managed to get the meshtastic CLI virtual environment thingie to work!! The problem is that I do not see any sensor data when I type in
meshtastic --info
I get a great deal of other interesting info such as battery voltage, GPS coordinates, etc. I have two T-Echo radios that have the BME280 multi sensor chip and one radio with a SHT30 soldered to a Heltec V3 pins 17 and 18.

On the Heltc V3, aka a974:

MQTT disabled

Telemetry module:
Device metrics 60 seconds
Env metrics 30 seconds
Env metrics on
Env metrics display on
Env metrics Fahrenheit on
Power metrics enabled
Power metrics display on

Is there something else that I need to enable on a974 in order to make the Env data show up on the
meshtastic --info
command? I am a bit puzzled. The SHT30 sensor data shows up in the Android meshtastic app and on the Heltec display just as commanded. And the data is wonderfully logged on the Apple iPhone app.

A qucik update!

I discovered the Meshtastic app for iPhone and it logs data!! So IT IS POSSIBLE to do!!

I am trying to collect sensor data and add it to a database on my linux computer and send it to a server.

Maybe I could create some kind of script or cron job on the iPhone to send the data it collected to a computer to analyze and FTP to a website??

Here is a screenshot of the iPhone logging data…