ESP8266 based Mobile Rocnet Node

Dagnall
Posts: 278
Joined: 15.05.2015, 14:41

ESP8266 based Mobile Rocnet Node

Post by Dagnall » 27.02.2018, 19:05

HI, I have mentioned this in other parts of the forum, but my ESPMQTTRocNet code is fully compatible with Rocrail MQTT, and also plays synchronised Chuffs and other sampled sounds. There is a YouTube video of the latest version here:
https://www.youtube.com/watch?v=Pg5r6MZDhww
The code is available on Github. https://github.com/dagnall53/ESPMQTTRocnetSound
Cheers
Dagnall

casperdeboer
Posts: 75
Joined: 12.02.2017, 21:46

Re: ESP8266 based Mobile Rocnet Node

Post by casperdeboer » 19.11.2018, 12:19

Hi Dagnall

I am usen using your rocnode auto connect on an nodemcu. But now i seem to have troubles with programming the in/outputs, I want the outputs to be used as an sensor but when i connect hall sensors to the nodemcu they wont work. I also used your other programms and here they work fine.

ESP wifirocnt v4 reboots constantly
ESP wifirocnet sound master the in and outputs are not programmable.

Could you please help me

Dagnall
Posts: 278
Joined: 15.05.2015, 14:41

Re: ESP8266 based Mobile Rocnet Node

Post by Dagnall » 27.03.2019, 16:45

Casper, i think i answered this in a pm, but i have also completely updated the code and called it WiRocS..
Another user found that there is an issue if the SPIFFs is not working or is missing files. The same problem I think you had..
I have today completed a version on the experimental branch of WiRocS, ( ver17f) that includes more tests, so that if the important wav files are missing, the code simply turns off audio, but keeps working..
Much better than crashing repeatedly! :wink:

The new code also has rocdisplay compatible OLED displays for station platform announcements /schedules/ arrivals etc.

As soon as i have confirmed it works with esp32 as well, i will update the 'master' WiRocS branch.
D

casperdeboer
Posts: 75
Joined: 12.02.2017, 21:46

Re: ESP8266 based Mobile Rocnet Node

Post by casperdeboer » 27.03.2019, 17:54

Thnx Dagnall

Dagnall
Posts: 278
Joined: 15.05.2015, 14:41

Re: ESP8266 based Mobile Rocnet Node

Post by Dagnall » 17.04.2019, 13:04

Rob, quick questions.
:?: Q1 A user is using my WiRocs Oled display stuff, but the data length of the message in the RocNet protocol is limiting how many characters can be sent, so we lost some platform numbers... I think I saw some time ago in a forum that you limited the message content in RocDisplay messages to (?) 100 (?) characters (to fit a 7 bit "length" byte ??).. Is this "hard fixed, or could it be increased to 255..?
:?: Q 2, More generally.. what limits the Rocnet protocol to 7 bits data length?.. Is this set somewhere in Rocrail so I can change to 8 bits?.. I have to admit I have not been previously troubled by this, but it would be good to check.

The answer that we are using at the moment is to send the messages out exactly as per Walter's system, with multiple messages "only" sending stuff for two lines of the display. But my displays have 8 Lines, so it would be nice (but not essential!) if we could send a single (longer) message for the whole display.

Many thanks
Dagnall
displ.jpg
You do not have the required permissions to view the files attached to this post.

peter&basti
Moderator
Posts: 6688
Joined: 09.01.2012, 22:09
Location: Vienna, Austria

Re: ESP8266 based Mobile Rocnet Node

Post by peter&basti » 17.04.2019, 13:32

Hi Dagnall,

in the technical description of the RocDisplay you can find the hint, that the max of characters including control characters is 110

But i dont know who is limited, Rocrail oder the display controller.

Dagnall
Posts: 278
Joined: 15.05.2015, 14:41

Re: ESP8266 based Mobile Rocnet Node

Post by Dagnall » 17.04.2019, 13:59

Peter, thanks..I could not find that reference when I looked for it.
peter&basti wrote:
17.04.2019, 13:32
max of characters including control characters is 110

But i dont know who is limited, Rocrail oder the display controller.
I think (but am not sure) it is Rocnet/Rocrail that limits to 110 (but why not "full" 7 bits len = 127 ?) If Rocnet Protocol can have 8 bit "length" then I "could" send 255 characters..
A deep dive (i used helium/nitrogen mix :wink: ) in my code shows I also applied the 110 message max length so I must have read it correctly somewhere before. And I have also now found a comment that noted that "Rocrail seems to limit to len=113 anyway"..I do now recall sending some long messages to see what "got through"..
My code limits Roc_Data message to 200 bytes total, (easily increased if needed). and the "Display" message buffer is 150 characters (again easily increased). (although why its 150 when I limit to 110 characters now escapes me :oops: )

However.. At the moment sending 4 messages to write the 8 lines works fine. :thumb_up:

Cheers
D

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

Re: ESP8266 based Mobile Rocnet Node

Post by rjversluis » 17.04.2019, 14:18

Hi,

RocNet could use the full size of one UDP message:
https://en.wikipedia.org/wiki/User_Datagram_Protocol
But transporting such an amount over I2C is not such a good idea, so at the moment I would say: Rejected.

Dagnall
Posts: 278
Joined: 15.05.2015, 14:41

Re: ESP8266 based Mobile Rocnet Node

Post by Dagnall » 17.04.2019, 16:49

Rob, Not to extend the discussion, - because I agree the length is "about right"..
But for complete understanding.. ?
:?: Why 110 and not 120 or 126 or 127?

Was it just a random selection? That's fine if it was, I am just curious..
D

(edit)Many thanks to Henning for pointing me to the German Forum!! viewtopic.php?f=128&t=16217&p=175070&hi ... th#p175070
-- Answer.. 110 leaves room for the rest of the message to be within a 128 package limit!--
Last edited by Dagnall on 18.04.2019, 10:30, edited 1 time in total.

drblack
Posts: 81
Joined: 10.05.2008, 13:02
Location: Quickborn, S-H

Re: ESP8266 based Mobile Rocnet Node

Post by drblack » 18.04.2019, 06:08

Hi Dagnall,

I had the same issue when I started to play with little RGB displays: translated by google
I then switched over to the great work Gerrit did with NodeRED: translated by google
After my bread board prototype, I designed a pcb prototype which didn't work. I ruined quite a few displays, so I lost interest after a while. Therefore I am not very deep into it anymore. But I'm still quite keen to get it running.

Dagnall
Posts: 278
Joined: 15.05.2015, 14:41

Re: ESP8266 based Mobile Rocnet Node

Post by Dagnall » 18.04.2019, 10:53

Henning,
Many thanks for introducing me to those parts of the German Forum!. I do search them, but had missed those threads!!. Rob must get tired answering the same questions in different languages!!

I would like to learn more about the Node-Red stuff- Did you write up any stuff in a Rocrail user Wiki??
I put my WiRocS stuff in and found it quite easy and fun.. https://wiki.rocrail.net/doku.php?id=us ... _dagnall53
Perhaps you could consider writing some notes on showing a Rocrail-> MQTT-> Node-RED-> MQTT-> WiRocS data flow??
Would that be easier than the Scheduling system that Peter wrote?
My WiRocS code tries to be "RocDisplay" compatible, so hopefully it would not be that difficult?

:rr_for_ever:

drblack
Posts: 81
Joined: 10.05.2008, 13:02
Location: Quickborn, S-H

Re: ESP8266 based Mobile Rocnet Node

Post by drblack » 18.04.2019, 16:29

Hi Dagnall,

I'm on easter holidays right now. But I'm certainly willing to write something about that.
Give me a few days.

Dagnall
Posts: 278
Joined: 15.05.2015, 14:41

Re: ESP8266 based Mobile Rocnet Node

Post by Dagnall » 18.04.2019, 18:46

Thanks, it sounds interesting.
D

Dagnall
Posts: 278
Joined: 15.05.2015, 14:41

Re: ESP8266 based Mobile Rocnet Node

Post by Dagnall » 24.04.2019, 12:10

rjversluis wrote:
17.04.2019, 14:18
RocNet could use the full size of one UDP message:
https://en.wikipedia.org/wiki/User_Datagram_Protocol
But transporting such an amount over I2C is not such a good idea, so at the moment I would say: Rejected.
Rob, sorry to bring this question up again.
But. With my WiRocS code running on ESP8266, the Data length limit does now limit what can be displayed on the OLEDS.

:!:First point The messages on RocView seem to be inconsistent with what is actually sent.
For example RocView here claims to send a message with length 144,

Code: Select all

11:32:32 set display 50:60:1 to  {F0}A{T0}Some  messages{L1}B{L1T0}Line 2 test of message length{L2}C{L2T0}01234567890{}ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz{P}   len=144
But I have some debug capability so can see what is actually recieved and I get this

Code: Select all

.*MQTT Received [rocnet/dp] Payload Length[113]  00 00 32 00 01 0C 01 71 3C 01 7B 46 30 7D 41 7B 54 30 7D 53 6F 6D 65 20 20 6D 65 73 73 61 67 65 73 7B 4C 31 7D 42 7B 4C 31 54 30 7D 4C 69 6E 65 20 32 20 74 65 73 74 20 6F 66 20 6D 65 73 73 61 67 65 20 6C 65 6E 67 74 68 7B 4C 32 7D 43 7B 4C 32 54 30 7D 30 31 32 33 34 35 36 37 38 39 30 7B 7D 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F 50 51 52 53 54 55 56 57 00
Which as you can see only gets 113 bytes of the message, i.e. up to the ASCII 57h or "W". I do not truncate the message so presumably RocRail truncated it as we have noted in earlier communications.
:?: :?: SO.. could you make the RocView controller window report what was REALLY sent. (ie a truncated message)


Second point Can you reconsider your rejection of the data content length increase.
:!: Potential hardware limits on what I2C can (or cannot) do should not limit what you send from Rocview using RocNet protocol. I happen to be using I2C for my displays, but we could be using any interface inside the hardware. RocNet is not I2C.
:?: So, could I ask again that you reconsider your transmission limit on the data content in the Rocnet protocol please.- I would hope/expect that the RasPi code would not be affected if it saw long messages ?

Thanks and sorry the message is so long. I have tried hard to make it concise but understandable..
PS. An example of what the OLEDS can do is shown here. https://youtu.be/PBin-VwnSM4 The data length limit now prevents sending larger or longer messages.
Dagnall

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

Re: ESP8266 based Mobile Rocnet Node

Post by rjversluis » 24.04.2019, 13:08

Hi Dagnall,

how many Bytes do you like to have?

Post Reply

Return to “RocNet”