#Node Red errors decrypting MQTT Meshtastic messages

1 messages · Page 1 of 1 (latest)

silk wave
#

I've tried the @meshtastic/node-red-contrib-meshtastic plugin and I have when add the decrypt node to my flow because it's blocked by a Error: TypeError: Cannot read properties of undefined error that shows briefly at the top of the screen.

I also tried the node-red-contrib-meshtastic-advanced plugin and after I configure the node, draw a wire from an "mqtt in" node, and send a message the debug messages show a Description failed: Failed to decode ServiceEnvelope: Cannot read properties of undefined (reading 'Mqtt') so it seems to be the same error in 2 different places. I get this behavior on all meshtastic "channels".

I can't find anyone who has had the exact errors I'm seeing or posted a solution to the GitHub issues about similar symptoms on the first one's repo, and there's been no activity so it's basically a dead project. The other plugin has a link to a repo but it's a 404 page now. I can't tell enough about the code to figure out what's undefined to try to fix it on my own.

winter jetty
#

I don't know about Node Red; doing things like the following in my configuration.yaml file worked for me. I have no idea what I'm missing, though.
- name: "MyEthernetNodeName_MyChannelNameForHAFromMyOtherNodeNameForHA"
unique_id: "myethernetnodename_mychannelnameforhafrommyothernodenameforha"
state_topic: "msh/MyCountry/MyMqttHeader/2/json/MeshtasticChannelName/!MeshtasticEthernetNodeHexId8characters"
value_template: >-
{% if value_json.from == MeshtasticSendingNodeDecimalId and value_json.payload.text is defined %}
{{ value_json.payload.text }}
{% else %}
{{ this.state }}
{% endif %}
- name: "MyEthernetNodeNameForHA_MyChannelNameForHA"
unique_id: "myethernetnodename_mychannelnameforha"
state_topic: "msh/MyCountry/MyMqttHeader/2/json/MeshtasticChannelName/!MeshtasticEthernetNodeHexId8characters"
value_template: >-
{% if value_json.payload.text is defined %}
{{ value_json.payload.text }}
{% else %}
{{ this.state }}
{% endif %}

#

In MQTT explorer, I can see
msh/MyCountry/MyMqttHeader/2/e/... with encrypted looking data
and
msh/MyCountry/MyMqttHeader/2/json/... with decrypted/human readable looking data.

#

To send messages, I can use either the Meshtastic plugin, or I can use straight MQTT; with a payload like the below:

#

{{ '{"channel": MeshtasticMyDecimalNumericChannelId, "from": MeshtasticEthernetNodeDecimalId,
"type": "sendtext",
"payload": "' ~
states('input_text.InputTextHelperNameAllLowerCaseForSoftcodedMessage') ~ ' hardcodedmessage goes here"
}' }}