What is the basic mosquitto_pub command to send text to your Mestastic unit?

I am trying to use this format from a command line on Linux to to see if I can receive a text on my Meshtastic device:

mosquitto_pub -h 192.168.1.52 -t ‘msh/2/e/!da638728’ -m ‘{“channel”:“0”,“sender”:“MeAtMyPC”,“type”:“sendtext”,“payload”:{“text” “mqtt-test”}}’

I see the MQTT message appear in the mosquitto_sub terminal but no notifications on my ANDROID App.

Any suggestion would be grateful.

See the documentation.
It has to be sent to a channel called “mqtt”, you need a field “from” with the node number and the payload should be just a string with the text.

I read that documentation but it doers not show an example of a basic command line for publishing a MQTT message which I am looking for

It doesn’t matter how you publish to the topic, I think your command would work but then it should be something like:

mosquitto_pub -h 192.168.1.52 -t ‘msh/2/json/mqtt’ -m ‘{"from": 3663955752, “channel”: 0, “type”: “sendtext”, “payload”: “mqtt-test”}’

This is if your root topic is just msh/. I would recommend checking with MQTT Explorer.

Thanks GUVWAF for your input, but where/how do I specifically send a text to a unique Meshtastic device? I see the “from” but not a “to”. Is it inserted into the message field or in into the topic field? And if so, how?

Add a field “to” in the message with the node number to send to. This is also in the link I shared.

I have added the following

“to”; “!da638728”

but i still see no text being delivered to my device.

Again, I have read that document BUT the topic that I have posted is as follows:

"What is the basic mosquitto_pub command to send text to your Mestastic unit?

Nothing more, nothing less. Could you do this for your own device and once it works, post that here please?

First, the documentation says the to needs to the node number, so e.g. 3663955752.
However, it also says this feature is to instruct a node to send out a message. So you don’t directly send a message from your computer to a node, but you instruct a node (the from field) to send a message to another node (the to field) or to a channel.

I don’t use mosquitto_pub, but I’ve used MQTT Explorer to do this.

OK then could you send me a known good MQTT syntax line that does work in MQTT Explorer, and I will reverse engineer it from there.

Thank you for your support, for it is greatly appreciated.

{
    "from": 841446079,
    "channel": 0,
    "type": "sendtext",
    "payload": "test"
}

Or to a certain node:

{
    "from": 841446079,
    "to": 2711401735,
    "type": "sendtext",
    "payload": "test"
}

You have to replace the “from” and “to” with your node numbers and publish it to the json/mqtt topic with your root topic, e.g. msh/2/json/mqtt.

I was able to do it here: