Fatek PLC migration to OpenHab v3

.dll is windows only format, use of these libraries beyond their origin software might violate license terms you accepted while downloading/installing software, finally each protocol beyond device adds mapping complexity and increases likehood of issues. Think of int32 written into uint16 register at lower level etc…
Sorry, but what you propose is not what we are discussing here. I’m happy that you are happy with HMIs you have.

I didn’t suggest to use them , i say you can take a look on they protocol. Is nothing wrong . Anyway weintek is free software also facom , single one payed is proface.
If you open the facom VB form , as they provide in example , can see what protocol they use to communicate . Is not secret and don’t break any license.
Thanks

@wangine protocol to read/write values out of registers is public and already implemented by @slawekjaranowski in jfatek library. There are no issues with it. However, there are more things which can be done, and retrieving register names is one of them.
Binding will function based on jfatek, its just a question if we will be able to make it more advanced.

Well , more than read/write registers can’t be done i think. Except R5000 ++ , ROR registers ( if they are configured by user ) and some “special” register there will not be the write function. Anything else than that i dont see the purpose. I mean , the station number is defined by master , register name the same , also comunication parameter. PLC only will respond on that . Anyway that depend on user ladder and how he write the rules in OH .
I was thinking the " jfatek " library is incomplete and that why i try to search documentation on that , but i assume is about portability from java 8 to 11.
I understand now , is only about the time and skill to be implemented in OH 3 .
Thanks

Yes , and can you see this also . Is everything here and way more than necesary
https://www.esea.cz/support/fatek/FBs_Manual/Manual_2/Appendix1.pdf
Thanks

Hello everyone, any news about Fatek plc binding for OH3?

I’ve made tests of discovery, however there was a bug in handling PLC thing on openHAB side.
Sources are available here: https://github.com/ConnectorIO/connectorio-addons/tree/master/bundles/org.connectorio.addons.binding.fatek

I am out for holiday this week, but I am in progress to make some dependency updates. Sadly these affect maintainability of all branches (3.x-4.x). I have no solution concept yet, once I pass this part I will try to look at addon distribution/bugfixes.

1 Like

Hey folks,
So far there is only build for OH 3.0.x. Please make a sandbox install and give it a try. I can’t currently produce version for each OH release. Go to openhab console and install extension through below command:
kar:install https://repository.connectorio.cloud/repository/co7io-public-snapshots/org/connectorio/addons/org.connectorio.addons.kar.fatek/3.0.0-f7081bf-SNAPSHOT/org.connectorio.addons.kar.fatek-3.0.0-f7081bf-20231011.223347-1.kar or download it by browser and install through copy/paste procedure.

Wait a bit, then co7io-fatek binding should appear. Binding supports so far only discrete input/output. Mapping of further channel/register kinds will follow.

For 4.0.x users, there is basic build with only discovery: org.connectorio.addons.kar.fatek-4.0.0-20231011.223528-1.kar.

All snapshot builds (such above) will be dropped after 90 days.

1 Like

An update - fatek bidning was updated so it covers binary channels - other channel kinds will follow later. You can download KAR file from repository.connectorio.cloud. Pick version with x.y.z-SNAPSHOT.

The KAR files were recently updated so almost all versions (3.0.x, 3.2.x, 3.3.x, 3.4.x, 4.0.x) are available for testing. All versions have the same functionality. Binding is able to discover PLCs within your local network or connected through serial port.

Many thanks for @skuhrovec.j who supplied me test hardware and and @Alien who did test program.
Please report issues with stack traces to GitHub - ConnectorIO/connectorio-addons: Dedicated repository for openHAB software extensions maintained by ConnectorIO. (with b-fatek label).

Best,
Łukasz

3 Likes

Hi Łukasz, great work! :slight_smile: Thx!
I’m stuck, the binding discover my CBEH and Fatek but bridge has status Initializing.


In Frontail

2023-11-11 18:14:16.582 [WARN ] [mmon.WrappedScheduledExecutorService] - Scheduled runnable ended with an exception: 
> java.lang.NullPointerException: Cannot invoke "java.util.concurrent.CompletableFuture.complete(Object)" because "this.connection" is null
> 	at org.connectorio.addons.binding.fatek.internal.handler.FatekTcpBridgeHandler.lambda$initialize$1(FatekTcpBridgeHandler.java:77) ~[?:?]
> 	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539) ~[?:?]
> 	at java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[?:?]
> 	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304) ~[?:?]
> 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) [?:?]
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) [?:?]
> 	at java.lang.Thread.run(Thread.java:833) [?:?]

Tested in OH 4.04 and 4.1.0M3

Hey, I have to check build status because this error happened with earlier versions. I know navigation over nexus listing is not obvious, but can you please check what was build date for your KAR file (it is part of filename after 4.0.0)?

EDIT:
Sorry, my fault, I thought the date was in the format Y:D:M :slight_smile:

Hi! it’s 20231011.223528-1

and when I login to karaf I get error like below, maybe it’s because I updated from 4.0.4 to M3, I will try a fresh install

Failed to load native library:jansi-2.4.0-ef22057c626bcd34-libjansi.so. osinfo: Linux/arm
java.lang.UnsatisfiedLinkError: /var/lib/openhab/tmp/jansi-2.4.0-ef22057c626bcd34-libjansi.so: /var/lib/openhab/tmp/jansi-2.4.0-ef22057c626bcd34-libjansi.so: nie można otworzyć pliku obiektu dzielonego: Nie ma takiego pliku ani katalogu

Please use 4.0.0-20231106.121241-2, part after 4.0.0 is build date (2023.11.06 12:12:41), thus it is more recent than version you picked first (I know nexus navigation is counter intuitive).

Other issue with jansi is not related to fatek binding. It does not ship nor use this dependency directly nor indirectly. It could be caused by other conditions, i.e. reload of core after binding gets installed, however I test offline installation especially against that and fatek integration was free od that trouble.
Anyhow - do you get same trouble with vanilla openHAB / without fatek addon / with any addon from community marketplace?

Cheers,
Łukasz

1 Like

Thanks Łukasz, I assumed the date was in American format:). Yes i installed some addons from community marketplace yesterday. when I installed block libraries, errors appeared.

Thanks

Hey Łukasz, after fresh OH install.
When adding Channel to Thing i got this error.
Can You add please instead of S: step relay, R: Register it’s useful for roller shutters and dimmers:)

2023-11-12 15:02:57.999 [WARN ] [mmon.WrappedScheduledExecutorService] - Scheduled runnable ended with an exception: 
java.util.concurrent.RejectedExecutionException: Task org.connectorio.addons.binding.fatek.internal.transport.JFatekFaconConnection$$Lambda$1733/0xbb63ba90@1387686 rejected from java.util.concurrent.ThreadPoolExecutor@12d7f70[Terminated, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 1]
	at java.util.concurrent.ThreadPoolExecutor$AbortPolicy.rejectedExecution(ThreadPoolExecutor.java:2065) ~[?:?]
	at java.util.concurrent.ThreadPoolExecutor.reject(ThreadPoolExecutor.java:833) ~[?:?]
	at java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:1365) ~[?:?]
	at org.connectorio.addons.binding.fatek.internal.transport.JFatekFaconConnection.execute(JFatekFaconConnection.java:47) ~[?:?]
	at org.connectorio.addons.binding.fatek.internal.handler.FatekPlcThingHandler.run(FatekPlcThingHandler.java:155) ~[?:?]
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539) ~[?:?]
	at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:305) ~[?:?]
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305) ~[?:?]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) ~[?:?]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) ~[?:?]
	at java.lang.Thread.run(Thread.java:833) ~[?:?]

Cheers,
Rafal

Can you share thing/channel definitions? I will try to reproduce issue.

Sure,

UID: co7io-fatek:plc:192-168-002-040:1
label: Fatek FBs-60MC station number:1
thingTypeUID: co7io-fatek:plc
configuration:
  stationNumber: 1
  refreshInterval: 100
bridgeUID: co7io-fatek:tcp:192-168-002-040
channels:
  - id: M24
    channelTypeUID: co7io-fatek:discrete
    label: M24
    description: ""
    configuration:
      index: 24
      register: M

Hi Łukasz,
I managed to get it work must make more investigation, now i can only read states.
Cheers Rafał.

Edit
After several tests, here’s a little how to :slight_smile:
Don’t touch Refresh Interval, it will throw errors as above, then all items/channels/things must be removed. Next uninstall binding then install again.
When configuring the M relays in Channel set Invert to ON


In Items, Profile set to Follow

Hello Łukasz,
I appreciate your work on binding. But next year is passing and i am still stuck with old openhab binding with no possiblity to do migration.
Do you know when you can have any working version?
Almost year ago i wrote i am dissappointed with opensource software - i was great fun of this before for long time. And now i am getting more and more frustrated. :frowning:
This is not personallu to you. i admire that you took this work although you were not author of this binding, nore engaged in this.
Marcin