{
"rxpk": [
{
"time": "2013-03-31T16:21:17.528002Z",
"tmst": 3512348611,
"chan": 2,
"rfch": 0,
"freq": 868000000,
"stat": 1,
"modu": "LORA",
"datr": "SF9BW125",
"codr": "4/5",
"rssi": -39,
"lsnr": 11,
"size": 23,
"data": "00FB5F00F07ED5B3708EBDC96952475D0004FAEC5DD086"
}
]
}
I decided to follow the easy route for now with the packet formatting, its JSON. Forget about the "time" and "tmst" values above, the rest is real information :)
JSON is not ideal, but I'm worried that I'll get tangled up in writing gateway bridge code for OpenWRT. I can just compile the Semtech Packet Forwarder. Furthermore I'd have to anyway convert most other formats to something that Chirpstack understands. Eventually, when this single Channel LoRaWAN gateway traffic pipeline is complete and has been running for some time I will change JSON for a better packed format.
I found a fresh and pure C JSON serializer library for embedded systems: https://github.com/rdpoor/jems
The best part is that it can "emit characters as you go", and I like to go. It means that the E5 can stream out JSON over USB character by character when a packet arrives. Combine that with the Mbed OS Event Queue and you can stream like there's no tomorrow without any major memory issues, other than my own.
Next I'll compile the packet forwarder on the router and sniff what it wants from what it thinks is a 'normal' gateway. We will give it all the JSON it needs, but not more.
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.