RA* Cloud - mqtt publish commands

Community contributed apps
Post Reply
rrodriguess
Posts: 132
Joined: Sun Mar 09, 2014 11:01 am
Location: Santos - Brazil

RA* Cloud - mqtt publish commands

Post by rrodriguess »

Hi there

The same way we have the "wifi commands" (http://forum.reefangel.com/viewtopic.ph ... i+commands, do we have a list of "mqqt publish commands"?

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

Best regards
Rafa
Image
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: RA* Cloud - mqtt publish commands

Post by rimai »

Nothing documented yet :(
But the commands are very similar.
I'll send an example when I get to a computer.
Roberto.
rrodriguess
Posts: 132
Joined: Sun Mar 09, 2014 11:01 am
Location: Santos - Brazil

Re: RA* Cloud - mqtt publish commands

Post by rrodriguess »

If I sniff the network I am able to get the commands. Just trying to avoid such work. :D
Image
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: RA* Cloud - mqtt publish commands

Post by rimai »

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.
rrodriguess
Posts: 132
Joined: Sun Mar 09, 2014 11:01 am
Location: Santos - Brazil

Re: RA* Cloud - mqtt publish commands

Post by rrodriguess »

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
rrodriguess
Posts: 132
Joined: Sun Mar 09, 2014 11:01 am
Location: Santos - Brazil

Re: RA* Cloud - mqtt publish commands

Post by rrodriguess »

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
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: RA* Cloud - mqtt publish commands

Post by rimai »

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.
rrodriguess
Posts: 132
Joined: Sun Mar 09, 2014 11:01 am
Location: Santos - Brazil

Re: RA* Cloud - mqtt publish commands

Post by rrodriguess »

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
rrodriguess
Posts: 132
Joined: Sun Mar 09, 2014 11:01 am
Location: Santos - Brazil

Re: RA* Cloud - mqtt publish commands

Post by rrodriguess »

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 9510 times
Image
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: RA* Cloud - mqtt publish commands

Post by rimai »

There ya go. :)
Roberto.
rrodriguess
Posts: 132
Joined: Sun Mar 09, 2014 11:01 am
Location: Santos - Brazil

Re: RA* Cloud - mqtt publish commands

Post by rrodriguess »

Tks Roberto it worked!!

Another quick one:

"mb:100:1" --> sets memory location 100 to 1
"mr" --> gets memory location from 200 to 379 (internal memory used by default functions)

How do I get memory location values from 100 to 199? I used to use the old "/mr100,199", but sending any form of "mr" does not work ("mr100:199", "mr:100:199" and so on).

Also tried to get individual memory locations sending "mb100" (not worked) or simply "mb:100" (did not get, but set mb 100 to 0 instead)

You had the trouble to split the "mr" response into MR00, MR01... up to MR21 kind of format.. so may not be simple to code the a "mr:100:199". If is that the case, would do any harm using locations from 200 to 379 just the way I want, regardeless the default functions? I do not use any any of them.

Rafa
Image
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: RA* Cloud - mqtt publish commands

Post by rimai »

You are right.
There is no way to read individual locations outside the range.
If you are not using them, you can save and read using MR.
If you are using internal memory settings, you will have to make sure to not reuse the ones you are already using.
Roberto.
rrodriguess
Posts: 132
Joined: Sun Mar 09, 2014 11:01 am
Location: Santos - Brazil

Re: RA* Cloud - mqtt publish commands

Post by rrodriguess »

Not using internal memory settings.

I am going to migrate from 100-199 to 200-299, and test it

Ps.: "c0:1" command stopped working again. Uapp got back using "cvar0,1". Maybe a rollback version?

Tks!
Image
Post Reply