Hi all, in the last days I migrated from OpenHab 2.5 (running on NetBook with ATOM CPU) to OpenHab 3.2 (now running on a Raspberry Pi3)
My configuration involves sending from OH some TCP packets to localhost at given port, where an external TCP server (a QT application of mine running on same machine) listen to the OH client.
It was working perfectly, so I would like to restore the OH 3.2 “network” functionalities as I had in previous OH 2.5. (QT application is kept the same)
I work mainly with " File-based configuration", mainly because I have all ready (again, I want to perform a porting to new OH/Pi3, not a new development).
I used to achieve the TCP sending by some rules like that
rule "GF_LivingRoom_Door"
when
Item GF_LivingRoom_Door received command
then
// some logics here...
val outStr = String::format("$%1$02d_%2$d#",DOORWAY_SPOTLIGHT,strVal)
sendCommand(txCmdString, outStr)
end
where txCmdString is an item
String txCmdString "txCmdString" (All) {tcp=">[127.0.0.1:1234:JS(sendValue.js)]"}
Now, when I act on GF_LivingRoom_Door item I see in log, as expected:
*2021-12-28 23:07:11.005 [INFO ] [openhab.event.ItemCommandEvent ] - Item 'txCmdString' received command
*2021-12-28 23:07:11.010 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'txCmdString' changed from...to...
but nothing reaches TCP server.
Sadly I don’t remember all the setup I did in OH 2.5, what am I missing? Some hints:
- I installed the Network binding
- weirdly, I didn’t find the network.cfg file under /etc/openhab/services…should I create it manually?
- unfortunately, I don’t remember why I added
JS(sendValue.js)]
to my item, maybe am I missing some other binding/transformation, like JS? - I have the backup of old OH 2.5, in case I need to retrieve some info from previous setup
If you have any suggestions how to send data TCP data (TCP server expects just strings) to given host:port, please tell me.
My only constraint is I want to keep the previous setup, so please do not come saying “try MQTT/CURL/other mechanism…” as I definitely prefer to keep the same configuration was working properly with OH 2.5
Thanks,
Enzo