On Wed, Jan 2, 2019 at 09:27 PM, Dave wrote:
Chris,
Re: 64 byte limit - I saw it in a message from Speed on 15 Dec. Yes, it is referring to ESP type devices, it's certainly not a problem with MQTT itself. Does anyone know what the smallest payload limit is on the devices we are likely to use for model railroads, perhaps NodeMCU ESP8266???
For signals, it may be simpler to use signal heads where the payload only needs to be the appearance - red, flashing yellow, dark, etc (also mentioned by Speed)? Masts can be built using Signal Head Controlled Mast driver, already available in JMRI.?
Simplest case payloads:
?
Device type? -? ?Payload options
?
Turnout - Closed | Thrown
Sensor - Active | Inactive (or 1 | 0 )?
Signal Head - Red | Yellow | Green | Dark | Flashing Red | Flashing Yellow | Flashing Green
and perhaps though maybe later down the track
Signal Mast - the aspect name (which isn't as simple as it sounds because there are in some railroads multiple appearance options for the same aspect name)?
? ? ? ? or? ? ? -? ?the combination of head appearances with comma separators e.g.? red,flashyellow,red
(Note: There appears to be some inconsistency between Heads and Masts currently in JMRI in the use of? flashyellow vs Flashing Yellow and where lunar is an option. I don't yet understand why that is so, will look a bit deeper)
Things start to get more complicated when you want to include more detailed configuration information to reduce the configuration information needing to be held in the actioning device or for having flexible devices and therefore requiring more instruction.? We can consider making allowance for this, perhaps using the Comments value in the JMRI table, or, at least as an interim step, just make it a requirement that such configuration is for the actioning device to sort out.?
- David.
Dave,?
I have some serious doubts that ESP8266 or ESP32 will have problems with JSON as shown in my last post. These two specific boards are very popular in the home automation spectrum and have the ability to parse these JSON:
{ "brightness": 255, "color_temp": 155, "color": { "r": 255, "g": 180, "b": 200, "x": 0.406, "y": 0.301, "h": 344.0, "s": 29.412 }, "effect": "colorloop", "state": "ON", "transition": 2, "white_value": 150 }I am not saying there are limits, but I have some serious doubts a JMRI payload will reach 64 bytes. As long as the the simple things like turnouts and sensors are kept simple. I believe that lights, signals should have the ability to be in JSON and this should allow more dynamic things for example. Reporters can also be simple text or JSON. If JSON are used for reporters the user would have to probably develop a custom script, since they are more than likely doing something special.?
Chris