💬 Building a Raspberry Pi Gateway
-
@jirm If you try to use the nrf24h radio you will get the same error as the @Tag post:
In file included from examples_linux/mysgw.cpp:74:0: ./MySensors.h:258:2: error: #error No support for nRF24 radio on this platform #error No support for nRF24 radio on this platformFor @aand error, it's what you mention in your early post, a gcc compiler issue.
MySensors nrf24 drivers uses the SPI interface to drive the module, it's the same driver for all supported platforms (RPi, esp8266, atmega328p, ...), this way it is easier to maintain.
I understand that it must have been frustrating to find out that it does not work for the OPi but there isn't much I can do to help you. I bought one too, still waiting to arrive.
Really thanks a lot for your work and very much appreciate you try to help us on our "fight" with the OPI board.
Sadly in this moment I cannot work because I'm out of time to try install all softw stuff on my OPI and try help much more to push it working with mysgw and so on.
I don't understand so much why is not working out of the box and the driver issue found and/what hardware communication issue are only on OPI with that similar derived Raspbian OS like Raspberry, and too not understand why cannot work on OPI because that SPI bus issue you say.
@aand reported nrf24 module work very well with TMRh20 driver, so seems hardware are OK on OPI for the module and I suppose still only discover and hopefully make it work avoiding the driver issue you say to compile properly mysgw softw.
Anyway, I only hope that anyone can help mainly here to make work mysgw on OPI too, and adapt it to work on Armbian, because OPI is a really good choice for HA controller board and sure in near future much people use it.Is there any chance to substitute own nfr24 driver mysgw with the TMR20h, at least for testing purposes on OPI?
If any mysgw "code" people are reading this maybe can try to help us with some idea to try workaround the compilation issue on OPI.
Best regards and again many thanks!
PD: Only for test SPI purposses on armbian this can help (post 248) :
https://forum.armbian.com/index.php/topic/617-wip-orange-pi-one-support-for-the-upcoming-orange-pi-one/page-9#entry5747Only for info, other interesting post about how to make work nrf24l01 module on OPI and armbian:
https://forum.armbian.com/index.php/topic/3161-orange-pi-one-with-nrf24l01/Another one interesting post OPI One with armbian using NRF24 module:
https://forum.armbian.com/index.php/topic/3161-orange-pi-one-with-nrf24l01/ -
OpenHab 2
@musthafa Openhab2 works using mysgw configured as an ethernet gateway. This is the guide I used: https://github.com/tobof/openhab2-addons/wiki
-
Hello.
I'm also using a orangepi one and wanted to build the gateway on it. But i didn't want to use the nrf24 but a usb to rs485 converter. But if i want to compile it, i get also the same error with the nrf24 and that it is not supporting platform. Why?
Also if i want to build a serial gateway with a connected arduino on usb port, i got the same error with the nrf24
-
@musthafa Openhab2 works using mysgw configured as an ethernet gateway. This is the guide I used: https://github.com/tobof/openhab2-addons/wiki
@marceloaqno thank you.
I have already installed OpenHAB 2 on my RPi. Can I install mysgw on to the same RPi ?
-
@hausinger -- are you running armbian on your orange pi one?
-
@marceloaqno thank you.
I have already installed OpenHAB 2 on my RPi. Can I install mysgw on to the same RPi ?
@musthafa Yes, set the IP Address to 127.0.0.1 in your openhab for the ethernet gateway.
-
@hausinger -- are you running armbian on your orange pi one?
-
@jirm Thanks for the suggestion. I've downloaded the raspian image. To duplicate the path I used with armbian, I downloaded TMRh20's RF24 code so I can test the radio with code I've already had up and running on the hardware.. However, this version of raspbian is really bad. So far nothing compiles. Regular raspbian, and armbian on the orange pi one do not have this kind of problem out of the box; they compile a wide range of packages. I'll spend some more time on it to be diligent, but this distro looks like it needs to be put on the abandon pile.
I tried compiling mysensors gateway too but no luck with that yet either. This is what I get:
./configure
[SECTION] Detecting target machine.
[OK] machine detected: SoC=H3, Type=unknown, CPU=armv7l.
[OK] init system detected: sysvinit
[SECTION] Saving configuration.
[SECTION] Cleaning previous builds.
[OK] Finished.make
gcc -MT build/drivers/Linux/log.o -MMD -MP -march=armv8-a -mtune=cortex-a53 -mfpu=neon-vfpv4 -mfloat-abi=hard -DMY_RA
DIO_NRF24 -DMY_GATEWAY_LINUX -DMY_DEBUG -Ofast -g -Wall -Wextra -I. -I./core -I./drivers/Linux -c drivers/Linux/log
.c -o build/drivers/Linux/log.o
cc1: error: bad value (armv8-a) for -march switch
cc1: error: bad value (cortex-a53) for -mtune switch
Makefile:102: recipe for target 'build/drivers/Linux/log.o' failed
make: *** [build/drivers/Linux/log.o] Error 1Hi again!
I spend some time seeing and reading some of the files from the mysensors github build and I see some things that can help to understand why the error raised to @aand trying to compile on OPI.
First say that I´m not a coding expert, so please be nice with my if I´m wrong and say something stupid ;-)
I see in the .configure file that the machine detection have H3 Soc and this are fine detected , but then I see that selecting type and CPU flags seems not properly selected to match OPI specs , because on OPI soc H3 have a cpu armv7 (not armv8) and is a A20 and not A53.
So maybe that cpu "selection" is not correct for H3 soc , and is so easy try if anyone that have OPI and have time can change only that values in the config file and try to compile.
All the values on the A20 line seems correct for the OPI H3 soc, so only needed copy them from the A20 line to the H3 line, and give a try.File Configure
.......
function gcc_cpu_flags {
local soc=$1
case $soc in
BCM2835)
flags="-march=armv6zk -mtune=arm1176jzf-s -mfpu=vfp -mfloat-abi=hard"
;;
BCM2836)
flags="-march=armv7-a -mtune=cortex-a7 -mfpu=neon-vfpv4 -mfloat-abi=hard"
;;
AM33XX)
flags="-march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=hard"
;;
A10)
flags="-march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=hard"
;;
A13)
flags="-march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=hard"
;;
A20)
flags="-march=armv7-a -mtune=cortex-a7 -mfpu=neon-vfpv4 -mfloat-abi=hard"
;;
H3)
flags="-march=armv8-a -mtune=cortex-a53 -mfpu=neon-vfpv4 -mfloat-abi=hard"
;;
*) -
@musthafa Yes, set the IP Address to 127.0.0.1 in your openhab for the ethernet gateway.
@marceloaqno Thank you!
-
also on banana pi pro when i trie to compile i'm getting this :
[SECTION] Detecting target machine.
[OK] machine detected: SoC=A20, Type=unknown, CPU=armv7l.
[OK] init system detected: sysvinit
[SECTION] Saving configuration.
[SECTION] Cleaning previous builds.
[OK] Finished.type i think must be BananaPro
on make :
-o build/examples_linux/mysgw.o
In file included from examples_linux/mysgw.cpp:74:0:
./MySensors.h:258:2: error: #error No support for nRF24 radio on this platform
#error No support for nRF24 radio on this platform
^
In file included from ./drivers/RF24/RF24.cpp:23:0,
from ./MySensors.h:294,
from examples_linux/mysgw.cpp:74:
./drivers/RF24/RF24.h:52:17: fatal error: SPI.h: No such file or directory
#include <SPI.h>
^
compilation terminated.
Makefile:98: recipe for target 'build/examples_linux/mysgw.o' failed
make: *** [build/examples_linux/mysgw.o] Error 1so Banana Pi Pro soc A20 it's also on wait list or never worked ?
-
also on banana pi pro when i trie to compile i'm getting this :
[SECTION] Detecting target machine.
[OK] machine detected: SoC=A20, Type=unknown, CPU=armv7l.
[OK] init system detected: sysvinit
[SECTION] Saving configuration.
[SECTION] Cleaning previous builds.
[OK] Finished.type i think must be BananaPro
on make :
-o build/examples_linux/mysgw.o
In file included from examples_linux/mysgw.cpp:74:0:
./MySensors.h:258:2: error: #error No support for nRF24 radio on this platform
#error No support for nRF24 radio on this platform
^
In file included from ./drivers/RF24/RF24.cpp:23:0,
from ./MySensors.h:294,
from examples_linux/mysgw.cpp:74:
./drivers/RF24/RF24.h:52:17: fatal error: SPI.h: No such file or directory
#include <SPI.h>
^
compilation terminated.
Makefile:98: recipe for target 'build/examples_linux/mysgw.o' failed
make: *** [build/examples_linux/mysgw.o] Error 1so Banana Pi Pro soc A20 it's also on wait list or never worked ?
Yes...I see. That error is that said @marceloaqno about own mysensors NRF24 drivers and SPI bus adapt for Raspberry, because for now mysensors is only supported at Raspi and arduinos.
On Banana CPU detection seems work better (I agree type seems not good...maybe you can change this on configure file and give a try to compile to see what happends) and I figure can work too on OPI too only changing that I said before, but then is raised NRF24 driver and SPI error.I see that mysensors RF24 driver are derivated from that https://github.com/mz-fuzzy/RF24 build that at same time last this is forked directly from http://tmrh20.github.io/RF24Installer/RPi/install.sh that we know are working fine on OPI and armbian, so I figure that maybe it´s not so much hard to modify mysensors RF24 to adapt to work on OPI.
Hope any mysensors "coder" ear our call and cand give us some hand to make the changes on the mysensors build and we can compile the mysgw to OPI soon.
Cheers
-
Yes...I see. That error is that said @marceloaqno about own mysensors NRF24 drivers and SPI bus adapt for Raspberry, because for now mysensors is only supported at Raspi and arduinos.
On Banana CPU detection seems work better (I agree type seems not good...maybe you can change this on configure file and give a try to compile to see what happends) and I figure can work too on OPI too only changing that I said before, but then is raised NRF24 driver and SPI error.I see that mysensors RF24 driver are derivated from that https://github.com/mz-fuzzy/RF24 build that at same time last this is forked directly from http://tmrh20.github.io/RF24Installer/RPi/install.sh that we know are working fine on OPI and armbian, so I figure that maybe it´s not so much hard to modify mysensors RF24 to adapt to work on OPI.
Hope any mysensors "coder" ear our call and cand give us some hand to make the changes on the mysensors build and we can compile the mysgw to OPI soon.
Cheers
As a side coment, the configure file is on the root Mysensors directory that is buid when you complete the first step "git clone https://github.com/mysensors/MySensors.git" on the mysgw install process.
Anyone can edit the file with a plain text editor and change the values for see what happens when try compile.
Regards
-
As a side coment, the configure file is on the root Mysensors directory that is buid when you complete the first step "git clone https://github.com/mysensors/MySensors.git" on the mysgw install process.
Anyone can edit the file with a plain text editor and change the values for see what happens when try compile.
Regards
@jirm The configure script from MySensor repo is based on the https://github.com/TMRh20/RF24/blob/master/configure. Could you try with theTMRh20 master branch and post the result?
git clone https://github.com/TMRh20/RF24.git cd RF24 ./configure make -
git clone https://github.com/TMRh20/RF24.git
cd RF24
./configure
[SECTION] Detecting arm compilation environment.
[OK] arm-linux-gnueabihf-gcc detected.
[OK] arm-linux-gnueabihf-g++ detected.
[SECTION] Detecting target machine.
[OK] machine detected: SoC=A20, Type=unknown, CPU=armv7l.
[SECTION] Detecting DRIVER
[OK] DRIVER detected:SPIDEV.
[SECTION] Detecting OS.
[INFO] OS detected:LINUX.
[SECTION] Preparing configuration.
[SECTION] Saving configuration.
[SECTION] Cleaning previous builds.
[OK] Finished.make
arm-linux-gnueabihf-g++ -fPIC -march=armv7-a -mtune=cortex-a7 -mfpu=neon-vfpv4 -mfloat-abi=hard -Ofast -Wall -pthread -c RF24.cpp
arm-linux-gnueabihf-g++ -fPIC -march=armv7-a -mtune=cortex-a7 -mfpu=neon-vfpv4 -mfloat-abi=hard -Ofast -Wall -pthread -c utility/SPIDEV/spi.cpp
arm-linux-gnueabihf-g++ -fPIC -march=armv7-a -mtune=cortex-a7 -mfpu=neon-vfpv4 -mfloat-abi=hard -Ofast -Wall -pthread -c utility/SPIDEV/gpio.cpp
arm-linux-gnueabihf-gcc -fPIC -march=armv7-a -mtune=cortex-a7 -mfpu=neon-vfpv4 -mfloat-abi=hard -Ofast -Wall -pthread -c utility/SPIDEV/compatibility.c
arm-linux-gnueabihf-g++ -fPIC -march=armv7-a -mtune=cortex-a7 -mfpu=neon-vfpv4 -mfloat-abi=hard -Ofast -Wall -pthread -c utility/SPIDEV/interrupt.c
[Linking]
arm-linux-gnueabihf-gcc -pthread -shared -Wl,-soname,librf24.so.1 -march=armv7-a -mtune=cortex-a7 -mfpu=neon-vfpv4 -mfloat-abi=hard -Ofast -Wall -pthread -o librf24.so.1.2.0 RF24.o spi.o gpio.o compatibility.o interrupt.o -
@Oli After these steps:
git clone https://github.com/mysensors/MySensors.git cd MySensorsto switch to the master branch, run:
git checkout masterand reinstall the gateway following the same steps from the instructions.
-
@marceloaqno
i've tried on banana pi pro :cat /etc/debian_version
8.6
cat /etc/bananian_platform
BananaPro -
@marceloaqno
i've tried on banana pi pro :cat /etc/debian_version
8.6
cat /etc/bananian_platform
BananaPro@eyesoft thanks for the feedback, we need to add support for SPIDEV driver in order to use the BananaPi.
-
@jirm The configure script from MySensor repo is based on the https://github.com/TMRh20/RF24/blob/master/configure. Could you try with theTMRh20 master branch and post the result?
git clone https://github.com/TMRh20/RF24.git cd RF24 ./configure make@marceloaqno Sadly I´m so much bussy and traveling for few days and cannot acces to my OPI´s :-( , but I´m sure someone here (@aand , @hausinger, etc.. ) can give a try on her OPI the things we said before. At least I hope this ...
-
@eyesoft thanks for the feedback, we need to add support for SPIDEV driver in order to use the BananaPi.
@marceloaqno I see some huge steps up on BananaPi...seems only need add SPIDEV support for make it working... :-)