Hi
Is anyone else having this same problem on Rpi3?: Gateway works ok after "sudo make install" with openHAB. With "sudo ./bin/mysgw -d" I can get debug log visible and log works ok.
But if I run "sudo systemctl enable mysgw.service" after "sudo make install", debug log start showing endlessly "mysgw: accept: Bad file descriptor". So debug log function gets destroyed and it can't be used anymore. I have made several clean installations and every time this same happens.
Br
Tommi

Silly questions, I'm a little bit confuse.
I have a serial Gateway running with arduino nano + nrf24 and a raspberry pi with domoticz on board. The link between domoticz & Gateway is done via USB <=> serial port (/dev/ttyUSB0). This setup runs like a charm.

Now, I would like to access to my Gateway via the network because I would like to use "Over The Air " functionnality with MYSController.

Can I install MySensors Gateway on the raspberry and keep the arduino + nrf24 connected via usb ?? For the moment, I can not use GPIO port.

If for some reason you can't use the GPIO pins of the Raspberry Pi, you could connect the radio to a arduino with the GatewaySerial sketch and feed the pi through a serial port:

@romeo01 I think that connecting nrf24 directly to arduino and compile mysgw as ethernet gateway is the cleanest solution (I have it as MQTT and it is working fine, but ethernet is the same). Keep in mind that you'd better use one of those adapters 5v-3.3v for nrf24 chips + capacitor because the 3v output of raspberry isn't very suited for the task.

When talking about this Raspberry Pi Gateway, I suppose, that its just connecting the NFR24L01+ to the Raspberry Pi GPIO and run

./bin/mysgw -d

right? On my Pi it does not work this way, maybe the NFR24L01+ is not ok. Instead I am running an external esp-wifi-gateway, but a direct gateway seems the better solution to me.
So did I get it right, that I can use a NFR24L01+ connected to the Raspberry PI GPIO without any external gateway? If so, what are the parameters for building the mysgw daemon? I tried this one:

@gohan Been trying to find my old post to tell you all how it got with my rpi and nodes that did not register. I bougt some voltage regulators LM350. used the 5v output insted of 3.3 V but still no luck to get node to register. when messauring volatage when GW send awnser it drops way below 3.3v. I think voltage output from rpi just is to bad. So I bought a nodemcu for GW instead and it works like a sharm

@dirkc I don't know where you got those pin numbers but they don't look like the ones on the guide. In addition you don't have to use spi driver. The PA version of nrf24 are quite a pain to get them working, so I suggest you first test with regular modules and then upgrade to PA

I'm having issues with the LED setup as shown on the page. The LEDs are just constantly on even though everything looks like it's setup just like the picture. I'm new at this so I could be doing something stupid.

However, I found out that the DI00 (=IRQ) on the RFM69 never gives a rising edge...
I'm suspecting that the RFM69 is not being initialised properly... I added some debugging in the RFM69 code to see what registers are being written and read:

I installed on an old RPI1 (clean Rasbian install). Same results as on my Domoticz RPI-3.

Setup the original RPI3 as a node, using the 2.2.0-beta code. I verified that in this case the RFM69HW actually transmits (I can hear it burst on 868.000 MHz). However, it is unable to connect to an existing Arduino 2.1.1 gateway.

I built an Arduino 2.2.0-beta serial gateway. Even then, the RPI as a node fails to connect to the 2.2.0-beta serial gateway.

I built an Arduino 2.2.0-beta node. This node is able to connect to the above gateway.

There seems to be something different in the radio network between the RFM69HW on the RPI and the RFM69HW on the Arduino. But I'm unable to find out what the difference is :-(.

The RPI RFM69HW will not communicate with the Arduino RFM69HW. When the RPI is a gateway, the RFM69HW will not physically interrupt when another node is trying to connect. When the RPI is a node, the RFM69HW on the ARduino does not interrupt either.

Did anyone get the RFM69HW working on the RPI? I'd really like to get this beautiful piece of code working!

@gohan There are no stupid questions, right :-)? But perhaps a stupid answer: no, I did not use any logic convertors. The RFM69 is 3.3V and as far as I know, so are the GPIO pins on the RPI. But I might be mistaken, of course... Should I use logic convertors?

At the moment I have no idea where it fails. Perhaps I need to give it a rest for a couple of days to think it over...

I followed the steps as given on the web site (git branch development). Connected the RFM radio (7 wires: Vcc, GND, MOSI, MISO, SCK, NSS, DI00). Only modified MyConfig.h with regard to the NETWORKID (100 --> 101; my 'production' MySensors runs at 100) and enabling "MY_DEBUG_VERBOSE_RFM69". I configured with:

I forgot to mention in the guide:
To communicate with the RPi using the RFM69 radio, all of your nodes need to use the new RFM69 driver available in the development branch.
To make the change, add the following line to the node sketch:

@marceloaqno Thanks! That indeed does the trick! And no worries, it is my own decision to play with beta(!) code (and it was a fun weekend troubleshooting it - I learned a lot about the structure of the MySensors code)!

Only 'bad' thing is that 2.2.0 is not compatible with my existing nodes :-).

so i can attach the NRF24L01+ to the pi running HA, make it a Ethernet Gateway and point to his own ip adress ?, will this be a long job with converting from a USB connected GW (Arduino with local sensors ? )

That's pretty much it. I don't know what is your current setup and what sensors you have, but is should not be a long job. Anyway you can install the ethernet gateway and when you are done you take care of the sensors

@Richard van der Plas: I strongly recommend to use MQTT instead of Ethernet gateway, as it is a standard way for 2 processes to communicate, and platform-agnostic.
HASS comes with an embed MQTT broker taht works out of the box.
Plus:

you can easily mock either your sensors network or your controller

it does support secure communication

you can add other clients to observe the event, e.g. to log what is coming from/what is sent to the gateway

@pettib@gohan There have been some changes in /proc/cpuinfo in newer versions of kernels which leads to a wrong detection.
The problem was fix in #827 and will be available in the master branch in the next mysensor release.

Ok, i am standig on a crossroad it seems, i have to build a new gateway but i am also interested in the MQTT option, this is between mysensors & HomeASSistant i presume? i have some ESP's lying around unused, but i have 0 knowledge of mqtt (i dont think my hass has it running by default)

Hello, it seems I found the problem: Complete newbie thing: sudo ./bin/mysgw -h worked, but /usr/local/bin/mysgw didn't
I just gave the right to the folder, and now it's working.
Thanks for taking time to help beginners !

@gdekeijzer There was a recent update on the random number generator for the RPi port, but unfortunately not all linux versions support the new method. @d00616 is working on a solution to this problem #856. Please use the master branch for the time being.

Hello, did anyone tried gateway on pi with RS485 wired network ? It looks like node with ID set is looking for parrent and gateway does not respond to the node and therefore there is no succesfull presentation.
example from GW mysgw:

I am a novice, trying to get the raspberry pi gateway to work. I did get it to work on one pi, but while installing it on the second, it produces the following error:

In file included from examples_linux/mysgw.cpp:74:0:
./MySensors.h:254: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:290,
from examples_linux/mysgw.cpp:74:
./drivers/RF24/RF24.h:52:17: fatal error: SPI.h: No such file or directory
#include <SPI.h>

@gohan Thanks for the response. I downloaded the MySensors Library 2.1.1. Sorting through it I can see that SPI.h is included.

I installed a complete system in FL (I'm retired and a snowbird). Included are a Bunch of Arduino sensors, a Foscam Camera and Wemo switches. So I used a lot of material from MySensors to get the Arduino sensors up and running (great stuff: thanks to all those folks who created it). I then created a Raspberry Wireless (RF24) Gateway and installed Mosquitto to communicate with HomeAssistant. Took a while to configure HA, and I'm still learning.

I do not recall having a problem with the SPI library when assembling all this stuff. Upon return to Boston, I have made a number of improvements talking to the Raspberry in FL through TeamViewer (a great app). However, along the way, I corrupted the system in FL. It now limps. So, I started recreating the stuff in FL on a new SD card, encountering the SPI problem.

Since sending out my request for help, I found a backup version of my FL system on an SD card. Looking at it, the system seems to be whole and boots with no issues. mysgw works fine on it. So, I've added all my new stuff to this SD card and have tested it to make sure its working. Things are looking good and so, my immediate problem is solved (circumvented).

I still want to know what I am doing wrong with the gateway. I've learned a little bit of Python along the way. There, one installs a library. I know effectively nothing about C++. So, I've done nothing to install the library, only followed the instructions on the MySensors Raspberry Pi Gateway page.

@Luc3as Thanks for your response. No, in fact it was not enabled. Please read my reply to gohan. As you see, I've cheated my way out of this problem. In the process, I've lost track of the SD card on which I encountered this problem. Nonetheless, I will circle back to test your suggestion.

Try to enable the SPI first. Then you could also try different linux distributions and see which one you like better ( I personally like dietpi more than the others ). You may also want to try to use Mysensors library from development branch that is now 2.2.0.
I now have a dietpi + mysensors 2.2.0 + nrf24 and all running fine