This is an open request for opinions on how a "serial data" data source might work. Many different approaches to how such a think could work can be conceived, so we are looking for specific examples of how you would want to derive data from a stream. In your description you should include examples of data (not too long please), and a description of how it is received and formatted.
"Serial data" data source
Quite strange, many questions related how to have some device connected or is some device supported, but no replies on this.
Here is one to start discussion with, but not very specific defined. I could think, many sorts of devices could be handled, if there was generic way to define ascii and binary message formats. Maybe something like start and end character(/binary pattern) to detect messages. The regEx could be used to parse values from ascii. Maybe binary pattern(s) and the pick bits from offset.
Example message formats
- ascii NMEA used in many GPS devices
- Binary format with fixed start and/or end ID fields. Maybe containing LID (length, identifier, data) type of content or data at fixed positions.
Why not having the same data source also handling tcp and udp type of data?
I will look on some example messages and add them here.
Here link to something which could be used as one use case example of binary type of messages. http://owfs.org/index.php?page=owserver-protocol
It is one variant of LID. Many protocols are quite like but having slightly different format.
An other is formatted like this
0x81 0F 06 01 02 03 04 XX 83
- start marker 0x81
- end marker 0x83
- message ID 0x0F
- length 0x06 (without start & end)
- data 01 02 03 04
- checksum XX
In this protocol values between 0x80 to 0x83 are reserved. If some field would have value in reserved range, the byte is bitwise inverted (e.g. 0x81 turns to 0x7E) and a special marker byte (0x80) is inserted before it, to mark for the receiver it has been inverted.
One more example would be modbus. There is a data source for it already, but just as example to think what kind of methods could be needed.
One more idea came up. Maybe the whole data handling could be done on user defined script, like in meta points. Then it would be more versatile (but not as easy to use with few clicks making special datasource). The data buffer could be given as variable to the script. The data sending could be triggered with events.
I don't know enough about serial data other than modbus but I think this is a excellent idea!
There are some commercial water system controllers that I work with that have data stream I would love to connect to Mango. I'll see if I can find information on there data format. I know there are lots of other devices that use unique serial data formats that would be great to be able to decode.
We're going to make this a pluggable feature of Mango V2 (aka M2M2). The thinking is that a template module could be written that would allow users to customize to their exact needs. Not sure how this will work exactly at the moment though.