Sensor data over msh, take out reading from MQTT

Hello!

I was advised to make new topic… https://meshtastic.discourse.group/t/home-assistant-mqtt-device-tracker/8305
pardon, I know that sometime as first post is " there was search function, why not used" :slight_smile: maybe somebody can post here recommended settings, how it should be done to achieve my goal - receive sensor setting over mesh.

my setup, fw. 2.2.24 (previously it was 2.2.21 …22)
devices:
a) router-client, connected to home wi-fi: LILYGO® TTGO Meshtastic T-Beam V1.2 ESP32 LoRa Development Board 433MHz (at https://flasher.meshtastic.org/ I used as devide - T-Beam, right?) +BME280 sensor;
b) client, not connected to wi-fi, can be used with iOS app or mostly serial connected, to change settings in web UI. device - LILYGO® TTGO LoRa32 V2.1_1.6 Version 433MHz at https://flasher.meshtastic.org/ I used as devide - T-LoRa V2.1_1.6, right?) +BME280 (I see snesor data in display) . I used as client, shell I change to sensor? idea is to keep this device as client normaly. (in EU we have 433 and 868MHz, I got also some Heltec boards for 868, but not yet tested this sensor feature.

Aim, ad additional feature ti have, to broadcast over msh BME280 /telemetry data and pick up data from mqtt.meshtastic broked and integrate into HomeAssistant. (I managed to do that with device - a) )

issus is that I dont see sensor data in mqtt explorer, it use to be only status " online" but now even that is gone. To check does it transmit or not:
a) I see router-client name in client display;
b) with iOS app, data off, I can send message to router, seems that LoRa module is fine;
c) there is client name in router-client mqtt topic, when I reboot device (see pic below, nr. 1)

Legend;
1 - my cient device short name;
2 - client-router id/name;
3 - 1728 is short name that I searching in all topics.

/ settings from 1728, cleint device →

MQTT -
Nr.1 as thsi is enablem, I see topics over mqtt, then I conenct phone app;
Nr2. - this is enabled, so there is sensor data if phone app conencted.
+in iOS app, some settings can t be enabled at smae time, but in serial client.meshatastic.com it allows enable all at once and keeps after reboot. hard to express what I mean, most likelly I will record screen, then you will see, that at some combination, some setting buttons jums back to off automatically.

nr.1 keeps to be off, if I set it ON, after reboot in web UI it is still off.

this settings is as default

by enabling these I see data in display, so this seems is sat right.

Thanks!

I think the issue is the module will not stay enabled?
Have you tried enabling the Sensor module another way, such as via CLI or mobile app?- ted

Hello.
on iOS app it appears as enabled.


with this setup, I can send message to hotsport - phone is not as proxy

on mqtt explored now I see only encrypted topics. seems I have to figure out how to use /decrypt it and then problem will be solved?!

tnx!

Hi zfed,

if you have figured out, how to decode, please let us know.

I’m struggling with the decoding my self.

Right now I’m using a node-red environmet with another mqtt server on a separate host.
I’m using ioBroker and would like to get my readings into the system.

The workaround with node-red is okay, but it’s another system to maintain I would like to avoid.

Regards,
mark

I’m confused – your first post on this thread shows unencrypted messages and your config in recent post shows Encryption option disabled. It’s difficult to understand your issues so please provide specific examples of the problem you’re trying to solve.

@mark77 provide example(s) and I’ll help debug, maybe others will jump in too. If your issue does not deal with sensor data, suggest making a new thread with subject more specific to your application and issue.- ted

1 Like

@ted, thanks already. I was jumping on to this thread, because zfed mentioned in his last post

on mqtt explored now I see only encrypted topics. seems I have to figure out how to use/decrypt it and then problem will be solved?!

Whats comming into the mqtt server is something like this:
=#�X�����"CX/�e���?%�6@5��Q=X/�eE

Datapoint is:
mesh/868/2/c/marktest/!gatewayid

I’ve alreday tried to figure out whta to do next, but encryption/decryption is far beyond my horizon, so any help would be appreciated.
I guess first step would be to convert to probably hex?
-Mark

1 Like

I suggest another topic because yours does not concern Sensor data, rather regular Message data.

I don’t see your device in the path you provided, please confirm it?
image

The #/c/# path is for encrypted data.
The #/json/# path is for encrypted data.
If you don’t see a topic with json from your device, then the node is not sending unencrypted data and requires a setting change.
See this page: MQTT Module Configuration | Meshtastic

If you’re using MQTT Explorer, use the Copy icon to grab the path.- ted
image

1 Like

@ted, nevermid. I probably have always looked into json details, when basic data was send, without sensor readings.
Everything is working fine, bloody layer 8 error :smile:

1 Like

Ted, thanks for replay.
I will try again during weekend, I think sensor send data in JSON to broker only when my app was connected and acted as proxy, but you can check this node - !ea0a1728 under EU_433.

also settings explanation explains that “don’t enable” seems it is not made to transfer unencrypted data as such… now new task, to learn NodeRed and encrypring data with @ mark77 advise, then you have sensor reading over mesh, correct?

json_Capture

but from router-client I still see data in my Home assistant, as it has wifi access it can broadcast sensor data to broker seems limitaiton is for unencrypted.

I know this is not purpose of this device, but in my location either my own TTN gateway or MSH repeater/router on balcony or just direct LoRa… but then no added value to neighbourhood. Pardon for spam, but I will try again on weekend from fresh instlal, just in case it did not save and I am now working with false settings.

@zfed, for node-red just follow instructions at node-red howto

1 Like

Hello,
I tried again, with fw 2.2.24 on both devices.

then client, connected to phone and data proxy is ON, it sends data over MQTT.


client @app, settings →

but, that JSON topic dissapears after few sec and in phone I see that JSON becomes OFF.

after I disable proxy, then my node xxx1728 aprears only thru my router topic, but seems as " hello message" because sensor data does not follow… →

{"channel":0,"from":3926529832,"id":470490957,"payload":{"hardware":3,"id":"!ea0a1728","longname":"Meshtastic 1728","shortname":"1728"},"rssi":-74,"sender":"!f96aa740","snr":10.5,"timestamp":1711052545,"to":4294967295,"type":"nodeinfo"}

I send from 1728 to without phone (data proxy off) to primary channel " “text”:“Bots everywhere” "
it goes thru as message / so main Mesh function works, sensors here are secondary :slight_smile: btw, with one combination of settings, I saw sensors data on my router display. but that that with previous firmware few weeks before I posted here… could be it was also with proxy on, but I did not managed to replicate that scenario since then.

{"channel":0,"from":3926529832,"id":1469054835,"payload":{"text":"Bots everywhere"},"rssi":-66,"sender":"!f96aa740","snr":13.75,"timestamp":1711052858,"to":4294967295,"type":"text"}

tnx!