Hi Dojo Community, I need your Help!
I am working on a task where I need to add dynamic polling (dynamic connections) feature. This driver is smart-serial, and only have one main connection. Table with Connection's IP addresses and Port Numbers must be added, and connection needs to be dynamically changed when previous connection is down (device not accessible) ...
- I have used dynamic ip parameter for this purpose (Dynamic polling | DataMiner Docs) - <Type options="dynamic ip 0">read</Type>
- Also, for tracking configured connections I am using <Type>ip</Type> parameter (in this case it will only contain one connection configuration, the main one, in "[IP Address]:[Port Number]" format)
Issue -> When I do set to dynamic ip parameter, and restart element, that value is correctly synced with <Type>ip</Type> param value. But on stream-viewer I can see that connection was not actually changed as it is still polling from Connection that was previously set from element edit wizard. I have also checked the Wireshark and it's same there.
In short, the previous connection is not closed and the new one is not established, although I see that the connection set in the dynamic ip parameter is the same as the one shown by the <Type>ip</Type> parameter that I use to track the connection configuration.
1st image:
- The element has been created. Inside the Element edit wizard, the ip address (10.12.0.1) and port number (9901) are set. That connection is added to the table, we also see that the <Type>ip</Type> parameter correctly shows the configuration. The stream-viewer also shows that the connection is established.
2nd image:
- Details have been added for the remaining connections (3 of them in this case). By pressing the 'Reconnect' button, an attempt is made to change the connection, in such a way that the value of the ip address and the port number are set in the dynamic ip parameter. If the element is restarted after that, the value of the dynamic ip parameter is correctly displayed on the <Type>ip</Type> parameter, however, that connection is not established, nor is the previous one terminated. The desired behavior would be to change the 10.0.12.1:9901 connection to 10.12.0.5:9905.
After investigating together with Matej, we had to come to the unfortunate conclusion that dynamic IP for smart-serial connections is not supported at the time of writing (version 10.3.8). I don't see a technical reason why we couldn't extend these features to work together, and urge you to get in touch with the PO of data-acquisition.
Update: Protocol Type was changed from smart-serial to serial in order to check if 'dynamic Ip' feature is working for serial. After testing it, it turns out that it actually works. I am not sure if 'dynamic Ip' is or should be supported for smart-serial, or if this is known sw issue. Also, it seems there is no need to trigger 'close' and 'open' actions in this case, 'dynamic Ip' will do it automatically.
Approach with triggering 'close' and 'open' Actions was tested, but outcome is still the same (although I was able to close the connection, but opened connection is still the same as the previously closed one, it seems that connection is locked on the configs from edit element wizard all the time).
It is definitely planned to use the TcpClient object for the device availability check algorithm and close those connections as soon as it detects that the device is unavailable on that tcp connection. However, the dynamic change of the connection (IP address and port number) blocks further driver development ...
Please see the attached screenshots for the described outcome.
Hi Matej,
Can you try the dynamic polling feature together with the Smart-Serial behavior after a physical device disconnect procedure?
Thank You Fenta,
I will try and check if it works with this approach 😀