Mobile RCP Rocmouse

Post Reply
rjversluis
Site Admin
Posts: 42383
Joined: 10.04.2006, 08:48
Location: Speyer, Germany
Contact:

Re: Mobile Rocmouse

Post by rjversluis » 21.12.2018, 16:26

Jan,

write english!

janvanderborden
Posts: 603
Joined: 06.09.2014, 16:23
Location: Heiloo

Re: Mobile Rocmouse

Post by janvanderborden » 21.12.2018, 16:28

OK

you are wright



please show us your MQTT command because this is were we are looking for

nice2have
Moderator
Posts: 1831
Joined: 24.01.2013, 14:29
Location: Erftstadt

Re: Mobile Rocmouse

Post by nice2have » 21.12.2018, 16:30

Hi Jan,
janvanderborden wrote:
21.12.2018, 14:43
Hi Rob

Rocview is toch ook een client. Als we vanuit rocview een dispatch commando geven verschijnt dat niet in rocrail/service/client we zien het alleen onder rocrail/service/info in de regel <exception en die mogen we niet gebruiken.
Please write english in this part of forum. It's easier for everybody to follow you - thanks.

Dagnall
Posts: 278
Joined: 15.05.2015, 14:41

Re: Mobile Rocmouse

Post by Dagnall » 21.12.2018, 16:33

rjversluis wrote:
21.12.2018, 16:09
If in Rocview a dispatch command has been issued, the following command ist send:

Code: Select all

<lc id="E03" cmd="dispatch" controlcode="" slavecode="" server="infwFF2946F0"/>
Thanks, But we do not see this and I have dos windows subscribed to both client and info mqtt topics..
Perhaps it is how we "send a dispatch command"? - Is there a "correct way" to get the message you show above?
For me, I click on the loco in the loco table in Rocview: Right mouse to get pull down menu: Select "Dispatch for Throttle": Left mouse click. (and it sends the exception message)
Are there any hidden boxes I need to tick to get this to work to send the <lc message?? -o

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

Re: Mobile Rocmouse

Post by rjversluis » 21.12.2018, 17:12

Hi Dagnall,

this message came from Rocview after doing the same action as you wrote; Dispatch in the Loco Tab.
This must have been send in this topic
rocrail/service/client
otherwise the server would not receive this command.

Dagnall
Posts: 278
Joined: 15.05.2015, 14:41

Re: Mobile Rocmouse

Post by Dagnall » 21.12.2018, 18:27

When I Dispatch in the loco tab, (+change speed and then release)..my Tracefile shows..

Code: Select all

20181221.170600.688 r9999I 00003034 OrocNet  0290 Clock sync 17:06 2018-12-21 20C bri=255
20181221.170600.704 r9999c rnwriter rnmqtt   0159 RocNet Group: 7
20181221.170602.541 r9999I cmdr03D2 OLoc     4354 processing cmd="dispatch" for [green steam]
20181221.170602.542 r9999c 00003538 OrocNet  0598 dispatch loco green steam:8
20181221.170611.730 r9999c 00000340 OrocNet  0617 loc 0:8 V=30 lights=off dir=forwards spcnt=128
20181221.170611.744 r9999c rnwriter rnmqtt   0159 RocNet Group: 2
20181221.170612.918 r9999c 00000340 OrocNet  0617 loc 0:8 V=0 lights=off dir=forwards spcnt=128
20181221.170612.927 r9999c rnwriter rnmqtt   0159 RocNet Group: 2
20181221.170616.637 r9999I cmdr03D2 OLoc     4354 processing cmd="release" for [green steam]
20181221.170622.015 r9999I cmdr03D2 OApp     1378 SHUTDOWN
BUT I still only see the exception message in rocrail/service/info,

How do you make Rocview send this via rocrail/service/info or rocrail/service/client as you show??
My rocrail is using the update from last night...

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

Re: Mobile Rocmouse

Post by rjversluis » 21.12.2018, 19:13

You are looking in the RocNetNode MQTT...
But I am writing about
https://wiki.rocrail.net/doku.php?id=ro ... tt_service

You will not find Client communication in the RocNetNode MQTT; Would be very misplaced if they were popping up at this level.

Dagnall
Posts: 278
Joined: 15.05.2015, 14:41

Re: Mobile Rocmouse

Post by Dagnall » 21.12.2018, 19:45

rjversluis wrote:
21.12.2018, 19:13
You are looking in the RocNetNode MQTT...
But I am writing about
https://wiki.rocrail.net/doku.php?id=ro ... tt_service
The code I sent in the previous message was from the rr server dos window. Does that show that I am not sending the dispatch properly?
I have very little hair left to tear out!! :wink: HOW (precisely) can I get it to send the message???

Code: Select all

<lc id="E03" cmd="dispatch" ...

Jan also has the same issue- Neither of us can get this message sent.. we both get exception texts :mad:

FYI I do use Rocnet MQTT for my static and mobile nodes, but NOT for the throttle..My Throttle is looking at the MQTT rocrail/service/info messages: and I also check using a dos window with

Code: Select all

mosquitto_sub -h 192.168.0.11 -p 1883 -t rocrail/service/info  -q 1
My test rocrail has only one controller: rocnet using MQTT. I also have Service tab setup with MQTT service.

Dagnall
Posts: 278
Joined: 15.05.2015, 14:41

Re: Mobile Rocmouse

Post by Dagnall » 21.12.2018, 19:56

One last thought..
Does the throttle have to send something to Rocrail Via (rocrail/service/client) to let RR know that a throttle is waiting for a dispatch??
IF so.. what is the message format please..

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

Re: Mobile Rocmouse

Post by rjversluis » 21.12.2018, 20:56

I think we are writing parallel without understanding each other.

If a client like Rocview sends a dispatch command to the Rocrail server, it does not expect a reply because a dispatch is for the hardware level like LocoNet or CBUS.
The Rocrail Server send this dispatch to the lowest level in the Rocrail architecture: The CS library.
Depending of the CS library, its will publish a trace, <exception/>, but this is only air, and not of use to trigger actions.

The dispatch command coming from Rocview will be visible in the mqtt client topic.
I have very little hair left to tear out!!
Use a shaver.

janvanderborden
Posts: 603
Joined: 06.09.2014, 16:23
Location: Heiloo

Re: Mobile Rocmouse

Post by janvanderborden » 21.12.2018, 21:35

Yes Rob

We look in there but don't get to see any dispatch commands and you apparently
We do see the release commands.
we use:

mosquitto_sub -h 192.168.0.11 -t rocrail/service/client -q 1 and
mosquitto_sub -h 192.168.0.11 -p 1883 -t rocrail/service/info -q 1


but maybe we should do a setting in rocview or rocrail or send something to rocrail.

Dagnall
Posts: 278
Joined: 15.05.2015, 14:41

Re: Mobile Rocmouse

Post by Dagnall » 21.12.2018, 21:54

Rob, i agree we may be getting closer..
Jan and i see similar but different exceptions when we dispatch for loco. This may be because our cs librarys differ?

You say the way the rr server reacts depends on its cs library. Assuming cs library is the command station library, i have (only) rocnet as a command station. What cs should i include to get the mqtt message you expected/demonstrated.?

Do i understand correctly: rocview sends dispatch for throttle to rocrail server(the dos window). This server interprets it depending on cs library, then sends messages via serial/ethernet/mqtt interfaces as required to the command station.

In https://wiki.rocrail.net/doku.php?id=gca-pi04-en you say
Assigning a loco to a throttle is done with the dispatch command.
There is furthermore not much to explain about this unit.
So how does the pi04 see the dispatch message if we are using mqtt for rocnet communications?? Is this missing from the rocnet cs library?

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

Re: Mobile Rocmouse

Post by rjversluis » 22.12.2018, 07:26

1) Rocview send a Dispatch command to Rocrail.
2) Rocrail, the loco object, redirect this command to the RocNet library.
3) RocNet saves the dispatched address in a slot.
4) If an unregistered PI04 RocMouse is detected, this address is internally mapped to this PI04.

If you are not able to detect the command 1) you have no chance.

Code: Select all

<lc id="E03" cmd="dispatch" controlcode="" slavecode="" server="infwFF2946F0"/>

At 3) a trace is broadcasted if monitor level ist activated:

Code: Select all

    TraceOp.trc( name, TRCLEVEL_MONITOR, __LINE__, 9999, "dispatch loco %s:%d", wLoc.getid(node), wLoc.getaddr(node));

What you want is an echo of the dispatch command at 2) send to all clients?

Dagnall
Posts: 278
Joined: 15.05.2015, 14:41

Re: Mobile Rocmouse

Post by Dagnall » 22.12.2018, 10:36

BINGO!
rjversluis wrote:
22.12.2018, 07:26
4) If an unregistered PI04 RocMouse is detected, this address is internally mapped to this PI04.
My throttle has not informed Rocnet that it IS A Throttle. (I did not realize that I had to) . --- So presumably Rocrail sends an Exception because it thinks there are not throttles to accept the dispatch.??

I would prefer NOT to use RocNet protocol to inform Rocrail that there is a throttle available, as this code is trying to use just the MQTT server interfaces.

BIG Questions... (4 parts-- sorry)
(1) CAN I send a message using Client MQTT channel to Rocrail to let it know I have a "free" Throttle? :?: - What is the form of this message? :?:

If I cannot send this message using "pure" server messages, I must fall back on sending in Rocnet protocol: So...

(2) DO I HAVE to use Rocnet to send the "This node has a PI04" message, and what is the Code for "I am a Pi04" :?: ?
If I remember Rocnet , I think its sent in the in Packet Format Header/Action/Code (?) In https://wiki.rocrail.net/doku.php?id=ro ... et-prot-en the Packet Format Header/Action/Code defines the two bits "type", but not the meaning of the 5 bits "code" can you add to the table explanations please :?: . (I had decoded most of this message the hard way for pi0 and Pi03, but not for Pi04)

Thanks..
Dagnall

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

Re: Mobile Rocmouse

Post by rjversluis » 22.12.2018, 10:48

Hi,

you still don't get it.

RocNetNode scans the I2C Pi04 throttles.
Throttle address and commands are pushed up to the Rocrail server into the RocNet library.
You will only see this at UDP level, and NOT in MQTT.

To process any Rocview dispatch command you must subscribe to the MQTT client topic.

Is your Rocmouse connected to the Rocrail Server MQTT or to the RocNet MQTT?
If to the last, there is no client topic.

Post Reply

Return to “DIY Hardware”