💬 Building a Raspberry Pi Gateway
-
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... :-)
-
@marceloaqno I am rather copy/paste not a programming kind a guy, so sorry for my lame questions.
pi@raspberrypi ~ $ git clone https://github.com/mysensors/MySensors.git
fatal: destination path 'MySensors' already exists and is not an empty directorypi@raspberrypi ~/MySensors $ git checkout master
Branch master set up to track remote branch master from origin.
Switched to a new branch 'master'but after that:
pi@raspberrypi ~/MySensors $ make
make: *** No targets specified and no makefile found. Stop.
pi@raspberrypi ~/MySensors $ sudo make install
make: *** No rule to make target 'install'. Stop.