Nevermind....When I set "--my-serial-groupname=tty" in ./configure it works.
Best posts made by jerseyguy1996
-
RE: π¬ Building a Raspberry Pi Gateway
-
RE: MySensors & RPi?
@Nexus I see. I'm kinda thinking more and more that I may just switch to the arduino based serial gateway. It seems like there is more support for it in terms of keeping up with the mysensors development branch. I really liked the idea of just attaching the radio directly to the Raspi because I felt that it eliminated a potential point of failure but i'm probably wrong. Anyway this whole mysensors community is fantastic! Thanks for all of the hard work you guys do!
-
RE: openHAB binding
@bkl First off I want to thank you for the MySensors openhab binding. It works wonderfully!
In the MySensors 2.0 there is an internal message that doesn't seem to be handled by the binding. I believe it needs to be handled in MySensorsBinding.java. I would do it myself but my knowledge of Java sucks....to put it lightly. The internal message is:
I_DISCOVER_RESPONSE
so my openhab log keeps getting spammed with:
2016-10-21 22:16:21.653 [INFO ] [.b.m.internal.MySensorsBinding] - No item configured for "4;255;I_DISCOVER_RESPONSE" 2016-10-21 22:26:21.374 [INFO ] [.b.m.internal.MySensorsBinding] - No item configured for "4;255;I_DISCOVER_RESPONSE" 2016-10-21 22:36:22.127 [INFO ] [.b.m.internal.MySensorsBinding] - No item configured for "4;255;I_DISCOVER_RESPONSE" 2016-10-21 22:46:21.847 [INFO ] [.b.m.internal.MySensorsBinding] - No item configured for "4;255;I_DISCOVER_RESPONSE" 2016-10-21 22:56:21.569 [INFO ] [.b.m.internal.MySensorsBinding] - No item configured for "4;255;I_DISCOVER_RESPONSE"
I'm assuming that we just need to add a line to:
public void incommingMessage(Message message)
to handle it but I would rather let you do it since like I said....I suck with Java. Is that something that would be an easy fix?
-
RE: π¬ Building a Raspberry Pi Gateway
I'm using the virtual serial port option and one of the things that I notice is that the port gets created where the tty group only has write access.
pi@raspberrypi:/dev/pts $ ls -l total 0 crw--w---- 1 root tty 136, 0 Oct 10 18:49 0
I can change it manually but if I reboot the raspberry pi it goes back to write access only. How do I get it to be created with 'rw' access?
-
RE: π¬ Building a Raspberry Pi Gateway
You can pretty much test out using any of the arduino examples here:
https://github.com/mysensors/MySensors/tree/development/examples
Each one will present itself to the gateway when it starts up and you will see the presentation in the debug log. Make sure to run:
https://github.com/mysensors/MySensors/tree/development/examples/ClearEepromConfig
on the arduino first to make sure it starts with a fresh eeprom. After you select an Arduino sketch to test it with (seriously it doesn't matter which one you try) make sure to look at the sketch and add:
// Enable and select radio type attached #define MY_RADIO_NRF24 #define MY_NODE_ID 4
For MY_NODE_ID you can select any number. Just make sure that each new sensor node that you create has a different node number so like start out at MY_NODE_ID 1 and when you make another sensor node you can #define MY_NODE_ID 2 and so on.
Next load it up to the Arduino, open the serial monitor, and see what happens. If you watch the serial monitor on the arduino you will see it present itself to the gateway and then you can confirm it in the debug log on the raspberry pi.
I think it is pretty normal to have the problems you are having. I uninstalled and reinstalled the gateway 3 times on the Raspberry Pi before I finally got it all figured out. Once you get it running it is a glorious thing.
-
RE: π¬ Building a Raspberry Pi Gateway
I'm doing a brand new install of Openhab2 and the mysensors gateway on a new Raspberry Pi 4 after having run Openhab(1) and the mysensors gateway successfully on a Raspberry Pi 3 for years. I used the development branch of the mysensorsgateway as discussed here: https://github.com/mysensors/MySensors/pull/1364
I wrote down my step by step procedure here in case it helps someone else. I'm starting out with the pre-built Openhabian image found here: https://www.openhab.org/docs/installation/openhabian.html
Install the PiGatewaySerial using these instructions:
- First get to your Downloads directory
cd cd Downloads
- Clone the MySensors repository into your Downloads directory and then go into that folder
git clone https://github.com/mysensors/MySensors.git --branch development cd MySensors
- Set configuration options (you can use β./configure βhelpβ to see your options)
a. In this case we are choosing to use the serial gateway with a pseudo terminal and a symbolic link to that pseudoterminal called ttyUSB20 in /dev. We then set the group to tty.
./configure --my-gateway=serial --my-serial-is-pty --my-serial-pty=/dev/ttyUSB20 --my-serial-groupname=tty
Edit: If building this on a 64bit operating system you will need to edit the configure file before running make. Do the following:
cp configure configure_bk nano configure
Find this function
function gcc_cpu_flags { local soc=$1 case $soc in
and find your CPU. In my case it is the BCM2711 (I've only done this on this one CPU so your mileage may vary) and I changed this:
BCM2711) flags="-march=armv8-a+crc -mtune=cortex-a72 -mfpu=neon-fp-armv8 -mfloat-abi=hard"
to this:
BCM2711) flags="-march=armv8-a+crc -mtune=cortex-a72"
Then proceed to step 4 below.
- Run make and make install
make sudo make install
- We can set it to launch on boot up by running
sudo systemctl enable mysgw.service
- To launch it manually right now run (skip this step to run and see output for confirmation that it works)
sudo systemctl start mysgw.service
- Executable in located:
cd /usr/local/bin
- need root to run it:
sudo mysgw
That's pretty much it. I was happily greeted with:
Dec 29 16:01:50 INFO Starting gateway...
Dec 29 16:01:50 INFO Protocol version - 2.4.0-alpha
Dec 29 16:01:50 DEBUG Serial port /dev/ttyUSB20 (115200 baud) created
Dec 29 16:01:50 DEBUG MCO:BGN:INIT GW,CP=RNNGL---,FQ=NA,REL=0,VER=2.4.0-alpha
Dec 29 16:01:50 DEBUG TSF:LRT:OK
Dec 29 16:01:50 DEBUG TSM:INIT
Dec 29 16:01:50 DEBUG TSF:WUR:MS=0
Dec 29 16:01:50 DEBUG TSM:INIT:TSP OK
Dec 29 16:01:50 DEBUG TSM:INIT:GW MODE
Dec 29 16:01:50 DEBUG TSM:READY:ID=0,PAR=0,DIS=0
Dec 29 16:01:50 DEBUG MCO:REG:NOT NEEDED
Dec 29 16:01:50 DEBUG MCO:BGN:STP
Dec 29 16:01:50 DEBUG MCO:BGN:INIT OK,TSP=1
Dec 29 16:01:50 DEBUG TSM:READY:NWD REQ
Dec 29 16:01:50 DEBUG ?TSF:MSG:SEND,0-0-255-255,s=255,c=3,t=20,pt=0,l=0,sg=0,ft=0,st=OK:
Dec 29 16:01:50 DEBUG TSF:MSG:READ,4-4-0,s=255,c=3,t=21,pt=1,l=1,sg=0:0
Dec 29 16:01:50 DEBUG TSF:MSG:READ,0-4-255,s=255,c=3,t=20,pt=0,l=0,sg=0:
Dec 29 16:01:50 DEBUG TSF:MSG:BC
Dec 29 16:01:52 DEBUG TSF:MSG:READ,4-4-0,s=1,c=1,t=2,pt=2,l=2,sg=0:0
Dec 29 16:01:52 DEBUG TSF:MSG:READ,4-4-0,s=2,c=1,t=2,pt=2,l=2,sg=0:0
Dec 29 16:01:52 DEBUG TSF:MSG:READ,4-4-0,s=3,c=1,t=2,pt=2,l=2,sg=0:1
Dec 29 16:01:52 DEBUG TSF:MSG:READ,4-4-0,s=4,c=1,t=2,pt=2,l=2,sg=0:1
^CDec 29 16:02:35 NOTICE Received SIGINT