MySensors
MySensors copied to clipboard
Rpi servicename
An attempt to implement the feature requested in https://github.com/mysensors/MySensors/issues/1407
If you can, please test and give feedback.
I am worried that people will use this new feature without thinking, and start multiple instances with the same eeprom file and/or config file. That would get them into big trouble.
This is how I tested:
pi@raspberrypi:~/MySensors $ ./configure --service-name=my2ndmysgw --my-port=5333
pi@raspberrypi:~/MySensors $ make
pi@raspberrypi:~/MySensors $ sudo make install
Installing bin/my2ndmysgw to /usr/local/bin
install -m0644 initscripts/mysgw.systemd /etc/systemd/system/my2ndmysgw.service
systemctl daemon-reload
MySensors gateway has been installed, to add to the boot run:
sudo systemctl enable my2ndmysgw.service
To start the gateway run:
sudo systemctl start my2ndmysgw.service
pi@raspberrypi:~/MySensors $ sudo systemctl enable my2ndmysgw.service
Created symlink /etc/systemd/system/multi-user.target.wants/my2ndmysgw.service → /etc/systemd/system/my2ndmysgw.service.
pi@raspberrypi:~/MySensors $ sudo systemctl start my2ndmysgw.service
/tmp/mysgw.log:
May 16 11:12:46 my2ndmysgw INFO Using log file /tmp/mysgw.log
May 16 11:12:46 my2ndmysgw INFO Starting gateway...
May 16 11:12:46 my2ndmysgw INFO Protocol version - 2.4.0-alpha
May 16 11:12:46 my2ndmysgw INFO Using eeprom file /etc/mysensors.eeprom
May 16 11:12:46 my2ndmysgw DEBUG MCO:BGN:INIT GW,CP=RNNGL---,FQ=NA,REL=0,VER=2.4.0-alpha
May 16 11:12:46 my2ndmysgw DEBUG TSF:LRT:OK
May 16 11:12:46 my2ndmysgw DEBUG TSM:INIT
May 16 11:12:46 my2ndmysgw DEBUG TSF:WUR:MS=0
pi@raspberrypi:~/MySensors $ sudo make uninstall
Stopping daemon my2ndmysgw (ignore errors)
removing files
rm /etc/systemd/system/my2ndmysgw.service /usr/local/bin/my2ndmysgw
THIS IS NOT READY FOR MERGE
My main concern for this feature is that people will start multiple instances without changing the eeprom config file. If 2 or more gateways use the same eeprom file, behavior will not be good and users will be mightily confused.
Is it this ready for testing. I want two use an RS485 and RF24 as two instance on a Raspberry
Yes, you can use it with the caveat posted above.