Lantronix Developer Forums  

Go Back   Lantronix Developer Forums > Evolution SDK > Samples

Samples Use this forum for questions or comments regarding specific sample source code files in the Evolution SDK.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 06-10-2011, 02:30 PM
cam cam is offline
Junior Member
 
Join Date: Nov 2010
Posts: 2
Default 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
Reply With Quote
  #2  
Old 06-15-2011, 07:32 PM
Frederick Gasoi Frederick Gasoi is offline
Junior Member
 
Join Date: Apr 2011
Posts: 3
Default

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.
Reply With Quote
  #3  
Old 07-28-2011, 10:56 AM
electron electron is offline
Junior Member
 
Join Date: Jul 2011
Posts: 5
Default

Me too, mee too
Reply With Quote
  #4  
Old 07-30-2011, 04:05 PM
malaugh malaugh is offline
Junior Member
 
Join Date: Jun 2011
Posts: 3
Default

Please Please Please, post an example, I really need to do this.
Reply With Quote
  #5  
Old 11-27-2013, 07:39 PM
cgamboni cgamboni is offline
Member
 
Join Date: Aug 2013
Posts: 15
Default

I am interested in an example like this as well. Does Lantronix moderate this forum?
Reply With Quote
  #6  
Old 01-26-2014, 01:41 PM
2001cpx 2001cpx is offline
Junior Member
 
Join Date: Jan 2014
Posts: 1
Question Want to Know mE TOO!!!!help!!!!

Quote:
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
Reply With Quote
  #7  
Old 01-26-2014, 01:50 PM
mariano mariano is offline
Lantronix FAE
 
Join Date: Aug 2012
Posts: 369
Default

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
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 12:01 AM.


Copyright Lantronix, Inc. 2013. All rights reserved.
Powered by vBulletin® Copyright ©2000 - 2017, vBulletin Solutions, Inc.