Mobile Rocmouse

Re: Mobile Rocmouse

Postby rjversluis » 17.04.2018, 06:49

Hi Dagnall,

the command
Code: Select all
<model cmd="lcprops" val="id"/>

will return just one loco property

I extended this function
Code: Select all
<model cmd="lcprops"/>

will return all loco properties as separate messages.

But be aware that one loco property could be big too with 32 function nodes and a lot of BBT records...
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: Mobile Rocmouse

Postby Dagnall » 17.04.2018, 12:17

I extended this function
CODE: SELECT ALL
<model cmd="lcprops"/>
Rob, thanks. :)
I look forward to testing it and modifying my code, (I have tested with 13869 and its not there ((or I am doing something wrong :oops: )) which version will this be in?) .

FYI, I am also working on the "other half" of the mobile tool: some code that works the same way, but for switches/turnouts.
The idea for this is you can have a small simple wireless tool to take around the track and modify the left and right positions of Rocnet switch servos...
I know that for indoor modellers, this is not an issue!, but outdoors, lugging around a laptop (preferably waterproof) is a hassle. With my servo switch mechanisms, some slippage can occur to the servo linkages over time or if they get jammed and then operated, so occasional re-setting of the left and right positions makes for happier trains.
I was hoping that moving switches using Client server protocol would be roughly the same as changing loco parameters, but am having trouble getting it working, this code seems to set to straight, but cmd=1 does not set to turnout..
Code: Select all
mosquitto_pub -h 192.168.0.18 -p 1883 -t rocrail/service/client -m "<sw id=\"wood7\"  cmd=\"0\"   />" -q 1 
Can you show me what i am missing please..? :oops:

:!: Since the SW data is smaller, the MQTT message limitation is less of an issue for this "switch tool" version. My initial version is receiving 11 switches with 48% of my MQTT payload, so should be good for 20 switches without an equivalent mod to the "lcprops", but is there a swprops version as well?

Cheers
Dagnall
ESP8266 Based RocNet Universal 8 i/o decoder and Mobile Decoder. http://wiki.rocrail.net/doku.php?id=users:dagnall53:description
G Scale 3D printed Locos and wagons : (on Thingyverse)
Dagnall
 

Re: Mobile Rocmouse

Postby rjversluis » 17.04.2018, 12:36

Hi Dagnall,

if I changed code today this will not effect the nightly build from today...
I cannot make changes in history. -o

A switch command can only be: straight, turnout, left and right
Zero is not a command.
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: Mobile Rocmouse

Postby Dagnall » 17.04.2018, 14:06

Aha.. it "clicks"..
Code: Select all
<sw id=\"wood7\" cmd=\"straight\"   />
:thumb_up: :D

I missed the date you sent the "lcprops" message :oops: ... I did not think you had a time machine!!. :D
(p.s. what is "glaskugel"?)
D
ESP8266 Based RocNet Universal 8 i/o decoder and Mobile Decoder. http://wiki.rocrail.net/doku.php?id=users:dagnall53:description
G Scale 3D printed Locos and wagons : (on Thingyverse)
Dagnall
 

Re: Mobile Rocmouse

Postby smitt48 » 17.04.2018, 14:12

Hi D,

Crystal Ball!

Tom
Kind regards,
Tom Smit
Kralendijk, Bonaire - Dutch Caribbean

Märklin M & K-rails with ECoS2 (4.2.3) - Win10
RoSoft: S88n & WDD switch & SDD signal decoders
Display: Tri-ang from 1950's, Märklin from early 1960's
In build phase
smitt48
 

Re: Mobile Rocmouse

Postby Dagnall » 17.04.2018, 14:50

'Glaskugel"...Ahh! :thumb_up:
ESP8266 Based RocNet Universal 8 i/o decoder and Mobile Decoder. http://wiki.rocrail.net/doku.php?id=users:dagnall53:description
G Scale 3D printed Locos and wagons : (on Thingyverse)
Dagnall
 

Re: Mobile Rocmouse

Postby Dagnall » 18.04.2018, 17:33

edited- I made a stupid mistake!! see next post..
Last edited by Dagnall on 19.04.2018, 12:03, edited 1 time in total.
ESP8266 Based RocNet Universal 8 i/o decoder and Mobile Decoder. http://wiki.rocrail.net/doku.php?id=users:dagnall53:description
G Scale 3D printed Locos and wagons : (on Thingyverse)
Dagnall
 

Re: Mobile Rocmouse

Postby Dagnall » 19.04.2018, 12:02

Rob
Sorry: :oops: I had not spotted that during the re installation my loco roster had dissapeared: :oops:
Not surprising that the lclist response was empty.
D
ESP8266 Based RocNet Universal 8 i/o decoder and Mobile Decoder. http://wiki.rocrail.net/doku.php?id=users:dagnall53:description
G Scale 3D printed Locos and wagons : (on Thingyverse)
Dagnall
 

Re: Mobile Rocmouse

Postby Dagnall » 19.04.2018, 18:30

Rob,
The improvement with lcprops over lclist is very impressive.
I have been able to reduce my pubsubclient MQTT_MAX_PACKET_SIZE to 10000 bytes and I am only half filling it for most loco messages. This massively reduces the memory usage, so I have been able to increase the number of locos I can "read", store and control to 126 locos.
I have tested it with 23 locos, and it seems to work fine. :thumb_up: (I did not try any more as I got tired of adding locos to the roster! )

I am very impressed with how well the esp8266 /mqtt data transmission / protocol works. The protocol must be delaying the message transfers a bit, as I can see a count of the number of locos whose attributes I have parsed/captured incrementing at perhaps 2 per second on the esp. On the PC, the lcprops response is virtually instantaneous, so the protocol is doing a great job of sending messages only when the esp is ready to accept them.

I have put the code on github, and given it the name RocClientThrottle. http://github.com/dagnall53/RocClientThrottle
If you would prefer I change to another name, (not using Roc) let me know your preferred name!...
I will write up some more on the throttle when I can take better pictures. But can get the idea from the attached photo, even with missing OLED lines.
I also need to work on a nice housing.

:?: Could you put a similar "props" command in for the switches? :?: swprops :?: please?

Huge thanks.
Dagnall
This is one of my 3D printed Terriers, which have my ESPMQTTRocnetSound controllers inside.
IMG_2149.JPG
You do not have the required permissions to view the files attached to this post.
ESP8266 Based RocNet Universal 8 i/o decoder and Mobile Decoder. http://wiki.rocrail.net/doku.php?id=users:dagnall53:description
G Scale 3D printed Locos and wagons : (on Thingyverse)
Dagnall
 

Re: Mobile Rocmouse

Postby janvanderborden » 19.04.2018, 19:56

Hi Dagnall

Congratulations, you did it.
When my module arrives from China, i will load up the code.

The missing lines in the display is that a broken display or is it a code problem
gr jan
janvanderborden
 

Re: Mobile Rocmouse

Postby rjversluis » 20.04.2018, 06:52

Dagnall,

I added the swprops command which works comparable as lcprops.
13.884+
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: Mobile Rocmouse

Postby Dagnall » 21.04.2018, 14:00

janvanderborden wrote:Hi Dagnall

Congratulations, you did it.
When my module arrives from China, i will load up the code.

The missing lines in the display is that a broken display or is it a code problem

The missing lines are just a "physical damage to the Oled" problem. I was lucky that it only affected every other line, so I can still test with the module...

I will now be working :coding: on a version for the switches! (Thanks Rob!! :rr_for_ever: )

Cheers
Dagnall
ESP8266 Based RocNet Universal 8 i/o decoder and Mobile Decoder. http://wiki.rocrail.net/doku.php?id=users:dagnall53:description
G Scale 3D printed Locos and wagons : (on Thingyverse)
Dagnall
 

Re: Mobile Rocmouse

Postby Dagnall » 21.04.2018, 14:05

rjversluis wrote:Dagnall,

I added the swprops command which works comparable as lcprops.
13.884+


Much Appreciated!
Out of interest, how many servo controlled switches/turnouts do you have on your layout(s)? - I would like to ensure that the "size" of any variables I put in the code allows for sufficient switches .
The Loco throttle can cope with ~120 locos. I hope the SW itch setting tool will be able to accept more switches than that when I finish it.

Dagnall
ESP8266 Based RocNet Universal 8 i/o decoder and Mobile Decoder. http://wiki.rocrail.net/doku.php?id=users:dagnall53:description
G Scale 3D printed Locos and wagons : (on Thingyverse)
Dagnall
 

Re: Mobile Rocmouse

Postby rjversluis » 21.04.2018, 14:52

Out of interest, how many servo controlled switches/turnouts do you have on your layout(s)?

After the last move I do not have a real layout, just some test boards.
I'm planing a new layout, but this will be realised in the next winter; Carport and garden do have a higher priority.

Check the user pages or the forum for large layouts.
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: Mobile Rocmouse

Postby Dagnall » 25.04.2018, 12:31

Rob,
I have "dug deeper", and found that Mosquitto places some limits on how many messages it will queue. max_queued_messages defaults to 100 messages, so a "standard" broker can only support sending of about 100 switch (or loco) items.

This probably limits the usefulness of my "universal" cient ideas!.

However I do now have the switch tool working and it was very nice to walk around the garden and switch point "thrown or straight" positions to check operation :thumb_up: (and change their left and right positions on the Rocnet ones).
As soon as I have a 3d printed case for it I will do a video.

Hope you enjoy some good weather soon and get the carport done!.
Mowing the lawn is always a chore!.

Dagnall
ESP8266 Based RocNet Universal 8 i/o decoder and Mobile Decoder. http://wiki.rocrail.net/doku.php?id=users:dagnall53:description
G Scale 3D printed Locos and wagons : (on Thingyverse)
Dagnall
 

PreviousNext

Return to RocNet