WeatherBus

WeatherBus Used AI

9 devlogs
35h 5m
Created by Nikolai

A RS485-based protocol for IoT environmental monitoring systems. Designed for a modular weather station

Timeline

I cleaned up the formatting and comments, and split the WeatherBus library into separate header/source files so now the repo is nice and tidy.

This really changed nothing functionally, so the best i can do is a pic of it compiling :)

Update attachment

Big work. Completely overhauled the session restore logic yet again. Decided to base it off the example found in the radiolib-persistence repo. I also overhauled the TILV system, removing the length byte and instead splitting the index byte so one nibble contains a datatype (like int16, float32, etc) and the other nibble contains the index. Now the application-side formatter knows what the data will look like, and as a bonus I get to shave an extra byte per sensor on each uplink, due to no length byte. Both the firmware and application determine the length from the data type (e.g. float32 will be 4 bytes).

Update attachment

Cleaned up logging, rewrote the lorawan session restore.
I also made the coordinator firmware public and pushed it to github.

Update attachment

implemented functionality to save discovered slaves to RTC RAM.
Also cleaned up code to make it more ready to track with git.
Added some logic to avoid querying slaves with 0 sensors, not sending empty uplinks, etc.

Update attachment

Pulled in the RadioLib library to send the data over loRaWAN. Wrote a little payload formatter that just sends the each slave ID and it's TILVs back-to-back, no need for start delimiters and CRC and all that since the LoRaWAN protocol does that for ya. It works well! Screenshot shows me gettin dutycycle'd (oops) (but it does work).

Update attachment

I made hooked up real sensors. Discovered I flipped the connectors for one of the sensors on my PCB, so I desoldered it and flipped it the other way and that worked. Now I gotta handle deep sleep and waking.

Update attachment

I now have full discovery and query/response working with multiple nodes! Discoverywas a bit of a painpoint, getting the timings right and making sure that the master didn't miss any discovery reply packets, but it works now. Next step is to hook up some real sensors then collect some data

Update attachment

Today I tried implementing a streaming system to send data across multiple packets which proved to be way more difficult than I thought. I ended up just scrapping the idea, because realistically, each node isn't going to have more than about 3-4 sensors. For most nodes, it's a 1:1 relationship anyway. And in a 32-byte payload, I can fit 7 in one packet.

Update attachment

it kinda works! Ran a simple test where a master discovers one slave and gets some bogus temp measurements.

Update attachment