Solved - Rocrail srcp server mode

Moderator: Moderators

Solved - Rocrail srcp server mode

Postby Richard-TX » 27.05.2013, 20:51

I enabled the srcp service in Rocrail and was looking at the status of the devices configured. I can't make any sense out of what srcp is saying.

Can someone explain it to me? According to what is listed below the GA at addr 157 port 1 is both ON and OFF.




1369683576.432 101 INFO 1 GA 157 N
1369683576.432 100 INFO 1 GA 157 1 1
1369683576.432 100 INFO 1 GA 157 0 0
1369683576.432 100 INFO 1 GA 157 1 0
1369683576.432 101 INFO 1 GA 158 N
1369683576.432 100 INFO 1 GA 158 1 1
1369683576.432 100 INFO 1 GA 158 0 0
1369683576.432 100 INFO 1 GA 158 1 0
Last edited by Richard-TX on 07.08.2013, 10:55, edited 1 time in total.
Richard-TX
 

Postby rjversluis » 27.05.2013, 21:13

The dual coil switch motor seems to simulated here with 0ms switch time. :-(

The SRCP Service in Rocrail does not regard single gate switch motors...
Last edited by rjversluis on 29.05.2013, 10:11, edited 1 time in total.
Best Regards, Rob.
:!: PS: Do not forget to attach the usual files.
:!: PS: Nicht vergessen die übliche Dateien an zu hängen.
[ macOS - Linux] - [ N: CBus - CAN-GCA ] - [ 0: RocNetNode - GCA-Pi ]
rjversluis
Site Admin
 

Re: Rocrail srcp server mode

Postby LDG » 27.05.2013, 22:20

Hi Richard,
Richard-TX wrote:I enabled the srcp service in Rocrail and was looking at the status of the devices configured. I can't make any sense out of what srcp is saying.
Have you ever tested your client with the original server and checked what that server is responding?

You opened a session in info-mode and all you got was the list of all known devices and there states.
SRCP Spec 0.8.4 wrote:100 INFO <bus> GA <addr> <port> <value>
Value of GA port at addr on the specified bus.
101 INFO <bus> GA <addr> <device protocol> ....
Initialisation of a GA device of the specified bus.

1369683576.432 101 INFO 1 GA 157 N
Definition of an accessory decoder at address 157 with protocol NMRA (DCC)
1369683576.432 100 INFO 1 GA 157 1 1
Rocrail extension (see below)
1369683576.432 100 INFO 1 GA 157 0 0
Decoder at address 157 Port 0 is currently off
1369683576.432 100 INFO 1 GA 157 1 0
Decoder at address 157 Port 1 is currently off

Because the srcp specification has no command to get the current state of a switch/signal/ouput there is a Rocrail extension during/before sending the port states after initialisation of a session in infomode:
If the state of an output, switch (4 states for 2 motor double crossing!) or signal (up to 4 states supported!) is known then the port(s) that is(are) responsible for the last state is first indicated as active and then all ports are sent as inactive.
So the last state sent by the srcp service in Rocrail are always exactly the same as with the original server, but if your info session parser is "intelligent" (not stateless) it might know what the current state of a switch/signal is :wink:

If you want something else then ask the srcp spec maintainers to change things according to your needs in the next release.

The Rocrail srcp service is compatible with j-man, spdrs60 and some of the clients supplied with the source of the srcp server (pyControl/"srcp.py"-library and perlhacks/"infomode.pl") !
I am using/testing with all those mentioned above.

Regards,
Lothar
LDG
Site Admin
 

Postby Richard-TX » 27.05.2013, 22:30

Given the following sequence:

1369683576.432 100 INFO 1 GA 157 1 1
1369683576.432 100 INFO 1 GA 157 0 0
1369683576.432 100 INFO 1 GA 157 1 0
I find it interesting that the last state reported is the true state, and previous states can be ignored as far as state is concerned.

As far as getting the status of configured devices is concerned, the only way I know of getting them is to establish a info session with the server in question. That brings up another issue. Reach 100 sessions and srcpd blows up assuming verbosity is greater than 1.
Richard-TX
 

Re: Rocrail srcp server mode

Postby Richard-TX » 27.05.2013, 23:29

LDG wrote:The Rocrail srcp service is compatible with j-man, spdrs60 and some of the clients supplied with the source of the srcp server (pyControl/"srcp.py"-library and perlhacks/"infomode.pl") !
I am using/testing with all those mentioned above.

Regards,
Lothar


I have tried all of those clients. Each does things just a little bit differently. Having said that, JMRI's implementation of srcp is just plain broken.

My biggest problem with the srcp documentation is that it is at times ambiguous and generally open to interpretation and in one case contradictory with itself. Go figure.

I can name many different things that should be done with the current srcpd implementation. My biggest one is

1 - Add descriptive error messages. HTTP has some great error messages as does SMTP. srcp? It has so few that generally they get lumped into something like "general error". There is no sense in going overboard like AIX does either.

It also needs to have an internet RFC written for it.
Richard-TX
 

Postby Richard-TX » 27.05.2013, 23:59

rjversluis wrote:The dual coil switch motor seems to simulated here with 0ms switch time. :-(

The SRCP Service in Rocrail is also out of sync with the addressing of the SRCP Client part and does not regard single gate switch motors...



That is not all bad. If it were me, I would assume 0 ms switch time but would wait for the FB (if configured) to tell me that it was complete. There are a variety of switch times on my layout and trying to keep track of them all would be really tough.
Richard-TX
 

Re: Rocrail srcp server mode

Postby Richard-TX » 28.05.2013, 00:12

LDG wrote:Hi Richard,Have you ever tested your client with the original server and checked what that server is responding?


Regards,
Lothar



Lothar,

In my case Rocrail on WinXP is the client and the server is srcpd on Linux ARM. I added a device to srcpd and fixed some bugs but that is all.

The authors are pretty adamant about anyone making changes or additions to the protocol. There is a GM (General Message) function however. I suppose one could leverage that if in a pinch.

There is always XRCP.

Richard
Richard-TX
 

Postby LDG » 28.05.2013, 03:45

Richard-TX wrote:Given the following sequence:

1369683576.432 100 INFO 1 GA 157 1 1
1369683576.432 100 INFO 1 GA 157 0 0
1369683576.432 100 INFO 1 GA 157 1 0
I find it interesting that the last state reported is the true state, and previous states can be ignored as far as state is concerned.
The last reported state for port 0 and port 1 is 0 (deactivated).
LDG
Site Admin
 

Postby Richard-TX » 28.05.2013, 18:43

Lothar,

I sent you a PM.
Richard-TX
 


Return to srcp