MySensors Raspberry port suggestions
-
Add some options to the gateway execution:
# ./examples_linux/mysGateway -h Usage: mysGateway [options] Options: -h Display a short summary of all program options. -d Enable debug. -b Become a daemon.Debug is now disabled by default.
You can't run it as a linux daemon if debug is enabled.
When daemonized all messages will be print to syslog.@marceloaqno Interesting. When I execute "mysGateway -h" I get the following:
pi@m:~/MySensors/examples_linux $ mysGateway -h MCO:BGN:INIT GW,CP=RNNG---,VER=2.0.1-beta TSM:INIT Segmentation faultWhat does "Segmentation fault' mean please?
-
@alexsh1 You must be root to run the gateway:
$ sudo mysGatewayIt seems that you are not using the latest version, -h should have shown you the options list.
-
@alexsh1 You must be root to run the gateway:
$ sudo mysGatewayIt seems that you are not using the latest version, -h should have shown you the options list.
@marceloaqno I have the latest version (downloaded yesterday). Thanks very much for your help. I got the following:
pi@m:~/MySensors/examples_linux $ sudo mysGateway -h MCO:BGN:INIT GW,CP=RNNG---,VER=2.0.1-beta TSM:INIT TSM:INIT:TSP OK TSM:INIT:GW MODE TSM:READY MCO:REG:NOT NEEDED MCO:BGN:STP MCO:BGN:INIT OK,ID=0,PAR=0,DIS=0,REG=1In Domoticz:
2016-09-09 09:32:26.032 TCP: Reconnecting... 2016-09-09 09:32:26.032 MySensors: connected to: 127.0.0.1:5003I added MySensors with LAN in Domoticz (port 5003), but here a problem. I can see the node and the GW communicating:
GW:
TSF:MSG:READ,255-255-0,s=255,c=3,t=3,pt=0,l=0,sg=0: TSF:MSG:READ,255-255-0,s=255,c=3,t=3,pt=0,l=0,sg=0: TSF:MSG:READ,255-255-0,s=255,c=3,t=3,pt=0,l=0,sg=0: Client 0: 0;0;3;0;18;PING TSF:MSG:READ,255-255-0,s=255,c=3,t=3,pt=0,l=0,sg=0: TSF:MSG:READ,255-255-0,s=255,c=3,t=3,pt=0,l=0,sg=0: Client 0: 0;0;3;0;18;PINGStarting sensor (RNNNA-, 2.0.0-beta) Radio init successful. req id send: 255-255-0-0 s=255,c=3,t=3,pt=0,l=0,sg=0,st=ok: req id send: 255-255-0-0 s=255,c=3,t=3,pt=0,l=0,sg=0,st=ok: req id send: 255-255-0-0 s=255,c=3,t=3,pt=0,l=0,sg=0,st=ok: req id send: 255-255-0-0 s=255,c=3,t=3,pt=0,l=0,sg=0,st=ok: Init complete, id=255, parent=0, distance=1 requesting time req id send: 255-255-0-0 s=255,c=3,t=3,pt=0,l=0,sg=0,st=ok: requesting time req id send: 255-255-0-0 s=255,c=3,t=3,pt=0,l=0,sg=0,st=ok: requesting time req id send: 255-255-0-0 s=255,c=3,t=3,pt=0,l=0,sg=0,st=ok: requesting time req id send: 255-255-0-0 s=255,c=3,t=3,pt=0,l=0,sg=0,st=ok: requesting time req id send: 255-255-0-0 s=255,c=3,t=3,pt=0,l=0,sg=0,st=ok:The RF communication is fine, but I do not understand why Domoticz is not assigning ID.......
EDIT: I can see in Domoticz in the Hardware section:
MySensors Gateway with LAN interface Version: ? SetupTypically ? comes up when the controller is not recognised or not connected
EDIT2:Deleted and started fresh. Unfortunately, now the log file is flooded with the following:
mysGateway: Max number of ethernet clients reached. mysGateway: Max number of ethernet clients reached. mysGateway: Max number of ethernet clients reached. mysGateway: Max number of ethernet clients reached. mysGateway: Max number of ethernet clients reached. mysGateway: Max number of ethernet clients reached. mysGateway: Max number of ethernet clients reached. mysGateway: Max number of ethernet clients reached. mysGateway: Max number of ethernet clients reached. mysGateway: Max number of ethernet clients reached. mysGateway: Max number of ethernet clients reached. mysGateway: Max number of ethernet clients reached. mysGateway: Max number of ethernet clients reached. -
@marceloaqno I have the latest version (downloaded yesterday). Thanks very much for your help. I got the following:
pi@m:~/MySensors/examples_linux $ sudo mysGateway -h MCO:BGN:INIT GW,CP=RNNG---,VER=2.0.1-beta TSM:INIT TSM:INIT:TSP OK TSM:INIT:GW MODE TSM:READY MCO:REG:NOT NEEDED MCO:BGN:STP MCO:BGN:INIT OK,ID=0,PAR=0,DIS=0,REG=1In Domoticz:
2016-09-09 09:32:26.032 TCP: Reconnecting... 2016-09-09 09:32:26.032 MySensors: connected to: 127.0.0.1:5003I added MySensors with LAN in Domoticz (port 5003), but here a problem. I can see the node and the GW communicating:
GW:
TSF:MSG:READ,255-255-0,s=255,c=3,t=3,pt=0,l=0,sg=0: TSF:MSG:READ,255-255-0,s=255,c=3,t=3,pt=0,l=0,sg=0: TSF:MSG:READ,255-255-0,s=255,c=3,t=3,pt=0,l=0,sg=0: Client 0: 0;0;3;0;18;PING TSF:MSG:READ,255-255-0,s=255,c=3,t=3,pt=0,l=0,sg=0: TSF:MSG:READ,255-255-0,s=255,c=3,t=3,pt=0,l=0,sg=0: Client 0: 0;0;3;0;18;PINGStarting sensor (RNNNA-, 2.0.0-beta) Radio init successful. req id send: 255-255-0-0 s=255,c=3,t=3,pt=0,l=0,sg=0,st=ok: req id send: 255-255-0-0 s=255,c=3,t=3,pt=0,l=0,sg=0,st=ok: req id send: 255-255-0-0 s=255,c=3,t=3,pt=0,l=0,sg=0,st=ok: req id send: 255-255-0-0 s=255,c=3,t=3,pt=0,l=0,sg=0,st=ok: Init complete, id=255, parent=0, distance=1 requesting time req id send: 255-255-0-0 s=255,c=3,t=3,pt=0,l=0,sg=0,st=ok: requesting time req id send: 255-255-0-0 s=255,c=3,t=3,pt=0,l=0,sg=0,st=ok: requesting time req id send: 255-255-0-0 s=255,c=3,t=3,pt=0,l=0,sg=0,st=ok: requesting time req id send: 255-255-0-0 s=255,c=3,t=3,pt=0,l=0,sg=0,st=ok: requesting time req id send: 255-255-0-0 s=255,c=3,t=3,pt=0,l=0,sg=0,st=ok:The RF communication is fine, but I do not understand why Domoticz is not assigning ID.......
EDIT: I can see in Domoticz in the Hardware section:
MySensors Gateway with LAN interface Version: ? SetupTypically ? comes up when the controller is not recognised or not connected
EDIT2:Deleted and started fresh. Unfortunately, now the log file is flooded with the following:
mysGateway: Max number of ethernet clients reached. mysGateway: Max number of ethernet clients reached. mysGateway: Max number of ethernet clients reached. mysGateway: Max number of ethernet clients reached. mysGateway: Max number of ethernet clients reached. mysGateway: Max number of ethernet clients reached. mysGateway: Max number of ethernet clients reached. mysGateway: Max number of ethernet clients reached. mysGateway: Max number of ethernet clients reached. mysGateway: Max number of ethernet clients reached. mysGateway: Max number of ethernet clients reached. mysGateway: Max number of ethernet clients reached. mysGateway: Max number of ethernet clients reached.@alexsh1 There is a bug with --my-controller-ip-address, I'm not sure if it's your case, but try to avoid it.
I tried Domoticz here and everything seems fine:
MySensors Gateway with LAN interface Version: 2.0.1-beta (Setup)I recommend you to start from scratch, re-download the gateway from here:
https://github.com/marceloaqno/MySensors/tree/dev-raspberrypi -
@alexsh1 There is a bug with --my-controller-ip-address, I'm not sure if it's your case, but try to avoid it.
I tried Domoticz here and everything seems fine:
MySensors Gateway with LAN interface Version: 2.0.1-beta (Setup)I recommend you to start from scratch, re-download the gateway from here:
https://github.com/marceloaqno/MySensors/tree/dev-raspberrypi@marceloaqno OK, this must be the reason. I have tried the serial setup and it worked with a little tweak:
/dev/ttyUSB20 -> /dev/ttyMySensorsGatewayFor whatever reason Domoticz did not see ttyMySensorsGateway so I had to create ttyUSB20
-
@marceloaqno OK, this must be the reason. I have tried the serial setup and it worked with a little tweak:
/dev/ttyUSB20 -> /dev/ttyMySensorsGatewayFor whatever reason Domoticz did not see ttyMySensorsGateway so I had to create ttyUSB20
@alexsh1 said:
For whatever reason Domoticz did not see ttyMySensorsGateway so I had to create ttyUSB20
Domoticz seems to only look for ttyUSB* interfaces. One easy trick is to run ./configure with this option so you don't have to worry with symlinking
./configure --my-serial-pty=/dev/ttyUSBMySensorsGatewayBTW @marceloaqno , what does the option --my-serial-is-pty exactly do?
So far I've been running the gateway in ethernet mode for a little while and it's working flawlessly, thanks a lot for this port. -
@alexsh1 said:
For whatever reason Domoticz did not see ttyMySensorsGateway so I had to create ttyUSB20
Domoticz seems to only look for ttyUSB* interfaces. One easy trick is to run ./configure with this option so you don't have to worry with symlinking
./configure --my-serial-pty=/dev/ttyUSBMySensorsGatewayBTW @marceloaqno , what does the option --my-serial-is-pty exactly do?
So far I've been running the gateway in ethernet mode for a little while and it's working flawlessly, thanks a lot for this port. -
@emc2 said:
./configure --my-serial-pty=/dev/ttyUSBMySensorsGateway
Exallent fix! Thanks
@marceloaqno I can confirm that the Ethernet GW works fine without --my-controller-ip-address
MAny thanks for your port and help!@alexsh1 said:
I can confirm that the Ethernet GW works fine without --my-controller-ip-addressJust a guess, I see on your previous post that you used --my-controller-ip-address=127,0,0,1 it may have been a typo here, but did you try with --my-controller-ip-address=127.0.0.1? (dots instead of commas in the IP)?
-
@alexsh1 said:
I can confirm that the Ethernet GW works fine without --my-controller-ip-addressJust a guess, I see on your previous post that you used --my-controller-ip-address=127,0,0,1 it may have been a typo here, but did you try with --my-controller-ip-address=127.0.0.1? (dots instead of commas in the IP)?
-
Good to know then, thanks!
-
BTW, I am using a nice adapter for nrf24l01+ LNA+PA designed by @GertSanders :
https://www.openhardware.io/view/17/Raspberry-Pi2-GPIO-interface-for-NRF24L01Works nicely with this port and RPi 3.
-
Same, I had one Pi with GertSanders adapter and now switched to the SMD versions to fit nicely in my case.
https://www.openhardware.io/view/105/MySRaspiGW
https://www.openhardware.io/view/116/MySRaspiGW-PALNAInterestingly the regular one is working better than the PA+LNA version since moved to 2.0, at least in term of sending commands. Receiving is fine. Compiling with --my-rf24-pa-level=RF24_PA_LOW helps a lot. It seems 2.0 is really more power hungry, any hope to optimize this?
Which remind me of one thing, sorry to bother you again @marceloaqno (how) is the --my-rf24-irq-pin=<PIN> working?
I installed wiringpi to get rid of the wiringPiISR: Can't find gpio program but I'm not sure if it's supposed to do anything in the long term.
I was thinking updating the design of my PCB to link BCM 24 (pin 18) to the IRQ pin of the radio module but it's unclear to me if the IRQ will ever actually be used on the gateway. -
Those are cool adapters, I need to build one for me.
@emc2 It's no bother at all!
Using nrf24 IRQ pin can give you more throughput and less chance of losing messages. It makes more sense to use if you have many sensors or need to transfer binary data (https://forum.mysensors.org/topic/3594/solar-powered-observation-nesting-box-network/).--my-serial-is-pty will simulate a serial port and create a symbolic link to it instead of using a real one.
-
Those are cool adapters, I need to build one for me.
@emc2 It's no bother at all!
Using nrf24 IRQ pin can give you more throughput and less chance of losing messages. It makes more sense to use if you have many sensors or need to transfer binary data (https://forum.mysensors.org/topic/3594/solar-powered-observation-nesting-box-network/).--my-serial-is-pty will simulate a serial port and create a symbolic link to it instead of using a real one.
@marceloaqno Thanks for the heads up.
I'm totally happy with the ethernet version, but as it seems @hek is in the process of writing guides on https://www.mysensors.org/build/raspberry I did a few tests.If I understood correctly (and it seems to work), to "replace" the 1.x serial gateway with the new one running the following command should work as is (/dev/ttyUSBMySensorsGateway can be renamed to /dev/ttyMySensorsGateway to be exactly as in 1.x or /dev/ttyUSB20 to bypass the symlink step)
./configure --my-gateway=serial --my-serial-is-pty --my-serial-pty=/dev/ttyUSBMySensorsGateway --my-rf24-pa-level=RF24_PA_LOW--my-rf24-pa-level=RF24_PA_LOW can be omitted, especially if not using a PA+LNA module, but it seems 2.0 is really more power hungry than 1.4.
@marceloaqno said:
Those are cool adapters, I need to build one for me.
If you are interested by the SMD ones, PM me your address and I will happily send you something!
-
@marceloaqno The mechanism for assigning the pty serial port the specified group ownership doesn't appear to be working. The pty port is always created with root:root ownership. Can you (or anyone else) confirm whether this is working for you? I'm on a Raspberry Pi 2 running Raspian Jessie. Thanks.
-
@marceloaqno The mechanism for assigning the pty serial port the specified group ownership doesn't appear to be working. The pty port is always created with root:root ownership. Can you (or anyone else) confirm whether this is working for you? I'm on a Raspberry Pi 2 running Raspian Jessie. Thanks.
@emc2 I appreciate the offer for the adapter, but my country's post is a little complicated (to say the least).
@hawk_2050 /dev/ttyUSBMySensorsGateway (or any other parameter you pass to --my-serial-pty) is a symbolic link:
$ ls -lah /dev/ttyMySensorsGateway lrwxrwxrwx 1 root root 10 Sep 16 12:39 /dev/ttyMySensorsGateway -> /dev/pts/2In this case it is pointing to /dev/pts/2 but can vary, and it's the one who holds the specified group ownership.
-
@emc2 I appreciate the offer for the adapter, but my country's post is a little complicated (to say the least).
@hawk_2050 /dev/ttyUSBMySensorsGateway (or any other parameter you pass to --my-serial-pty) is a symbolic link:
$ ls -lah /dev/ttyMySensorsGateway lrwxrwxrwx 1 root root 10 Sep 16 12:39 /dev/ttyMySensorsGateway -> /dev/pts/2In this case it is pointing to /dev/pts/2 but can vary, and it's the one who holds the specified group ownership.
@marceloaqno Up to you. I don't mind giving it a shot, if I send you the pcb alone it will fit in a regular letter and should not even have to go through customs etc. Worst case scenario it won't reach you.
-
@ericvdb That's right. I hope to add support for RFM69, Serial and software signing very soon.
To use, clone the raspberryPi port for MySensors 2.0:
git clone https://github.com/marceloaqno/MySensors.git cd MySensorsTo configure it, take a look at the options available within configure:
./configure --helpFor other options, you may have to edit the sample file example_linux/mysGateway.cpp, and uncoment what you need.
Once done, run:
make sudo make installTo run the gateway you need to be root or use sudo:
sudo msyGateway -hFor wiring, follow this guide:
https://forum.mysensors.org/topic/2437/step-by-step-procedure-to-connect-the-nrf24l01-to-the-gpio-pins-and-use-the-raspberry-as-a-serial-gateway-mysensors-1-x@marceloaqno , I assume your link for the wiring pinout behind the link is for Raspi 1 A+ with 26 pin header? Or for which version?
I'd like to try this with raspi 2 B, would you have instructions how to wire it?
Raspi2:

Raspi1:

Thanks
-
