💬 Building a Raspberry Pi Gateway
-
Hi Guys,
Is anyone here using the Pi with OTA updates? I'm finding them painfully slow (1-2 stream messages every few seconds). It's taking 1 hour per OTA update compared with 2-3 minutes when using the Arduino gateway!
-
Hey guys,
I tried to setup my Raspberry running Node-RED and serial gateway but I got stuck halfway. I followed the serial gateway compilation above and got it up and running, however using the serial nodes an Node-RED I could not manage to get them to connect tho the gateway.
First I tried to connect to
/dev/ttyMySensorsGatewaywhich did not work due to permissions (owned by root). When checking out/dev/ttyMySensorsGatewayI found it links to/dev/pts/1
which belongs to root and the tty group. But I could not connect to this as the tty group only has write privileges. I think I miss some crucial point connecting those two together so I hope somebody can save the day by pointing me in the right direction.Thanks in advance,
mirodin -
-
So you run a separate arduino board as a mysensors gateway, connected with serial (USB) to your raspberry pi? Or do you mean that you are using the rpi directly with radio, and then run the rpi variant of the mysensors gateway code?
@tbowmo I run the gateway on my Pi directly with the radio is connected to the Pi's GPIOs. Compilation and gateway do just fine I, if only I could convince my Pi to let Node-RED talk to the device :D
EDIT:
This is my output:dietpi@buddy:~ $ ll /dev/ttMySensorsGateway lrwxrwxrwx 1 root root 10 Jun 18 14:38 /dev/ttMySensorsGateway -> /dev/pts/2 dietpi@buddy:~ $ ll /dev/pts/ total 0 crw--w---- 1 dietpi tty 136, 0 Jun 18 14:38 0 crw--w---- 1 dietpi tty 136, 1 Jun 18 14:38 1 crw--w---- 1 root tty 136, 2 Jun 18 14:38 2 crw--w---- 1 dietpi tty 136, 3 Jun 18 14:38 3 c--------- 1 root root 5, 2 Nov 3 2016 ptmx -
Unfortunately adding my nodered user to dialout did not bring the hoped success. I still get premission denied messages after a reboot of my raspberry.
As my console print above shows the
/dev/ptsdevice belongs to tty but adding nodered to tty did not work out either (since the group only has write privileg). I have no idea how to fix this other then chowning the port to nodered but that feels wrong for me after years using linux based systems. -
My 5 cents:
Run it as a MQTT gateway, if possible. It makes things so much easier, when you interact with the data in node-red. Even integrating other controllers is easier, as you have the MQTT as standard backbone bus between everything.You need to have a MQTT broker (mosquitto) running as well.. But it's worth it..
-
Yes I came to the conclusion that this might be my only option even if it sucks as I have to subscribe to all events from MySensors, process them with Node-RED and republish again which screws my logging a bit. Right now I have another flow subscribed to "#" and write every event into my DB.
Since I have everything talking to mosquitto setup to follow Homie Convention I was hoping for only having my MQTT broker bombarded with compliant messages and have Node-RED convert everything (assign device names, etc. using a SQLite DB) from serial so the rather cryptic MySensors topics do not show up there.
-
Yes I came to the conclusion that this might be my only option even if it sucks as I have to subscribe to all events from MySensors, process them with Node-RED and republish again which screws my logging a bit. Right now I have another flow subscribed to "#" and write every event into my DB.
Since I have everything talking to mosquitto setup to follow Homie Convention I was hoping for only having my MQTT broker bombarded with compliant messages and have Node-RED convert everything (assign device names, etc. using a SQLite DB) from serial so the rather cryptic MySensors topics do not show up there.
-
Well... I think I fixed it, let's hear it for documentation. Just when I had MQTT setup half way I got struck by the idea that there was some group flag for
configure. And indeed there is, setting--my-serial-groupname=nodereddid the trick making/dev/pts/Xowned by group nodered and let Node-RED connect to it, writing and reading works just fine now.Thanks @gohan for your input I think I would have gone the ethernet route in the end if this last test had failed.
-
I am currently trying to update to 2.3
Have stopped service and deleted the file (systemctl status mysgw -> Unit mysgw.service could not be found.)
Also renamed the config file /etc/mysensors.dat
Renamed the old folder, then copied new files.
Checked readme.md in MySensors-folder: MySensors Library v2.3.0
Then I configured the radio and -> make, no errors
However, changing to bin folder and executing mysgw shows: Protocol 2.2.0
What am I missing? -
I am currently trying to update to 2.3
Have stopped service and deleted the file (systemctl status mysgw -> Unit mysgw.service could not be found.)
Also renamed the config file /etc/mysensors.dat
Renamed the old folder, then copied new files.
Checked readme.md in MySensors-folder: MySensors Library v2.3.0
Then I configured the radio and -> make, no errors
However, changing to bin folder and executing mysgw shows: Protocol 2.2.0
What am I missing? -
I am currently trying to update to 2.3
Have stopped service and deleted the file (systemctl status mysgw -> Unit mysgw.service could not be found.)
Also renamed the config file /etc/mysensors.dat
Renamed the old folder, then copied new files.
Checked readme.md in MySensors-folder: MySensors Library v2.3.0
Then I configured the radio and -> make, no errors
However, changing to bin folder and executing mysgw shows: Protocol 2.2.0
What am I missing? -
@inso Did you
sudo make installafter building it? This command copies the service file and mysgw to their respective locations.@mirodin
make install before testing did the trick, now it is 2.3.0 . :smiley:
Was just going step by step through tutorial, there it´s make -> test -> make install. Didn´t realized it would use old parts if it´s not first install :relaxed:@gohan
thought stop, disable and remove the service would be enough to ensure the service is completely "uninstalled" - could you give me a hint what I´ve missed? :sweat_smile: -
Hi,
I try to access log info from my gateway installed on my domoticz raspberry pi, but I get no success..
First, I can't find the mysensors.conf file : nothing in the /etc folder. I tried to use "find / -name 'mysensors.conf' 2>/dev/null" command, but it finds nothing.
I tried creating such a file (then it's found by the fond command above) and in which I have the lineslog_pipe=0 log_pipe_file=/tmp/mysgw.pipeas instructed above.
I restarted the wole Raspberry PI, then tried the command cat /tmp/mysgw.pipe but error message:cat: /tmp/mysgw.pipe: Aucun fichier ou dossier de ce type(= no file or folder like that)
I then tried this: sudo mysgw -c /etc/mysensors.conf and I got also error message:mysgw: invalid option -- 'c'I installed the Mysensor gateway on 17th October 2017 and my raspberry pi is working on Wheezy. In Domoticz, I see the Mysensor gateway has version 2.1.1.
MY gateway seems working fine, communicating properly with sensors (both ways). I'm trying to find log because I face an issue with a new sensor which works properly when powered with external FTDI 3.3V and only 1 way (sensor to gateway only) when powered on battery (I raised question in another post, where I was suggested to check log fil on gtw side..)Any idea of what I should do (except "reinstall whole raspberry pi with latest OS..) ?
Thanks a lot,
Ricorico