Problem implementing new device

Hello Everybody,

I am a beginner of OpenNMS. I am trying to implement a new device. I followed this link Implementing a device :: Open Energy Management System

I got the error for this function, although I imported suggested packages.

@Override
	protected ModbusProtocol defineModbusProtocol() throws OpenemsException {
		return new ModbusProtocol(this, //
				new FC3ReadRegistersTask(1000, Priority.HIGH,
						m(ElectricityMeter.ChannelId.ACTIVE_POWER, new SignedWordElement(1000))));
	}

The error message is

The type com.ghgande.j2mod.modbus.msg.ReadMultipleRegistersRequest cannot be resolved. It is indirectly referenced from required type io.openems.edge.bridge.modbus.api.task.FC3ReadRegistersTask

Could someone guide me to fix this?
I would really appreciate any input.

Best Regards
Ei Ei Mon

i have the same error

hi ei mon

i just found something,hope it can help u.i try to compare the tutorial code and other code one line to one line and try to figure out what it works on other devices but error on us.

Then finally i find the error disappears after u add a new line

com.ghgande.j2mod

to the buildpath inside the source of bnd.bnd like this

微信图片_20230821165941

it fixs our problem but i have no idea what com.ghgande.j2mod is,hope someone can give some tips

regards,
zao_hon

Thank you very much zao_hon. I will try it.

Same problem and I use the solution you present and its work