๐ฌ Building a Raspberry Pi Gateway
-
When talking about this Raspberry Pi Gateway, I suppose, that its just connecting the NFR24L01+ to the Raspberry Pi GPIO and run
./bin/mysgw -dright? On my Pi it does not work this way, maybe the NFR24L01+ is not ok. Instead I am running an external esp-wifi-gateway, but a direct gateway seems the better solution to me.
So did I get it right, that I can use a NFR24L01+ connected to the Raspberry PI GPIO without any external gateway? If so, what are the parameters for building the mysgw daemon? I tried this one:./configure --spi-driver=SPIDEV --spi-spidev-device=/dev/spidev0.0update: as in https://www.mysensors.org/view/180#wiring
22 โ CE
24 โ CSN/CS
23 โ SCK
19 โ MOSI
21 โ MISOSPI is activated:
$ls /dev/spidev* /dev/spidev0.0 /dev/spidev0.1And this is the result, when building it with the settings mentioned above. (Raspberry Pi 3, jessie 4.9.13-v7+)
$ sudo ./bin/mysgw -d mysgw: Starting gateway... mysgw: Protocol version - 2.1.1 mysgw: MCO:BGN:INIT GW,CP=RNNG---,VER=2.1.1 mysgw: TSM:INIT mysgw: TSF:WUR:MS=0 mysgw: !TSM:INIT:TSP FAIL mysgw: TSM:FAIL:CNT=1 mysgw: TSM:FAIL:PDT mysgw: TSM:FAIL:RE-INIT mysgw: TSM:INIT mysgw: !TSM:INIT:TSP FAIL mysgw: TSM:FAIL:CNT=2 mysgw: TSM:FAIL:PDT mysgw: TSM:FAIL:RE-INIT mysgw: TSM:INIT mysgw: !TSM:INIT:TSP FAIL mysgw: TSM:FAIL:CNT=3 mysgw: TSM:FAIL:PDT mysgw: TSM:FAIL:RE-INIT mysgw: TSM:INIT mysgw: !TSM:INIT:TSP FAIL mysgw: TSM:FAIL:CNT=4 mysgw: TSM:FAIL:PDTAnd can someone show how to bind this gateway into FHEM? As said, today I am running an esp-wifi-gateay.
Thanks in advance for any support...
@dirkc Try to connect your module to the SPI0 (https://www.mysensors.org/view/180#wiring).
You only need to enable the SPIDEV if you want to use the SPI1. -
When talking about this Raspberry Pi Gateway, I suppose, that its just connecting the NFR24L01+ to the Raspberry Pi GPIO and run
./bin/mysgw -dright? On my Pi it does not work this way, maybe the NFR24L01+ is not ok. Instead I am running an external esp-wifi-gateway, but a direct gateway seems the better solution to me.
So did I get it right, that I can use a NFR24L01+ connected to the Raspberry PI GPIO without any external gateway? If so, what are the parameters for building the mysgw daemon? I tried this one:./configure --spi-driver=SPIDEV --spi-spidev-device=/dev/spidev0.0update: as in https://www.mysensors.org/view/180#wiring
22 โ CE
24 โ CSN/CS
23 โ SCK
19 โ MOSI
21 โ MISOSPI is activated:
$ls /dev/spidev* /dev/spidev0.0 /dev/spidev0.1And this is the result, when building it with the settings mentioned above. (Raspberry Pi 3, jessie 4.9.13-v7+)
$ sudo ./bin/mysgw -d mysgw: Starting gateway... mysgw: Protocol version - 2.1.1 mysgw: MCO:BGN:INIT GW,CP=RNNG---,VER=2.1.1 mysgw: TSM:INIT mysgw: TSF:WUR:MS=0 mysgw: !TSM:INIT:TSP FAIL mysgw: TSM:FAIL:CNT=1 mysgw: TSM:FAIL:PDT mysgw: TSM:FAIL:RE-INIT mysgw: TSM:INIT mysgw: !TSM:INIT:TSP FAIL mysgw: TSM:FAIL:CNT=2 mysgw: TSM:FAIL:PDT mysgw: TSM:FAIL:RE-INIT mysgw: TSM:INIT mysgw: !TSM:INIT:TSP FAIL mysgw: TSM:FAIL:CNT=3 mysgw: TSM:FAIL:PDT mysgw: TSM:FAIL:RE-INIT mysgw: TSM:INIT mysgw: !TSM:INIT:TSP FAIL mysgw: TSM:FAIL:CNT=4 mysgw: TSM:FAIL:PDTAnd can someone show how to bind this gateway into FHEM? As said, today I am running an esp-wifi-gateay.
Thanks in advance for any support...
@dirkc I don't know where you got those pin numbers but they don't look like the ones on the guide. In addition you don't have to use spi driver. The PA version of nrf24 are quite a pain to get them working, so I suggest you first test with regular modules and then upgrade to PA
-
@gohan, @marceloaqno : sorry, I corrected the "typo", the NRF was already connected as shown in https://www.mysensors.org/view/180#wiring. I double checked that again.
What is the correct setup for ./configure ? -
@romeo01 You have to connect the nrf24 to the GPIO if you want to use it with the RPi, the information on the wiki was wrong, sorry about that.
-
@gohan, @marceloaqno : sorry, I corrected the "typo", the NRF was already connected as shown in https://www.mysensors.org/view/180#wiring. I double checked that again.
What is the correct setup for ./configure ?@dirkc The default settings for ./configure is to use the nrf24 module connected in the same way as shown in the guide and as an ethernet gateway.
-
@dirkc The default settings for ./configure is to use the nrf24 module connected in the same way as shown in the guide and as an ethernet gateway.
@marceloaqno ok, thanks, I will change the radio.
-
Support for RFM69 was added to the development branch (finally!).
-
Support for RFM69 was added to the development branch (finally!).
Iยดm really happy ear that !
RFM69 is one of best RF transceivers in these days for IoT.
So good news I believe for Mysensors community.You know if are any hope that RFM69 will be added too to OPI boards support mysgw development ?
Congratulations for that great work !
-
Iยดm really happy ear that !
RFM69 is one of best RF transceivers in these days for IoT.
So good news I believe for Mysensors community.You know if are any hope that RFM69 will be added too to OPI boards support mysgw development ?
Congratulations for that great work !
@jirm Support for RFM69 also applies to the OrangePi :wink:
-
@jirm Support for RFM69 also applies to the OrangePi :wink:
-
When I configure "MY_RFM69_MAX_POWER_LEVEL_DBM" in MyConfig.h, compiling fails.
Perhaps you should change the code in ./drivers/RFM69/new/RFM69_new.h from:#define RFM69_MAX_POWER_LEVEL_DBM MY_RFM69_MAX_POWER_LEVEL_DBM //!< MY_RFM69_MAX_POWER_LEVEL_DBM
to:
#define RFM69_MAX_POWER_LEVEL_DBM ((rfm69_powerlevel_t)MY_RFM69_MAX_POWER_LEVEL_DBM) //!< MY_RFM69_MAX_POWER_LEVEL_DBM
-
I cannot get the RFM69(HW) working. When I start myswg in debug mode (-d), I see:
mysgw: Starting gateway... mysgw: Protocol version - 2.2.0-beta mysgw: MCO:BGN:INIT GW,CP=RPNG----,VER=2.2.0-beta mysgw: TSF:LRT:OK mysgw: TSM:INIT mysgw: TSF:WUR:MS=0 mysgw: RFM69:INIT mysgw: RFM69:INIT:PIN,CS=24,IQP=22,IQN=22 mysgw: RFM69:PTX:LEVEL=5 dBm mysgw: TSM:INIT:TSP OK mysgw: TSM:INIT:GW MODE mysgw: TSM:READY:ID=0,PAR=0,DIS=0 mysgw: MCO:REG:NOT NEEDED mysgw: Listening for connections on 0.0.0.0:5003 mysgw: MCO:BGN:STP mysgw: MCO:BGN:INIT OK,TSP=1But I can see ('hear' with a radio on 868.000 MHz) no transmission of the RFM69. When I power up a node, the node does not connect to the gateway: "NO REPLY":+1:
0 MCO:BGN:INIT NODE,CP=RRNNA--,VER=2.1.1 4 TSM:INIT 4 TSF:WUR:MS=0 8 TSM:INIT:TSP OK 10 TSM:INIT:STATID=4 12 TSF:SID:OK,ID=4 14 TSM:FPAR 274 TSF:MSG:SEND,4-4-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK: 2281 !TSM:FPAR:NO REPLY 2283 TSM:FPAR 2562 TSF:MSG:SEND,4-4-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK: 4569 !TSM:FPAR:NO REPLY 4571 TSM:FPAR 4831 TSF:MSG:SEND,4-4-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK: 6838 !TSM:FPAR:NO REPLY 6840 TSM:FPAR 7100 TSF:MSG:SEND,4-4-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK: 9107 !TSM:FPAR:FAIL 9109 TSM:FAIL:CNT=1 9111 TSM:FAIL:PDTIs there any 'check' I can do to perform basic RFM69HW testing on my RPI?
-
I'm pretty sure I wired up the RFM69 correctly.
However, I'm debugging. It seems we are stuck in "core/MyGatewayTransport.cpp":inline void gatewayTransportProcess(void) { if (gatewayTransportAvailable()) { // NEVER REACHEDI never seem to get pass gatewayTransportAvailable. I will continue debugging.
Disclaimer: I'm relatively new to MySensors and not really 'up to speed' with the source code :-). -
I'm pretty sure I wired up the RFM69 correctly.
However, I'm debugging. It seems we are stuck in "core/MyGatewayTransport.cpp":inline void gatewayTransportProcess(void) { if (gatewayTransportAvailable()) { // NEVER REACHEDI never seem to get pass gatewayTransportAvailable. I will continue debugging.
Disclaimer: I'm relatively new to MySensors and not really 'up to speed' with the source code :-). -
Download myscontroller and connect it to the gateway, you can now see all messages from ethernet controller
@gohan said in ๐ฌ Building a Raspberry Pi Gateway:
myscontroller
I just did. When I also have a Domoticz controller connected to the gateway:
2017-04-23 11:18:33 INFO Connected to 192.168.10.24:5003 2017-04-23 11:18:33 CHILD New child discovered, node id=0, child id=internal 2017-04-23 11:18:33 RX 0;255;3;0;14;Gateway startup complete. 2017-04-23 11:18:33 DEBUG Update child id=255, type=ARDUINO_RELAY 2017-04-23 11:18:33 RX 0;255;0;0;18;2.2.0-beta 2017-04-23 11:18:33 RX 0;255;3;0;22;208103 2017-04-23 11:18:33 RX 0;255;3;0;2;2.2.0-beta 2017-04-23 11:18:43 RX 0;255;3;0;22;218106 2017-04-23 11:18:53 RX 0;255;3;0;22;228110 2017-04-23 11:19:03 RX 0;255;3;0;22;238101 2017-04-23 11:19:13 RX 0;255;3;0;22;248104 2017-04-23 11:19:23 RX 0;255;3;0;22;258110 2017-04-23 11:19:33 RX 0;255;3;0;22;268107 2017-04-23 11:19:43 RX 0;255;3;0;22;278106 2017-04-23 11:19:53 RX 0;255;3;0;22;288110 2017-04-23 11:20:03 RX 0;255;3;0;22;298116However, I found out that the DI00 (=IRQ) on the RFM69 never gives a rising edge...
I'm suspecting that the RFM69 is not being initialised properly... I added some debugging in the RFM69 code to see what registers are being written and read:mysgw: Starting gateway... mysgw: Protocol version - 2.2.0-beta mysgw: MCO:BGN:INIT GW,CP=RPNG----,VER=2.2.0-beta mysgw: TSF:LRT:OK mysgw: TSM:INIT mysgw: TSF:WUR:MS=0 mysgw: RFM69:INIT mysgw: RFM69:INIT:PIN,CS=24,IQP=22,IQN=22 mysgw: FtW:RFM69:write register, reg=0x01, value=4 mysgw: FtW:RFM69:write register, reg=0x02, value=0 mysgw: FtW:RFM69:write register, reg=0x03, value=2 mysgw: FtW:RFM69:write register, reg=0x04, value=64 mysgw: FtW:RFM69:write register, reg=0x05, value=3 mysgw: FtW:RFM69:write register, reg=0x06, value=51 mysgw: FtW:RFM69:write register, reg=0x18, value=136 mysgw: FtW:RFM69:write register, reg=0x19, value=66 mysgw: FtW:RFM69:write register, reg=0x26, value=7 mysgw: FtW:RFM69:write register, reg=0x28, value=16 mysgw: FtW:RFM69:write register, reg=0x29, value=220 mysgw: FtW:RFM69:write register, reg=0x2c, value=0 mysgw: FtW:RFM69:write register, reg=0x2d, value=3 mysgw: FtW:RFM69:write register, reg=0x2e, value=136 mysgw: FtW:RFM69:write register, reg=0x2f, value=45 mysgw: FtW:RFM69:write register, reg=0x30, value=101 mysgw: FtW:RFM69:write register, reg=0x37, value=212 mysgw: FtW:RFM69:write register, reg=0x38, value=66 mysgw: FtW:RFM69:write register, reg=0x39, value=255 mysgw: FtW:RFM69:write register, reg=0x3a, value=255 mysgw: FtW:RFM69:write register, reg=0x3c, value=5 mysgw: FtW:RFM69:write register, reg=0x3d, value=16 mysgw: FtW:RFM69:write register, reg=0x6f, value=48 mysgw: FtW:RFM69:write register, reg=0x07, value=217 mysgw: FtW:RFM69:write register, reg=0x08, value=0 mysgw: FtW:RFM69:write register, reg=0x09, value=0 mysgw: FtW:RFM69:write register, reg=0x01, value=4 mysgw: FtW:RFM69:read register, reg=0x27, value=128 mysgw: FtW:RFM69:read register, reg=0x3d, value=16 mysgw: FtW:RFM69:write register, reg=0x3d, value=16 mysgw: FtW:RFM69:write register, reg=0x11, value=87 mysgw: RFM69:PTX:LEVEL=5 dBm mysgw: FtW:RFM69:read register, reg=0x02, value=0 mysgw: FtW:RFM69:read register, reg=0x03, value=2 mysgw: FtW:RFM69:read register, reg=0x04, value=64 mysgw: FtW:RFM69:read register, reg=0x05, value=3 mysgw: FtW:RFM69:read register, reg=0x06, value=51 mysgw: FtW:RFM69:read register, reg=0x30, value=101 mysgw: FTW attachInterrupt: gpioPin=25 mode=3 mysgw: TSM:INIT:TSP OK mysgw: TSM:INIT:GW MODE mysgw: FtW:RFM69:write register, reg=0x39, value=0 mysgw: TSM:READY:ID=0,PAR=0,DIS=0 mysgw: MCO:REG:NOT NEEDED mysgw: FtW:RFM69:write register, reg=0x25, value=64 mysgw: FtW:RFM69:write register, reg=0x13, value=26 mysgw: FtW:RFM69:write register, reg=0x5a, value=85 mysgw: FtW:RFM69:write register, reg=0x5c, value=112 mysgw: FtW:RFM69:read register, reg=0x3d, value=16 mysgw: FtW:RFM69:write register, reg=0x3d, value=20 mysgw: FtW:RFM69:write register, reg=0x01, value=16 mysgw: Listening for connections on 0.0.0.0:5003 mysgw: MCO:BGN:STP mysgw: MCO:BGN:INIT OK,TSP=1 mysgw: New connection from 127.0.0.1 mysgw: Client 0 connected mysgw: Client 0: 0;0;3;0;2; mysgw: gatewayTransportAvailable mysgw: Client 0: 0;0;3;0;2;Get Version mysgw: gatewayTransportAvailable mysgw: Client 0: 0;0;3;0;18;PING mysgw: gatewayTransportAvailable mysgw: Client 0: 0;0;3;0;18;PING mysgw: gatewayTransportAvailable mysgw: Client 0: 0;0;3;0;18;PING -
Can't get the RFM69HW to work on RPI. I tried the following:
- I installed on an old RPI1 (clean Rasbian install). Same results as on my Domoticz RPI-3.
- Setup the original RPI3 as a node, using the 2.2.0-beta code. I verified that in this case the RFM69HW actually transmits (I can hear it burst on 868.000 MHz). However, it is unable to connect to an existing Arduino 2.1.1 gateway.
- I built an Arduino 2.2.0-beta serial gateway. Even then, the RPI as a node fails to connect to the 2.2.0-beta serial gateway.
- I built an Arduino 2.2.0-beta node. This node is able to connect to the above gateway.
There seems to be something different in the radio network between the RFM69HW on the RPI and the RFM69HW on the Arduino. But I'm unable to find out what the difference is :-(.
The RPI RFM69HW will not communicate with the Arduino RFM69HW. When the RPI is a gateway, the RFM69HW will not physically interrupt when another node is trying to connect. When the RPI is a node, the RFM69HW on the ARduino does not interrupt either.
Did anyone get the RFM69HW working on the RPI? I'd really like to get this beautiful piece of code working!