Support for CC1101 radios
-
I wanted 433MHz support to improve performance in an environment challenging to 2.4GHz, so I bought a bunch of cheap CC1101 radio modules and set about writing a HAL driver for this chipset. I probably should have bought some RFM69 modules, but I wanted the challenge of supporting another popular radio.
I took inspiration from some of the other radio drivers, and now have a fully featured driver that is very stable and I have a small network of nodes running nicely now. Nodes are AVR and the gateway is ESP32.
Power consumption is very similar to the RF24 radios (~20mA on full power xmit and a couple of uA in sleep). It also includes adaptive power control to automatically set TX power to just the necessary level.
My fork with cc1101 branch are in my repo, I have also added some documentation (some AI assistance here as I got lazy) . I've gotten the code pretty clean but probably still has a little development cruft left in it.
Would there be any interest in merging into the core?
Happy to take feedback, PRs, etc.
-
Nice. I know there are RFM69's, but I've seen quite a few requests for the CC1101. Always good to have options.
I did something similar with the WIO-E5 chips in my repo. The E5 is not quite ready for prime time, but the basics are working.
I have many MySensors nodes, and still adding more. Good to see some new code for it. -
I wanted 433MHz support to improve performance in an environment challenging to 2.4GHz, so I bought a bunch of cheap CC1101 radio modules and set about writing a HAL driver for this chipset. I probably should have bought some RFM69 modules, but I wanted the challenge of supporting another popular radio.
I took inspiration from some of the other radio drivers, and now have a fully featured driver that is very stable and I have a small network of nodes running nicely now. Nodes are AVR and the gateway is ESP32.
Power consumption is very similar to the RF24 radios (~20mA on full power xmit and a couple of uA in sleep). It also includes adaptive power control to automatically set TX power to just the necessary level.
My fork with cc1101 branch are in my repo, I have also added some documentation (some AI assistance here as I got lazy) . I've gotten the code pretty clean but probably still has a little development cruft left in it.
Would there be any interest in merging into the core?
Happy to take feedback, PRs, etc.
@buxtronix thanks for the effort! Why not make a PR? 433MHz is a quite unique value proposition of MySensors. I'd recommend a quick search through the open issues on MySensors github, maybe some CC1101 support was requested already. In any way, I'd encourage to raise a PR to the development branch. Who knows, if we get some people engaged, maybe we can release a new official version of MySensors with improved hardware support.
Thx, Dirk. -
I finally got around to creating a PR into the official repo, as it's been running reliably for some time so I believe it's ready.
-
So almost time to create a 3rd gateway? :) I'm switching over to RFM69 for now, due to it's high range. Although it's significantly slower than NRF. So Curious about the performance of CC1101 any stats on power consumption?
-
The CL got accepted and merged, so now MySensors officially supports CC1101!
Yes CC1101 is slower than NRF (the bitrate tops out at 250k, NRF starts at 250k), so I imagine this would increase
power consumption a little simply due to the longer airtime. However idle power consumption is comparable.Penetration is certainly better, I have been running an NRF network for nearly a decade, but wanted to add a 433MHz network due to wall penetration issues, hence this feature.
-
Thank you Buxtronix
-
I finally got around to measuring power consumption, with some good results. I made two nodes that were identical except one with a CC1101 and the other on an RF24 network. The nodes had a single SHT31 temp/humidity sensor and woke up every 10s to transmit a single temperature value.
I measured power consumption with an oscilloscope across a 10 ohm shunt on the battery line, so current is v/10. For both nodes, sleep current was near identical, around 4.5uA.
Values for TX over a 60mS window:
- On the CC1101 without MY_PASSIVE_NODE, average current draw during TX was 9.7mA.
- When I enabled MY_PASSIVE_NODE, this dropped considerably down to 3.3mA.
- For RF24 both with and without MY_PASSIVE_NODE, current was 2.2mA.
When averaging for a node transmitting once per minute, this would provide a long lifetime on both radios. With a 180mAh CR2032, I'd calculate a lifetime of:
- 1150 days on a RF24
- 540 days for CC1101 without MY_PASSIVE_NODE
- 975 days for CC1101 with MY_PASSIVE_NODE
The use of MY_PASSIVE_NODE helps on CC1101, as the node does a 'fire-and-forget' on TX. Without this, it listens for an ack from the gateway, drawing RX current. For RF24, the ack is handled in hardware which is considerably quicker.
Some graphs! The ~12mS hump before TX is the SHT31 acquisition.
RF24 transmit (not sure what the initial 4ms bump is, radio coming out of sleep maybe?):

CC1101 active mode (blue curve is CC1101 CLK line):

CC1101 passive node:

So yeah, interesting results, in summary the CC1101 is a bit more power hungry than the RF24, but results in only around 10% drop in battery life if used in passive mode (or 50% in active mode).
-
nice! I'm happy that there is another radio to use