[SOLVED] OH2 onewire binding seems to not send output parameter value to DS2413

I am migrating a working OH1 installation with several DS2413 controlling rollershutters to OH2.

The roller shutters do not move in OH2 when I send the respective commands. They do move with OH1 and with a simple jowfs application

Checking with tcpdump I found the OH2 does send a message which seems to lack the value, notice there is no data at the and of the message, just a 0 after the sensor id:

0000   00 00 00 00 00 00 00 10 00 00 00 06 00 00 01 24
0010   00 01 00 00 00 00 00 00 33 41 2e 37 31 38 46 31
0020   43 30 30 30 30 30 30 00

This is from the jowfs test client, there is a ‘1’ (0x31) at the end (which is the value to be sent to the DS2431:

0000   00 00 00 00 00 00 1a 00 00 00 03 00 00 01 06 00
0010   00 00 01 00 00 00 00 33 41 2e 37 31 38 46 31 43
0020   30 30 30 30 30 30 2f 50 49 4f 2e 42 59 54 45 00
0030   31

The message above was generated by
connection.write("3A.718F1C000000/PIO.BYTE", "1");

This is my .things file

Bridge onewire:owserver:mybridge [ 
    network-address="192.168.3.46" 
    ] {o
	Thing digitalio2 rs1 [
        id="3A.718F1C000000", 
        refresh=60
        ] {
            Channels:
                Type dio : rrss1 [
                    mode="output"
                ]
        } 
}
Number rs1 "MySensor [%.1f %unit%]" { channel="onewire:digitalio:mybridge:rs1:rrss1" }

I am using this version of the binding:

openhab> bundle:list|grep Wire
221 │ Active   │  80 │ 0.11.0.201901020922    │ Eclipse SmartHome OneWire Binding

because the version bundled with OH2.4 left my items stayed in “initializing”

Is my configuration incorrect or is this a bug?

Fixed in master Issue #6725. You can download the current master build here.

Thanks, great. I will test and provide feedback in the next days.

Wait, your version already contains the fix. But please name the channel digital0, digital1, …

no sure what you mean. this does not seem to work:

Thing digitalio2 rs1 [
    id="3A.718F1C000000", 
    refresh=60
    ] {
        Channels:
            Type dio : digital0 [
                mode="output"
            ]
    }

I just checked and tested with one of my own DS2413 that it works. However, I use PaperUI defined things. Please try if that works for you. We can try to find out what is wrong with the textual configuration later.

PaperUI created things work for me.

I checked the text configuration again, using the same naming conventions as the PaperUI but it still does not work.

	Thing digitalio2 3A_718F1C000000 [
        id="3A.718F1C000000", 
        refresh=60
        ] {
            Channels:
                Type dio : digital0 [
                    mode="output"
                ]
                Type dio : digita11 [
                    mode="output"
                ]
        } 

Let me know if I can help in any way to fix the textual config. I have Java experience and could maybe remotely debug my OH instance if that would make sense.

I’d rather like to stay with the textual config. (I am a OH newbie so maybe i am doing something wrong but changes in my configuration are not always activated and I have then to clear the cache and tmp which is annoying. Working with the PaperUI and text configuration at the same during analysis of this issue again brought my system in a state where it did not pick up the text config changes so I had to clear the cache.)

Thanks, so the code itself works and we have to find out why the channel config is not picked up by the textual configuration. I‘ll try to debug that.

My system is now behaving weird.

I have a PaperUI defined and another textual defined thing.

I see (not reproducible) commands being sent to the item which is connected to the textually configured thing and then the correct message was is sent! I have no idea where these commands come from.

To me it seems best to install a new instance and try again. What do you think?

I’m a bit lost. I just tested with the latest master (link above) and it works for me. I used:

Bridge onewire:owserver:mybridge [ 
	network-address="192.168.0.51" 
	] {
	
	Thing digitalio2 mysensor [
		id="3A.D5BC04000000",
		refresh=60
		] {
			Channels:
				Type dio : digital0 [
					mode="output"
				]
		} 
	
}

i am already reinstalling from scratch and will keep you updated

Still seeing this additional command after new installation and uninstallation of onewire binding. I need to solve this problem first then I will come back

I don’t have additional commands anymore, I did not use PaperUI since reinstallation.

Do you tests with 2 channels for a thing? Is my configuration above correct wrt multiple channels?

Because what I see in the logs now is that the binding refuses to write because the channel is supposedly configured as input:

2019-01-05 14:22:41.860 [DEBUG] [ternal.handler.DigitalIOThingHandler] - writing to channel onewire:digitalio2:mybridge:3A_718F1C000000:digital1 in thing onewire:digitalio2:mybridge:3A_718F1C000000 not permitted (input channel)

I do not find digital0 anywhere in the logs. All data goes to PIO.A as seen in the logs and by tcpdump.

Default is input. So you would need to configure the digital1 channel like the digital0.

If you don’t configure the channel, it is still present as input. Since writing to inputs is not allowed, you get the error message.

IMHO I have both channels configured as output, see my post from 11:47 today. Is the syntax correct?

Except that you wrote digita11 instead of digital1. It works with two channels in that way for me.

1 Like

Thanks for spotting the typo, I made sure that I have l1 everywhere no.

After removing the digital1 channel all works fine with the remaining digital0 channel.

Wen I add the second channel back again, I see only references to PIO.A in the logs. (My commands to the item connected to the second channel seem to get lost)

Is the second channel supposed to access PIO.B?

Sorry, can‘t help there.

It works exactly as described in my test setup. digital0 operates PIO.A and digital1 operates PIO.B.

Where is the description of your test setup?

Bridge onewire:owserver:mybridge [ 
	network-address="192.168.0.51" 
	] {
	
	Thing digitalio2 mysensor [
		id="3A.D5BC04000000",
		refresh=60
		] {
			Channels:
				Type dio : digital0 [
					mode="output"
				]
				Type dio : digital1 [
					mode="output"
				]
		} 
	
}