RA* Cloud - mqtt publish commands

Community contributed apps

Posts: 133
Joined: Sun Mar 09, 2014 11:01 am
Location: Santos - Brazil
PostPosted: Fri Jan 26, 2018 5:26 am
Hi there

The same way we have the "wifi commands" (http://forum.reefangel.com/viewtopic.php?f=7&t=1541&hilit=wifi+commands, do we have a list of "mqqt publish commands"?

Somenthing like: user/outRON1:1 to turn on Relay01?

Best regards
Rafa
Image

Posts: 12877
Joined: Fri Mar 18, 2011 6:47 pm
PostPosted: Fri Jan 26, 2018 9:26 am
Nothing documented yet :(
But the commands are very similar.
I'll send an example when I get to a computer.
Roberto.

Posts: 133
Joined: Sun Mar 09, 2014 11:01 am
Location: Santos - Brazil
PostPosted: Fri Jan 26, 2018 9:30 am
If I sniff the network I am able to get the commands. Just trying to avoid such work. :D
Image

Posts: 12877
Joined: Fri Mar 18, 2011 6:47 pm
PostPosted: Fri Jan 26, 2018 3:25 pm
Easier is to just watch the console log on Goggle chrome when you use Uapp.
It should show incoming and outgoing messages.
For the purposes of not getting confused, incoming are messages sent from the UApp or any other MQTT publisher to the RA* controller and outgoing are messages sent from RA* to any other subscriber.
Incoming messages use channel username/in and outgoing messages use channel username/out.
Our MQTT server uses authentication and authorization that are integrated with the forums, so make sure you send username and password when subscribing or publishing any message.
For the sake of exercise, if you send publish message "all:0" to channel username/in, RA* will respond on channel username/out and it will publish all parameters.
Another example is if you send publish message "r:111" to channel username/in, RA* will respond on channel username/out with the status of box1 and it will override box1_port1 to always on.
Roberto.

Posts: 133
Joined: Sun Mar 09, 2014 11:01 am
Location: Santos - Brazil
PostPosted: Fri Jan 26, 2018 7:46 pm
Tks Roberto

Already modifying my python code.

With RA+ I was getting the R99 from time to time. Now I can subscribe using mqtt and just wait for it :)
Image

Posts: 133
Joined: Sun Mar 09, 2014 11:01 am
Location: Santos - Brazil
PostPosted: Sat Jan 27, 2018 3:11 pm
rrodriguess wrote:Tks Roberto

Already modifying my python code.

With RA+ I was getting the R99 from time to time. Now I can subscribe using mqtt and just wait for it :)
Roberto

Making progress with mqtt client and xmpp server to send push messages to celfone in real time.

Two main features: Real Time push messages, in plain text (transform a code into text message using SQLite) and to Control RA by message, Just like a command line interface.

I already have a version, working with RA+ and x99 output.

Tks for the direction...

I was unable to find the publish messages to change custom Var.

Tried /inC2:0... Did not work.

Any Idea?
Rafa

Image


Image


Image


Image
Image

Posts: 12877
Joined: Fri Mar 18, 2011 6:47 pm
PostPosted: Sat Jan 27, 2018 3:33 pm
The incoming channel is always lowercase and the outgoing channel is always uppercase.
So, to publish in the incoming channel to change variables or parameters on RA*.
So, for what you are trying to do, you need to publish to username/in channel, the message "c2:1"
Roberto.

Posts: 133
Joined: Sun Mar 09, 2014 11:01 am
Location: Santos - Brazil
PostPosted: Sat Jan 27, 2018 3:39 pm
rimai wrote:The incoming channel is always lowercase and the outgoing channel is always uppercase.
So, to publish in the incoming channel to change variables or parameters on RA*.
So, for what you are trying to do, you need to publish to username/in channel, the message "c2:1"
Tks Roberto!!!!!!!!!!!

Enviado de meu Moto G (5S) Plus usando Tapatalk
Image

Posts: 133
Joined: Sun Mar 09, 2014 11:01 am
Location: Santos - Brazil
PostPosted: Thu Feb 01, 2018 3:17 am
Roberto

May be nothing, but publishing the message "c2:1" to username/in does not take any effect.

In fact, looking the messages using google chrome console log, when we try to change any variable it's sending the command "cvar2,1", and than the "out" channel responds with "C2:1" properly.

var test.png
var test.png (35.79 KiB) Viewed 7592 times
Image

Posts: 12877
Joined: Fri Mar 18, 2011 6:47 pm
PostPosted: Thu Feb 01, 2018 10:13 am
There ya go. :)
Roberto.
Next

Return to Apps

Who is online

Users browsing this forum: No registered users and 2 guests

cron