Java and Transparent Socket | Telit Cinterion IoT Developer Community
January 27, 2019 - 9:15pm, 1465 views
I'm working with an EHS5 module and have some doubts.
My project is to connect with a PLC to retrieve its data and send some commands, and I could achieve it using a J2ME application that communicates via Modbus RTU protocol with my equipment and send this data to my FTP Server.
Since the maker of this PLC offer some other features like Remote Access and the possibility of multi-connections on its serial port I've been wondering if there is the possibility of creating a transparent socket between 2G/3G connection and the module serial ports and having a separate J2ME application running just to send the module IP to my server, acting as a Dynamic DNS Solution.
My questions are:
- How can I create a link between COM0 or COM1 and a Transparent Socket?
- Can I have both transparent Socket and a J2ME application running concurrently (the J2ME will never access the serial port in this way)?
Thanks in advance.
As I understand you have a Java MIDlet on the module that communicates with PLC over serial interface, executes some logic with Modbus protocol and sends data to a server.
There is a transparent socket feature on the module but your device (in this case PLC) would have to configure it and open with AT commands. Then it could transfer the data. Then you would not be able to use your Java application to access the same serial port.
If you can't program PLC to execute AT commands on the module to configure and open this connection and you'd rather want to have all the logic inside the MIDlet, you'd have to implement this logic - open ASC0 inside the MIDlet, connect to a network server (or accept an incoming connection) and then forward all incoming data to serial and all the data from serial to the network socket. You can also implement reading of IP address and sending it to some network server (in the same MIDlet or another).