Problem with initialization from Modbus

Hello, everybody,

I try to use Openhab2 to read out a charge control from Phoenix Contact via Modbus and control it later.
I did the following:

-I installed the binding for Modbus in the paper UI
-I wrote the following modbus.things file:

Bridge modbus:tcp:wallbe [ host=“192.168.178.8”, port=502, id=255 ] {

    Bridge poller Wallbe_Data [ start=315, length=4, refresh=1000, type="holding" ] {
	
		Thing data EV_IP_1			[ readStart="315", readValueType="int16", writeStart="315", writeValueType="int16", writeType="holding" ]
		Thing data EV_IP_2			[ readStart="316", readValueType="int16", writeStart="316", writeValueType="int16", writeType="holding" ]
		Thing data EV_IP_3			[ readStart="317", readValueType="int16", writeStart="317", writeValueType="int16", writeType="holding" ]
		Thing data EV_IP_4			[ readStart="318", readValueType="int16", writeStart="318", writeValueType="int16", writeType="holding" ]
    }
}

-I wrote the following modbus.items file:

Number IP_Adress_1	"IP-Adresse 1. Byte [%d]" { channel="modbus:data:wallbe:holding:EV_IP_1:number" }
Number IP_Adress_2	"IP-Adresse 2. Byte [%d]" { channel="modbus:data:wallbe:holding:EV_IP_2:number" }
Number IP_Adress_3	"IP-Adresse 3. Byte [%d]" { channel="modbus:data:wallbe:holding:EV_IP_3:number" }
Number IP_Adress_4	"IP-Adresse 4. Byte [%d]" { channel="modbus:data:wallbe:holding:EV_IP_4:number" }

I get the following errors with the LOG Viewer:

2019-11-14 19:57:13.707 [WARN ] [el.core.internal.ModelRepositoryImpl] - Configuration model ‘modbus.things’ has errors, therefore ignoring it: [2,33]: no viable alternative at input ‘?’

[2,36]: missing ‘]’ at ‘192’

[2,40]: no viable alternative at input ‘168’

[2,44]: no viable alternative at input ‘178’

[2,48]: no viable alternative at input ‘8’

[2,54]: no viable alternative at input ‘port’

[2,59]: no viable alternative at input ‘502’

[2,64]: no viable alternative at input ‘id’

[2,67]: no viable alternative at input ‘255’

[11,1]: extraneous input ‘}’ expecting EOF

What am I doing wrong? Maybe someone can help me.

Greetings and thanks, Karsten

Spot the difference in highlighting -

host=“192.168.178.8”
type="holding"

You must use the correct type of “plain” quotemarks in xxx.things files.

As an aside -

Really? That’s unusual, and technically invalid in Modbus I think. If you don’t know what should be, try 1

Hi rossko,
Thank you, I’m blind ;-).
The id=255 is real. The modbus is working now.
My next problem is, that the items from my .item file are visible in the Paper UI but they are not linked to the channels from the Modbus data. If I link they by hand, then it will work well.
What am I doing wrong?

It is still technically invalid, or rather reserved. 1 - 247 are “approved” unit IDs. The only time I’ve come across 255 is when it is given as a factory default that can be easily identified by some configuration utility, that then sets it to a sensible value.

You’re not likely to run into this in a “home” environment, but beware that anything around that is actually aware of Modbus-TCP protocol (a gateway or somesuch) can act unexpectedly.

PaperUI is only vaguely aware of anything from xxx.things or xxx.items files.
Don’t expect everything to work in PaperUI for non-PaperUI configured stuff.

Do they work?

OK. I have to connect the items manually, then it works.
The Modbus ID cannot be changed. But in my network there are only two Modbus participants. It works so far first. Thanks!