Coder Social home page Coder Social logo

volkszaehler / mbmd Goto Github PK

View Code? Open in Web Editor NEW
224.0 23.0 80.0 6.84 MB

ModBus Measurement Daemon - simple reading of data from ModBus meters and grid inverters

License: BSD 3-Clause "New" or "Revised" License

Dockerfile 0.93% Makefile 0.54% CSS 0.19% HTML 8.47% JavaScript 1.43% Go 87.89% Roff 0.56%
modbus smart-meter openhab golang volkszaehler modbus-meters grid-inverters sunspec

mbmd's People

Contributors

andig avatar astrakid avatar bbiegun avatar beldeczki avatar bilbolodz avatar chrostek avatar dependabot-preview[bot] avatar dependabot[bot] avatar driemekasten avatar fasmide avatar florisvdk avatar gonium avatar hacor avatar isarrider avatar jellevictoor avatar kartenkarsten avatar kirk-loeten avatar korpa avatar merbanan avatar meyerd avatar ochykysh avatar panzerdev avatar premultiply avatar richieb2b avatar rpoisel avatar shadow974 avatar sirtet avatar thecount avatar tobima avatar twam avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mbmd's Issues

Throttling for Influxdb

There should be a possibility to throttle data sent do Influxdb. Ideal solution (for me of course) is to set separate frequency of pooling device BUT throttle frequency of Influxdb updates. Maybe it also could be good idea (for some parameters) send data to Influxdb ONLY on value change.

Orno WE514 Errors

Hi, have a problem with the Orno counter. Every second request to the device fails. However, all values ​​are displayed correctly.
How could I isolate the problem?
mbmd version: 0.13

{"StartTime":"2020-08-11T21:16:29.595013831+02:00","UpTime":170780.75667915,"Goroutines":47,"Memory":{"Alloc":5208816,"HeapAlloc":5208816},"Meters":[{"Device":"DZG1.18","Type":"DZG","Online":true,"Requests":21349,"RequestsPerMinute":7.500607811139889,"Errors":1,"ErrorsPerMinute":0.0003513329809892683},{"Device":"ORNO1p1.1","Type":"ORNO1p","Online":true,"Requests":42696,"RequestsPerMinute":15.000337266489238,"Errors":21348,"ErrorsPerMinute":7.500168633244619}]}

Documentation how to get data to Volkszaehler

I like to get the measurements that mbmd reads into the Volkszaehler middleware. I found no documentation how this can or which is the recommended way of doing so.

Is there any documentation or examples how this can achieved?

SolarEdge SE10K

Hi,

ich wollte mbmd für meinen SolarEdge SE10K einsetzen um die Daten an eine InfluxDB zu schicken. Leider komme ich nicht voran.

Der inspect-Befehl gibt folgendes aus:

Ausgabe
/ # mbmd inspect -v -d SOLAREDGE:[email protected]:502
2020/05/31 17:25:47 config: creating TCP connection for 192.168.100.24:502
--------- Model 1 common ---------
Mn         SolarEdge     string
Md              SE10K    string
Opt                      string
Vr           0003.225    string
SN           7E14903B    string
DA               1.00    uint16
Pad            0x0067    pad
--------- Model 103 inverter ---------
A                    2.49    uint16
AphA                 0.81    uint16
AphB                 0.85    uint16
AphC                 0.82    uint16
A_SF                   -2    sunssf
PPVphAB            406.70    uint16
PPVphBC            409.20    uint16
PPVphCA            408.80    uint16
PhVphA             232.00    uint16
PhVphB             235.50    uint16
PhVphC             237.30    uint16
V_SF                   -1    sunssf
W                  360.00    int16
W_SF                   -1    sunssf
Hz                  49.98    uint16
Hz_SF                  -2    sunssf
VA                 584.90    int16
VA_SF                  -1    sunssf
VAr               -461.00    int16
VAr_SF                 -1    sunssf
PF                 -61.44    int16
PF_SF                  -2    sunssf
WH            17017776.00    acc32
WH_SF                   0    sunssf
DCA                  0.49    uint16
DCA_SF                 -4    sunssf
DCV                747.60    uint16
DCV_SF                 -1    sunssf
DCW                365.40    int16
DCW_SF                 -1    sunssf
TmpCab                n/a    int16
TmpSnk              40.43    int16
TmpTrns               n/a    int16
TmpOt                 n/a    int16
Tmp_SF                 -2    sunssf
St                      4    enum16
StVnd                   0    enum16
Evt1                  n/a    bitfield32
Evt2                  n/a    bitfield32
EvtVnd1        0x00000001    bitfield32
EvtVnd2               n/a    bitfield32
EvtVnd3               n/a    bitfield32
EvtVnd4        0x00000000    bitfield32
--------- Model 1 common ---------
Mn           WattNode    string
Md      WND-3Y-400-MB    string
Opt          Export+I    string
Vr                 31    string
SN            5007280    string
DA               1.00    uint16
Pad            0x00cb    pad
--------- Model 203 ac_meter ---------
A                            2.20    int16
AphA                         2.10    int16
AphB                         0.70    int16
AphC                         0.00    int16
A_SF                           -1    sunssf
PhV                        232.50    int16
PhVphA                     232.50    int16
PhVphB                     236.00    int16
PhVphC                     237.65    int16
PPV                       -247.70    int16
PhVphAB                   -249.68    int16
PhVphBC                   -246.92    int16
PhVphCA                   -246.50    int16
V_SF                           -2    sunssf
Hz                          49.99    int16
Hz_SF                          -2    sunssf
W                          -36.00    int16
WphA                       -15.00    int16
WphB                       -55.00    int16
WphC                        34.00    int16
W_SF                            0    sunssf
VA                         564.00    int16
VAphA                      281.00    int16
VAphB                      152.00    int16
VAphC                      144.00    int16
VA_SF                           0    sunssf
VAR                       -563.00    int16
VARphA                    -280.00    int16
VARphB                    -141.00    int16
VARphC                    -140.00    int16
VAR_SF                          0    sunssf
PF                           3.00    int16
PFphA                        3.70    int16
PFphB                       28.15    int16
PFphC                      -22.84    int16
PF_SF                          -2    sunssf
TotWhExp              12142959.00    acc32
TotWhExpPhA            5083589.00    acc32
TotWhExpPhB            5031494.00    acc32
TotWhExpPhC            4536532.00    acc32
TotWhImp               2051098.00    acc32
TotWhImpPhA            2118733.00    acc32
TotWhImpPhB             965564.00    acc32
TotWhImpPhC            1475456.00    acc32
TotWh_SF                        0    sunssf
TotVAhExp                     NaN    acc32
TotVAhExpPhA                  NaN    acc32
TotVAhExpPhB                  NaN    acc32
TotVAhExpPhC                  NaN    acc32
TotVAhImp                     NaN    acc32
TotVAhImpPhA                  NaN    acc32
TotVAhImpPhB                  NaN    acc32
TotVAhImpPhC                  NaN    acc32
TotVAh_SF                     n/a    sunssf
TotVArhImpQ1                  NaN    acc32
TotVArhImpQ1PhA               NaN    acc32
TotVArhImpQ1PhB               NaN    acc32
TotVArhImpQ1PhC               NaN    acc32
TotVArhImpQ2                  NaN    acc32
TotVArhImpQ2PhA               NaN    acc32
TotVArhImpQ2PhB               NaN    acc32
TotVArhImpQ2PhC               NaN    acc32
TotVArhExpQ3                  NaN    acc32
TotVArhExpQ3PhA               NaN    acc32
TotVArhExpQ3PhB               NaN    acc32
TotVArhExpQ3PhC               NaN    acc32
TotVArhExpQ4                  NaN    acc32
TotVArhExpQ4PhA               NaN    acc32
TotVArhExpQ4PhB               NaN    acc32
TotVArhExpQ4PhC               NaN    acc32
TotVArh_SF                    n/a    sunssf
Evt                    0x00000000    bitfield32

Soweit so gut, wenn ich jedoch den run-Befehl verwende, bekomme ich folgende Fehlermeldung:

/ # mbmd run -v -d SOLAREDGE:[email protected]:502
2020/05/31 17:15:23 mbmd unknown version (unknown commit)
2020/05/31 17:15:23 config: creating TCP connection for 192.168.100.24:502
2020/05/31 17:15:23 config: declared device SOLAREDGE:1
2020/05/31 17:15:23 httpd: starting api at 0.0.0.0:8080
2020/05/31 17:15:23 initializing device SOLAREDGE1.1 failed: sunspec: multiple devices found

Wobei der Fehler immer wieder in einer Schleife kommt.

Weiterhin habe ich versucht, per scan die angeschlossenen Geräte zu funden.
Findet das Programm nichts: 2020/05/31 16:46:20 found 0 active devices:

@andig hast du eine Idee woran es liegen könnte?

Maintain device order

Hi,

I've set up mbmd for two SUNSPEC devices, a KOSTAL inverter (plenticore) and a smart meter device (ksem).

The corresponding device config looks like that:

adapters:
- device: 192.168.1.5:502
- device: 192.168.1.6:1502

devices:
- name: ksem
  type: SUNSPEC
  id: 71
  adapter: 192.168.1.5:502
- name: plenticore
  type: SUNSPEC
  id: 71
  adapter: 192.168.1.6:1502

The setup worked as expected, the KSEM ended up as KOSTAL1.71, the plenticore as KOSTAL2.71 and mbmd started logging to influxdb. However, after a short downtime and restart, I've noticed that the devices got mixed up. The smart meter (KSEM) was now KOSTAL2.71 and the inverter KOSTAL1.71. I've noticed this after an hour by looking at weird graphs. After restarting mbmd, the order was restored again.

Corresponding stdout:

# second run

2020/07/28 15:27:46 mbmd unknown version (unknown commit)
2020/07/28 15:27:46 config: using /etc/mbmd/config.yaml
2020/07/28 15:27:46 config: creating TCP connection for 192.168.1.5:502
2020/07/28 15:27:46 config: creating TCP connection for 192.168.1.6:1502
2020/07/28 15:27:46 config: declared device SUNSPEC:71
2020/07/28 15:27:46 config: declared device SUNSPEC:71
2020/07/28 15:27:46 httpd: starting api at 0.0.0.0:8080
2020/07/28 15:27:46 initialized device KOSTAL2.71: {KOSTAL KOSTAL Smart Ene  1.2.1 xxx}
2020/07/28 15:27:46 sunspec: device opened partially
2020/07/28 15:27:46 initialized device KOSTAL1.71: {KOSTAL PLENTICORE plus1          01.15.04 xxx}
2020/07/28 16:36:46 received signal - stopping
2020/07/28 16:36:46 stopped

# third run

2020/07/28 16:36:50 mbmd unknown version (unknown commit)
2020/07/28 16:36:50 config: using /etc/mbmd/config.yaml
2020/07/28 16:36:50 config: creating TCP connection for 192.168.1.5:502
2020/07/28 16:36:50 config: creating TCP connection for 192.168.1.6:1502
2020/07/28 16:36:50 config: declared device SUNSPEC:71
2020/07/28 16:36:50 config: declared device SUNSPEC:71
2020/07/28 16:36:50 httpd: starting api at 0.0.0.0:8080
2020/07/28 16:36:50 initialized device KOSTAL1.71: {KOSTAL KOSTAL Smart Ene  1.2.1 xxx}
2020/07/28 16:36:50 sunspec: device opened partially
2020/07/28 16:36:50 initialized device KOSTAL2.71: {KOSTAL PLENTICORE plus1          01.15.04 xxx}

I think the order should be maintained, so data doesn't get messed up.

Alternatively, an option to persistently naming the devices would suffice. As you can see, I've filled out the name field, however it doesn't seem to be respected anywhere. Maybe related to point 2 in #65?

Side question: is "device partially opened" something to be worried about?

Documentation/template for configuration YAML

Hi,

I fetched the precompiled binary for ARM and managed to set it up on a RPi as daemon successfully.
For the sake of beauty, I'd prefer configuration in a YAML file over the command line parameters. E.g. the command gets quite messy, if you have to handle MQTT configuration.

Is there some documentation or template file one could use?

Regards

Add support for ORNO OR-WE-516 and OR-WE-517

Hallo zusammen!

I'd like to add a support for ORNO OR-WE-516 and OR-WE-517 three-phase meters. They're almost identical - 517 additionally have 4 tariffs.
I have a list of registers, lengths etc.

Unfortunately I never write a thing in Golang. I can can try, but no promises.
I reviewed the code for couple of meters and it seems very easy to adopt a new one. If I'm not mistaken you're supporting up to 2 tariffs. Would it be possible to add 2 more?

In theory I've registers for one-phase meters like OR-WE-514 or OR-WE-515 but haven't any of them to test.

simple logging

is it possible to build in simple logging? A diversion similar
"mbmd >> /var/log/mbmd.log" does not work

Systemd not able to run

I just cannot let a service run via systemd:

Run manually like this works: mbmd run -d SDM:1 -a /dev/ttyUSB2
Run systemd script like this fails:
[Unit]
Description=MBMD
After=syslog.target
[Service]
ExecStart=mbmd run -d SDM:1 -a /dev/ttyUSB2
Restart=always
[Install]
WantedBy=multi-user.target

I have no idea why this does not work. Note that I did not have such issues using the 0.6.0 version of sdm630.

error: "* '' has invalid keys: mqtt-clean"

I just did a docker build with the provided docker which ran fine, but if I start up the docker-container I get the following log with error:

2020/02/21 22:00:22 mbmd  ()
2020/02/21 22:00:22 config: using /etc/mbmd.yaml
2020/02/21 22:00:22 config: failed parsing config file /etc/mbmd.yaml: 1 error(s) decoding:
  * '' has invalid keys: mqtt-clean

This happens with both my own mdmd.yaml file as with the provided example file.
As I see there have been some changes with the mutt-clean flag this might be related.

Data readings on Kostal Inverter incorrect

I'm trying to read Data from my Kostal Plenticore Plus 10.

When I use inspect I get different models with different results.
Model 103 reads the right values e.g. 2780553.00 for WH.
Model 113 results in values e.g. -2.4630083e-06 for WH.

When I open the API in a browser, it unfortunatly reads the values for Model 113.

How can i change the model or how can i get mbmd to deliver the correct values?

SBC ALE3 Problems

I own a SBC ALE3 Modbus. Unfortunately, I do not manage to read this Meter. I tried it both: via Tasmota (SmartMeter) on a Wemos D1 Mini and via the MbMd software on a Raspberry Pi3b. On the Raspi both, via internal UART interface and via a USB2UART converter. I get no response from the SBC back on my RS485 converter. (https://hacktronics.co.in/rs232485-usb-ttl-converters/scm-ttl-to-rs485-converter-485-to-uart-serial-port-automatic-flow-control-module)
I have already swapped the wires, tried at both ends with and without 120ohm terminator, as well as simply swapped TX / RX between RS485adapter and Pi.

Has anyone ever had experience with this meter?

The supply line is about 1m Shield TP.

Rest API not working with release binary

Since updating sdm630 0.6.0 to mbmd release the rest API does not work anymore. Calling http://****:8080/last/ (same with avg, status) gives "404 page not found", ws gives "bad request".

The main page http://****:8080 shows the correct data.

What am I doing wroing?

Program version is not available on command line

With the command mbmd version the result is version: unknown version only instead of "version: 0.9".

Note: I just upgraded manually - at least I guess so - from 0.8 to 0.9. But due to the above I cannot verify on command line.

Roadmap to 0.8

I feel the current code is already working quite well, though with limited testing and real-world exposure. The things that should be addressed until 0.8 are:

  • allow custom device names using config file
  • rethink the device naming approach (maybe even allow backwards compatibility)
  • remove empty connections from API
  • remove empty connections from MQTT device names (#34)
  • allow specifying query interval (used to be rate limiting) (#59)
  • allow closing device connection after query (might help with some SMA devices) (#64)
  • improve RTU failure handling (re-query last measurement instead of all measurements) (#29)
  • improve detection against false positives (#26 and #28)

API documentation errors

Hi,

I have tried mbmd and found that the documentation on the API is not correct.

It says:
mbmd provides a convenient REST API. Supported endpoints under /api are:
/last/{ID} latest data for device
/minuteavg/{ID} averaged data over last minute
/status daemon status

This however should be:
mbmd provides a convenient REST API. Supported endpoints under /api are:
/last/{ID} latest data for a specific device or /last for all devices
/avg/{ID} averaged data over last minute for a specific device or /avg for all devices
/status daemon status

iEM3000 Fehler

panic: runtime error: index out of range [7] with length 4

goroutine 52 [running]:

encoding/binary.bigEndian.Uint64(...)

/home/travis/.gimme/versions/go1.13.linux.amd64/src/encoding/binary/binary.go:124

github.com/volkszaehler/mbmd/meters/rs485.RTUInt64ToFloat64(0x1aea103, 0x4, 0xfd, 0x0, 0x19da700)

/home/travis/gopath/src/github.com/volkszaehler/mbmd/meters/rs485/transform.go:76 +0x88

github.com/volkszaehler/mbmd/meters/rs485.MakeScaledTransform.func1(0x1aea103, 0x4, 0xfd, 0x4, 0xfd)

/home/travis/gopath/src/github.com/volkszaehler/mbmd/meters/rs485/transform.go:83 +0x3c

github.com/volkszaehler/mbmd/meters/rs485.(*RS485).QueryOp(0x199af40, 0x756b20, 0x187ae40, 0xdc60003, 0x2, 0x31, 0x1ac8150, 0x0, 0x0, 0x0, ...)

/home/travis/gopath/src/github.com/volkszaehler/mbmd/meters/rs485/rs485.go:101 +0xd4

github.com/volkszaehler/mbmd/meters/rs485.(*RS485).Query(0x199af40, 0x756b20, 0x187ae40, 0xa, 0x1ac6048, 0xa, 0x0, 0x6)

/home/travis/gopath/src/github.com/volkszaehler/mbmd/meters/rs485/rs485.go:137 +0xe4

github.com/volkszaehler/mbmd/server.(*Handler).queryDevice(0x187aea0, 0x753060, 0x199b1a0, 0x186ce80, 0x186ce40, 0x753403, 0x753460, 0x199af40)

/home/travis/gopath/src/github.com/volkszaehler/mbmd/server/handler.go:136 +0xd8

github.com/volkszaehler/mbmd/server.(*Handler).Run.func1(0x19ea003, 0x753460, 0x199af40)

/home/travis/gopath/src/github.com/volkszaehler/mbmd/server/handler.go:84 +0x14c

github.com/volkszaehler/mbmd/meters.(*Manager).All(0x199aea0, 0x1a70f40)

/home/travis/gopath/src/github.com/volkszaehler/mbmd/meters/manager.go:42 +0x6c

github.com/volkszaehler/mbmd/server.(*Handler).Run(0x187aea0, 0x753060, 0x199b1a0, 0x186ce80, 0x186ce40)

/home/travis/gopath/src/github.com/volkszaehler/mbmd/server/handler.go:55 +0x60

github.com/volkszaehler/mbmd/server.(*QueryEngine).Run.func1(0x3b9aca00, 0x0, 0x753060, 0x199b1a0, 0x186ce80, 0x186ce40, 0x19d6010, 0x187aea0)

/home/travis/gopath/src/github.com/volkszaehler/mbmd/server/queryengine.go:95 +0x80

created by github.com/volkszaehler/mbmd/server.(*QueryEngine).Run

/home/travis/gopath/src/github.com/volkszaehler/mbmd/server/queryengine.go:89 +0x128

Roadmap to 1.0

These things that should be addressed until 1.0:

  • allow custom device names using config file
  • rethink the device naming approach (maybe even allow backwards compatibility)
  • add read/write commands to support modbus "fiddling" (#56)
  • check SDM630 resets (#63)
  • investigate register filtering and per-device rate limiting (#52)

could we supply aliases for meter types?

i had mbmd running for rather a long time but i was facing issues with connecting my SDM120, i had it configured as an SDM, but only after a long time i found out that i needed to configure it as a SDM220.
I know the SDM 120 is a very popular meter, i want to update the documenation to make this more clear, but i don't really know where i should do this.

Docker file not working on RPI

Hi,

Great program, thanks for publishing this. I had some trouble however to get this running on an RPI as a Docker container.

First the example in the documentation is not correct and does not start the container:
docker run -p 8080:8080 --device=/dev/ttyUSB0 volkszaehler/mbmd -a /dev/ttyUSB0 -u 0.0.0.0:8080 -d sdm:1
As the Docker-file has the last line:
CMD /go/bin/mbmd
This means you also have to provide the run/scan/inspect or version as first parameter in the command line.

But even then, the Docker-image did not run properly.
After investigation I found out that the user "appuser". that is the active user in the container has no read-rights on /dev/ttyUSB0 (or whatever you expose to it).

Only after removing the "USER appuser" statement in the Dockerfile and rebuilding the image I now have this working.
Now I am certainly no Docker expert, so this probably needs to be solved differently (because now the user is root I think).

It seems that ABB meters show too much current and power by factor 10

Hello,

It seems that ABB meters show too much current and power by factor 10
For example, if I switch on a 500 watt halogen lamp, the power increases by 5000 watts.

According to the manual the voltage is output with a resolution of 01. But current and power with 001.

I have tried to adapt the code locally, unfortunately without success. With my local modification no more measured values are displayed. I get the following error message: device ABB1.2 did not respond (1/3)

Best regards,

Klaus

--- a/meters/rs485/abb.go
+++ b/meters/rs485/abb.go
@@ -143,11 +143,16 @@ func (p *ABBProducer) Probe() Operation {
func (p *ABBProducer) Produce() (res []Operation) {
for _, op := range []Measurement{
VoltageL1, VoltageL2, VoltageL3,

  •           CurrentL1, CurrentL2, CurrentL3,
      } {
              res = append(res, p.snip32u(op, 10))
      }
    
  •   for _, op := range []Measurement{
    
  •           CurrentL1, CurrentL2, CurrentL3,
    
  •   } {
    
  •           res = append(res, p.snip32u(op, 100))
    
  •   }
    
  •   for _, op := range []Measurement{
              Cosphi, CosphiL1, CosphiL2, CosphiL3,
      } {
    

@@ -163,7 +168,7 @@ func (p *ABBProducer) Produce() (res []Operation) {
for _, op := range []Measurement{
Power, PowerL1, PowerL2, PowerL3,
} {

  •           res = append(res, p.snip32i(op, 10))
    
  •           res = append(res, p.snip32i(op, 100))
      }
    
      for _, op := range []Measurement{
    

SolarEdge 2000M results in panic

./mbmd run -v -d SOLAREDGE:[email protected]:502'
2020/07/19 09:00:41 mbmd unknown version (unknown commit)
2020/07/19 09:00:41 config: creating TCP connection for 10.0.0.207:502
2020/07/19 09:00:41 config: using /home/foobar/go/src/github.com/volkszaehler/mbmd/mbmd.yaml
2020/07/19 09:00:41 config: declared device SOLAREDGE:1
2020/07/19 09:00:41 httpd: starting api at 0.0.0.0:8080
2020/07/19 09:00:41 initialized device SolarEdge 1.1: {SolarEdge  SE2000M-RWK02BNN  0004.000 7C00151A}
panic: no such block

goroutine 50 [running]:
github.com/andig/gosunspec/impl.(*model).MustBlock(0xc00011a2c0, 0x1, 0x1, 0x118e900)
        /home/foobar/go/pkg/mod/github.com/andig/[email protected]/impl/model.go:34 +0x8f
github.com/volkszaehler/mbmd/meters/sunspec.(*SunSpec).Query(0xc000351260, 0xc6a840, 0xc000191ee0, 0xc000130130, 0xc000024940, 0xd, 0xc000505c10, 0x4e15fa)
        /home/foobar/go/src/github.com/volkszaehler/mbmd/meters/sunspec/sunspec.go:316 +0x5d4
github.com/volkszaehler/mbmd/server.(*Handler).queryDevice(0xc000392750, 0xc649e0, 0xc000036080, 0xc0001a8ae0, 0xc0001a8a80, 0x1, 0xc653a0, 0xc000351260)
        /home/foobar/go/src/github.com/volkszaehler/mbmd/server/handler.go:132 +0x11c
github.com/volkszaehler/mbmd/server.(*Handler).Run.func1(0xa60c01, 0xc653a0, 0xc000351260)
        /home/foobar/go/src/github.com/volkszaehler/mbmd/server/handler.go:78 +0x1d0
github.com/volkszaehler/mbmd/meters.(*Manager).All(0xc000392758, 0xc000505eb8)
        /home/foobar/go/src/github.com/volkszaehler/mbmd/meters/manager.go:41 +0x95
github.com/volkszaehler/mbmd/server.(*Handler).Run(0xc000392750, 0xc649e0, 0xc000036080, 0xc0001a8ae0, 0xc0001a8a80)
        /home/foobar/go/src/github.com/volkszaehler/mbmd/server/handler.go:49 +0x8a
github.com/volkszaehler/mbmd/server.(*QueryEngine).Run.func1(0xdf8475800, 0xc649e0, 0xc000036080, 0xc0001a8ae0, 0xc0001a8a80, 0xc0002b8000, 0xc000392750)
        /home/foobar/go/src/github.com/volkszaehler/mbmd/server/queryengine.go:93 +0xbb
created by github.com/volkszaehler/mbmd/server.(*QueryEngine).Run
        /home/foobar/go/src/github.com/volkszaehler/mbmd/server/queryengine.go:87 +0x188

inspect works ok

./mbmd inspect -d SOLAREDGE:[email protected]:502
2020/07/19 09:01:41 config: creating TCP connection for 10.0.0.207:502
--------- Model 1 common ---------
Mn         SolarEdge     string
Md   SE2000M-RWK02BNN    string
Opt                      string
Vr           0004.000    string
SN           7C00151A    string
DA               1.00    uint16
Pad            0x0065    pad
--------- Model 101 inverter ---------
A                    2.08    uint16
AphA                 2.08    uint16
AphB                  n/a    uint16
AphC                  n/a    uint16
A_SF                   -2    sunssf
PPVphAB            231.30    uint16
PPVphBC               n/a    uint16
PPVphCA               n/a    uint16
PhVphA                n/a    uint16
PhVphB                n/a    uint16
PhVphC                n/a    uint16
V_SF                   -1    sunssf
W                  376.50    int16
W_SF                   -1    sunssf
Hz                  50.00    uint16
Hz_SF                  -3    sunssf
VA                 481.40    int16
VA_SF                  -1    sunssf
VAr                299.99    int16
VAr_SF                 -2    sunssf
PF                  78.21    int16
PF_SF                  -2    sunssf
WH             2614948.00    acc32
WH_SF                   0    sunssf
DCA                  5.48    uint16
DCA_SF                 -3    sunssf
DCV                 69.80    uint16
DCV_SF                 -1    sunssf
DCW                382.20    int16
DCW_SF                 -1    sunssf
TmpCab                n/a    int16
TmpSnk              46.98    int16
TmpTrns               n/a    int16
TmpOt                 n/a    int16
Tmp_SF                 -2    sunssf
St                      4    enum16
StVnd                   0    enum16
Evt1                  n/a    bitfield32
Evt2                  n/a    bitfield32
EvtVnd1        0x00000000    bitfield32
EvtVnd2               n/a    bitfield32
EvtVnd3               n/a    bitfield32
EvtVnd4        0x00000000    bitfield32

Configuration file is used continuously if specified once

I create a config file and run mbmd with the config param (mbmd run -c /etc/mbmd.yaml) - ok.
After I stop the program (CTRL-C) and rerun it without the config param it keeps going to read the config.

pi@racknode:/usr/local/bin $ mbmd run -c /etc/mbmd.yaml
2020/08/12 21:48:52 mbmd 0.13 (fa6b574)
2020/08/12 21:48:52 config: using /etc/mbmd.yaml
2020/08/12 21:48:52 config: creating TCP connection for inverter.thomo.de:1502
2020/08/12 21:48:52 config: using default adapter inverter.thomo.de:1502 for device {SE 1 0 inverter }
2020/08/12 21:48:52 config: using default adapter inverter.thomo.de:1502 for device {SE 1 1 powermeter }
2020/08/12 21:48:52 config: declared device SE:1.0
2020/08/12 21:48:52 config: declared device SE:1.1
2020/08/12 21:48:52 httpd: starting api at 0.0.0.0:8080
2020/08/12 21:48:52 initialized device SE1.1: {SE SolarEdge SE15K-RW0T0BNN4  0004.000 7E08C3F2 0}
2020/08/12 21:48:53 initialized device SE1.1.1: {SE SolarEdge SE-MTR-3Y-400V-A Export+I 73 606384567 1}
^C2020/08/12 21:48:53 received signal - stopping
2020/08/12 21:48:53 stopped
pi@racknode:/usr/local/bin $ mbmd run
2020/08/12 21:49:00 mbmd 0.13 (fa6b574)
2020/08/12 21:49:00 config: using /etc/mbmd.yaml
2020/08/12 21:49:00 config: creating TCP connection for inverter.thomo.de:1502
2020/08/12 21:49:00 config: using default adapter inverter.thomo.de:1502 for device {SE 1 0 inverter }
2020/08/12 21:49:00 config: using default adapter inverter.thomo.de:1502 for device {SE 1 1 powermeter }
2020/08/12 21:49:00 config: declared device SE:1.0
2020/08/12 21:49:00 config: declared device SE:1.1
2020/08/12 21:49:00 httpd: starting api at 0.0.0.0:8080
2020/08/12 21:49:01 initialized device SE1.1: {SE SolarEdge SE15K-RW0T0BNN4  0004.000 7E08C3F2 0}
^C2020/08/12 21:49:01 received signal - stopping
2020/08/12 21:49:01 initialized device SE1.1.1: {SE SolarEdge SE-MTR-3Y-400V-A Export+I 73 606384567 1}
2020/08/12 21:49:01 stopped

Does mbmd somewhere store the information about the config or is it a feature of golang? Or is it magic?

add option to chose port of web interface

I have to query two different modbus tcp devices. Therefore I need to start two instances of mbmd. Unluckly it is not possible on the same machine because the port of web interface is hard coded to 8080.

please add an option to change this.

Trying to compile from the source -> invalid/unknown revision

I'm trying to compile MBMD from the source but I get this odd error that I can't get my head around with google :)

go: github.com/andig/[email protected]: invalid version: unknown revision ff0a69a1ad97

In go.mod there's a line:

replace github.com/grid-x/modbus v0.0.0-20191105145357-867898f52408 => github.com/andig/gridx-modbus v0.0.0-20191223181555-ff0a69a1ad97

unable to make build

Console output (last ones):
# github.com/volkszaehler/mbmd/cmd
cmd/root.go:82:16: undefined: os.UserHomeDir
make: *** [Makefile:31: build] Error 2

Via:
sudo git clone https://github.com/volkszaehler/mbmd.git
cd mbmd
sudo make install
sudo make build

I was able to build latest version of mbmd on Raspberry Pi 4B yesterday.
Since changing root.go, I received the above errors!
issue240819

Wrong sub device values

version: mbmd 0.12 (0d6f45f)
SE inverter with power meter

The current data extracted from the power meter seams wrong - even on a sunny day 4492.0 A looks incredible. The web page also changes the current values between the reasonable ones (~19A) and the wrong (~4492A) on all three lines (L1/L2/L3).

root@racknode:/usr/local/bin# mbmd run -a inverter.thomo.de:1502 -d SE:1.0 -d SE:1.1 -v
2020/08/05 15:09:37 mbmd 0.12 (0d6f45f)
2020/08/05 15:09:37 config: creating TCP connection for inverter.thomo.de:1502
2020/08/05 15:09:37 config: declared device SE:1.0
2020/08/05 15:09:37 config: declared device SE:1.1
2020/08/05 15:09:37 httpd: starting api at 0.0.0.0:8080
2020/08/05 15:09:38 initialized device SE1-1: {SE SolarEdge SE15K-RW0T0BNN4  0004.000 7E08C3F2 0}
2020/08/05 15:09:38 device SE1-1 L1: 0.0V 0.0A 0.0W 0.0cos | L2: 0.0V 19.5A 0.0W 0.0cos | L3: 0.0V 0.0A 0.0W 0.0cos | 0.0Hz
2020/08/05 15:09:38 device SE1-1 L1: 244V 0.0A 0.0W 0.0cos | L2: 0.0V 19.5A 0.0W 0.0cos | L3: 0.0V 0.0A 0.0W 0.0cos | 0.0Hz
2020/08/05 15:09:38 device SE1-1 L1: 244V 0.0A 0.0W 0.0cos | L2: 246V 19.5A 0.0W 0.0cos | L3: 0.0V 0.0A 0.0W 0.0cos | 0.0Hz
2020/08/05 15:09:38 device SE1-1 L1: 244V 0.0A 0.0W 0.0cos | L2: 246V 19.5A 0.0W 0.0cos | L3: 0.0V 0.0A 0.0W 0.0cos | 50Hz
2020/08/05 15:09:38 device SE1-1 L1: 244V 0.0A 0.0W 0.0cos | L2: 246V 19.5A 0.0W 0.0cos | L3: 245V 0.0A 0.0W 0.0cos | 50Hz
2020/08/05 15:09:38 device SE1-1 L1: 244V 19.5A 0.0W 0.0cos | L2: 246V 19.5A 0.0W 0.0cos | L3: 245V 0.0A 0.0W 0.0cos | 50Hz
2020/08/05 15:09:38 device SE1-1 L1: 244V 19.5A 0.0W 0.0cos | L2: 246V 19.5A 0.0W 0.0cos | L3: 245V 19.4A 0.0W 0.0cos | 50Hz
2020/08/05 15:09:38 initialized device SE1-1.1: {SE SolarEdge SE-MTR-3Y-400V-A Export+I 72 606384567 1}
2020/08/05 15:09:38 device SE1-1.1 L1: 244V 0.0A 0.0W 0.0cos | L2: 0.0V 0.0A 0.0W 0.0cos | L3: 0.0V 0.0A 0.0W 0.0cos | 0.0Hz
2020/08/05 15:09:38 device SE1-1.1 L1: 244V 0.0A 0.0W 0.0cos | L2: 0.0V 18.2A 0.0W 0.0cos | L3: 0.0V 0.0A 0.0W 0.0cos | 0.0Hz
2020/08/05 15:09:38 device SE1-1.1 L1: 244V 0.0A 0.0W 0.0cos | L2: 0.0V 18.2A 0.0W 0.0cos | L3: 0.0V 18.7A 0.0W 0.0cos | 0.0Hz
2020/08/05 15:09:38 device SE1-1.1 L1: 244V 0.0A 0.0W 0.0cos | L2: 0.0V 4492.0A 0.0W 0.0cos | L3: 0.0V 18.7A 0.0W 0.0cos | 0.0Hz
2020/08/05 15:09:38 device SE1-1.1 L1: 244V 0.0A 0.0W 0.0cos | L2: 0.0V 4492.0A 0.0W 0.0cos | L3: 0.0V 4583.0A 0.0W 0.0cos | 0.0Hz
2020/08/05 15:09:38 device SE1-1.1 L1: 244V 0.0A 3071W 0.0cos | L2: 0.0V 4492.0A 0.0W 0.0cos | L3: 0.0V 4583.0A 0.0W 0.0cos | 0.0Hz
2020/08/05 15:09:38 device SE1-1.1 L1: 244V 0.0A 3071W 0.0cos | L2: 0.0V 4492.0A 0.0W 0.0cos | L3: 0.0V 4583.0A 0.0W 0.0cos | 50Hz
2020/08/05 15:09:38 device SE1-1.1 L1: 244V 0.0A 3071W 0.0cos | L2: 0.0V 4492.0A 3062W 0.0cos | L3: 0.0V 4583.0A 0.0W 0.0cos | 50Hz
2020/08/05 15:09:38 device SE1-1.1 L1: 244V 18.6A 3071W 0.0cos | L2: 0.0V 4492.0A 3062W 0.0cos | L3: 0.0V 4583.0A 0.0W 0.0cos | 50Hz
2020/08/05 15:09:38 device SE1-1.1 L1: 244V 18.6A 3071W -66.39cos | L2: 0.0V 4492.0A 3062W 0.0cos | L3: 0.0V 4583.0A 0.0W 0.0cos | 50Hz
2020/08/05 15:09:38 device SE1-1.1 L1: 244V 18.6A 3071W -66.39cos | L2: 0.0V 4492.0A 3062W 0.0cos | L3: 0.0V 4583.0A 3109W 0.0cos | 50Hz
2020/08/05 15:09:38 device SE1-1.1 L1: 244V 18.6A 3071W -66.39cos | L2: 0.0V 4492.0A 3062W -67.69cos | L3: 0.0V 4583.0A 3109W 0.0cos | 50Hz
2020/08/05 15:09:38 device SE1-1.1 L1: 244V 18.6A 3071W -66.39cos | L2: 0.0V 4492.0A 3062W -67.69cos | L3: 0.0V 4583.0A 3109W -67.00cos | 50Hz
2020/08/05 15:09:38 device SE1-1.1 L1: 244V 18.6A 3071W -66.39cos | L2: 246V 4492.0A 3062W -67.69cos | L3: 0.0V 4583.0A 3109W -67.00cos | 50Hz
2020/08/05 15:09:38 device SE1-1.1 L1: 244V 18.6A 3071W -66.39cos | L2: 246V 4492.0A 3062W -67.69cos | L3: 243V 4583.0A 3109W -67.00cos | 50Hz
2020/08/05 15:09:38 device SE1-1.1 L1: 244V 4569.0A 3071W -66.39cos | L2: 246V 4492.0A 3062W -67.69cos | L3: 243V 4583.0A 3109W -67.00cos | 50Hz
2020/08/05 15:09:38 device SE1-1 L1: 244V 19.5A 0.0W 0.0cos | L2: 246V 19.5A 0.0W 0.0cos | L3: 245V 19.4A 0.0W 0.0cos | 50Hz
2020/08/05 15:09:38 device SE1-1 L1: 243V 19.5A 0.0W 0.0cos | L2: 246V 19.5A 0.0W 0.0cos | L3: 245V 19.4A 0.0W 0.0cos | 50Hz
2020/08/05 15:09:38 device SE1-1 L1: 243V 19.5A 0.0W 0.0cos | L2: 247V 19.5A 0.0W 0.0cos | L3: 245V 19.4A 0.0W 0.0cos | 50Hz
2020/08/05 15:09:38 device SE1-1 L1: 243V 19.5A 0.0W 0.0cos | L2: 247V 19.5A 0.0W 0.0cos | L3: 245V 19.4A 0.0W 0.0cos | 50Hz
2020/08/05 15:09:38 device SE1-1 L1: 243V 19.4A 0.0W 0.0cos | L2: 247V 19.5A 0.0W 0.0cos | L3: 245V 19.4A 0.0W 0.0cos | 50Hz
2020/08/05 15:09:38 device SE1-1 L1: 243V 19.4A 0.0W 0.0cos | L2: 247V 19.5A 0.0W 0.0cos | L3: 245V 19.4A 0.0W 0.0cos | 50Hz
2020/08/05 15:09:38 device SE1-1 L1: 243V 19.4A 0.0W 0.0cos | L2: 247V 19.5A 0.0W 0.0cos | L3: 245V 19.4A 0.0W 0.0cos | 50Hz

(At first start of mbmd with the sub devices the web page didn't show any values, only the about sections - but I can not reproduce it.)

SDM630, TCP communication via USR-410

Hi,
I tired to collect data from my two SDM630 meters meters with alpha11&alpha12 over TCP.
I used the precompiled software "mbmd_0.8-alpha.12_linux_armv6.tar.gz" that runs on RaspberryPi -> "USR-TCP232-410S" -> SDM:ID1 & SDM:ID2.
Ìt looks like I get a response from the meters but they are not detected correclty.
Currenlty I am using Node-Red ( where I can pull data).

What am I missing?

terminal copy:

pi@raspberrypi:/usr/local/bin $ ./mbmd scan --raw -a 192.168.178.31:26
2020/01/01 09:49:59 config: creating TCP connection for 192.168.178.31:26
2020/01/01 09:49:59 starting bus scan on 192.168.178.31:26
2020/01/01 09:49:59 modbus: send 00 01 00 00 00 06 01 03 9c 40 00 02
2020/01/01 09:50:00 modbus: recv 00 01 00 00 00 07 01 03 04 00 00 00 00
2020/01/01 09:50:00 modbus: send 00 02 00 00 00 06 01 03 c3 50 00 02
2020/01/01 09:50:00 modbus: recv 00 02 00 00 00 07 01 03 04 00 00 00 00
2020/01/01 09:50:00 modbus: send 00 03 00 00 00 06 01 03 00 00 00 02
2020/01/01 09:50:00 modbus: recv 00 03 00 00 00 07 01 03 04 42 70 00 00
2020/01/01 09:50:00 device 1: n/a
2020/01/01 09:50:00 modbus: send 00 04 00 00 00 06 02 03 9c 40 00 02
2020/01/01 09:50:00 modbus: recv 00 04 00 00 00 07 02 03 04 00 00 00 00
2020/01/01 09:50:00 modbus: send 00 05 00 00 00 06 02 03 c3 50 00 02
2020/01/01 09:50:00 modbus: recv 00 05 00 00 00 07 02 03 04 00 00 00 00
2020/01/01 09:50:00 modbus: send 00 06 00 00 00 06 02 03 00 00 00 02
2020/01/01 09:50:00 modbus: recv 00 06 00 00 00 07 02 03 04 42 70 00 00
2020/01/01 09:50:00 device 2: n/a
2020/01/01 09:50:00 modbus: send 00 07 00 00 00 06 03 03 9c 40 00 02
2020/01/01 09:50:01 modbus: send 00 08 00 00 00 06 03 03 c3 50 00 02
2020/01/01 09:50:02 modbus: send 00 09 00 00 00 06 03 03 00 00 00 02
2020/01/01 09:50:03 device 3: n/a

No readings on model 160 (SunSpec) on ABB inverter

I can't seem to get readings from model 160 data in web server or InfluxDB database. I only get partial information from model 103 data.

When I run mbmd inspect command, I see all the data I need, however, when using run, only selected data gets stored.

Is this by design?

Config file for 2 TCP adapters

My current setup is:

  • Fronius Inverter (TCP connection: 192.168.105.252:502)
  • 2 x SDM630 meters connected over "Modbus TCP converter" (HF5111B: http://www.hi-flying.com/hf5111b) (TCP connection: 192.168.105.4:502)
    Everything is fine when I'm using one of TCP connection (it means only Fronius or only SDM meters. It's working correctly also when I've Fronius connected via TCP and SDM meters only USB to RS485 converter). No I'm trying to connect all my devices via TCP and got strange error:

mbmd -c /etc/mbmd.yaml run

2020/04/30 13:30:11 config: using /etc/mbmd.yaml
2020/04/30 13:30:11 config: creating TCP connection for 192.168.105.252:502
2020/04/30 13:30:11 config: creating TCP connection for 192.168.105.4:502
2020/04/30 13:30:11 config: declared device SUNSPEC:1
2020/04/30 13:30:11 config: declared device SDM:1
2020/04/30 13:30:11 config: declared device SDM:2
2020/04/30 13:30:11 httpd: starting api at 0.0.0.0:8081
2020/04/30 13:30:11 initializing device SDM2.1 failed: not a SunSpec device
2020/04/30 13:30:14 initialized device Fronius1.1: {Fronius Symo 7.0-3-M 3.14.1-1 0.3.23.0 30198007}
2020/04/30 13:30:15 initializing device SDM2.2 failed: not a SunSpec device

My config file is:

# REST api, use 127.0.0.1 to restrict to localhost
api: 0.0.0.0:8081
rate: 60s

# adapters are referenced by device
adapters:
#- device: /dev/ttyUSB-modbus
#  baudrate: 38400
#  comset: 8N1 # "8E1" needs be quoted as string or will error
- device: 192.168.105.252:502
  rtu: false
- device: 192.168.105.4:502
  rtu: false

# list of devices
devices:
- name: Licznik wejscie
  type: sdm
  id: 1
  adapter: 192.168.105.4:502

- name: Licznik dom
  type: sdm
  id: 2
  adapter: 192.168.105.4:502

- name: Inverter Fronius
  type: sunspec
  id: 1
  adapter: 192.168.105.252:502

How should I get it working?

feature request: variable polling frequency and registers

Great program, now that I have it working. However I notice that it looks like it polls my meter like crazy (every second?) and requests all parameters from my SDM630 meter.

However I only would like query my meter every minute and want only with a subset of all possible parameters, so as not to produce too much overhead and pushing useless data to Influx (or MQTT).
Is there a place in the code where I can adjust this? Or even better: would you consider to make this configurable? Perhaps via the input parameters or even better using the mbmd.yaml so this can be configured specifically for each meter.

After building unfortunately no data

When I try to build on my Raspberry 4, I get no error message but unfortunately no data in the web interface.
On the console they are printed with -v.
Anyone have an idea?

grafik

SDM120C CRC checksum error

I try to read data from my SDM120C. with
/mbmd scan -a /dev/ttyUSB0 -b 2400 2020/08/05 21:53:15 config: creating RTU connection for /dev/ttyUSB0 (2400baud, 8N1) 2020/08/05 21:53:15 starting bus scan on /dev/ttyUSB0 2020/08/05 21:53:15 device 1: SDM type device found, VoltageL1: 230.80 2020/08/05 21:53:15 device 2: SDM type device found, VoltageL1: 229.75
device 1 is the SDM120c. Device 2 is a 630 and can be read perfectly.
but
./mbmd run -a /dev/ttyUSB0 -d sdm:1 -b 2400 -v
2020/08/05 21:54:08 mbmd 0.12 (0d6f45f)
2020/08/05 21:54:08 config: creating RTU connection for /dev/ttyUSB0 (2400baud, 8N1)
2020/08/05 21:54:08 config: declared device SDM:1.0
2020/08/05 21:54:08 httpd: starting api at 0.0.0.0:8080
2020/08/05 21:54:08 initialized device SDM1-1: {SDM SDM Eastron SDM630 0}
2020/08/05 21:54:08 device SDM1-1 did not respond (1/3)
2020/08/05 21:54:09 device SDM1-1 did not respond (2/3)
2020/08/05 21:54:11 device SDM1-1 did not respond (3/3)
Says no response.

SOme parameters which I take wrong?
with

sdm120c -a1 -PN -S1 /dev/ttyUSB0
Voltage: 230.50 V

I can read at least the Voltage.

THanks in advance.

Errors and errors per minute SDM630

Hi, I was looking at the json result that the mbmd sends and I noticed that there are "Errors" and "ErrorsPerMinute" which increase steadily after a few hours of running the mbmd. What are these? Are they related to:

2020/02/12 10:27:03 device SDM1.1 did not respond (1/3)

After restarting the software it takes a few minutes and then they start:

0: {Device: "SDM1.1", Type: "SDM", Online: true, Requests: 252, RequestsPerMinute: 19.379029257344072,…}
Device: "SDM1.1"
Type: "SDM"
Online: true
Requests: 252
RequestsPerMinute: 19.379029257344072
Errors: 3
ErrorsPerMinute: 0.2307027292540961

Below is a short log from raw output.

2020/02/12 10:19:24 modbus: send 01 04 00 0e 00 02 10 08
2020/02/12 10:19:24 modbus: recv 01 04 04 00 00 00 00 fb 84
2020/02/12 10:19:24 modbus: send 01 04 01 6a 00 02 50 2b
2020/02/12 10:19:24 modbus: recv 01 04 04 45 a2 26 c7 14 98
2020/02/12 10:19:24 modbus: send 01 04 00 ea 00 02 50 3f
2020/02/12 10:19:24 modbus: recv 01 04 04 3f e3 c9 61 91 de
2020/02/12 10:19:24 modbus: send 01 04 00 ee 00 02 11 fe
2020/02/12 10:19:24 modbus: recv 01 04 04 40 d5 73 45 1b 7f
2020/02/12 10:19:24 modbus: send 01 04 00 0c 00 02 b1 c8
2020/02/12 10:19:24 modbus: recv 01 04 04 41 fa 17 7c c1 98
2020/02/12 10:19:24 modbus: send 01 04 00 38 00 02 f0 06
2020/02/12 10:19:24 modbus: recv 01 04 04 41 fc 71 09 cb de
2020/02/12 10:19:24 modbus: send 01 04 01 5c 00 02 b0 25
2020/02/12 10:19:24 modbus: recv 01 04 04 45 9d 98 31 d5 72
2020/02/12 10:19:24 modbus: send 01 04 01 60 00 02 70 29
2020/02/12 10:19:24 modbus: recv 01 04 04 00 00 00 00 fb 84
2020/02/12 10:19:24 modbus: send 01 04 01 56 00 02 90 27
2020/02/12 10:19:24 modbus: recv 01 04 04 46 85 73 f0 da 51
2020/02/12 10:19:24 modbus: send 01 04 00 00 00 02 71 cb
2020/02/12 10:19:24 modbus: recv 01 04 04 43 6c 8a 2d 89 60
2020/02/12 10:19:24 modbus: send 01 04 00 02 00 02 d0 0b
2020/02/12 10:19:24 modbus: recv 01 04 04 43 6e 80 4e 6e 29
2020/02/12 10:19:24 modbus: send 01 04 00 0a 00 02 51 c9
2020/02/12 10:19:24 modbus: recv 01 04 04 00 00 00 00 fb 84
2020/02/12 10:19:24 modbus: send 01 04 01 66 00 02 90 28
2020/02/12 10:19:24 modbus: recv 01 04 04 45 d6 10 c9 c2 e6
2020/02/12 10:19:24 modbus: send 01 04 00 22 00 02 d1 c1
2020/02/12 10:19:24 modbus: recv 01 04 04 3f 80 00 00 f6 78
2020/02/12 10:19:24 modbus: send 01 04 00 46 00 02 90 1e
2020/02/12 10:19:24 modbus: recv 01 04 04 42 48 06 48 6c 7c
2020/02/12 10:19:24 modbus: send 01 04 00 04 00 02 30 0a
2020/02/12 10:19:24 modbus: recv 01 04 04 43 6e 28 f1 50 59
2020/02/12 10:19:24 modbus: send 01 04 01 5a 00 02 50 24
2020/02/12 10:19:24 modbus: recv 01 04 04 45 d6 10 c9 c2 e6
2020/02/12 10:19:24 modbus: send 01 04 00 06 00 02 91 ca
2020/02/12 10:19:24 modbus: recv 01 04 04 3e 09 b4 22 d1 77
2020/02/12 10:19:24 modbus: send 01 04 00 34 00 02 30 05
2020/02/12 10:19:24 modbus: recv 01 04 04 41 fc 2e 9a b2 43
2020/02/12 10:19:24 modbus: send 01 04 01 64 00 02 31 e8
2020/02/12 10:19:24 modbus: recv 01 04 04 00 00 00 00 fb 84
2020/02/12 10:19:24 modbus: send 01 04 00 08 00 02 f0 09
2020/02/12 10:19:24 modbus: recv 01 04 04 00 00 00 00 fb 84
2020/02/12 10:19:24 modbus: send 01 04 00 3c 00 02 b1 c7
2020/02/12 10:19:24 modbus: recv 01 04 04 00 00 00 00 fb 84
2020/02/12 10:19:24 modbus: send 01 04 00 54 00 02 30 1b
2020/02/12 10:19:24 modbus: recv 01 04 04 41 fc 2b 66 b1 52
2020/02/12 10:19:24 modbus: send 01 04 00 48 00 02 f1 dd
2020/02/12 10:19:24 modbus: recv 01 04 04 46 85 73 f0 da 51
2020/02/12 10:19:24 modbus: send 01 04 01 68 00 02 f1 eb
2020/02/12 10:19:24 modbus: recv 01 04 04 45 9d 98 31 d5 72
2020/02/12 10:19:24 modbus: send 01 04 00 10 00 02 70 0e
2020/02/12 10:19:24 modbus: recv 01 04 04 00 00 00 00 fb 84
2020/02/12 10:19:24 modbus: send 01 04 01 62 00 02 d1 e9
2020/02/12 10:19:25 modbus: recv 01 04 04 00 00 00 00 fb 84
2020/02/12 10:19:25 modbus: send 01 04 00 4a 00 02 50 1d
2020/02/12 10:19:25 modbus: recv 01 04 04 00 00 00 00 fb 84
2020/02/12 10:19:25 modbus: send 01 04 00 3e 00 02 10 07
2020/02/12 10:19:25 modbus: recv 01 04 04 3f 79 c3 9d b7 10
2020/02/12 10:19:25 modbus: send 01 04 00 ec 00 02 b0 3e
2020/02/12 10:19:25 modbus: recv 01 04 04 40 0c 8b d4 48 e8
2020/02/12 10:19:25 modbus: send 01 04 01 5e 00 02 11 e5
2020/02/12 10:19:25 modbus: recv 01 04 04 45 a2 26 c7 14 98
2020/02/12 10:19:25 modbus: send 01 04 00 1e 00 02 11 cd
2020/02/12 10:19:25 modbus: recv 01 04 04 3f 7d b2 a1 d2 90
2020/02/12 10:19:25 modbus: send 01 04 00 20 00 02 70 01
2020/02/12 10:19:25 modbus: recv 01 04 04 3f 80 00 00 f6 78
2020/02/12 10:19:25 modbus: send 01 04 00 f8 00 02 f0 3a

Docker not starting, throws error

i couldnt get docker to start. its throwing error probably some wrong arguments/

dima@dima-desktop:~/docker-mounts/compose$ sudo docker run -p 8080:8080  --device=/dev/ttyUSB0 volkszaehler/mbmd -a /dev/ttyUSB0 -u 0.0.0.0:8080 -d sdm:1
Error: unknown shorthand flag: 'u' in -u
unknown shorthand flag: 'u' in -u
Usage:
  mbmd [command]

Available Commands:
  help        Help about any command
  inspect     Inspect SunSpec device models and implemented values
  read        Read register (EXPERIMENTAL)
  run         Read and publish measurements from all configured devices
  scan        Scan for attached devices
  version     Show MBMD version
  write       Write register (EXPERIMENTAL)

Flags:
  -a, --adapter string   Default MODBUS adapter. This option can be used if all devices are attached to a single adapter.
                         Can be either an RTU device (/dev/ttyUSB0) or TCP socket (localhost:502).
                         The default adapter can be overridden per device
  -b, --baudrate int     Serial interface baud rate (default 9600)
      --comset string    Communication parameters for default adapter, either 8N1 or 8E1.
                         Only applicable if the default adapter is an RTU device (default "8N1")
  -c, --config string    Config file (default is $HOME/mbmd.yaml)
  -h, --help             Help for mbmd
      --raw              Log raw device data
      --rtu              Use RTU over TCP for default adapter.
                         Typically used with RS485 to Ethernet adapters that don't perform protocol conversion (e.g. USR-TCP232).
                         Only applicable if the default adapter is a TCP connection
  -v, --verbose          Verbose mode

Use "mbmd [command] --help" for more information about a command.

also, a docker-compose file would be great :)

Topic ID in Homie MQTT entspricht nicht der Convention

Ich habe versucht MBMD mit Homie MQTT in Verbindung mit openHAB 2 zu nutzen. Leider meldet mir openHAB einen Fehler:

ID segment 'mbmd_sdm1.1_meter' contains invalid characters. Each segment of the ID must match the pattern [A-Za-z0-9_-]*.

Das ist auch korrekt so, laut Homie Convention:
https://homieiot.github.io/specification/#topic-ids
darf da kein Punkt drin sein. Das Problem liegt also bei "sdm1.1".
Meine Config sieht so aus:

# mqtt config
mqtt:
  broker: localhost:1883
  topic:
  user: 
  password: 
  clientid: mbmd
  qos: 0
  clean: true
  homie: mbmd

# adapters are referenced by device
adapters:
- device: /dev/ttyUSB0
  baudrate: 9600
  comset: 8N1

# list of devices
devices:
- type: sdm
  id: 1
  adapter: /dev/ttyUSB0
- type: sdm
  id: 2
  adapter: /dev/ttyUSB0
- type: sdm
  id: 3
  adapter: /dev/ttyUSB0

Ich habe also aktuell 3 SDM Geräte, die entsprechend durchnumeriert werden.
Im einfachsten Falle müsste für Homie einfach ein "." durch ein "-" ersetzt werden.

Danke

Viele Grüße
Sebastian

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.