Added support for local MySensors RPI direct radio connection
Recently i added support for custom created serial ports. This also means support for the local MySensors RPI<->NRF connection using the RPI GPIO pins is supported. I have just tested it and can confirm it working, follow the screenshots below as a small howto for the connection.
First, get the nrf working on the Raspberry Pi and make sure it talks to nodes.
Add the custom port
As PiDome works with libudev and is triggered an hardware added/disconnected signalling it also means that if you add a custom port (for example with /dev/ttyMySensorsGateway) which does not trigger hardware added signalling, the port is not recognized.
So an option is added to PiDome to add a custom serial port.
Go to Management > Peripherals
Click on the "Add custom port" button
The server will traverse the /dev/ directory and look for /dev/tty* ports and show them in the drop down menu. Here you can select the MySensors local serial port and give it a name. It's like naming your own hardware
Click create Hardware (Future naming will be Create port link)
The port reference is now created, it will get a yellow label with the text "Attentions/Settings" Which is normal as you need to supply connection settings. If /dev/ttyMySensorsGateway would be triggered automatically you step 1 and 2 where not needed but you would also get the yellow label.
Set your connection settings
Click on the newly added MySensors port you have created with the yellow label, a popup with connection settings will appear. Set the connection settings as shown in the screenshot with of course the created port. And yes select the USB driver as it is compatible.
Press Set and start
If all goes well you will see the same as below with a green success label.
Check the settings
Not really an added step but handy to know you can check the connect settings by clicking on added mysensors driver. You will see something like shown below. P.S. This window is also used to disconnect the hardware. Just in case you had some wrong settings you can click disconnect and reconnect later on.
Check stuff works
Got to Management > Drivers and click on the MySensors driver. When you see "Gateway Startup complete" You have made a successful connection. If not check your wiring and/or connection settings.
I have tested it with the PingPong sketch and the screenshot below conforms it working
There are two things:
- It is possible you will be seeing that the server load is 100% as a message in the web interface. This is due to the /dev/mysensorsgateway. When you connect the server with serial settings the load will lower.
- PiDome only works with the gateway when the gateway works. So if there is any issue, first check the gateway unless you have seen gateway started.
P.S. PiDome will remember the custom added port and the configuration is written to config/hardconf/cust_serial/. Normally the server would remove these links from it's configuration of they are non-existing. So when you reboot your PI the port reference still exists.
If you want it all to go automatically after reboot make sure the pigateway is started before PiDome is started. Otherwise you have to set the connection settings manually again.
I'm about to try this and the current version of PiDome looks a little different. Is there anything that have changed about this setup?
Yes, but this is mainly visuals, the routines all stay the same.