NRF5 as a secure radio for nano?
I have some pretty big Arduino Nano setups. For example, a plant sensor that checks on and then waters 6 plants. It's based on the very handy Nano expansion boards, which I use as a base.
That Nano does not have enough memory left for encryption and signing.
One way to fix this is to upgrade the entire nodes to use the NRF5. But I was wondering: wouldn't it be possible to just use cheap NRF51 devices as plug-in upgraded NRF24 radios?
Perhaps MySensors just sends what needs to be sent to the NRF5 via a simple serial connection. It then takes care of having a secure connection.
@alowhum MySensors writes to the radio registers over spi. And signing is done on the device where MySensors runs, so the code would still need to be running on the Nano if the nrf5 is used as a radio only.
But you could use the Nano as a "slave" to the nrf5, if you want to reuse your existing boards. The nrf5 would then treat the Nano as a spi/i2c/serial "sensor". Not sure if that makes things easier.
I don't know if it does. I have no problem with making the NRF5 the 'main' chip on the network, and getting the data from the nano into the NRF5. That's exactly what I'd like to do.
The question is: how? Would there be an easy upgrade path? Or could it be interesting to explore that? Could some code be written as part of the MySensors library that would facilitate this?
Just thinking out loud.
@alowhum I don't think it makes much sense to write MySensors library code for using a Nano as slave, for the same reason it doesn't make sense to write MySensors library code to read data from a DHT or ds18b20 sensor.
MySensors' purpose is to shuffle data between nodes, not to get data from peripherals.
@alowhum, whatever you do, you will have to make an adapter for the NRF5 module, so for me if you don't want to spend months writing complex code that might never work properly you have the following choices :
- you have specific sensors that can't run on nrf5 (don't think it exist beyond a simple voltage translation problem), then you use nrf5 as master on an adapter board that you plug in the nrf24 connector, and reprogram your nano as an spi slave that will manage the sensors
- you remove the nano, and replace it with a pin-compatible adapter for an nrf5
That sounds about right.
What do you think is the way to go?
- Does the Arduino slave functionality already exist? Is that a common use case?
- Is an open hardware Nano-compatible board likely to emerge? Is there precedent for that? In order to true adoption it would have to be something that Chinese manufacturers would want to mass produce as some point. I suspect they would sooner want to create a prototype board for the NRF5 directly, similar to the Arduino Strong boards.
@alowhum search Arduino spi slave, it seems to exist. I say that because it's connected on spi pins, but you could decide to use software serial also it's probably way more simple
For the nrf5 pro mini I don't think it will happen, you would need an simple adapter for a cheap nrf5 module to keep cost low. Like a 3$ Ebyte E73 + 1$PCB + 1-2$ other components.
I used a Pro Mini as slave over SoftwareSerial for a project. Maybe you could use that for inspiration and reuse some code. https://forum.mysensors.org/topic/3438/physical-mood-light-color-and-brightness-selector-based-on-lcd-touchscreen-with-demo-video/