raspi as a wireless feedback module

Moderator: Moderators

Postby Helge » 16.08.2013, 20:28

Hello Richard,

Thank you for your comprehensive explanation and sorry for my delayed response .
As far as I understand in order to use srcp for accessory decoder communication I have to register every single raspi accessory decoder as a command station.
Only the command station have a tcp/ip address and every raspi accessory has a very simple srcp server installed just to receive und accept the accessory decoder commands. But I doubt that this a reasonable solution.
I discussed this issue with a friend and I found in the wiki a protocol called "rocnet" using udp multicast communication. This seems to be a viable solution, but at least for me a challenge to code the udp communication in python.
I will think it over a while.

Helge
Helge
 

Postby Richard-TX » 16.08.2013, 21:01

Having to define another command station is a fallacy.

Actually there is no need to define anything as a command station when using Rocrail's built in srcp server.

Here is how to do it.

Enable srcp within rocrail. Restart Rocrail.

configure a sensor with no IID, bus = 0, address = 10 (or some other address that is unused.

Telnet to the machine that is running rocrail using port 4303
type "go"
type "set 1 fb 10 1"
that turns on #10 sensor
sending a "set 1 fb 10 0" turns the sensor off

It is just that simple.


Here is a sample session using feedback addr #1

# telnet 10.232.1.101 4303
Trying 10.232.1.101...
Connected to 10.232.1.101.
Escape character is '^]'.
Rocrail 2.0r5286; SRCP 0.8.4; SRCPOTHER 0.8.3
go
1376682802.944 200 OK GO 1
set 1 fb 1 1
1376682810.574 200 OK
set 1 fb 1 0
1376682839.471 200 OK

In the case above I was using the demo layout with no controllers defined.
Richard-TX
 

Postby Richard-TX » 16.08.2013, 21:15

Many thanks to Lothar and Rob for the excellent work on the srcp implementation in Rocrail. It is slicker than greasy teflon. :lol:
Richard-TX
 

raspi as a wireless feedback module

Postby Halvorw » 09.10.2013, 20:31

Changing sensor status from the remote Rpi with RFID-reader

I have only succeeded in changing "Output" on My_Plan. using the command:
co id("name of the Output button") cmd "on"
For some reason I do not get the command fb ... to work.

What is the correct format? What am I missing?
Halvor






Data in our table roctab.csv:
These rfid cards work fine:
R L 11005dde47 '<co id="Se17R1" cmd="off"/>'
R E 110060a95e '<co id="Se18R1" cmd="on"/>'
R L 110060a95e '<co id="Se18R1" cmd="off"/>'

but this one does create any reaction on the Rocserver.
R E 11005dcd87 '<fb id="Se104" state="true"/>'
R L 11005dcd87 '<fb id="Se104" state="false"/>'


Printed from our roctrig.py program

64.203065 R11005dcd87E '<xmlh><xml size="29"/></xmlh><fb id="Se104" state="true"/>'
65.406830 R11005dcd87L '<xmlh><xml size="30"/></xmlh><fb id="Se104" state="false"/>'


96.477947 R11005df733E '<xmlh><xml size="28"/></xmlh><co id="OutSe101" cmd="on"/>'
104.148833 R11005df733L '<xmlh><xml size="29"/></xmlh><co id="OutSe101" cmd="off"/>'




Rocserver writes:
Only responds to the "co id ...." command, not the fb command

20131009.160517.305 r9999I cmdr0270 OOutput 0203 setting output OutSe101 to on [1]

20131009.160654.328 r9999I cmdr0270 OOutput 0203 setting output OutSe101 to off [0]
You do not have the required permissions to view the files attached to this post.
Halvorw
 

Postby rjversluis » 10.10.2013, 13:11

The script and the Rocrail server trace are missing in your zip.

Try to activate automatic trace level to seen unregistered sensor events.
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
 

raspi as a wireless feedback module

Postby Halvorw » 10.10.2013, 14:21

Atached is the pi- program and teh table that is used to generate the commands to the Rocrail server

And to the best of my knowlede I have activated tracing. See picture.

Best regards

Halvor
You do not have the required permissions to view the files attached to this post.
Halvorw
 

Postby rjversluis » 10.10.2013, 15:28

Still no rocrail.*.trc attached with the needed info.
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
 

raspi as a wireless feedback module

Postby Halvorw » 10.10.2013, 15:46

Hi Rob.

Thanks! Now I learned the trick and found several *.trc filen on my Raspberry where the server is running. I am on my way out for a few days. But as soon as I am back, I´ll dig into this eagerly learning more of the Rocrail system.
Have a good weekend

Best regards

Halvor
Halvorw
 

Postby Pirat-Kapitan » 10.10.2013, 20:41

Hi Halvor,
do You have a /opt/rocrail/nohup.out file?
It is like the last *.trc of rocrail.

Best regards
Johannes
Clearasilfahrer auf Spur G, Lenz LZV (3.6), ORD-20, Manhart-Funki und WLM, RS-Bus Rückmelder (Reedkontakte),
Rocrail auf RasPi ("raspiRoc") mit mobilen Geräten (andRoc). Details auf http://wiki.rocrail.net/doku.php?id=use ... at-kapitan.
Pirat-Kapitan
 

raspi as a wireless feedback module

Postby Halvorw » 12.10.2013, 17:07

Hello again Rob and Johannes

Enclosed is the .trc file. Have a look towards the end of the file at time stamps 20131009.160517.
There are several lines stating: "action state does not match: (off/false)"
This is Rocrail server´s response to my messager :

fb id=" ..." state="false"


Would you like to have a phyton program that is sending this string? Or is this enough to guide me back on track.

And to you Johannes, I do not have any file called nohup.out. Any setting I should do in order to get such a file? Or where to look?

By the way the .trc file tell me also about several errors in my plan, so I need to do some cleanup. But those errors should not have any impact on my reported problem.Thanks for learning about these files.

Best regards Halvor
You do not have the required permissions to view the files attached to this post.
Halvorw
 

Postby Pirat-Kapitan » 12.10.2013, 17:17

Hi Halvor,
I use the instructions by Manolo Serano from the english part of this forum.
Hi modified the file /opt/rocrail/rocraild.sh to get a via WLAN readable rocrail-output.

best regards
johannes

MS instructions:
http://tren.enmicasa.net/wp-content/upl ... i_v1.4.pdf
You do not have the required permissions to view the files attached to this post.
Clearasilfahrer auf Spur G, Lenz LZV (3.6), ORD-20, Manhart-Funki und WLM, RS-Bus Rückmelder (Reedkontakte),
Rocrail auf RasPi ("raspiRoc") mit mobilen Geräten (andRoc). Details auf http://wiki.rocrail.net/doku.php?id=use ... at-kapitan.
Pirat-Kapitan
 

raspi as a wireless feedback module

Postby Halvorw » 13.10.2013, 14:20

Hello Johannes

Thank you very much for this link. I found that document very interesting, We have aslo met many of the challenges solved in this document. And found alternative solutions. May roads to Rome.

Regarding my problem of sendeing commands to the Rocrail server for changing sensors, I hope Rob now has information enough to guide me back on track.

Halvor
Halvorw
 

Postby gramels » 13.02.2014, 22:24

Hi folks,

I am looking in the same topic, wireless rfid reader on the loko, G gauge, RFID tags on the track.

I start to consider to use WIFI UART modules ( like http://www.shuncomwireless.com/sell-mod ... 08863.html ) and attach a ID20 RFID reader to it. Connection to rocrail via wireless, on the rocrail side I need to check, but I guess this might be relatively easy to map in.
This would eliminate the whole rasp-pi on the Loko and make it way smaller, so it might fit alos in small Diesel shunters.

I started a threat about this in german here http://forum.rocrail.net/viewtopic.php?p=64072#64072

Thoughts?

Cheers

Lothar
openDCC - MultiMaus - (MERG RFID) - testing a planned garden layout in IIm -
gramels
 

Previous

Return to DIY Hardware