pull/170/head
Fredrik Öhrström 2020-09-02 14:36:10 +02:00
rodzic 1378d50700
commit 8e6d39492d
3 zmienionych plików z 19 dodań i 35 usunięć

Wyświetl plik

@ -30,14 +30,26 @@ Availability of **wmbusmeters** for other Linux distributions can be checked on
Remove the wmbus dongle (im871a,amb8465,rfmrx2,cul,d1tc) or the generic rtlsdr dongle (RTL2838) from your computer.
`make; sudo make install` will install wmbusmeters as a daemon that starts
automatically when an appropriate wmbus usb dongle is inserted in the computer.
`make; sudo make install` will install wmbusmeters as a daemon.
Check the contents of your `/etc/wmbusmeters.conf` file, assuming it
has `device=auto` and you are using a im871a,amb8465 or cul device,
then you can now start the daemon with `sudo systemctl start wmbusmeters`.
When the daemon is running it will scan for wmbus devices every few seconds
and detect whenever a device is plugged in or removed.
To have wmbusmeters start automatically when the computer boots do:
`sudo systemctl enable wmbusmeters`
You can trigger a reload of the config files with `sudo killall -HUP wmbusmetersd`
(Note! make install only works for GNU/Linux. For MacOSX try to start
`wmbusmetersd /tmp/thepidfile` from a script instead. Here you can also override the device:
`wmbusmetersd --device=/dev/ttyXXY --listento=t1 /tmp/thepidfile`)
Check the config file /etc/wmbusmeters.conf and edit the device to
point to your dongle.
point to your dongle or use auto
```
loglevel=normal
device=/dev/ttyUSB0:im871a
@ -158,8 +170,7 @@ As <options> you can use:
As <device> you can use:
auto, to have wmbusmeters look for the links /dev/im871a, /dev/amb8465, /dev/rfmrx2 and /dev/rtlsdr
(the links are automatically generated by udev if you have run the install scripts)
auto, to have wmbusmeters look existing serial devices and probe them to detect: im871a, amb8465 or cul.
/dev/ttyUSB0:amb8465, if you have an amb8465 dongle assigned to ttyUSB0. Other suffixes are im871a,rfmrx2,d1tc,cul.
@ -395,7 +406,6 @@ Binary generated: `./wmbusmeters_0.8_armhf.deb`
`/usr/bin/wmbusmeters`
`/usr/sbin/wmbusmetersd`
`/etc/systemd/system/wmbusmeters.service`
`/etc/udev/rules.d/99-wmbus-usb-serial.rules`
`/etc/logrotate.d/wmbusmeters`
creates these directories:
@ -404,34 +414,6 @@ creates these directories:
and adds the user `wmbusmeters` with no login account.
This means that when a im871a/amb8465 dongle is inserted, then the
appropriate /dev/im871a or /dev/amb8465 link is created. Also the
wmbusmeters daemon will be automatically started/stopped whenever the
im871a/amb8465 dongle is inserted/removed, and the daemon starts when
the computer boots, if the dongle is already inserted.
You can start/stop the daemon with `sudo systemctl stop wmbusmeters@-dev-im871a_0.service`
or `sudo systemctl stop wmbusmeters@-dev-amb8465_1.service` etc.
You can trigger a reload of the config files with `sudo killall -HUP wmbusmetersd`
If you add more dongles, then more daemons gets started, each with a unique name/nr.
# Daemon without udev rules
To start the daemon without the udev rules. Then do:
`make install EXTRA_INSTALL_OPTIONS='--no-udev-rules'`
then no udev rules will be added.
(If you have already installed once before you might have to remove
/dev/udev/rules.d/99-wmbus-usb-serial.rules)
You can now start/stop the daemon with `sudo systemctl stop wmbusmeters`
the device must of course be correct in the /etc/wmbusmeters.conf file.
To have wmbusmeters start automatically when the computer boots do:
`sudo systemctl enable wmbusmeters`
# Common problems
If the daemon has started then the wmbus device will be taken and you cannot start wmbusmeters manually.

Wyświetl plik

@ -276,7 +276,8 @@ unique_ptr<WMBus> createWMBusDeviceFrom(Detected *detected, Configuration *confi
}
LinkModeCalculationResult lmcr = calculateLinkModes(config, wmbus.get(), link_modes_matter);
if (lmcr.type != LinkModeCalculationResultType::Success) {
if (lmcr.type != LinkModeCalculationResultType::Success)
{
error("%s\n", lmcr.msg.c_str());
}
return wmbus;

Wyświetl plik

@ -812,6 +812,7 @@ void SerialCommunicationManagerImp::closeAll()
{
LOCK("(serial)", "closeAll", devices_lock_);
vector<SerialDeviceImp*> copy = devices_;
devices_.clear();
UNLOCK("(serial)", "closeAll", devices_lock_);
for (SerialDeviceImp *d : copy)