Implementing a device guide issue

Hi,

I am trying to follow the procedure described in implement a device online guide from openEMS website:

Implementing a device :: Open Energy Management System (openems.github.io)

At step 1.6 Enable the Component when I clicked on Resolve to update the list of bundles that are required to run OpenEMS Edge although
bnd.identity;id=‘io.openems.edge.meter.simulated’ appeared I had to add manually
io.openems.edge.meter.simulated;version=’[1.0.0,1.0.1)’,\

Note: On Resolution Results there is no finish but rather update.

Now on step 1.7 Run the implementation I ran OSGi and from Apache Felix Web Console I set the corresponding settings to the Apache Felix Web Console but there is no Meter Simulated subsection. For this purpose I randomly chose Meter Weidmueller 525. The results from Eclipse IDE console are shown below:

2022-03-03T11:08:49,255 [re.Cycle] WARN [ms.edge.core.cycle.CycleWorker] [_cycle] Error in Controller [ctrlBalancing0]: Value for Channel [meter0/ActivePower] is invalid.

2022-03-03T11:08:49,255 [Worker-0] WARN [socket.AbstractWebsocketClient] Unable to send JSON-RPC message. WebsocketNotConnectedException: {“jsonrpc”:“2.0”,“method”:“timestampedData”,“params”:{}}

2022-03-03T11:08:49,255 [Backend0] INFO [socket.ClientReconnectorWorker] [ctrlBackend0] Waiting till next WebSocket reconnect [32s]

2022-03-03T11:08:49,255 [re.Cycle] INFO [ntroller.debuglog.DebugLogImpl] [ctrlDebugLog0] _sum[State:Fault Ess SoC:49 %|L:0 W Grid:1156 W Consumption:1156 W] ctrlBackend0[State:WARNING: UnableToSend] ctrlBalancing0[State:FAULT: Running the Controller failed] ess0[SoC:49 %|L:0 W] meter0[L:UNDEFINED|State:FAULT: Modbus Communication failed] meter0[1156 W]

2022-03-03T11:08:50,217 [modbus0 ] WARN [bridge.modbus.api.ModbusWorker] [modbus0] FC3ReadHoldingRegisters [meter0;unitid=1;ref=19000/0x4a38;length=122] execution failed: Transaction failed: Illegal Data Address: Illegal Data Address

2022-03-03T11:08:50,264 [re.Cycle]

Could you please help me debug the project and solve the modbus communication issue with the virtual smart meter?

For any further clarification feel free to contact me here.

Hi,

Thanks for reporting the errors and getting in touch!

I just went through the Implementing a Device tutorial once again and indeed found some small problems. At first I had the same problem while Resolving the EdgeApp.bndrun. It was solved by saving the file after Drag&Drop and before starting the resolve process. Afterwards everything else worked properly.

I added my updates to the tutorial in this commit - hope it helps:

Regards,
Stefan

Hello

I followed the updated tutorial (saving the file after Drag&Drop and before starting the resolve process) as well as I deleted the io.openems.edge.meter.simulated folder inside the test folder. However, I get the output below:

[re.Cycle] INFO [ntroller.debuglog.DebugLogImpl] [ctrlDebugLog0] _sum[State:Fault Ess SoC:50 %|L:0 W Grid:1601 W Consumption:1601 W] ctrlBackend0[State:WARNING: UnableToSend] ctrlBalancing0[State:FAULT: Running the Controller failed] ess0[SoC:50 %|L:0 W] meter0[L:UNDEFINED|State:FAULT: Modbus Communication failed] meter0[1601 W]

instead of:

[re.Cycle] INFO [ntroller.debuglog.DebugLogImpl] [ctrlDebugLog0] _sum[State:Ok Production:500 W Consumption:500 W] meter0[L:500 W]

Also, there is a note on the tutorial:

The Modbus-TCP Slave -Server opens on the non-standard port 8502 . The default standardized port for Modbus-TCP is 502 , but we chose 8502 here, because if you run this example on a Linux system it will not allow you to occupy ports below 1024 .

However I see this output on the Eclipse IDE console log:

Modbus-Slave Simulator started. Port [502] Unit-ID [1]

(502 instead of 8502)

In the end of this guide, you will see a production of ‘500 W’ - where ‘500’ comes from register address 1000.

However, I could not see ‘500W’

Kind Regards

[re.Cycle] INFO [ntroller.debuglog.DebugLogImpl] [ctrlDebugLog0] _sum[State:Warning Ess SoC:48 %|L:7831 W Grid:-6179 W Production:500 W Consumption:2152 W] ctrlBackend0[State:WARNING: UnableToSend] ess0[SoC:48 %|L:7831 W] meter0[L:500 W] meter0[-6179 W]

Ignore the previous email.

Now I have State:Warning Ess and Production is 500 W, meter0 [L:500W] however Consumption is 2152 W (instead of 500W).

On the tutorial:

[re.Cycle] INFO [ntroller.debuglog.DebugLogImpl] [ctrlDebugLog0] _sum[State:Ok Production:500 W Consumption:500 W] meter0[L:500 W]

How can I fix this?

Kind Regards