Maybe undelimited isn't wholly accurate, but I have an embedded source that spews via RS485. I have that terminated on a 485 to 232 shield, the serial stream coming into the AVR on Serial1 @ 9600.
I can see the stream coming in - there's a lot of it and it comes fast - maybe 1 second between streams. There are two issues I'm fighting: 1, there are multiple different nodes broadcasting on the bus with random length stream events and 2, the delimiter is sometimes a padding of eight 0xFF bytes followed by the header and interesting data and other times just the header 0xFF 0x0 0xFF 0xA5, other times just a 0x10 0x2. Fortunately the latter terminates with a 0x10 0x3. The others terminate with a 2 byte checksum. Since samples 1 & 2 both include the same 0xFF 0x0 0xFF 0xA5 maybe I should disregard the eight 0xFF bytes. I don't do this stuff everyday, bear with me. I wasted a weekend trying various code and finally I'm tossing the towel in. HELP!
Google and I have parsed the string out in a text editor and I know which fields hold the interesting values, trouble is I can't get the code right to parse it.
Here's a sample of the data stream and what I know. No, there is no public API and the manufacturer won't give it up.
In #1, I am looking for HOUR, MIN, TMP 1 & TMP 3.
In #2, I am looking for RPMH, RPML, WATTH, WATTL.
In #3, I am looking for PCT.
Any help is appreciated.
H T T T C C
D S ? O M M M M H H
S R U I P P P K K
<------padding-----> <--header--> T C R N 1 2 3 H L
FF FF FF FF FF FF FF FF 0 FF A5 7 F 10 2 1D C 27 1 0 0 0 0 0 0 20 0 0 0 4 5A 5A 0 0 66 0 0 0 0 0 0 D0 7C 3 D 3 B8
This shows a broadcast msg (10 >> F) at 12:39, TMP1 (water temp) is 90, TMP3 (air temp) is 102
W W
R R A A C C
D S ? P P T T H H
S R U I M M T T K K
<--header--> T C R N H L H L H L
FF 0 FF A5 0 10 60 7 F 0 0 0 E6 5 78 0 0 0 0 0 1 C 38 2 DD
This shows a targeted update from 60 >> 10 (pump to control panel) reporting 230 watts @ 1400 RPM
P C
C H
<hdr> T K <trm>
10 2 50 11 32 A5 10 3
This shows a load of 50% on the salt chlorinator cell.
These streams come all jammed together in raw format like this:
FFFFFFFFFFFFFFFF0FFA57F1021D1F20000000200004575700600000008D7B3D37DFFFFFFFFFFFFFFFF0FFA57F1021D1F20000000200004575700600000008D7B3D37D102501132A51031020124B80EF103FFFFFFFFFFFFFFFF0FFA57F1021D1F20000000200004575700600000008D7B3D37DFFFFFFFFFFFFFFFF0FFA57F1021D1F20000000200004575700600000008D7B3D37DFF0FFA50601041FF219FF0FFA50106041FF219FF0FFA50601061126FF0FFA50106061126FF0FFA506010142C457825D