Introducing MySensors on nRF24LE1
-
First impression of MySensors running on nRF24LE1. Reporting temperature / humidity from DHT22, VCC voltage and millis() timer.
This SoC has many interesting features (SPI, 2-Wire, Serial, GPIO, ADC, RNG, AES accelerator, etc. ) and sub uA sleeping modes - without the need to solder a RF module. However, flash size limited to 16kB - still more than enough for many (peripheral) sensors...
Readings in MYSController:
Compiling with SDCC and nRF24LE1 SDK.
Source (Proof of concept/POC, non-optimized) here.
-
Wow! Great work.
-
Awesome man!
-
Great work indeed!
However, the source link (at this time) fails...
-
-
impressive work. very good idea!
-
What is the current in transmition and idle mode?
Did you realize sleep?
-
hmm 8051 instruction set.. Now that's an old mcu then.. Remember them from back in the beginning of the 90's
Thought they where long forgotten, and dead, now that there are newer (and probably more efficient) mcu cores available.
Actually, just found my final exam project I made 20 years ago based on an 80535. An EPROM burner, that could program up to 27c512 And one had to use UV lamps to erase the chips again (Getting all nostalgic here :))
-
This looks very cool. I understand the concept, and I'm more of a software guy then an electronics guy, but I have not done anything like this. Would you be able to provide a step by step or point me to something that could get me from code to getting it onto the chip. Thanks great idea.
-
@Ivan-Z said:
What is the current in transmition and idle mode?
You may find the information in the product specs.
Did you realize sleep?
No, not yet.
-
@gbfromhb said:
This looks very cool. I understand the concept, and I'm more of a software guy then an electronics guy, but I have not done anything like this. Would you be able to provide a step by step or point me to something that could get me from code to getting it onto the chip. Thanks great idea.
Since everything is pretty much POC at the moment, no time so far to compile a doc. However, uVision Keil is the official IDE supporting those MCUs (compiler, simulator, flashing, and debugging). You will also find some information (e.g. SDK, open-source programmer, etc.) by simply searching for "nRF24LE1" ...
More to follow...
-
Checking aliexpress:
At those sizes and prices, this could be a very interesting option. Looking forward to hearing about your progress.
-
Thank you tekka. I suspect you given me the clues I need.
-
@tekkaYou can follow any responses to publish libraries (MyMessage.h MyMessage.cpp, ...) adapt to the SDCC compiler?
-
@alexSV said:
@tekkaYou can follow any responses to publish libraries (MyMessage.h MyMessage.cpp, ...) adapt to the SDCC compiler?
For the example above the standard MyMessage.h library was used. All other dependencies can be found in the nRF24LE1 SDK from nordic.
-
@tekka sdсс not support __attribute ((packed)). Or do you use a different compiler?
sdcc --model-large --std-sdcc99 -Iinclude -I../SDK/_target_sdcc_nrf24le1_32/include -I../SDK/include -I./aes/include -c src/main.c -o "obj/"
include/MyMessage.h:308: syntax error: token -> '(' ; column 18
make: *** [obj/main.rel] Ошибка 1
(attribute((packed));)
and
sdcc --model-large --std-sdcc99 -Iinclude -I../SDK/_target_sdcc_nrf24le1_32/include -I../SDK/include -I./aes/include -c src/main.c -o "obj/"
src/main.c:74: syntax error: token -> 'outMsg' ; column 16
make: *** [obj/main.rel] Ошибка 1
-
@alexSV remove __attribute ((packed)) from the .h file.
-
@tekka Thanks - works
-
@tekka Nice project. This would be very useful for small, battery powered, binary sensors. What did you use to program the nRF24LE1?
-
-
I've done a lot of work on this chip. Nothing for this project though.
You can take a look here.
https://hackaday.io/project/6270-io-node@tekka I released my code under GPL3.
-
This post is deleted!
-
sdcc --model-large --std-sdcc99-Iinclude -I../nRF24LE1_SDK/_target_sdcc_nrf24le1_32/include -I../nRF24LE1_SDK/
include -L../nRF24LE1_SDK/ -c main.c
Have:
main.c:374: warning 158: overflow in implicit constant conversion
What is this error and how to fix it?
-
Thanks a lot for this, that's exactly what I was looking for.
This is very cheap, small, and low power.
I'm still waiting to receive one to try.Please note the existance of existing libraries including a wiring library which looks great:
https://hackaday.io/project/5794-nrf24le1-wiring-library
It is written by Justin who just posted above.
There is also a rf24.h there, I don't know if it is compatible with arduino's lib?It seems you have made your own digitalRead/Write?
I'm still very new to all this.
I will start to setup a dev environment (ubuntu) and try to compile your stuff.Do you plan something else?
Create a library? Is MySensor only C++? Is there a plan to create a C MySensor library?
Too bad that most MySensor examples are in C++...
Would you like to create a github repo?
-
@jobarjo thanks for taking a look. The Wiring library isn't much more than a bunch of macros for the SDK. I chose to do it that way because SDCC will keep unused code in the output it generates. So yes, there is most everything you would expect if you are coming from arduino. digitalRead etc are all there.
There is also a very alpha version of the RF24 library. It is in C of course, so a small amount of porting is needed.
Let me know if you run into any problems. I am busy with another project at the moment with the nrf51822 SoC which is actually similarly priced and much more capable, although much more cumbersome to work with at the moment.
-
@Justin-Decker said:
nrf51822
module costs 6.18 euro on ebay, 32 bit arm 16k sram, 256k flash!!
compatible with nrf24 radio and bluetooth smart.
I'm impressed!
Seems compatible with arm mbed, and there even exists arduino add-on ? (looks like commercial...)
I will look at existence of linux tools, will order one, and see if porting mysensor on this is easy...
-
@jobarjo Yes, there are implementations using mbed. If you go that route, you also get a nice BLE API to work with as well as all the standard mbed stuff. I haven't looked too closely at the Arduino board (Red Bear), but their source is on github so you can pull that and work with it without having the actual board.
https://hackaday.io/project/8512-nrf51822-development is my project for this chip. It includes a working project skeleton and instructions on setting up debugging. It uses a custom board that I made, but I suspect the one you linked to on ebay will work.
-
Quick question on the topic of using the nRF24LE1 as a platform.
Can the AES accelerator be used in order to sign messages?Thanks.
-
No, AES is used for encryption. The HMAC/SHA256 signing format MySensors use, has no benefit of AES.
-
@Anticimex : Thanks for the quick response. I have got my terms mixed there, thanks for clarifying.
-
@Diogo-Salazar You are welcome
-
@tekka Hi! I'm trying to assemble this setup
Could you provide the wiring diagram (humidity sensor and NRF).
Do you have an updated code?
-
@ykhokhlov would like to get it going as well, have a requirement for a tiny form factor, have had one of these in the drawer forever.
-
@chickey @ykhokhlov This was a POC I did a few years ago and never updated the code nor did I do further development on the library due to limited interest. There are way better alternatives available nowadays, i.e. nrf51/nrf52.
-
@tekka Thanks for the answer and suggestion. Did you develop a POC of a MySensors node for the nrf51/nrf52?
-
@ykhokhlov There are a ton of not just POCs but also fully functioning mysensors nrf51/nrf52 nodes on openhardware.io Just click and have a look for yourself.
-
@neverdie Thank you!