MySensors icon indicating copy to clipboard operation
MySensors copied to clipboard

Rpi servicename

Open mfalkvidd opened this issue 5 years ago • 4 comments

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.

mfalkvidd avatar May 14 '20 13:05 mfalkvidd

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

mfalkvidd avatar May 16 '20 09:05 mfalkvidd

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.

mfalkvidd avatar May 16 '20 09:05 mfalkvidd

Is it this ready for testing. I want two use an RS485 and RF24 as two instance on a Raspberry

MySensors-MJChrist avatar Dec 14 '20 17:12 MySensors-MJChrist

Yes, you can use it with the caveat posted above.

mfalkvidd avatar Dec 14 '20 17:12 mfalkvidd