💬 Building a Raspberry Pi Gateway
-
Welcome to the MySensors community @pandy
./configure --my-transport=nrf24should be sufficient. What results did you get from the make and sudo ./bin/mysgw -d commands?
@mfalkvidd said in 💬 Building a Raspberry Pi Gateway:
./configure --my-transport=nrf24
Hi and thanks for the quick answer..
This is the result of the command:[SECTION] Detecting target machine.
[OK] machine detected: SoC=BCM2835, Type=rpi1, CPU=armv6l.
[SECTION] Detecting SPI driver.
[OK] SPI driver detected:BCM.
[SECTION] Detecting init system.
[OK] init system detected: systemd.
[SECTION] Saving configuration.
[SECTION] Cleaning previous builds.
[OK] Finished. -
@mfalkvidd said in 💬 Building a Raspberry Pi Gateway:
./configure --my-transport=nrf24
Hi and thanks for the quick answer..
This is the result of the command:[SECTION] Detecting target machine.
[OK] machine detected: SoC=BCM2835, Type=rpi1, CPU=armv6l.
[SECTION] Detecting SPI driver.
[OK] SPI driver detected:BCM.
[SECTION] Detecting init system.
[OK] init system detected: systemd.
[SECTION] Saving configuration.
[SECTION] Cleaning previous builds.
[OK] Finished. -
Hi and sorry for the question..
I have been trying to build a gateway with a raspberry pi 1 and a radio module nrf24 + for several days without success. .I am analyzing step by step what I can be wrong..
You can kindly indicate the exact command syntax ./configure I have to give?
thank you so much -
the result of sudo ./bin/mysgw -d is :
mysgw: Starting gateway...
mysgw: Protocol version - 2.2.0-betaand it blocks..
-
the result of sudo ./bin/mysgw -d is :
mysgw: Starting gateway...
mysgw: Protocol version - 2.2.0-betaand it blocks..
-
@sineverba thank you for your suggestion..Do you have a link where I can find a tutorial for this system?
thank you so much -
Thanks to everyone for the answers and suggestions...
At this point I think the problem is the raspberry type..
I will try the suggested solution above otherwise I will be forced to change raspberry ..
Thanks to everyone for help -
Hello everyone!
I am trying to use a NRF24 module on the SPI1 of a Raspberry2 (so that I can also use a touch tft on SPI0).
I enabled it in the config.txt so that is lists under /dev/spidev1.0 - for conveniency I configured the CS0 to be at GPIO16=Pin36 (by using dtoverlay=spi1-1cs,cs0_pin=16).
I use the dev branch of MySensors.git as the master branch does not recognize my Pi. I used this configure line:
./configure --my-rf24-channel=124 --my-rf24-irq-pin=29 --my-rf24-ce-pin=31 --my-rf24-cs-pin=36 --spi-driver=SPIDEV --spi-spidev-device=/dev/spidev1.0successful make
but when I run the gateway in the shell with sudo ./bin/mysgw -d, I get the following:mysgw: Starting gateway... mysgw: Protocol version - 2.2.0-beta __ __ ____ | \/ |_ _/ ___| ___ _ __ ___ ___ _ __ ___ | |\/| | | | \___ \ / _ \ `_ \/ __|/ _ \| `__/ __| | | | | |_| |___| | __/ | | \__ \ _ | | \__ \ |_| |_|\__, |____/ \___|_| |_|___/\___/|_| |___/ |___/ 2.2.0-beta mysgw: MCO:BGN:INIT CP=RNNG--Q- mysgw: TSF:LRT:OK mysgw: TSM:INIT mysgw: TSF:WUR:MS=0 mysgw: pinMode: invalid pin: 29 mysgw: pinMode: invalid pin: 31 mysgw: pinMode: invalid pin: 36 mysgw: digitalWrite: invalid pin: 31 mysgw: digitalWrite: invalid pin: 36 mysgw: digitalPinToInterrupt: invalid pin: 29 mysgw: digitalPinToInterrupt: invalid pin: 29 mysgw: digitalWrite: invalid pin: 36Any ideas what I can do to make it work?
-
Hello everyone!
I am trying to use a NRF24 module on the SPI1 of a Raspberry2 (so that I can also use a touch tft on SPI0).
I enabled it in the config.txt so that is lists under /dev/spidev1.0 - for conveniency I configured the CS0 to be at GPIO16=Pin36 (by using dtoverlay=spi1-1cs,cs0_pin=16).
I use the dev branch of MySensors.git as the master branch does not recognize my Pi. I used this configure line:
./configure --my-rf24-channel=124 --my-rf24-irq-pin=29 --my-rf24-ce-pin=31 --my-rf24-cs-pin=36 --spi-driver=SPIDEV --spi-spidev-device=/dev/spidev1.0successful make
but when I run the gateway in the shell with sudo ./bin/mysgw -d, I get the following:mysgw: Starting gateway... mysgw: Protocol version - 2.2.0-beta __ __ ____ | \/ |_ _/ ___| ___ _ __ ___ ___ _ __ ___ | |\/| | | | \___ \ / _ \ `_ \/ __|/ _ \| `__/ __| | | | | |_| |___| | __/ | | \__ \ _ | | \__ \ |_| |_|\__, |____/ \___|_| |_|___/\___/|_| |___/ |___/ 2.2.0-beta mysgw: MCO:BGN:INIT CP=RNNG--Q- mysgw: TSF:LRT:OK mysgw: TSM:INIT mysgw: TSF:WUR:MS=0 mysgw: pinMode: invalid pin: 29 mysgw: pinMode: invalid pin: 31 mysgw: pinMode: invalid pin: 36 mysgw: digitalWrite: invalid pin: 31 mysgw: digitalWrite: invalid pin: 36 mysgw: digitalPinToInterrupt: invalid pin: 29 mysgw: digitalPinToInterrupt: invalid pin: 29 mysgw: digitalWrite: invalid pin: 36Any ideas what I can do to make it work?
I think I might have found the root of the problem. The ./configure detects my Rpi2 as such (rpi2) but in the RPi.cpp in line 26 there is the pin to GPIO translation array and it is lacking translations for the high pin numbers - which is obviously wrong as on the RPi2 you have the extended GPIO connector with 40 pins...
const static int pin_to_gpio_rev1[41] = {-1, -1, -1, 0, -1, 1, -1, 4, 14, -1, 15, 17, 18, 21, -1, 22, 23, -1, 24, 10, -1, 9, 25, 11, 8, -1, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }; const static int pin_to_gpio_rev2[41] = {-1, -1, -1, 2, -1, 3, -1, 4, 14, -1, 15, 17, 18, 27, -1, 22, 23, -1, 24, 10, -1, 9, 25, 11, 8, -1, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }; const static int pin_to_gpio_rev3[41] = {-1, -1, -1, 2, -1, 3, -1, 4, 14, -1, 15, 17, 18, 27, -1, 22, 23, -1, 24, 10, -1, 9, 25, 11, 8, -1, 7, -1, -1, 5, -1, 6, 12, 13, -1, 19, 16, 26, 20, -1, 21 };I copied the rev3 array to the rev2 array and compiled this and it seems to work in my case!
-
I think I might have found the root of the problem. The ./configure detects my Rpi2 as such (rpi2) but in the RPi.cpp in line 26 there is the pin to GPIO translation array and it is lacking translations for the high pin numbers - which is obviously wrong as on the RPi2 you have the extended GPIO connector with 40 pins...
const static int pin_to_gpio_rev1[41] = {-1, -1, -1, 0, -1, 1, -1, 4, 14, -1, 15, 17, 18, 21, -1, 22, 23, -1, 24, 10, -1, 9, 25, 11, 8, -1, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }; const static int pin_to_gpio_rev2[41] = {-1, -1, -1, 2, -1, 3, -1, 4, 14, -1, 15, 17, 18, 27, -1, 22, 23, -1, 24, 10, -1, 9, 25, 11, 8, -1, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }; const static int pin_to_gpio_rev3[41] = {-1, -1, -1, 2, -1, 3, -1, 4, 14, -1, 15, 17, 18, 27, -1, 22, 23, -1, 24, 10, -1, 9, 25, 11, 8, -1, 7, -1, -1, 5, -1, 6, 12, 13, -1, 19, 16, 26, 20, -1, 21 };I copied the rev3 array to the rev2 array and compiled this and it seems to work in my case!
-
I just noticed that mysgw is constantly consuming 95-100% CPU here. This even happens when I unplug the NRF24 module so that after starting mysgw basically nothing happens. Running development branch. Hmmmm. Any idea what to check?
@Velo17 strace might be able to help:
sudo strace ./bin/mysgw -dCould you post your configure command? I'd like to try to reproduce the problem. I have a gateway with development from git as of about 2 weeks ago (a9418271) but I'm not using the nrf24. That gateway uses about 2% cpu on my Raspberry Pi 1. There have only been 6 commits since I built my gateway but I can update it and see if it starts acting up.
On my gateway, strace outputs loads and loads of these:
gettimeofday({1501098316, 668956}, NULL) = 0 ioctl(6, FIONREAD, [0]) = 0 gettimeofday({1501098316, 671383}, NULL) = 0 gettimeofday({1501098316, 672447}, NULL) = 0 gettimeofday({1501098316, 673818}, NULL) = 0 nanosleep({0, 10000000}, NULL) = 0 gettimeofday({1501098316, 685602}, NULL) = 0 getsockopt(6, SOL_TCP, TCP_INFO, "\1\0\0\0\0\7g\1P4\3\0@\234\0\0\250\5\0\0\30\2\0\0\0\0\0\0\0\0\0\0"..., [104]) = 0 getsockopt(6, SOL_TCP, TCP_INFO, "\1\0\0\0\0\7g\1P4\3\0@\234\0\0\250\5\0\0\30\2\0\0\0\0\0\0\0\0\0\0"..., [104]) = 0 gettimeofday({1501098316, 689179}, NULL) = 0 ioctl(6, FIONREAD, [0]) = 0Also, which git hash are you using? (git log -1)
Another thing to try could be to enable all the debug flags in MyConfig.h and see if they give you something interesting.
-
@mfalkvidd I make / make install a couple of times and maybe did a git pull inbetween as well - now everything is back to normal again. Thank you for giving me some dbug tips for the next issue :-)
My strace output looks similiar.
My configure line is
./configure --my-rf24-channel=124 --my-rf24-irq-pin=29 --my-rf24-ce-pin=31 --my-rf24-cs-pin=36 --spi-driver=SPIDEV --spi-spidev-device=/dev/spidev1.0 --my-debug=disable -
Should be possible to connect two radio modules and run two instances at the same time?
It could be interesting to have a hat with nrf+rfm, all in one. -
Should be possible to connect two radio modules and run two instances at the same time?
It could be interesting to have a hat with nrf+rfm, all in one.@Sergio-Rius it would be great if you could contribute to making that a reality.
An earlier discussion on the same topic: https://forum.mysensors.org/topic/4151/nrf24l01-and-rfm69-on-one-gw/So far, people have found it easier to add a separate gateway for each transport.
-
@Sergio-Rius it would be great if you could contribute to making that a reality.
An earlier discussion on the same topic: https://forum.mysensors.org/topic/4151/nrf24l01-and-rfm69-on-one-gw/So far, people have found it easier to add a separate gateway for each transport.
@mfalkvidd thanks for guiding me on the starting point. Perhaps the raspberry can break the doble transport limitation.
I'll investigate in how to install two services at once. But it'll would be nice any advice on the device virtualization part.