RCP Power state request Topic is solved

Moderator: dadolphs

Post Reply
NorbertH

RCP Power state request

Post by NorbertH » 03.01.2012, 11:33

Hi there,

I'm new to Rocrail and first of all I want to say thank you to all who created this great piece of software!

I'm trying to write my own software client that connects to the RocRail server. Works quite fine, but I still found no way to request the current power condition after the server connection has been established.

The RCP Scripting page on the Wiki shows how to turn the power on/off. This works fine and the server responds with a state broadcast with the current power condition.

But how can I retrieve this state info after establishing the server connection without to change it???

I found some sort of protocol description at http://www.rocrail.net/doc/rocrail-wrap ... er-en.html , but (at least for me) this is rather cryptic.

Best regards,
Norbert

rjversluis
Site Admin
Posts: 42319
Joined: 10.04.2006, 08:48
Location: Speyer, Germany
Contact:

Re: RCP Power state request

Post by rjversluis » 03.01.2012, 11:47

Hi Norbert,
NorbertH wrote: But how can I retrieve this state info after establishing the server connection without to change it???
After connecting to the server the client gets this information automatically.

NorbertH

Re: RCP Power state request

Post by NorbertH » 03.01.2012, 12:10

rjversluis wrote: After connecting to the server the client gets this information automatically.
Hmm, I tested with a local server (MACOS, Rocrail Revision 3119, Virtual + Intellibox) and remote on rocrail.dyndns.org: All I receive are periodic clock messages. No state messages at all :cry:

Best regards,
Norbert

rjversluis
Site Admin
Posts: 42319
Joined: 10.04.2006, 08:48
Location: Speyer, Germany
Contact:

Post by rjversluis » 03.01.2012, 12:44

Hi,

clients get those information directly after connect and before the plan.

NorbertH

Post by NorbertH » 03.01.2012, 13:13

rjversluis wrote:clients get those information directly after connect and before the plan.
That's it! I simply have to submit a request for the whole plan.

My intention was just to get some loco list plus power info. Therefore I never requested the plan. Doing so, all required info is present. :D

Thanks a lot!
Norbert

martinrabl
Posts: 14
Joined: 10.10.2014, 22:29

Re: RCP Power state request

Post by martinrabl » 18.08.2015, 07:49

Hi Rob,
rjversluis wrote:Hi Norbert,
NorbertH wrote: But how can I retrieve this state info after establishing the server connection without to change it???
After connecting to the server the client gets this information automatically.
Is there a command for getting a (power) state whenever a RCP-Client want to know the state?
<sys cmd="info"> doesn't work (as it is not the real command for that, I think :-) ).

Thanks,
Martin

rjversluis
Site Admin
Posts: 42319
Joined: 10.04.2006, 08:48
Location: Speyer, Germany
Contact:

Re: RCP Power state request

Post by rjversluis » 18.08.2015, 07:56

Hi Martin,

the RCP Client will get power events after something has been changed.

martinrabl
Posts: 14
Joined: 10.10.2014, 22:29

Re: RCP Power state request

Post by martinrabl » 18.08.2015, 10:42

Hi Rob,
rjversluis wrote: the RCP Client will get power events after something has been changed.
Ok, so the best way to init a State-Response should be to change something, which has not "real" effect?
Which changable Attribute would you suggest?
My idea was to check the rocraild, better its state by a client which calls the state i. e. like a cronjob or sends a validation request to the server ("did you really send a poweroff?").

Greetings,
Martin

rjversluis
Site Admin
Posts: 42319
Joined: 10.04.2006, 08:48
Location: Speyer, Germany
Contact:

Re: RCP Power state request

Post by rjversluis » 18.08.2015, 10:50

martinrabl wrote: Which changable Attribute would you suggest?
the Rocrail server sends events to the clients on changes like power, voltage, current, temp. and so on.
No need to trigger it.

martinrabl
Posts: 14
Joined: 10.10.2014, 22:29

Re: RCP Power state request

Post by martinrabl » 18.08.2015, 11:08

Hi Rob,
rjversluis wrote:No need to trigger it.
Hm. Sometimes already.
I have a picture about a (polling) client which will request the current state server when needed and not when rocrail decide to send a state.
I know, when logging in, a client will get a state ... but I see no command for allowing a client request a confirmation for a state.

So, there is no way to trigger a state request without changing params which I cannot set.

Thanks,
Martin

Post Reply

Return to “Basic topics”