Announcement

Collapse
No announcement yet.

Example on how to handle JavaScript requests

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Example on how to handle JavaScript requests

    Hi
    Can someone point me to any documentation or code examples or explanation on how the Xport Pro device is meant to handle JavaScript requests for data? The Lantronix documentation seems very poor in providing any documentation or examples on how to achieve these functions?

    I want to make requests for data (from my HTML/JavaScript pages) to Xport Pro which will then communicate via its serial port to retrieve data from an external device and return this data to my JavaScript code which will then display it on a webpage.

    I don't want to generate web-pages as per their cgi.c example - rather I want to use Ajax/JavaScript to simple make requests for data, but I don't know how or where to put the relevant server side code (on Xport Pro) to perform these functions?

    I need info/example on how to code the server side funtions to recieve requests which talks to serial port to get my data from an external device and respond to the requests?

    Any advice will be appreciated - thanks

  • #2
    I have the same issue. I need to send parameter updates via the serial port and receive status data back. Lantronix tech support has suggested using Java applets to do this in the browser rather than on the XPort. I will be very interested in the replies you get.

    Comment


    • #3
      Me too, mee too

      Comment


      • #4
        Please Please Please, post an example, I really need to do this.

        Comment


        • #5
          I am interested in an example like this as well. Does Lantronix moderate this forum?

          Comment


          • #6
            Want to Know mE TOO!!!!help!!!!

            Can someone point me to any documentation or code examples or explanation on how the Xport Pro device is meant to handle JavaScript requests for data? The Lantronix documentation seems very poor in providing any documentation or examples on how to achieve these functions?

            I want to make requests for data (from my HTML/JavaScript pages) to Xport Pro which will then communicate via its serial port to retrieve data from an external device and return this data to my JavaScript code which will then display it on a webpage.

            I don't want to generate web-pages as per their cgi.c example - rather I want to use Ajax/JavaScript to simple make requests for data, but I don't know how or where to put the relevant server side code (on Xport Pro) to perform these functions?

            I need info/example on how to code the server side funtions to recieve requests which talks to serial port to get my data from an external device and respond to the requests?

            Any advice will be appreciated - thanks
            yes i want to know how to

            Comment


            • #7
              The default firmware in the XPort Pro handles connection to the serial port via a TCP port. By default that's 10001, but you can change it to anything.

              Javascript doesn't allow for a TCP connection to any TCP port, so accessing the tunnel is not possible from within Javascript.

              The two options to accomplish are:
              1) Use a Java applet to do it (Java can open a TCP connection to the inbound port of the Lantronix tunnel). There's a white paper on how to do that here: http://ltxfaq.custhelp.com/ci/fattac...b_ServerV4.pdf

              2) Use the Evolution SDK to create custom CGI calls, using the cgi.c example, then point the Javascript to the URL that the CGI callback is attached to.

              Mariano

              Comment

              Working...
              X