[solved] Rocnetnode and Macro

http://wiki.rocrail.net/doku.php?id=roc ... netnode-en
Post Reply
pmansvelder

[solved] Rocnetnode and Macro

Post by pmansvelder » 29.01.2014, 20:03

I am trying to set up a macro to control 4 outputs: the outputs are defined on the rocnetnode and work fine, I have set a macro (see attachment).
But how do I trigger this macro? In the documentation it says "Macros can be addressed by port type “macro” on the interface tab of stationary objects.", so I set up an 'output' (see second attachment), but nothing happens when I trigger this.
What am I doing wrong?
--
Peter Mansvelder
You do not have the required permissions to view the files attached to this post.

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

Post by rjversluis » 29.01.2014, 20:28

The value fields are all zero: Off.
Just set some to one: On.

http://wiki.rocrail.net/doku.php?id=roc ... p-en#value

pmansvelder

Re: Macros

Post by pmansvelder » 29.01.2014, 22:09

Hello Rob,

ok I did that, and that works. But I wanted a macro to turn all outputs off, that's why I set them to zero.
Now I made a second macro, but I still can't get the 'off' macro to trigger.

Peter

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

Post by rjversluis » 29.01.2014, 22:25

Hi Peter,

I use macros for signal aspects. They are mixed on/off and works fine.
For the output command the macro offset zero was not send which I added now, but that should not be the cause of your issue.

If you have macro 2 you can only activate it with an output at address 2...

pmansvelder

Macros

Post by pmansvelder » 29.01.2014, 22:42

Hello Rob,

I got it to work, although not very robustly; this is the part of my plan.xml where the outputs (including the one that triggers the macros) is defined:

Code: Select all

  <colist>
    <co id="1" x="1" y="11" z="0" porttype="0" desc="Relais 1" show="true" svgtype="0" blockid="" routeids="" tristate="false" toggleswitch="true" iid="Rocnet" bus="4" addr="4" port="0" gate="0" param="0" value="1" prot="D" inv="false" blink="false" asswitch="false" accessory="false" ori="west" state="on"/>
    <co id="2" porttype="0" desc="Relais 2" show="true" svgtype="0" blockid="" routeids="" tristate="false" toggleswitch="true" iid="Rocnet" bus="4" addr="3" port="0" gate="0" param="0" value="1" prot="D" inv="false" blink="false" asswitch="false" accessory="false" x="2" y="11" z="0" ori="west" state="on"/>
    <co id="3" porttype="0" desc="Relais 3" show="true" svgtype="0" blockid="" routeids="" tristate="false" toggleswitch="true" iid="Rocnet" bus="4" addr="2" port="0" gate="0" param="0" value="1" prot="D" inv="false" blink="false" asswitch="false" accessory="false" x="3" y="11" z="0" ori="west" state="off"/>
    <co id="4" porttype="0" desc="Relais 4" show="true" svgtype="0" blockid="" routeids="" tristate="false" toggleswitch="true" iid="Rocnet" bus="4" addr="1" port="0" gate="0" param="0" value="1" prot="D" inv="false" blink="false" asswitch="false" accessory="false" x="4" y="11" z="0" ori="west" state="off"/>
    <co id="power-off" x="9" y="11" z="0" porttype="6" desc="" show="true" svgtype="0" blockid="" routeids="" tristate="false" toggleswitch="true" iid="Rocnet" bus="4" addr="1" port="0" gate="0" param="0" value="1" prot="D" inv="true" blink="false" asswitch="true" accessory="false" ori="west" state="off"/>
  </colist>
Macro 1 is defined on the rocnetnode as 'on', Macro 2 is off. This way I have a button that toggles all 4 outputs at once. But like I said, it does not work all the time, sometimes I have to go to Programming->Rocnetnode and check the macros first, after that the button works the first time. One possible reason for this could be that I have the controlling computer on wifi at the moment, while the rocnetnode is wired, maybe UDP over wi-fi is not 100% reliable (it's UDP, right?), I will test more when I have wired the PC too. I keep postponing the inevitable pullling-ethernet-cables-though-walls hassle...

Peter

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

Post by rjversluis » 30.01.2014, 07:03

UDP over WiFi is reliable if the same router is used for both wired and wireless connections.
But more important is the power supply of the Raspi! Most 5V adapters are of bad quality and drop to 4.2V which causes network problems!
Order as soon as possible a Pi06.


http://wiki.rocrail.net/doku.php?id=gca-pi06-en
Last edited by rjversluis on 30.01.2014, 07:43, edited 2 times in total.

Richard-TX
Posts: 1320
Joined: 10.07.2012, 04:00
Location: Texas, USA
Contact:

Post by Richard-TX » 30.01.2014, 07:28

Another possible solution is to add a high quality powered USB hub. I won't run WIFI unless I have the wifi adapter plugged into a hub.

pmansvelder

Re: Macros

Post by pmansvelder » 31.01.2014, 16:22

I have plugged in the main computer into an ethernet cable, but the macros are still not reliable; I will check your suggestions:
- power supply to the pi: right now it is plugged into a combined charger/USB powersupply, I have some decent psu's lying around, including a 5V/3A switched power supply, which I will convert into a CGA-Pi06 clone ;)
- rocrail version: I will try the latest version of the rocrail server program, to see if the behaviour is any different.

Peter

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

Post by rjversluis » 31.01.2014, 16:40

Make sure Rocrail and Rocnetnode have the latest available revisions otherwise its useless to report any difficulties.
Macros are heavily used by other users.

pmansvelder

Re: Macros

Post by pmansvelder » 01.02.2014, 15:48

Thanks for the tip, Rob! I just checked everything with the latest revision (dated today!), and the macros work fine!
I will be doing the other half of my layout soon, I already ordered the other GCA-modules.

Thanks again for the help,

Peter

Post Reply

Return to “RocNetNode”