đź’¬ Building a Raspberry Pi Gateway
-
You're not being able to connect to your MQTT broker (Mosquitto or Moqutte as was in mycontroller.org). I havent used mycontroller so I cant help with that.
I use Mosquitto on the same Rpi (so just install mosquitto and mosquitto-clients). You should secure it but test first without credentials to get going. Remember to create credentials in mosquitto AND reconfig your gw
@MasMat I already managed to configure my gateway it already works with Mycontroller.org, I like the interface of this, but I was thinking if the nodes of my network, which are esp8266 can be configured an operating system like FreeRTOS, TinyOS or ApacHE MyNewt can be configured in my osp and handle all Mysensors processes?
There is a possibility or it is impossible -
@MasMat I already managed to configure my gateway it already works with Mycontroller.org, I like the interface of this, but I was thinking if the nodes of my network, which are esp8266 can be configured an operating system like FreeRTOS, TinyOS or ApacHE MyNewt can be configured in my osp and handle all Mysensors processes?
There is a possibility or it is impossible@Nicolás-Potier that's way way over my understanding and fluency with Mysensors. And way off topic, I think.
-
Hi all,
I want to launch gateway on RaspberryPi with a RS485 network.
I downloaded the software (MySensors Library v2.4.0-alpha).
And i made coniguration:
./configure --my-transport=rs485 --my-rs485-serial-port=/dev/ttyUSB0 --my-rs485-baudrate=9600 --my-gateway=serial --my-serial-is-pty --my-serial-port=/dev/ttyUSB20 -my-serial-baudrate=115200 -my-serial-groupname=ttyI have USB-RS485 (it uses FT232RL) converter connected to the /dev/ttyUSB0.
On the other side i have Arduino uno with UART-RS485 (MAX485) converter, and a MotionSensorRS485 example on it.After i made the program (make), and type sudo ./bin/mysgw, i've got this:

I'm able to add the hardware in domoticz (serial gateway ttyYSB20, 115200), but it doesn't see nodes.

Please help.
-
Hi all,
I want to launch gateway on RaspberryPi with a RS485 network.
I downloaded the software (MySensors Library v2.4.0-alpha).
And i made coniguration:
./configure --my-transport=rs485 --my-rs485-serial-port=/dev/ttyUSB0 --my-rs485-baudrate=9600 --my-gateway=serial --my-serial-is-pty --my-serial-port=/dev/ttyUSB20 -my-serial-baudrate=115200 -my-serial-groupname=ttyI have USB-RS485 (it uses FT232RL) converter connected to the /dev/ttyUSB0.
On the other side i have Arduino uno with UART-RS485 (MAX485) converter, and a MotionSensorRS485 example on it.After i made the program (make), and type sudo ./bin/mysgw, i've got this:

I'm able to add the hardware in domoticz (serial gateway ttyYSB20, 115200), but it doesn't see nodes.

Please help.
@rafal9318 please don't post the same question in multiple threads. Posting in multiple threads means the discussion is split. Important information might be available in one thread, but not the other, which means people have to ask you for that information multiple times. It is a waste of the community members' (including you) time.
If anyone can help @rafal9318 please respond in https://forum.mysensors.org/topic/11128/raspberrypi-4-as-a-gateway-controller
-
@rafal9318 please don't post the same question in multiple threads. Posting in multiple threads means the discussion is split. Important information might be available in one thread, but not the other, which means people have to ask you for that information multiple times. It is a waste of the community members' (including you) time.
If anyone can help @rafal9318 please respond in https://forum.mysensors.org/topic/11128/raspberrypi-4-as-a-gateway-controller
@mfalkvidd Okey, sorry.
-
I’m sorry if this is a newbie question. I have managed to create a controller using MyController on a Raspberry Pi. I have connected a NRF24l01 and created a gateway, and my controller picks up that I have a gateway present, so I assume my wiring is correct.
I have started to wire up the status LEDs, and this is where I am confused. I am used to using LEDs on PI, but connecting between he GPIO pin and ground, where the GPIO provides the voltage. The diagram above suggests that they should be permanently connected to the voltage and the GPIO provides the ground connection. Is this correct? And if it is, is it possible to test the LEDs? Thanks in advance. -
I’m sorry if this is a newbie question. I have managed to create a controller using MyController on a Raspberry Pi. I have connected a NRF24l01 and created a gateway, and my controller picks up that I have a gateway present, so I assume my wiring is correct.
I have started to wire up the status LEDs, and this is where I am confused. I am used to using LEDs on PI, but connecting between he GPIO pin and ground, where the GPIO provides the voltage. The diagram above suggests that they should be permanently connected to the voltage and the GPIO provides the ground connection. Is this correct? And if it is, is it possible to test the LEDs? Thanks in advance.@ej3-martin My LEDs come on when the Rpi boots (is that what you mean by testing?). Also you can invert the LEDs (on but blink off) if you want. I figured the wiring makes for better power delivery rather than feeding voltage from the GPIO
-
@MasMat I was purely wanting to find a way of testing them, to check my wiring, if they do come on during boot then this is a great way to test. It would also possibly be useful (for those of us less experienced) to have a script to run to check the wiring is correct. I think it much more useful to have them off, and blink on, and it was the wiring that confused me. I will have to see if I can investigate this further.
-
@MasMat I was purely wanting to find a way of testing them, to check my wiring, if they do come on during boot then this is a great way to test. It would also possibly be useful (for those of us less experienced) to have a script to run to check the wiring is correct. I think it much more useful to have them off, and blink on, and it was the wiring that confused me. I will have to see if I can investigate this further.
Since the pins are configurable before compilation, creating a script that uses the same settings as the compiled code would be pretty hard.
The easiest way with existing code is probably to add --my-leds-blinking-inverse to your configure command and start the gateway, as suggested by @MasMat
-
Just trying to figure out whether there is a switch or config file option for the channel, or whether the only option to change the channel is truly to recompile?!...
Just ran the Poor Man's scanner and channels 1-98 a a garbage mess, so I need to go >> 100, but am surprised the only option there seems to be a recompile?...
-
Just trying to figure out whether there is a switch or config file option for the channel, or whether the only option to change the channel is truly to recompile?!...
Just ran the Poor Man's scanner and channels 1-98 a a garbage mess, so I need to go >> 100, but am surprised the only option there seems to be a recompile?...
-
Sorry for the lack of response, life's been crazy... Thanks for the reply, I have since recompiled, but need to make some add'l changes to the sensor sketches, so I want to do all of that at once before I deploy to the new channel... ;)
-
Sorry for the lack of response, life's been crazy... Thanks for the reply, I have since recompiled, but need to make some add'l changes to the sensor sketches, so I want to do all of that at once before I deploy to the new channel... ;)
@Fear-na-Boinne if you want to be able to switch your rpi gateway between the old and the new channel while testing, you could try my patch which allows configurable service name
https://github.com/mysensors/MySensors/pull/1421
Or just skip running make install so you don’t overwrite the old gateway
-
@Fear-na-Boinne if you want to be able to switch your rpi gateway between the old and the new channel while testing, you could try my patch which allows configurable service name
https://github.com/mysensors/MySensors/pull/1421
Or just skip running make install so you don’t overwrite the old gateway
@mfalkvidd Just a quick update...
Been extremely busy, so not a lot of time, but when I run the recompiled version (channel 109) gateway and use the existing - known good - sensor sketches with the channel 109 macro declaration included, it doesn't connect at all.
When I run the "old" version of the gateway and the same sensor sketches with channel 109 commented out, it just-works™...More testing and such due I guess! :(
-
Is it possible to have the RPi4B, that is being used as the Webthings Gateway, also be the My Sensor controller once I add a NRF24L01+ module and follow steps above?
-
In case someone has similar issue:
Running everything latest up to date.Raspberry pi zero w with nrf24 connected directly on GPIO and domoticz. Had to have startup delay on mysgw service since domoticz wouldn't or couldn't start automatically on boot.
So i added to:
sudo nano /etc/systemd/system/mysgw.service[Service]
ExecStartPre=/bin/sleep 10Maybe 10 seconds is overkill, but at least it works now.
With raspberry pi 3b+ there wasn't that issue.Also in domoticz had to use raspi ip address, when setting up mysensors LAN gateway address, instead of localhost 127.0.0.1
And myscontroller OTA updates are working too.🙂
-
I'm new to MySensors. I'm trying to build an MQTT gateway with an nRF24 radio on my RPi 3B+. I follow the instructions here,
My radio is connected with CE on physical pin 15 (GPIO22) and CSN on physical pin 24 (GPIO8) I am confident this works has I was able to run the tMRH20 examplesI follow the instructions here on this web page
I configured with:
./configure --my-gateway=mqtt --my-controller-ip-address=127.0.0.1 --my-mqtt-publish-topic-prefix=mysensors-out --my-mqtt-subscribe-topic-prefix=mysensors-in --my-mqtt-client-id=mygateway1 --my-transport=rf24I run make but quickly error with "missing stropts.h" for which I found a fix "sudo touch /usr/include/stropts.h". I run make again after a many warnings it stops with Error 1. The last few lines:
re/Linux/drivers/core/compatibility.o build/hal/architecture/Linux/drivers/core/EthernetClient.o build/hal/architecture/Linux/drivers/core/EthernetServer.o build/hal/architecture/Linux/drivers/core/GPIO.o build/hal/architecture/Linux/drivers/core/interrupt.o build/hal/architecture/Linux/drivers/core/IPAddress.o build/hal/architecture/Linux/drivers/core/noniso.o build/hal/architecture/Linux/drivers/core/Print.o build/hal/architecture/Linux/drivers/core/SerialPort.o build/hal/architecture/Linux/drivers/core/SoftEeprom.o build/hal/architecture/Linux/drivers/core/SPIDEV.o build/hal/architecture/Linux/drivers/core/StdInOutStream.o build/hal/architecture/Linux/drivers/core/Stream.o build/examples_linux/mysgw.o build/hal/architecture/Linux/drivers/BCM/bcm2835.o build/hal/architecture/Linux/drivers/BCM/BCM.o build/hal/architecture/Linux/drivers/BCM/RPi.o build/hal/architecture/Linux/drivers/BCM/SPIBCM.o build/hal/architecture/Linux/drivers/BCM/Wire.o /usr/bin/ld: build/examples_linux/mysgw.o: in function `.LANCHOR1': /home/appian3344/MySensors/./hal/architecture/Linux/drivers/core/config.h:39: multiple definition of `conf'; build/hal/architecture/Linux/drivers/core/config.o:/home/appian3344/MySensors/hal/architecture/Linux/drivers/core/config.h:39: first defined here collect2: error: ld returned 1 exit status make: *** [Makefile:80: bin/mysgw] Error 1OK, what didn't I do right?
-
I'm new to MySensors. I'm trying to build an MQTT gateway with an nRF24 radio on my RPi 3B+. I follow the instructions here,
My radio is connected with CE on physical pin 15 (GPIO22) and CSN on physical pin 24 (GPIO8) I am confident this works has I was able to run the tMRH20 examplesI follow the instructions here on this web page
I configured with:
./configure --my-gateway=mqtt --my-controller-ip-address=127.0.0.1 --my-mqtt-publish-topic-prefix=mysensors-out --my-mqtt-subscribe-topic-prefix=mysensors-in --my-mqtt-client-id=mygateway1 --my-transport=rf24I run make but quickly error with "missing stropts.h" for which I found a fix "sudo touch /usr/include/stropts.h". I run make again after a many warnings it stops with Error 1. The last few lines:
re/Linux/drivers/core/compatibility.o build/hal/architecture/Linux/drivers/core/EthernetClient.o build/hal/architecture/Linux/drivers/core/EthernetServer.o build/hal/architecture/Linux/drivers/core/GPIO.o build/hal/architecture/Linux/drivers/core/interrupt.o build/hal/architecture/Linux/drivers/core/IPAddress.o build/hal/architecture/Linux/drivers/core/noniso.o build/hal/architecture/Linux/drivers/core/Print.o build/hal/architecture/Linux/drivers/core/SerialPort.o build/hal/architecture/Linux/drivers/core/SoftEeprom.o build/hal/architecture/Linux/drivers/core/SPIDEV.o build/hal/architecture/Linux/drivers/core/StdInOutStream.o build/hal/architecture/Linux/drivers/core/Stream.o build/examples_linux/mysgw.o build/hal/architecture/Linux/drivers/BCM/bcm2835.o build/hal/architecture/Linux/drivers/BCM/BCM.o build/hal/architecture/Linux/drivers/BCM/RPi.o build/hal/architecture/Linux/drivers/BCM/SPIBCM.o build/hal/architecture/Linux/drivers/BCM/Wire.o /usr/bin/ld: build/examples_linux/mysgw.o: in function `.LANCHOR1': /home/appian3344/MySensors/./hal/architecture/Linux/drivers/core/config.h:39: multiple definition of `conf'; build/hal/architecture/Linux/drivers/core/config.o:/home/appian3344/MySensors/hal/architecture/Linux/drivers/core/config.h:39: first defined here collect2: error: ld returned 1 exit status make: *** [Makefile:80: bin/mysgw] Error 1OK, what didn't I do right?
@OldSurferDude loos like it could be the same problem as https://github.com/mysensors/MySensors/pull/1454
In that case, applying the suggested fix manually, or using the development branch (where the fix is already included) should work.
-
@OldSurferDude loos like it could be the same problem as https://github.com/mysensors/MySensors/pull/1454
In that case, applying the suggested fix manually, or using the development branch (where the fix is already included) should work.
@mfalkvidd I implemented your suggestion of running the development branch. This didn't work for a different reason. Below my questions is what I did.
Questions:
o Is the gateway trying to connect to a controller such as Home Assistant (HA)?
o The IP address of 127.0.0.1 implies the controller is on the same machine. Would the gateway connect to a docker containerized HA?
o What example programs will connect to the RF24 radio side of the gateway? We could start off with a simple ONoff switch and progress to that node controlling a relay on another node. (passing the request through an MQTT broker?)
o Note that I made the assumption that the gateway doesn't distinguish between wired ethernet or WiFi. Is that a good assumption?Hardware RPi 3B+, nRF24 wired with CE to physical pin 15
OS: Raspbian GNU/Linux 11 (bullseye)It is assumed that deleting the MySensors folder will uninstall the existing master branch. (probably a bad assumption)
-
sudo rm -r MySensors
-
git clone https://github.com/mysensors/MySensors.git --branch development
-
cd MySensors
-
./configure --my-gateway=mqtt --my-controller-ip-address=127.0.0.1 --my-mqtt-publish-topic-prefix=mysensors-out --my-mqtt-subscribe-topic-prefix=mysensors-in --my-mqtt-client-id=mygateway1 --my-transport=rf24
note: It is stated that the default configuration is ethernet port 5003 (./configure --my-gateway=ethernet --my-port=5003)
It is assumed that the software doesn't distinguish between ethernet and WiFi -
make
many compiler warnings -
Start gateway with
sudo ./bin/mysgwwhich results in:
Apr 04 12:12:37 INFO Config file /etc/mysensors.conf does not exist, creating new file.
Apr 04 12:12:37 INFO Starting gateway...
Apr 04 12:12:37 INFO Protocol version - 2.4.0-alpha
Apr 04 12:12:37 INFO EEPROM file /etc/mysensors.eeprom does not exist, creating new file.
Apr 04 12:12:37 DEBUG MCO:BGN:INIT GW,CP=RNNGL---,FQ=NA,REL=0,VER=2.4.0-alpha
Apr 04 12:12:37 DEBUG TSF:LRT:OK
Apr 04 12:12:37 DEBUG TSM:INIT
Apr 04 12:12:37 DEBUG TSF:WUR:MS=0
Apr 04 12:12:37 DEBUG TSM:INIT:TSP OK
Apr 04 12:12:37 DEBUG TSM:INIT:GW MODE
Apr 04 12:12:37 DEBUG TSM:READY:ID=0,PAR=0,DIS=0
Apr 04 12:12:37 DEBUG MCO:REG:NOT NEEDED
Apr 04 12:12:37 DEBUG MCO:BGN:STP
Apr 04 12:12:37 DEBUG MCO:BGN:INIT OK,TSP=1followed by repeating:
Apr 04 12:12:37 DEBUG GWT:RMQ:CONNECTING...
Apr 04 12:12:37 ERROR connect: Connection refused
Apr 04 12:12:37 ERROR failed to connect
Apr 04 12:12:38 DEBUG !GWT:RMQ:FAIL
Apr 04 12:12:38 DEBUG TSM:READY:NWD REQ
Apr 04 12:12:40 DEBUG ?TSF:MSG:SEND,0-0-255-255,s=255,c=3,t=20,pt=0,l=0,sg=0,ft=0,st=OK:
Assumed that it failed to connect to an MQTT broker and the my-controller-ip-address is a broker address
Changed the --my-controller-ip-address to that of my MQTT broker (It is assumed that the default MQTT port is used)
repeat step 4. with the change and step 5. and 6.
no joy same output
Restarted with step 1 with changes
no joy same output -