💬 Building a Raspberry Pi Gateway
-
@Sergio-Rius I see. Sorry. Then we know the channel parameter works. Good testing.
Strange problem. It looks from the threads I linked earlier that using the second SPI does indeed work (if the pin definition fix is applied). When the first mysgw is stopped, your second mysgw should behave just as it did for Velo17 and wergeld. Can you think of any difference in your setup?@mfalkvidd I have the impression that if I stop the first service, the second picks the first radio.
I disconnected the power from the first radio and left the second all connected and I only got TSM errors and fails. As soon as I attached power to the first NRF it worked.
Perhaps the other users only used the configurable pins (CS/CE/IRQ) on the extended bank... -
That's it. It doesn't use MOSI, MISO and SCLK from the SPI1. I removed the NRF1 and only connected those tree pins of NRF2 into SPI0 and service2 works with NRF2 at channel 125.
I've tried to share those pins (MOSI, MISO, SCLK) between both radios but as soon as I connect NRF1, 2 stops communicating. Same effect than connecting NRF2 to SPI1.
What a pity... #@%&!!! :grinning:
Edit: I finally tried a more "standard" configuration. Using only the first SPI bank and also doesn't work.
-
@Matt log files for the time where the problem occurred will be essential for troubleshooting.
make uninstall will stop the service and uninstall
make cleanconfig will remove previous ./configure settings
make clean will remove compiled code@mfalkvidd OK have attached the logfiles below.
No clues that I can see. At 1502 the NRF goes quiet. I have tried a different pi2, different NRF (PA/LNA) and am currently running the NRF off of 5V from the PI through one of those $1.00 regulator adapter things with built in caps and such. Have also tried different PSUs including a 2A one.
Only thing I can think left to try is reducing the power output in case the high output of the radio module is inducing transients in the cables...
Am kinda stumped here. I have an arduino NRF gateway that I will try via USB if low power does not work. I have tried setting up MYSGW as LAN and USB via ./configure but the same thing happens each time.
One thought just came to me, I AM using the pin15 IRQ option on the NRF now that is still experimental?
So next time will try without IRQ and low power...Any help/suggestions greatly appreciated.
FYI I have had domoticz running on a lubuntu netbook with USB arduino NRF gateway that has been rock solid. Am trying the get a workable PI solution though, for myself and my father in law but not workable as yet sadly...At 15:02:34 you can see the last incoming node message after that the only MYSGW activity is the PING thing... which seems to happen every 10S or so. This goes on for an hour after that with no more incomings. I have ~12 sensors around the place including a power meter one which reports every minute.
15:02:29 raspberrypi dhcpcd[734]: wlan0: Router Advertisement from fe80::260:64ff:fed7:f613 Aug 5 15:02:33 raspberrypi mysgw: TSF:MSG:READ,23-23-0,s=1,c=1,t=0,pt=7,l=5,sg=0:18.0 Aug 5 15:02:33 raspberrypi mysgw: TSF:MSG:READ,23-23-0,s=0,c=1,t=1,pt=7,l=5,sg=0:21.0 Aug 5 15:02:34 raspberrypi mysgw: TSF:MSG:READ,23-23-0,s=255,c=3,t=0,pt=1,l=1,sg=0:68 Aug 5 15:02:34 raspberrypi dhcpcd[734]: wlan0: Router Advertisement from fe80::260:64ff:fed7:f613 Aug 5 15:02:36 raspberrypi mysgw: Client 0: 0;0;3;0;18;PING Aug 5 15:02:37 raspberrypi mysgw: TSF:MSG:READ,41-7-0,s=0,c=1,t=0,pt=7,l=5,sg=0:11.6 Aug 5 15:02:41 raspberrypi dhcpcd[734]: wlan0: Router Advertisement from fe80::260:64ff:fed7:f613 Aug 5 15:02:46 raspberrypi mysgw: Client 0: 0;0;3;0;18;PING Aug 5 15:02:50 raspberrypi dhcpcd[734]: wlan0: Router Advertisement from fe80::260:64ff:fed7:f613 Aug 5 15:02:56 raspberrypi mysgw: Client 0: 0;0;3;0;18;PING Aug 5 15:02:57 raspberrypi dhcpcd[734]: wlan0: Router Advertisement from fe80::260:64ff:fed7:f613 Aug 5 15:03:06 raspberrypi dhcpcd[734]: wlan0: Router Advertisement from fe80::260:64ff:fed7:f613 Aug 5 15:03:06 raspberrypi mysgw: Client 0: 0;0;3;0;18;PING Aug 5 15:03:13 raspberrypi dhcpcd[734]: wlan0: Router Advertisement from fe80::260:64ff:fed7:f613 Aug 5 15:03:16 raspberrypi mysgw: Client 0: 0;0;3;0;18;PINGAlso FWIW to log from domoticz below. Ignore FANFLAG thats just a blockly flag I use...
2017-08-05 15:01:18.936 (GW) General/Voltage (FanIntakeV) 2017-08-05 15:02:04.935 (GW) General/kWh (Meter) 2017-08-05 15:02:33.940 (GW) Temp + Humidity (Mitch2) 2017-08-05 15:02:33.945 (GW) Temp + Humidity (Mitch2) 2017-08-05 15:02:37.941 (GW) Temp (MBR Fan) 2017-08-05 15:50:02.678 Set UserVariable FanFlag = 1 2017-08-05 15:51:02.693 Set UserVariable FanFlag = 1 2017-08-05 15:52:02.703 Set UserVariable FanFlag = 1 2017-08-05 15:53:02.710 Set UserVariable FanFlag = 1 2017-08-05 15:54:00.037 Set UserVariable FanFlag = 1Thanks,
Matt -
@mfalkvidd OK have attached the logfiles below.
No clues that I can see. At 1502 the NRF goes quiet. I have tried a different pi2, different NRF (PA/LNA) and am currently running the NRF off of 5V from the PI through one of those $1.00 regulator adapter things with built in caps and such. Have also tried different PSUs including a 2A one.
Only thing I can think left to try is reducing the power output in case the high output of the radio module is inducing transients in the cables...
Am kinda stumped here. I have an arduino NRF gateway that I will try via USB if low power does not work. I have tried setting up MYSGW as LAN and USB via ./configure but the same thing happens each time.
One thought just came to me, I AM using the pin15 IRQ option on the NRF now that is still experimental?
So next time will try without IRQ and low power...Any help/suggestions greatly appreciated.
FYI I have had domoticz running on a lubuntu netbook with USB arduino NRF gateway that has been rock solid. Am trying the get a workable PI solution though, for myself and my father in law but not workable as yet sadly...At 15:02:34 you can see the last incoming node message after that the only MYSGW activity is the PING thing... which seems to happen every 10S or so. This goes on for an hour after that with no more incomings. I have ~12 sensors around the place including a power meter one which reports every minute.
15:02:29 raspberrypi dhcpcd[734]: wlan0: Router Advertisement from fe80::260:64ff:fed7:f613 Aug 5 15:02:33 raspberrypi mysgw: TSF:MSG:READ,23-23-0,s=1,c=1,t=0,pt=7,l=5,sg=0:18.0 Aug 5 15:02:33 raspberrypi mysgw: TSF:MSG:READ,23-23-0,s=0,c=1,t=1,pt=7,l=5,sg=0:21.0 Aug 5 15:02:34 raspberrypi mysgw: TSF:MSG:READ,23-23-0,s=255,c=3,t=0,pt=1,l=1,sg=0:68 Aug 5 15:02:34 raspberrypi dhcpcd[734]: wlan0: Router Advertisement from fe80::260:64ff:fed7:f613 Aug 5 15:02:36 raspberrypi mysgw: Client 0: 0;0;3;0;18;PING Aug 5 15:02:37 raspberrypi mysgw: TSF:MSG:READ,41-7-0,s=0,c=1,t=0,pt=7,l=5,sg=0:11.6 Aug 5 15:02:41 raspberrypi dhcpcd[734]: wlan0: Router Advertisement from fe80::260:64ff:fed7:f613 Aug 5 15:02:46 raspberrypi mysgw: Client 0: 0;0;3;0;18;PING Aug 5 15:02:50 raspberrypi dhcpcd[734]: wlan0: Router Advertisement from fe80::260:64ff:fed7:f613 Aug 5 15:02:56 raspberrypi mysgw: Client 0: 0;0;3;0;18;PING Aug 5 15:02:57 raspberrypi dhcpcd[734]: wlan0: Router Advertisement from fe80::260:64ff:fed7:f613 Aug 5 15:03:06 raspberrypi dhcpcd[734]: wlan0: Router Advertisement from fe80::260:64ff:fed7:f613 Aug 5 15:03:06 raspberrypi mysgw: Client 0: 0;0;3;0;18;PING Aug 5 15:03:13 raspberrypi dhcpcd[734]: wlan0: Router Advertisement from fe80::260:64ff:fed7:f613 Aug 5 15:03:16 raspberrypi mysgw: Client 0: 0;0;3;0;18;PINGAlso FWIW to log from domoticz below. Ignore FANFLAG thats just a blockly flag I use...
2017-08-05 15:01:18.936 (GW) General/Voltage (FanIntakeV) 2017-08-05 15:02:04.935 (GW) General/kWh (Meter) 2017-08-05 15:02:33.940 (GW) Temp + Humidity (Mitch2) 2017-08-05 15:02:33.945 (GW) Temp + Humidity (Mitch2) 2017-08-05 15:02:37.941 (GW) Temp (MBR Fan) 2017-08-05 15:50:02.678 Set UserVariable FanFlag = 1 2017-08-05 15:51:02.693 Set UserVariable FanFlag = 1 2017-08-05 15:52:02.703 Set UserVariable FanFlag = 1 2017-08-05 15:53:02.710 Set UserVariable FanFlag = 1 2017-08-05 15:54:00.037 Set UserVariable FanFlag = 1Thanks,
Matt@Matt I agree that power is the most likely cause. The nrf24 is very sensitive.
Before you recompile, add --extra-cxxflags=-DMY_DEBUG_VERBOSE_RF24 to the configure command and you'll get extra details on the radio status in the gateway's debug log.
-
@Matt I agree that power is the most likely cause. The nrf24 is very sensitive.
Before you recompile, add --extra-cxxflags=-DMY_DEBUG_VERBOSE_RF24 to the configure command and you'll get extra details on the radio status in the gateway's debug log.
@mfalkvidd Thankyou. Stable for now. Not sure if they are even genuine modules so... Can reach outside to my glasshouse even on low power setting.
If it starts playing up again I'll add verbose logging and have another look. -
@niehoff80 and/or @Oliviakrk can you run
sudo raspi-config(install it using sudo apt-get install raspi-config if it isn't already installed)
Select8 Advanced Optionsand
A6 SPIand
Yesto all questions. Reboot the raspberry pi and try running make again. If that works I'll add it to the documentation.
-
I was able to compile it after doing what you're suggesting. It's still have error message during communication with the gateway but that is probably a noobs-error in my config. so I have to investigate a bit more.
-
Hi
I enabled SPI. For Rasberry PI B it was under 5. Interfacing options. The build completed successfully. Thanks!
But there is a problem...When I run mysqgw -d I get:
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:PDTI also tried development release. Works perfectly. Looks like there is problem with stable.
-
Have the same problem with the stable branch as @Oliviakrk using the NRF24 transport on an Raspberry PI B, it might be a driver issue, is see that the make for the development branche builds the BCM drivers while the master branche does not.
-
Hi I followed the instructions, but I can't get it to work, I have a Raspberry Pi 1 Rev1 with NRF24 connected following the instructions.
First I configured it just using ./configure --spi-driver=SPIDEV --spi-spidev-device=/dev/spidev0.0 --soc=BCM2835 --my-transport=nrf24 --my-rf24-ce-pin=22 --my-rf24-cs-pin=24 --my-gateway=ethernet --my-port=5003
I also tried with almost every combination but I always get the same errors.
The idea is for it to be used as a standalone GW running from RPI with RF directly attached to it (SPI is enabled and I don't get any errors when compiling)
I can send the logs if needed, any help will be welcome, thanks!
pi@raspberrypi:~/MySensors $ 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: TSF:LRT:OK
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 -
Tried it and got the same output, I also tried with a different NRF24 just in case and doublechecked the connections. are the options I am using ok?
./configure --spi-driver=SPIDEV --spi-spidev-device=/dev/spidev0.0 --soc=BCM2835 --my-debug=enable --my-transport=nrf24 --my-rf24-ce-pin=22 --my-rf24-cs-pin=24 --my-gateway=ethernet --my-port=5003 -
@gohan, Thank you! I got it to work. First I tried with the development branch and it didn't work either, then I used the following instructions https://forum.mysensors.org/topic/1151/tutorial-raspberry-pi-nrf24l01-direct-connection
And when that didn't work either I rechecked the wiring which ended up being the reason for it to fail previously, "faulty wires".
I got it to work with the master branch.pi@raspberrypi:~/MySensors $ 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: TSF:LRT:OK
mysgw: TSM:INIT
mysgw: TSF:WUR:MS=0
mysgw: TSM:INIT:TSP OK
mysgw: TSM:INIT:GW MODE
mysgw: TSM:READY:ID=0,PAR=0,DIS=0
mysgw: MCO:REG:NOT NEEDED -
Hi.
I have a Raspberry Pi already configured as gateway, but I don't know how to interact with. I means, how can I read incoming data from? I tried open /dev/ttyMySensorsGateway as a common serial port but I got a message error:
cu: open (/dev/ttyMySensorsGateway): Permission denied
cu: /dev/ttyMySensorsGateway: Line in use
With 'ps ax' command I can see only '/usr/local/sbin/PiGatewaySerial -d' running as a deamon.
Could someone explain me what's ne next step for?