💬 Building a Raspberry Pi Gateway
-
Hi,
I'm trying to install the gateway on a Raspberry Pi 2 hosting Domoticz already (I had used the standard Domoticz image).
I receive an error message on the make step, but maybe I've not properly understood instructions (not very friendly with raspberry and linux environment).
First, I wired the NRF24 with PA (meaning I used an adapter and the 5V physical PIN#4) and the IRQ (wired on physical pin #15)
Then I logged into my raspberry and staid in initial directory (pi@raspberrypi )
I then typed:pi@raspberrypi ~ $ git clone https://github.com/mysensors/MySensors.git --branch master Cloning into 'MySensors'... remote: Counting objects: 14895, done. remote: Compressing objects: 100% (8/8), done. remote: Total 14895 (delta 0), reused 5 (delta 0), pack-reused 14887 Receiving objects: 100% (14895/14895), 12.17 MiB | 1.68 MiB/s, done. Resolving deltas: 100% (9022/9022), done. pi@raspberrypi ~ $ cd MySensors pi@raspberrypi ~/MySensors $ ./configure --helpHopefully I did it in adequate folder ? (now I see a Mysensors folder in my /home/pi folder).
Then I typed:pi@raspberrypi ~/MySensors $ --my-transport=nrf24 -bash: --my-transport=nrf24 : commande introuvable pi@raspberrypi ~/MySensors $ ./configure --my-transport=nrf24 [SECTION] Detecting target machine. [OK] machine detected: SoC=BCM2836, Type=Rpi2, CPU=armv7l. [SECTION] Detecting SPI driver. [OK] SPI driver detected:BCM. [SECTION] Detecting init system. [OK] init system detected: sysvinit. [SECTION] Saving configuration. [SECTION] Cleaning previous builds. [OK] Finished.So far, no error.. but should I have typed "./configure --my-transport=nrf24 --my-rf24-irq-pin=15" to implement the IRQ ? If yes, can I retype that command with new settings without issue ?
Then I understaood I had to run make command:
pi@raspberrypi ~/MySensors $ make gcc -MT build/drivers/Linux/log.o -MMD -MP -march=armv7-a -mtune=cortex-a7 -mfpu=neon-vfpv4 -mfloat-abi=hard -DMY_RADIO_NRF24 -DMY_GATEWAY_LINUX -DMY_DEBUG -DLINUX_SPI_BCM -DLINUX_ARCH_RASPBERRYPI -Ofast -g -Wall -Wextra -I. -I./core -I./drivers/Linux -I./drivers/RPi -I./drivers/BCM -c drivers/Linux/log.c -o build/drivers/Linux/log.o cc1: error: bad value (cortex-a7) for -mtune switch Makefile:118: recipe for target 'build/drivers/Linux/log.o' failed make: *** [build/drivers/Linux/log.o] Error 1But errors... :anguished:
I tried to search on forum, and saw someone else meniotning a smilar error, but people were answering about OrangePI, whereas I use a Rasp PI 2.
I probably misunderstood some steps.. Could someone help me ?Note: in instructions, there's a statement I don't understand for ethernet gateway: "To set the gateway as a client that connects to a controller, use:--my-gateway=ethernet --my-controller-url-address=YOUR-CONTROLLER-ADDRES" . IN which case do we need that ? (as said, I plan to simply use this gateway on My dodmoticz rasp PI).
br,
Ricorico94 -
@ricorico94 said in 💬 Building a Raspberry Pi Gateway:
./configure --my-transport=nrf24 --my-rf24-irq-pin=15
That is fine, no need to add extra parameters as by defaults it will configure as ethernet gateway. Also try using the development branch as it has lots of bugs fixed.
-
@ricorico94 Yesterday I managed to make a working rpi gateway. I am on rpi3, use a socket adapter board for the radio and use domoticz. I posted all the details here: https://forum.mysensors.org/topic/7793/nrf24l01-problems-in-2-1-1-and-2-2-0-beta/24
-
Hi,
@arraWX : I looked at your post. Unfortunately, the error I face is before the start, as it's during the make, so it appears I follow the first steps you describe (config & make), but I still don't know how to solve the make errors.In case it can help understanding what's going on or what to do, I ran the command:
gcc -vwhich displayed: gcc version 4.6.3 (Debian 4.6.3-14+rpi1)
Could it be an issue this "+rpi1" whreas I've a PI 2 ? -
Hi,
I tried to update gcc, just in case.. though I'm not sure of what I do.:confused:
I ran:pi@raspberrypi ~/MySensors $ sudo apt-get upgrade gccand after a little while, it ended without obvious mistake.
but if I do gcc -v again, I still get
gcc version 4.6.3 (Debian 4.6.3-14+rpi1)
(even after reboot)
Is there another step to be done, or am I using wrong command ? -
@gohan : JUst tried it, but same result.. no change on version number.
is there something like apt-get install to be done also ? -
I don't know really... I am using dietpi on a RPI3 and there is a convenient tool that you can check what to install and installs for you and among the others I have chosen the "Build-Essentials" that contains all the common packages for compile, so I don't know what packages are included.
-
@gohan : JUst tried it, but same result.. no change on version number.
is there something like apt-get install to be done also ?@ricorico94 Do you see gcc-4.9 in the list returned by the command below?
sudo apt-cache search gccIf it's listed, try installing it by specifying the version:
sudo apt-get install gcc-4.9 -
Hi,
Thanks to @marceloaqno and @Gohan and @arraWX , I could progress somewhow.. but still not working.When listing the versions as per Marceloagno advice, I could see gcc-4.6 and -4.7 and 4.8 but nothing else (no 4.9).
I then decided to take the risk of installing the 4.8.. The commands from Marcelagno did not work (well, I mean gcc - v was still showing 4.6).
Then I followed this tutorial on upgrade step by step to upgrade to gcc-4.8 and then the make command apparently succeeded (well, plenty messages, some warnings.. but no error apparently, as ar as I could see. I dd not find the folders desribed in website, but the commands were still ok.. weird, but I'm too rookie..)I then followed again the Mysensors tutorial with
sudo ./bin/mysgw -h
sudo ./bin/mysgw -d (and no error message. great!)
sudo make install
but then I ran
sudo systemctl enable mysgw.service
and I got error messagesudo: systemctl: command not foundAfter some search, I saw that it's a Jessie command whereas I discovered that my good old version of Rasp Pi, which was built from the standard Domoticz image in 2015 is still Wheezy
pi@raspberrypi ~/MySensors $ cat /etc/os-release PRETTY_NAME="Raspbian GNU/Linux 7 (wheezy)" NAME="Raspbian GNU/Linux" VERSION_ID="7" VERSION="7 (wheezy)" ID=raspbian ID_LIKE=debian ANSI_COLOR="1;31" HOME_URL="http://www.raspbian.org/" SUPPORT_URL="http://www.raspbian.org/RaspbianForums" BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"Any idea of what I should do now?..
another commande equivalent to the systemctl ?
an upgrade to Jessie (any risk ? and how to do it safely ?)br,
Ricorico94 -
I am new to Linux and hopefully have an easy question...
I have followed the build instructions and everything seems to be working well so far. One issue I'm having is getting node-red to see the usb port (/dev/ttyUSB020). I did some searching online and found that if I run the following command node-red will see the port and things start working.sudo chmod 666 /dev/ttyUSB020The problem is that each time I reboot the Pi the command needs to be run again. Does anyone have any ideas on how I can resolve this so I don't need to run the command each time the system is booted? Thanks in advance.
-
I am new to Linux and hopefully have an easy question...
I have followed the build instructions and everything seems to be working well so far. One issue I'm having is getting node-red to see the usb port (/dev/ttyUSB020). I did some searching online and found that if I run the following command node-red will see the port and things start working.sudo chmod 666 /dev/ttyUSB020The problem is that each time I reboot the Pi the command needs to be run again. Does anyone have any ideas on how I can resolve this so I don't need to run the command each time the system is booted? Thanks in advance.
-
I am new to Linux and hopefully have an easy question...
I have followed the build instructions and everything seems to be working well so far. One issue I'm having is getting node-red to see the usb port (/dev/ttyUSB020). I did some searching online and found that if I run the following command node-red will see the port and things start working.sudo chmod 666 /dev/ttyUSB020The problem is that each time I reboot the Pi the command needs to be run again. Does anyone have any ideas on how I can resolve this so I don't need to run the command each time the system is booted? Thanks in advance.
-
@petewill or you can compile the gateway as ethernet or mqtt that are both supported by node-red, making life a little easier
@gohan Sorry, I did not see your reply earlier. I tried an ethernet gateway in node-red a while ago and could never get it to work with Vera. There was some port conflicts or something. I have never played with mqtt. I need to learn it at some point but I am hoping to finish this project so I can move on to some others. :) Do you think I will gain significant advantages by using that over a serial/usb gateway?
-
From a node-red perspective, IMHO, mqtt is easier to handle even without specific mysensors nodes, but it all depends what you need to do. I played with it some months ago but I got stuck when I had to start using javascript as I still don't know that language, but it was quite easy to link mysensors values to the dashboard without actually touching any code.
-
From a node-red perspective, IMHO, mqtt is easier to handle even without specific mysensors nodes, but it all depends what you need to do. I played with it some months ago but I got stuck when I had to start using javascript as I still don't know that language, but it was quite easy to link mysensors values to the dashboard without actually touching any code.