No announcement yet.

Tunnel and S2E

  • Filter
  • Time
  • Show
Clear All
new posts

  • Tunnel and S2E

    I apologize if this question has been addressed elsewhere in the forum, but I have searched to no avail. Documentation for the XPORT has shed no light on the subject either.

    I'm curious if it is possible for the XPORT to simultaneously support both an Ethernet-to-RS232 tunnel and CGI-scripts that utilize the RS232 serial port.

    My project currently utilizes the tunneling capability to send and receive command responses to the uC via RS232. This feature works great, but I would also like to query/modify statistics and configuration information via a webpage.

    The current thought process is as follows:
    - Process tunneled data as usual.
    - Upload CGI scripts which query and modify the configuration.
    - The activated CGI script will generate specially formatted commands and send it to the uC via RS232.
    - The uC will recognize the specially formatted command and generate a response and send it to the uC via RS232.
    - The CGI script will wait for the RS232 reply and generate the formatted HTML.

    - Will a CGI script waiting for an RS232 reply suspend the tunnel functionality so that the reply will NOT be transmitted across the tunnel?
    - If not, how might I synchronize access to the RS232 port between the CGI script and the tunnel task?

    Other comments:
    - Unfortunately it is not sufficient to expose the tunneled command interface via the web interface. Both tunneling and web interface must be active at the same time.

    Thanks for your consideration.

  • #2
    It would be possible in theory. But you'll need to do some source code modification.

    My recommendation would be to create an intermediary process that actually deals with the serial communications (receiving and sending data) and passes on the received data to the relevant process.

    If you don't, then you'll likely face problems with mutual exclusion and i/o starvation. Let alone potential problems with data received being passed to the wrong process.