Step-by-step procedure to connect the NRF24L01+ to the GPIO pins and use the Raspberry as a Serial Gateway (MySensors 1.x)
-
Does anyone know what this error is about?
RPi2, NRF24l01, OSMC (Debian jessie), Domoticz v3.5051.osmc@osmc:~/Raspberry$ sudo make install Installing PiGatewaySerial to /usr/local/sbin Installing PiGateway to /usr/local/sbin Installing initscripts to /etc/init.d Installing syslog config to /etc/rsyslog.d Failed to restart rsyslog.service: Unit rsyslog.service failed to load: No such file or directory. Makefile:79: recipe for target 'install-initscripts' failed make: *** [install-initscripts] Error 6I can run the gateway even with the error, i can also add it to Domoticz and send/receive data.
But after a few minutes i get a massive error in domoticz saying "(24) Too many files open" on every logentry and my domoticz loose connection to the Logitech mediaserver, remote Kodi hardware, mqtt server etc.osmc@osmc:~/Raspberry$ sudo ./PiGatewaySerial Starting PiGatewaySerial... Protocol version - 1.4 Created PTY '/dev/pts/2' Gateway tty: /dev/ttyMySensorsGateway ================ SPI Configuration ================ CSN Pin = CE0 (PI Hardware Driven) CE Pin = Custom GPIO25 Clock Speed = 8 Mhz ================ NRF Configuration ================ STATUS = 0x0e RX_DR=0 TX_DS=0 MAX_RT=0 RX_P_NO=7 TX_FULL=0 RX_ADDR_P0-1 = 0xa8a8e1fc00 0xa8a8e1fc00 RX_ADDR_P2-5 = 0xff 0xc4 0xc5 0xc6 TX_ADDR = 0xa8a8e1fc02 RX_PW_P0-6 = 0x20 0x20 0x20 0x00 0x00 0x00 EN_AA = 0x3b EN_RXADDR = 0x06 RF_CH = 0x4c RF_SETUP = 0x23 CONFIG = 0x0e DYNPD/FEATURE = 0x3f 0x06 Data Rate = 250KBPS Model = nRF24L01+ CRC Length = 16 bits PA Power = PA_LOW -
Hi, is signing supported using this library? thanks.
-
Hi, is signing supported using this library? thanks.
-
I'm looking for some help in getting "PiGatewaySerial" running properly. I am having no issue running "PiGateway" and receiving all data from a counter node I'm using for testing. When I try to run "PiGatewaySerial", only intermittent data appears. For this example, I have my counter sending increasing integers at 1 second intervals, and receives fewer than 1 in 25 through the "PiGatewaySerial" script. I previously had this working reliably on a RPi2, reading in the tty output and logging it to a file. Now, I cannot repeat that on either that device, nor the current RPi B+ I'm working with. I'm sure there's some basic setting that I'm missing, but I can't seem to figure it out. Thanks!
An example of "PiGateway" correctly receiving all messages:
pi@raspberrypi:/dev/pts $ sudo /usr/local/sbin/PiGateway Starting Gateway... ================ SPI Configuration ================ CSN Pin = CE0 (PI Hardware Driven) CE Pin = Custom GPIO25 Clock Speed = 8 Mhz ================ NRF Configuration ================ STATUS = 0x0e RX_DR=0 TX_DS=0 MAX_RT=0 RX_P_NO=7 TX_FULL=0 RX_ADDR_P0-1 = 0xa8a8e1fc00 0xa8a8e1fc00 RX_ADDR_P2-5 = 0xff 0xc4 0xc5 0xc6 TX_ADDR = 0xe7e7e7e7e7 RX_PW_P0-6 = 0x20 0x20 0x20 0x00 0x00 0x00 EN_AA = 0x3b EN_RXADDR = 0x06 RF_CH = 0x4c RF_SETUP = 0x23 CONFIG = 0x0e DYNPD/FEATURE = 0x3f 0x06 Data Rate = 250KBPS Model = nRF24L01+ CRC Length = 16 bits PA Power = PA_LOW [CALLBACK]0;0;3;0;14;Gateway startup complete. read: 0-0-0 s=33,c=1,t=38,pt=2,l=2:906 [CALLBACK]0;33;1;0;38;906 read: 0-0-0 s=33,c=1,t=38,pt=2,l=2:907 [CALLBACK]0;33;1;0;38;907 read: 0-0-0 s=33,c=1,t=38,pt=2,l=2:908 [CALLBACK]0;33;1;0;38;908 read: 0-0-0 s=33,c=1,t=38,pt=2,l=2:909 [CALLBACK]0;33;1;0;38;909 read: 0-0-0 s=33,c=1,t=38,pt=2,l=2:910 [CALLBACK]0;33;1;0;38;910 read: 0-0-0 s=33,c=1,t=38,pt=2,l=2:911 [CALLBACK]0;33;1;0;38;911 read: 0-0-0 s=33,c=1,t=38,pt=2,l=2:912 [CALLBACK]0;33;1;0;38;912 read: 0-0-0 s=33,c=1,t=38,pt=2,l=2:913 [CALLBACK]0;33;1;0;38;913an example of "PiGatewaySerial" missing most messages:
pi@raspberrypi:/dev/pts $ sudo /usr/local/sbin/PiGatewaySerial Starting PiGatewaySerial... Protocol version - 1.4 Created PTY '/dev/pts/1' Gateway tty: /dev/ttyMySensorsGateway ================ SPI Configuration ================ CSN Pin = CE0 (PI Hardware Driven) CE Pin = Custom GPIO25 Clock Speed = 8 Mhz ================ NRF Configuration ================ STATUS = 0x0e RX_DR=0 TX_DS=0 MAX_RT=0 RX_P_NO=7 TX_FULL=0 RX_ADDR_P0-1 = 0xa8a8e1fc00 0xa8a8e1fc00 RX_ADDR_P2-5 = 0xff 0xc4 0xc5 0xc6 TX_ADDR = 0xe7e7e7e7e7 RX_PW_P0-6 = 0x20 0x20 0x20 0x00 0x00 0x00 EN_AA = 0x3b EN_RXADDR = 0x06 RF_CH = 0x4c RF_SETUP = 0x23 CONFIG = 0x0e DYNPD/FEATURE = 0x3f 0x06 Data Rate = 250KBPS Model = nRF24L01+ CRC Length = 16 bits PA Power = PA_LOW read: 0-0-0 s=33,c=1,t=38,pt=2,l=2:301 read: 0-0-0 s=33,c=1,t=38,pt=2,l=2:302 read: 0-0-0 s=33,c=1,t=38,pt=2,l=2:303 read: 0-0-0 s=33,c=1,t=38,pt=2,l=2:328 read: 0-0-0 s=33,c=1,t=38,pt=2,l=2:353 read: 0-0-0 s=33,c=1,t=38,pt=2,l=2:378 read: 0-0-0 s=33,c=1,t=38,pt=2,l=2:403 read: 0-0-0 s=33,c=1,t=38,pt=2,l=2:428 read: 0-0-0 s=33,c=1,t=38,pt=2,l=2:454 read: 0-0-0 s=33,c=1,t=38,pt=2,l=2:479 read: 0-0-0 s=33,c=1,t=38,pt=2,l=2:504I'm running a RPi B+, NRF24l01+, on a clean install of Jessie, and using only a few percent of the CPU power.
-
I have been thinking about giving this a try But:-
The Raspberry port is using protocol version 1.4.
Do the sensors also have to use version 1.4?@rmtucker
No, the sensors can be running 1.5 or 2.0-beta, the PI will run a 1.4 version.
The only thing not supported by the PiGateway is message signing.
But I have a mix of sensors in 1.5, 1.6-beta and 2.0-beta in my home network, so it certainly works. -
@rmtucker
No, the sensors can be running 1.5 or 2.0-beta, the PI will run a 1.4 version.
The only thing not supported by the PiGateway is message signing.
But I have a mix of sensors in 1.5, 1.6-beta and 2.0-beta in my home network, so it certainly works.Is it best to start with a blank jessie image and manually install/compile domoticz or just use the domoticz sd image?
The latter would be the easiest for me because i am useless with the CLI but if the first method is best?? -
Adding support for signing on a pi gw should just be a matter of implementing random number generation and use software signing. With slight modification in the software signing backend as it assumes Arduino api:s for obtaining a seed for the rng.
-
Is it best to start with a blank jessie image and manually install/compile domoticz or just use the domoticz sd image?
The latter would be the easiest for me because i am useless with the CLI but if the first method is best??@rmtucker if you want to be able to run the very latest version of Domoticz, use the Debian image and compile Domoticz from git.
I use the Domoticz image. The downside is that I need to wait for new "official" Domoticz builds before upgrading, but the upside is that getting up and running was very easy.
-
@rmtucker if you want to be able to run the very latest version of Domoticz, use the Debian image and compile Domoticz from git.
I use the Domoticz image. The downside is that I need to wait for new "official" Domoticz builds before upgrading, but the upside is that getting up and running was very easy.
@mfalkvidd
Actually ... I started with an official Domoticz build, and then I indicated in the settings that I wanted to update with the beta version. Since then I'm always on the latest beta (v5143 at the moment). -
@mfalkvidd
Actually ... I started with an official Domoticz build, and then I indicated in the settings that I wanted to update with the beta version. Since then I'm always on the latest beta (v5143 at the moment). -
@GertSanders cool. How often is the beta updated? Every build?
@mfalkvidd
Well, that seems to be the case. Sometimes I see daily updates, sometimes a week passes by without any changes. I selected the BETA channel for updates and since then I have seen new functionality come in on a regular basis. Not all of it is relevant to Mysensors of course, but none the less it's fun to see Domoticz is developed actively. -
@mfalkvidd
Well, that seems to be the case. Sometimes I see daily updates, sometimes a week passes by without any changes. I selected the BETA channel for updates and since then I have seen new functionality come in on a regular basis. Not all of it is relevant to Mysensors of course, but none the less it's fun to see Domoticz is developed actively.@GertSanders I have seen no issues in Domoticz stable with CPU usage. Thing just purrs along. Will have to check when I get home but i believe my system uptime is approaching 1 year. It "just works" as they say.
I would like to upgrade to mysensors 2.0 library by it looks like the Pi repo has not being updated as often (last I checked, anyway).
-
@GertSanders I have seen no issues in Domoticz stable with CPU usage. Thing just purrs along. Will have to check when I get home but i believe my system uptime is approaching 1 year. It "just works" as they say.
I would like to upgrade to mysensors 2.0 library by it looks like the Pi repo has not being updated as often (last I checked, anyway).
@wergeld
Correct, the PI repo is basically unchanged. But it still is compatible with the 2.0-beta Mysensors library. -
@wergeld
Correct, the PI repo is basically unchanged. But it still is compatible with the 2.0-beta Mysensors library.@GertSanders What? I was under the impression that some features (like sending messages to nodes from domitcz wouldn't work).
-
@GertSanders What? I was under the impression that some features (like sending messages to nodes from domitcz wouldn't work).
@wergeld
Did not notice that, I can send values and "switch on" messages to nodes. The only thing I miss is the signing via ATSHA204. Even V_TEXT sending to and from nodes works. -
I have some trouble with the gateway not storing the network map, if i restart the gateway my non-sensor nodes need to send some kind of heartbeat to reconnect to the gateway.
Is this a known problem or is it something wrong with my setup?
-
Yes, known problem.
I had some hopes on @marceloaqno and @aaron832 providing a PR into development branch (so we can scrap the old RPI code). But there hasn't been any activity in a while.
https://forum.mysensors.org/topic/2759/mysensors-raspberry-port-suggestions/12
