Step-by-step procedure to connect the NRF24L01+ to the GPIO pins and use the Raspberry as a Serial Gateway (MySensors 1.x)
-
@minscof got an answer in this thread: http://forum.mysensors.org/topic/2367/pigatewayserial-using-interrupts/3
The high cpu usage will go away as soon as you start your controller (or something else that reads from the tty the gateway creates). -
@Eawo If you look at the excellent original post from @mfalkvidd above:
The 3.3V power on the Raspberry Pi is rated for a maximum of 50mA. A regular NRF24L01+ only needs 15mA, but if you are using a power amplified version you might exceed what the Raspberry Pi can output. In that case, an external power supply might be required.
I don't believe that you will need to make any changes to code.
-
My friend also started with mysensors and i gave him my old raspberry with the 26 pin gpio. Can he also use this guide? Also if it possible how do u wire it? Im just a beginner so i ask stupid questions. maybe serial gateway is the way to go but we are waiting for arduino's
-
@Eawo Yes, it should work. I ran Domoticz and MySensors Gateway on my Raspberry Pi 1 when I first tried MySensors. If I remember correctly I had to connect CE to pin 15 instead of 22 but I am not sure why. Try using the same connections as on your Raspberry Pi 2 first, and switch CE pin if you get "check wires". Please report back here how it goes, so I can add the necessary information to the original post.
-
I get stuff like
read: 2-2-0 s=255,c=0,t=17,pt=0,l=3:1.5 send: 2-194-1-0 s=255,c=0,t=17,pt=0,l=3,st=fail:1.5 read: 2-2-0 s=255,c=3,t=6,pt=1,l=1:0 send: 2-194-1-0 s=255,c=3,t=6,pt=1,l=1,st=fail:0 read: 2-2-0 s=1,c=1,t=2,pt=2,l=2:1 send: 2-194-1-0 s=1,c=1,t=2,pt=2,l=2,st=fail:1from 'PiGatewaySerial' but no results on the Serial Port. Any idea what i'm doing wrong?
-
Hi
something is missing..Is there a problem with the repository
Tks a lot for your job!pi@domoticjp ~ $ sudo git clone https://github.com/mysensors/Raspberry.git Cloning into 'Raspberry'... remote: Counting objects: 273, done. remote: Compressing objects: 100% (3/3), done. remote: Total 273 (delta 0), reused 0 (delta 0), pack-reused 270 Receiving objects: 100% (273/273), 215.00 KiB | 0 bytes/s, done. Resolving deltas: 100% (114/114), done. Checking connectivity... done. pi@domoticjp ~ $ cd Raspberry/librf24-bcm -bash: cd: Raspberry/librf24-bcm: No such file or directory -
Hi
something is missing..Is there a problem with the repository
Tks a lot for your job!pi@domoticjp ~ $ sudo git clone https://github.com/mysensors/Raspberry.git Cloning into 'Raspberry'... remote: Counting objects: 273, done. remote: Compressing objects: 100% (3/3), done. remote: Total 273 (delta 0), reused 0 (delta 0), pack-reused 270 Receiving objects: 100% (273/273), 215.00 KiB | 0 bytes/s, done. Resolving deltas: 100% (114/114), done. Checking connectivity... done. pi@domoticjp ~ $ cd Raspberry/librf24-bcm -bash: cd: Raspberry/librf24-bcm: No such file or directory@jpbabou said:
Hi
something is missing..Is there a problem with the repository
Tks a lot for your job!pi@domoticjp ~ $ sudo git clone https://github.com/mysensors/Raspberry.git Cloning into 'Raspberry'... remote: Counting objects: 273, done. remote: Compressing objects: 100% (3/3), done. remote: Total 273 (delta 0), reused 0 (delta 0), pack-reused 270 Receiving objects: 100% (273/273), 215.00 KiB | 0 bytes/s, done. Resolving deltas: 100% (114/114), done. Checking connectivity... done. pi@domoticjp ~ $ cd Raspberry/librf24-bcm -bash: cd: Raspberry/librf24-bcm: No such file or directoryPlease go ahead and install the rf24 library from https://github.com/TMRh20/RF24
The rest should be the same -
I got it working on my rb2 but i got 100% of cpu ussage.
I read a lot of post about this but i cant found a solution.
Some one know how to fix this?
@msantang said:
I got it working on my rb2 but i got 100% of cpu ussage.
I read a lot of post about this but i cant found a solution.
Some one know how to fix this?
The 100% cpu usage is probably due to the style of receiving new messages from rf24/serial port.
The current state is that the PiSerialGateway tries to poll data in a endless loop from rf24/serial.
This could maybe fixed with using the interrupt of the nrf24l01+ to signal new data and reading data from the serial in blocking mode.
I want to solve this but using interrupts on the RPi isn't that trivial. -
http://forum.mysensors.org/topic/2367/pigatewayserial-using-interrupts/2 has information on how to use interrupts. I haven't tried it myself though.
@mfalkvidd said:
http://forum.mysensors.org/topic/2367/pigatewayserial-using-interrupts/2 has information on how to use interrupts. I haven't tried it myself though.
Oh yeah, thanks for the hint @Bens got the exact same problem and seem to solved the rf24 part already. I hope he gets back online and shares his results. :)
-
-
Hi all,
I'm following this thread and have upgraded to MySensors v1.5 and get the following error. Version mismatch.It looks like the Protocol version is 1.4.
Does the Raspberry MySensors Gateway support v1.5 or only v1.4? Any ideas on how to fix?
@den2k said:
Hi all,
I'm following this thread and have upgraded to MySensors v1.5 and get the following error. Version mismatch.It looks like the Protocol version is 1.4.
Does the Raspberry MySensors Gateway support v1.5 or only v1.4? Any ideas on how to fix?
Up until now, MySensors v1.4 only for nrf24l01+ direct connection.
Did you upgrade the GW or the sensors or both ? -
You can "fake" a later version (e.g, 1.5) on the Raspberry by changing the version code in the version.h file and recompiling the Gateway software.
As far as I understand, the gateway will still pass the messages to the controller, even is there is a version mismatch message on the console.
-
@den2k said:
Hi all,
I'm following this thread and have upgraded to MySensors v1.5 and get the following error. Version mismatch.It looks like the Protocol version is 1.4.
Does the Raspberry MySensors Gateway support v1.5 or only v1.4? Any ideas on how to fix?
Up until now, MySensors v1.4 only for nrf24l01+ direct connection.
Did you upgrade the GW or the sensors or both ?