New alpha 1.2.25 to test the MQTT gateway feature

This release (for alpha testers only) is mainly so that I can get some brave early users of the MQTT gateway feature. If you have a node that can connect to some sort of wifi, your help would be appreciated. Instructions are below. But first some caveats:

  • These instructions will result in your default text message and position packets to be sent to the public internet, where they will be decoded and available for anyone to read. This requirement to make the messages public will go away after weā€™ve done some more development.
  • You need at least one node with access to a wifi lan (multiple nodes are fine, but as long as there is one, it will route for the entire mesh)

Steps to enable:

  • Install this build
  • Update your python tool ā€œpip install --upgrade meshtasticā€
  • Run ā€œmeshtastic --set wifi_ssid YOURNETNAME --set wifi_password YOURWIFIPASSWORD --ch-set uplink_enabled trueā€
  • Reboot the device

It will now be sending any traffic from your default/primary channel to the internet. Currently you donā€™t have much ā€œbenefitā€ from this, but soonish there will be a crude world map view (somehow) and soon after that the riot.im global messaging bridge. If you are able to run nodws now that start uploading data it will help us because real test data is super useful.

If you have linux (or are on a machine where can install the mosquito command line tools): You can see the packets all the nodes are sending up (which currently is just a couple of my testing nodes):

sudo apt install mosquitto-clients
mosquitto_sub -h mqtt.meshtastic.org -v -t \$SYS/\# -t msh/+/stat/\# -t msh/+/json/\#
msh/1/json/LongSlow/!28979058/NODEINFO_APP {"channelId":"LongSlow","gatewayId":"!28979058","packet":{"from":681021528,"to":4294967295,"channel":177,"decoded":{"id":"!28979058","long_name":"Im Remote","short_name":"IR","macaddr":"$o(ļ¾—ļ¾X","hw_model":"TBEAM"},"id":428119695,"rx_time":1618028671,"hop_limit":3,"priority":"BACKGROUND"}}
msh/1/json/LongSlow/!28979058/POSITION_APP {"channelId":"LongSlow","gatewayId":"!28979058","packet":{"from":681021528,"to":4294967295,"channel":177,"decoded":{"latitude_i":250422513,"longitude_i":1215770222,"altitude":-1008,"time":1618028702},"id":428119696,"rx_time":1618028702,"hop_limit":3,"priority":"BACKGROUND"}}
msh/1/json/LongSlow/!abf84098/NODEINFO_APP {"channelId":"LongSlow","gatewayId":"!28979058","packet":{"from":2885173400,"to":4294967295,"channel":177,"decoded":{"id":"!abf84098","long_name":"Main Node","short_name":"MN","macaddr":"$bļ¾«ļæø@ļ¾˜","hw_model":"TBEAM"},"id":363563234,"rx_time":1618028924,"rx_snr":3.25,"hop_limit":2}}
msh/1/json/LongSlow/!abf84098/POSITION_APP {"channelId":"LongSlow","gatewayId":"!28979058","packet":{"from":2885173400,"to":4294967295,"channel":177,"decoded":{"latitude_i":250382527,"longitude_i":1215732725,"altitude":26,"battery_level":100},"id":363563235,"rx_time":1618028953,"rx_snr":2.5,"hop_limit":2}}
msh/1/json/LongSlow/!28979058/NODEINFO_APP {"channelId":"LongSlow","gatewayId":"!28979058","packet":{"from":681021528,"to":4294967295,"channel":177,"decoded":{"id":"!28979058","long_name":"Im Remote","short_name":"IR","macaddr":"$o(ļ¾—ļ¾X","hw_model":"TBEAM"},"id":428119697,"rx_time":1618029572,"hop_limit":3,"priority":"BACKGROUND"}}
msh/1/json/LongSlow/!28979058/POSITION_APP {"channelId":"LongSlow","gatewayId":"!28979058","packet":{"from":681021528,"to":4294967295,"channel":177,"decoded":{"latitude_i":250381170,"longitude_i":1215726458,"altitude":134,"time":1618029602},"id":428119698,"rx_time":1618029602,"hop_limit":3,"priority":"BACKGROUND"}}
msh/1/json/LongSlow/!abf84098/NODEINFO_APP {"channelId":"LongSlow","gatewayId":"!28979058","packet":{"from":2885173400,"to":4294967295,"channel":177,"decoded":{"id":"!abf84098","long_name":"Main Node","short_name":"MN","macaddr":"$bļ¾«ļæø@ļ¾˜","hw_model":"TBEAM"},"id":363563236,"rx_time":1618029824,"rx_snr":-1.75,"hop_limit":2}}
msh/1/json/LongSlow/!abf84098/POSITION_APP {"channelId":"LongSlow","gatewayId":"!28979058","packet":{"from":2885173400,"to":4294967295,"channel":177,"decoded":{"latitude_i":250382565,"longitude_i":1215731772,"altitude":26,"battery_level":100},"id":363563237,"rx_time":1618029852,"rx_snr":-3.75,"hop_limit":2}}

Other changes in the release:

@timgunter improved the install scripts and how they find python.

6 Likes

Does the channel or is-router matter?

Done. Iā€™ve got our 8-node test network from Sydney, connected.

the forwarding to/from MQTT is channel specific, though for simplicity now the instructions I just gave are setting (with --ch-set) ā€œuplink_enabledā€ on the primary channel. So any message seen on that particlar channel would be also sent to the MQTT server. Iā€™m intentionally asking people to not set downlink_enabled (yet).

For any node doing this internet gateway feature, probably best to not set is_router, becuase router nodes sleep a lot and we want to keep a link open to the internet server. But you did point out a bug - if we are talking mqtt we should suppress sleep (thanks!)

ooh cool! youā€™ve got the first node connected that wasnā€™t one of mine, from the mqtt log:

msh/1/json/LongSlow/!050c330c/NODEINFO_APP {"channelId":"LongSlow","gatewayId":"!050c330c","packet":{"from":84685580,"to":4294967295,"channel":177,"decoded":{"id":"!050c330c","long_name":"Node Red 330c","short_name":"NR3","macaddr":"<a\u0005\f3\f","hw_model":"TBEAM"},"id":160894754,"rx_time":1618032386,"hop_limit":3,"priority":"BACKGROUND"}}
msh/1/json/LongSlow/!050c330c/TEXT_MESSAGE_APP {"channelId":"LongSlow","gatewayId":"!050c330c","packet":{"from":84685580,"to":4294967295,"channel":177,"decoded":"Partly cloudy throughout the day. H:22.93, L:14.95, 15% rain, 44% cloud","id":1410477404,"rx_time":1618032502,"hop_limit":3}}

Installed on one of my nodes. I havenā€™s used the Python tool yet but Iā€™m sure @Chiumanfu will upgrade his as well.

Yep, that weather report is mine, and the occasional Bitcoin price in Australian dollars.

1 Like

I dont like that when I set a gps using --setlat 45.4887545 --setlon -122.6964613 --setalt 344 that the Android app overrides it.

I got mqtt to work, I wasnt aware that the SSID is case sensitive.

This is amazing! traditional computer mqtt subscribers get quicker messages than most of the nodes!

Will there be some type of feature to throttle uplinks or block IPā€™s if they abuse the server? Of course we get to use whatever mqtt server we choose but I really like the global bridge.

1 Like

If you have jq installed (sudo apt install jq) you can do the following to filter only text messages and get them in a form <from>@<gatewayId>: <decoded text>

mosquitto_sub -h mqtt.meshtastic.org -t msh/+/json/+/+/TEXT_MESSAGE_APP | jq --unbuffered '(.packet.from|tostring) + "@" + (.gatewayId|tostring) + ": " + (.packet.decoded|tostring)'

Itā€™s like a very poor chat than. :wink:

3 Likes

good timing, yesterday, I got a shipment of 5 T-Beams. One is now participating in this experiment :slight_smile:
It already said meh and hi.

1 Like

I notice that macaddr seems to be encoded in a way thatā€™s probably not safe for JSON. I think it should be an integer maybe? Iā€™m not sure if this is an artifact of MQTT.

msh/1/json/LongSlow/!abddd8c4/NODEINFO_APP {"channelId":"LongSlow","gatewayId":"!abddd8c4","packet":{"from":2883442884,"to":4294967295,"channel":177,"decoded":{"id":"!abddd8c4","long_name":"KC7RBW","short_name":"KC7","macaddr":"$bļ¾«ļæļæ˜ļæ„","hw_model":"TBEAM"},"id":260478057,"rx_time":1618078699,"hop_limit":3,"priority":"BACKGROUND"}}
1 Like

Checking in from North Bend!

1 Like

Why wouldnā€™t it be safe? Usually characters that would break the JSON will just be escaped.

Good point - I was assuming that non-printable characters should be escaped in JSON, but I see now that they donā€™t have to be. Still itā€™s odd to see a MAC address represented that way, but youā€™re right - itā€™s fine.

1 Like

Im not sure if this is post 1.2.25 but I noticed that depending on power, reset and screen attached, Im getting weird lights behaviour. It seems under normal operation I can detach the screen and all is fine. But if I then reboot with the screen still detached, only certain lights come back up. Everything appears to work correctly, just not all the lights. Is it supported to run headless or does that mess up i2c axp?

Im digging the new look of the meshtastic-web @sachaw !

2 Likes

Still early days, but the foundation is pretty good

1 Like

Wow, I got it to work!

2 Likes

Is this now in the 1.2.25 build?

No, I got it from GitHub - sachaw/meshtastic-client and edited /src/App.tsx with the ip of my node. Then run npm start.

1 Like