Skip to content

Example

Version: 1.0.0

In order to setup a functioning example, a PMU simulator can be compiled using the following library: https://github.com/marsolla/Open-C37.118

The following example can be compiled and directly used to test readings from ESF: https://github.com/marsolla/Open-C37.118/blob/master/examples/pmu.c

Run the compiled simulator. Create a new Driver instance of type com.eurotech.framework.c37118.driver.C37118Driver, setting the Host and Port parameters in order to point towards the simulator which is listening (most probably, localhost:4712).

Set the Stream source ID parameter of the newly created Driver to 7, as it is the ID used in the simulator.

Create a Wire Graph as the following, composed by: Timer → Asset → Logger

Wire graph

Set the timer.interval of the Timer to 1 in order to trigger readings more frequently. Set the log.verbosity of the Logger to VERBOSE in order to see the data in the log. Set the Asset channels as the following, to read test parameters defined in the simulator:

Wire graph

You should now be able to read values in the console log, if testing through ESF simulator in Eclipse. Otherwise, if running directly on the gateway, run command tail -f /var/log/kura.log.

Wire graph