Pentair: Serial connection not working

Hi @jsjames,

after a while I re-setup my Pi with the pentair binding to control my pool system. I had to replace the old serial adapter, re-wire and moved from OH 2.5 to 4 in between.

  • Raspberry Pi
  • OH 4.0.2 with Pentair binding
  • Ip2Serial adapter with WiFi (USR-W610), link is up
  • serial port is set uo 9600,8,n,1; no flow control, RS485 mode
  • no other serial device

I have a Pentair EasyTouch controller with PentAir pump and a remove, system operated in shared equipment mode with a spa. I had this setup running at that time.

The serial adapter shows “Link Up” (WiFi) and I can ping it. I see frequent RxD.
nc shows the following traffic:

00000000: 0000 01b5 ffdf df5b fd5b fb2b ff00 0001  .......[.[.+....
00000010: b5ff 3fdf f7fd 01fb cdff 01ff 01b5 ffdf  ..?.............
00000020: 3ff7 fd01 fbcd ff00 0001 b5ff 3fdf f3fd  ?...........?...
00000030: ebfd b3ff 01ff 01b5 ffdf 3ff3 fdeb fdb3  ..........?.....
00000040: ff00 0001 b5ff 3fdf fdf7 fb77 f18b fbbd  ......?....w....
00000050: ff01 ff01 b5ff df3f fdfb f18b fd4d ff00  .......?.....M..
00000060: 0000 0000 0000 0000 01b5 fde1 dffb c5ed  ................
00000070: f1bf ffff ffff ffff ffff ffff df53 53fb  .............SS.
00000080: 4b63 01fb 9bf5 ddff ffff ade9 f911 ff00  Kc..............
00000090: 0001 b5ff dfdf 5bfd 5bfb 2bff 0000 0000  ......[.[.+.....
000000a0: 0000 0000 0001 b5fd e1df fbc5 edf1 bfff  ................
000000b0: ffff ffff ffff ffff ffdf 5353 fb4b 6301  ..........SS.Kc.
000000c0: fb9b f5dd ffff ffad e9f9 11ff 0000 01b5  ................
000000d0: ffdf df5b fd5b fb2b ff00 0000 0000 0000  ...[.[.+........
000000e0: 0000 01b5 fde1 dffb c5ed f1bf ffff ffff  ................
000000f0: ffff ffff ffff df53 53fb 4b63 01fb 9bf5  .......SS.Kc....
00000100: ddff ffff ade9 f911 ff00 0001 b5ff dfdf  ................
00000110: 5bfd 5bfb 2bff 00b7 5fdd 9bb5 dff9 ff00  [.[.+..._.......
00000120: 0001 b5ff dfdf 5bfd 5bfb 2bff 0000 0000  ......[.[.+.....
00000130: 0000 0000 0001 b5fd e1df fbc5 edf1 bfff  ................
00000140: ffff ffff ffff ffff ffdf 5353 fb4b 6301  ..........SS.Kc.
00000150: fb9b f5dd ffff ffad e9f9 11ff 0000 01b5  ................
00000160: ffdf df5b fd5b fb2b ff00 0000 0000 0000  ...[.[.+........
00000170: 0000 01b5 fde1 dffb c5ed f1bf ffff ffff  ................
00000180: ffff ffff ffff df53 53fb 4b63 01fb 9bf5  .......SS.Kc....

but the binding shows only "FF"s in DEBUG mode, sometimes a WritePacket,
Also when tge pump comes on or I press a button on the remote.

08:48:20.788 [DEBUG] [rnal.handler.PentairBaseBridgeHandler] - FF00 !FF
08:48:21.718 [DEBUG] [rnal.handler.PentairBaseBridgeHandler] - FF00 !FF
08:48:22.218 [DEBUG] [rnal.handler.PentairBaseBridgeHandler] - FF00 !FF
08:48:22.941 [DEBUG] [rnal.handler.PentairBaseBridgeHandler] - Writing packet: FF FF FF 00 FF A5 00 60 22 07 00 01 2E 
08:48:23.738 [DEBUG] [rnal.handler.PentairBaseBridgeHandler] - FF00 !FF
08:48:24.238 [DEBUG] [rnal.handler.PentairBaseBridgeHandler] - FF00 !FF
08:48:26.258 [DEBUG] [rnal.handler.PentairBaseBridgeHandler] - FF00 !FF

but it looks like the serial data is not received correctly from the ip-serial connection.

Do you have any idea?

Which version on the binding are you using? There are quite a few requested changes before I check in the latest, so the one in the distribution is pretty outdated.

I haven’t tested with OH 4.0 yet, so I don’t know if there is some incompatibility.

Is the serial data not being received - or can you not write data?

Hi, OH4 is baed ob Java 17, so I doubt that the OH3 version starts (Java 11), Do you mind to create a version, Changes should be minimal (copyright head in source files, new addon.xml - you can take it from the distro). I created a script for me that converts from OH3 to 4, so I could maintain a single codebase.

Hi Markus -

I’ll try to get something out this week.

Jeff

Hi Markus -

Please try this build: org.openhab.binding.pentair-4.1.0-SNAPSHOT.jar - Google Drive

I have only tested on my development platform with the ip_bridge since I haven’t migrated my home setup to OH 4.0 yet.

If you are starting from the binding that was in the openhab distro, there are quite a few “not backward compatible” changes. Overall the binding should be more robust and capable (see https://github.com/openhab/openhab-addons/pull/13485)

Regards,
Jeff

I’m using the ip bridge too.

The binding doesn’t start due to dependency issue

org.osgi.framework.BundleException: Could not resolve module: org.openhab.binding.pentair [285]
  Unresolved requirement: Import-Package: javax.measure; version="[2.2.0,3.0.0)"

	at org.eclipse.osgi.container.Module.start(Module.java:463) ~[org.eclipse.osgi-3.18.0.jar:?]
	at org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:445) ~[org.eclipse.osgi-3.18.0.jar:?]
	at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundle(DirectoryWatcher.java:1260) ~[?:?]
	at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundles(DirectoryWatcher.java:1233) ~[?:?]
	at org.apache.felix.fileinstall.internal.DirectoryWatcher.doProcess(DirectoryWatcher.java:520) ~[?:?]
	at org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:365) ~[?:?]
	at org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:316) ~[?:?]

I’m wondering, because of javax.measure. You may add this to pom.xml

<dependencies>
    <dependency>
      <groupId>javax.measure</groupId>
      <artifactId>unit-api</artifactId>
      <version>1.0</version>
    </dependency>
</dependencies>

or

<properties>
    <bnd.importpackage>javax.measure.*;version="[2.1,3)"</bnd.importpackage>
</properties>

(not sure about the version)
but I would expect a better fix. Maybe @wborn could help.

You might also add openhab-transport-serial to feature.xml rather than

<properties>
    <bnd.importpackage>gnu.io;version="[3.12,6)"</bnd.importpackage>
</properties>

Where could we find the source code?

Just compiled a new version with the <bnd.importpackage>javax.measure.*;version="[2.1,3) if you want to try that.

the feature.xml is as follows and already has openhab-transport-serial. Are you seeing an error here?

<?xml version="1.0" encoding="UTF-8"?> mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features
    <feature name="openhab-binding-pentair" description="Pentair Binding" version="${project.version}">
            <feature>openhab-runtime-base</feature>
            <feature>openhab-transport-serial</feature>
            <bundle start-level="80">mvn:org.openhab.addons.bundles/org.openhab.binding.pentair/${project.version}</bundle>
    </feature>

looks good, but we need to resolve the dependency on javax.measure
Could you provide a build with+

<properties>
    <bnd.importpackage>javax.measure.*;version="[2.1,3)"</bnd.importpackage>
</properties>

Hi Markus - A new build is already available with the bnd.importpackage. Should be the same link as above.

This version loads, great

I see Pentair IPBridge connected to 192.168.1.9:8899 in the log
but no other output.

Bridge thing is ONLINE, but Controller and Pump have state UNNOWN
disabling/enabling the bridge doesn’t make a difference

It sounds like the binding is not receiving traffic - which was the same issue you had before, correct? The controller and pump things will stay in the UNKNOWN state until it sees a status packet from the ip_bridge. Are you configuring via text or did you add the controller & pump through the UI?

No with the old version the binding was receiving FFs, whereas nc shows at least different codes (but may be just protocol leaders with FF as payload), see Pentair: Serial connection not working

I setup the things using the UI, no text files.

EDIT: ok, it seems debug levels have changed. If I put the binding to TRACE log I see

11:12:16.060 [TRACE] [pentair.internal.parser.PentairParser] - parser: FF00 !FF
11:12:16.570 [TRACE] [pentair.internal.parser.PentairParser] - parser: FF00 !FF
11:12:18.091 [TRACE] [pentair.internal.parser.PentairParser] - parser: FF00 !FF
11:12:18.593 [TRACE] [pentair.internal.parser.PentairParser] - parser: FF00 !FF
11:12:20.102 [TRACE] [pentair.internal.parser.PentairParser] - parser: FF00 !FF

Sample nc ouput

00000000: 0000 01b5 ffdf df5b fd5b fb2b ff00 0001  .......[.[.+....
00000010: b5ff 3fdf f1ff fdc7 ff01 ff01 b5ff df3f  ..?............?
00000020: f1e1 ebed fbfd 55f1 8bff ffff ffff ffe9  ......U.........

Does this shows any usable payload?

Do you have the binding code online? Maybe I could do some debugging.

The code is here: GitHub - jsjames/openhab-addons at pentair2

I’ll look more at the parser to see if something odd is going on with the byte stream.

Does the nc output makes sense?

In looking at the nc output, it does not look right. The binding is looking for a Preamble FF00FF to denote the start of packet. You can read more about the protocol here: https://www.sdyoung.com/home/decoding-the-pentair-easytouch-rs-485-protocol/

I wonder if the baud rate is not set right?

Is 9600,n,8,1 correct?

Yes. Is this a new serial adapter? Not sure what it would be, but the serial adapter seems to be the issue since your old serial adapter was working?

The old one was same brand, different model. It was running well under OH 2.5 and then breaks. It took me a while to work on that and the old model was no longer available.

Firmware (UI etc.) looks the same beside new functions. It supports transparent mode, which should be the required one (others are HTTP client, command mode…). Serial is set to 9600,8,n,1 and I see traffic (also RxD blinks; I connected green to A and yellow to B)

Since RS485 uses differential signalling, you could try to swap the green/yellow connections. In fact, looking at your bit-stream, i see a lot of repeated 00 (vs. FF) - its possible your entire bit-stream is inverted. Just something to try.