Errors in simulating Evcs

Hello folks,

I am beginner of OpemEMS. I am trying to implement simulator evcs. It appears in UI but the errors show the below:

2023-10-14T11:53:13,393 [tManager] ERROR [mulator.evcs.SimulatorEvcsImpl] bundle io.openems.edge.simulator:1.0.0.202310140240 (153)[io.openems.edge.simulator.evcs.SimulatorEvcsImpl(71)] : Error during instantiation of the implementation object
java.lang.reflect.InvocationTargetException: null
at jdk.internal.reflect.GeneratedConstructorAccessor10.newInstance(Unknown Source) ~[?:?]
at jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[?:?]
at java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499) ~[?:?]
at java.lang.reflect.Constructor.newInstance(Constructor.java:480) ~[?:?]
at org.apache.felix.scr.impl.inject.internal.ComponentConstructorImpl.newInstance(ComponentConstructorImpl.java:326) ~[?:?]
at org.apache.felix.scr.impl.manager.SingleComponentManager.createImplementationObject(SingleComponentManager.java:286) ~[?:?]
at org.apache.felix.scr.impl.manager.SingleComponentManager.createComponent(SingleComponentManager.java:115) ~[?:?]
at org.apache.felix.scr.impl.manager.SingleComponentManager.getService(SingleComponentManager.java:1002) ~[?:?]
at org.apache.felix.scr.impl.manager.SingleComponentManager.getServiceInternal(SingleComponentManager.java:975) ~[?:?]
at org.apache.felix.scr.impl.manager.SingleComponentManager.getService(SingleComponentManager.java:920) ~[?:?]
at org.apache.felix.framework.ServiceRegistrationImpl.getFactoryUnchecked(ServiceRegistrationImpl.java:349) ~[?:?]
at org.apache.felix.framework.ServiceRegistrationImpl.getService(ServiceRegistrationImpl.java:249) ~[?:?]
at org.apache.felix.framework.ServiceRegistry.getService(ServiceRegistry.java:362) ~[?:?]
at org.apache.felix.framework.Felix.getService(Felix.java:3984) ~[?:?]
at org.apache.felix.framework.BundleContextImpl.getService(BundleContextImpl.java:450) ~[?:?]
at io.openems.edge.core.componentmanager.ComponentManagerImpl.getComponentsViaService(ComponentManagerImpl.java:205) ~[?:?]
at io.openems.edge.core.componentmanager.ComponentManagerImpl.getComponentsViaService(ComponentManagerImpl.java:182) ~[?:?]
at io.openems.edge.core.componentmanager.ComponentManagerImpl.getEnabledComponents(ComponentManagerImpl.java:141) ~[?:?]
at io.openems.edge.core.componentmanager.OsgiValidateWorker.findDefectiveComponents(OsgiValidateWorker.java:99) ~[?:?]
at io.openems.edge.core.componentmanager.OsgiValidateWorker.forever(OsgiValidateWorker.java:80) ~[?:?]
at io.openems.common.worker.AbstractWorker$1.run(AbstractWorker.java:129) ~[?:?]
Caused by: java.lang.IllegalArgumentException: Duplicated Channel-ID [ActiveConsumptionEnergy] for Component [null]
at io.openems.edge.common.component.AbstractOpenemsComponent.addChannel(AbstractOpenemsComponent.java:374) ~[?:?]
at io.openems.edge.common.component.AbstractOpenemsComponent.addChannel(AbstractOpenemsComponent.java:357) ~[?:?]
at io.openems.edge.common.component.AbstractOpenemsComponent.addChannels(AbstractOpenemsComponent.java:414) ~[?:?]
at io.openems.edge.common.component.AbstractOpenemsComponent.(AbstractOpenemsComponent.java:100) ~[?:?]
at io.openems.edge.evcs.api.AbstractManagedEvcsComponent.(AbstractManagedEvcsComponent.java:50) ~[?:?]
at io.openems.edge.simulator.evcs.SimulatorEvcsImpl.(SimulatorEvcsImpl.java:60) ~[?:?]
… 21 more
2023-10-14T11:53:13,397 [tchQueue] ERROR [Events.Framework ] FrameworkEvent ERROR
org.osgi.framework.ServiceException: Service factory returned null. (Component: Simulator.Evcs (71))
at org.apache.felix.framework.ServiceRegistrationImpl.getFactoryUnchecked(ServiceRegistrationImpl.java:385) ~[?:?]
at org.apache.felix.framework.ServiceRegistrationImpl.getService(ServiceRegistrationImpl.java:249) ~[?:?]
at org.apache.felix.framework.ServiceRegistry.getService(ServiceRegistry.java:362) ~[?:?]
at org.apache.felix.framework.Felix.getService(Felix.java:3984) ~[?:?]
at org.apache.felix.framework.BundleContextImpl.getService(BundleContextImpl.java:450) ~[?:?]
at io.openems.edge.core.componentmanager.ComponentManagerImpl.getComponentsViaService(ComponentManagerImpl.java:205) ~[?:?]
at io.openems.edge.core.componentmanager.ComponentManagerImpl.getComponentsViaService(ComponentManagerImpl.java:182) ~[?:?]
at io.openems.edge.core.componentmanager.ComponentManagerImpl.getEnabledComponents(ComponentManagerImpl.java:141) ~[?:?]
at io.openems.edge.core.componentmanager.OsgiValidateWorker.findDefectiveComponents(OsgiValidateWorker.java:99) ~[?:?]
at io.openems.edge.core.componentmanager.OsgiValidateWorker.forever(OsgiValidateWorker.java:80) ~[?:?]
at io.openems.common.worker.AbstractWorker$1.run(AbstractWorker.java:129) ~[?:?]

Could anyone give suggestions? Thank you very much in advance.

Best regards,
EEM

Without the Code or the “Parts of Interest” it is not easy to Debug i need to say - maybe provide the Code so we can have a look

Hi @Sn0w3y ,

Thank you very much. Actually, I didn’t modify the code. I just tried to implement simulator EVCs as shown below:

Are there any documents to implement EVCs?

Thanks again.

Hello,

i quote @tsicking:

I just checked it myselt. There is indeed an error in the implementation of the simulated Evcs: The channel ACTIVE_CONSUMPTION_ENERGY exists in both, ElectricityMeter.ChannelId and Evcs.ChannelId, so you have a duplicated ChannelId, and the constructor throws an exception.

I don’t know what the easiest solution to this is. Maybe, for the moment, you simply rename the channel in the Evcs-interface to EVCS_ACTIVE_CONSUMPTION_ENERGY or something? Or does someone else have a better and similarly short solution?

Best regards,
Thomas

Thank you very much @Sn0w3y for your support.

1 Like

Thank you for reporting this. It will be (quick-)fixed in FEMS Backports by sfeilmeier · Pull Request #2446 · OpenEMS/openems · GitHub, concretely here:

Regards,
Stefan

Forgive me for hijacking this thread but I was about to pose a question about the Simulated EVCS but I thought the errors above were related to the fact that there is no option to provide a datasource as with other simulator services. I have attached a screenshot of both the Simulator EVCS configuration window as well as the Simulator PV-Inverter window. If the missing datasource option in Simulator EVCS has nothing to do with the issues above, I apologize.


Hi @acabrera and welcome to the OpenEMS Community.

No, in fact your question has nothing to do with the above. Don’t be afraid to open up a separate thread for your future questions. :+1:

The simulated EVCS is not intended to “replay” the data of a datasource, but it is used to test EVCS controllers that actively control the EVCS. In that regard it is very different to a simulated Meter. What is the actual use-case you are trying to solve?

Regards,
Stefan

Thanks, Stefan. Please disregard the above, I was experiencing errors with the EVCS simulator and thought the issue might be with the datasource. I was just poking around trying to better understand OpenEMS so no need to dig further into this one.

I have begun the process of setting up OpenEMS for a client and I am slowly learning the ins and outs of this framework. I did post a separate forum question about an error I am getting trying to run the GitPod simulation and I just tried it again with a similar issue for Task 2 (OpenEMS Edge build): Live-Demo on Gitpod Build Error