Difference between revisions of "XPicoWiFi/WebAPItoDevice"

From Lantronix Wiki!
Jump to navigation Jump to search
(Created page with "'''This is an Alpha Feature of 1.4 firmware. Features are subject to change. Please contact a Lantronix Field Applications Engineer to get firmware that supports this feature...")
 
Line 1: Line 1:
'''This is an Alpha Feature of 1.4 firmware. Features are subject to change. Please contact a  
+
'''This is an Alpha Feature of 1.4 firmware. Features are subject to change. Please contact a Lantronix Field Applications Engineer to get firmware that supports this feature'''
Lantronix Field Applications Engineer to get firmware that supports this feature'''
 
  
  
 
== Overview ==
 
== Overview ==
  
The xPico Wi-Fi's web server has a function called WebAPI that allows you to monitor and control
+
The xPico Wi-Fi's web server has a function called WebAPI that allows you to monitor and control the xPico Wi-Fi and attached devices via HTTP calls to specific URLs. For example, the  
the xPico Wi-Fi and attached devices via HTTP calls to specific URLs. For example, the  
+
/export/config URL lets you view the current configuration of the xPico Wi-fi. The /export/status lets you view the current status, such as Wi-Fi signal strength, IP addresses, etc.  
/export/config URL lets you view the current configuration of the xPico Wi-fi. The /export/status
 
lets you view the current status, such as Wi-Fi signal strength, IP addresses, etc.  
 
  
For the Web to Serial feature, the relevant URL is /action/status. This lets you directly send and
+
For the Web to Serial feature, the relevant URL is /action/status. This lets you directly send and receive data from the serial ports, as well as manipulate the GPIOs (CP) with an HTTP transaction, for example from Javascript.
receive data from the serial ports, as well as manipulate the GPIOs (CP) with an HTTP transaction,
 
for example from Javascript.
 
  
  
 
== WebAPI Status Actions ==
 
== WebAPI Status Actions ==
  
By using the WebAPI, you can use HTTP transactions (for example from Javascript) to Transmit and
+
By using the WebAPI, you can use HTTP transactions (for example from Javascript) to Transmit and Receive data to the two serial ports, as well as to change and monitor the status of the CPs of the xPico Wi-fi. The data is sent urlencoded, and the response is in the XML format. For more details on how to use the WebAPI, please see Chapter 5 of the [http://www.lantronix.com/pdf/xPico-Wi-Fi_UG.pdf User Guide].
Receive data to the two serial ports, as well as to change and monitor the status of the CPs
 
of the xPico Wi-fi. The data is sent urlencoded, and the response
 
is in the XML format. For more details on how to use the WebAPI, please see Chapter 5 of the
 
[http://www.lantronix.com/pdf/xPico-Wi-Fi_UG.pdf User Guide].
 
  
It is important to note that to use the Web to Serial function, the Line configuration must be
+
It is important to note that to use the Web to Serial function, the Line configuration must be set to None so that there is no conflict with other serial applications (like Mux or Monitor, for example).
set to None so that there is no conflict with other serial applications (like Mux or Monitor, for
 
example).
 
  
 
== Javascript Library ==
 
== Javascript Library ==
  
While the WebAPI can be used to affect configuration with simple HTTP transactions like a form submission,
+
While the WebAPI can be used to affect configuration with simple HTTP transactions like a form submission, or from a smartphone App like the Lantronix xPico Wi-Fi Utilities [https://play.google.com/store/apps/details?id=com.lantronix.xpicowifiutils Android App], one of the most common uses is to create a webapp that is stored in the xPico Wi-Fi's filesystem and served by the local web server. In that fashion, using Javascript, you can create a dynamic webapp to access the hardware in your end product easily.
or from a smartphone App like the Lantronix xPico Wi-Fi Utilities  
 
[https://play.google.com/store/apps/details?id=com.lantronix.xpicowifiutils Android App], one of the  
 
most common
 
uses is to create a webapp that is stored in the xPico Wi-Fi's filesystem and served by the local
 
web server. In that fashion, using Javascript, you can create a dynamic webapp to access the hardware
 
in your end product easily.
 
  
 
=== xpwJslib on Github ===
 
=== xpwJslib on Github ===
  
To make it easy for you to deploy rich, dynamic webapps on the xPico Wi-Fi, Lantronix has made available
+
To make it easy for you to deploy rich, dynamic webapps on the xPico Wi-Fi, Lantronix has made available a Javascript library to make it easy to use the WebAPI to conduct status Actions and send data back and forth to the serial port. You can find the library, with documentation on all of the functions on [https://github.com/Lantronix/xpwJSlib Github].
a Javascript library to make it easy to use the WebAPI to conduct status Actions and send data back and
 
forth to the serial port. You can find the library, with documentation on all of the functions on
 
[https://github.com/Lantronix/xpwJSlib Github].
 

Revision as of 14:57, 18 May 2015

This is an Alpha Feature of 1.4 firmware. Features are subject to change. Please contact a Lantronix Field Applications Engineer to get firmware that supports this feature


Overview

The xPico Wi-Fi's web server has a function called WebAPI that allows you to monitor and control the xPico Wi-Fi and attached devices via HTTP calls to specific URLs. For example, the /export/config URL lets you view the current configuration of the xPico Wi-fi. The /export/status lets you view the current status, such as Wi-Fi signal strength, IP addresses, etc.

For the Web to Serial feature, the relevant URL is /action/status. This lets you directly send and receive data from the serial ports, as well as manipulate the GPIOs (CP) with an HTTP transaction, for example from Javascript.


WebAPI Status Actions

By using the WebAPI, you can use HTTP transactions (for example from Javascript) to Transmit and Receive data to the two serial ports, as well as to change and monitor the status of the CPs of the xPico Wi-fi. The data is sent urlencoded, and the response is in the XML format. For more details on how to use the WebAPI, please see Chapter 5 of the User Guide.

It is important to note that to use the Web to Serial function, the Line configuration must be set to None so that there is no conflict with other serial applications (like Mux or Monitor, for example).

Javascript Library

While the WebAPI can be used to affect configuration with simple HTTP transactions like a form submission, or from a smartphone App like the Lantronix xPico Wi-Fi Utilities Android App, one of the most common uses is to create a webapp that is stored in the xPico Wi-Fi's filesystem and served by the local web server. In that fashion, using Javascript, you can create a dynamic webapp to access the hardware in your end product easily.

xpwJslib on Github

To make it easy for you to deploy rich, dynamic webapps on the xPico Wi-Fi, Lantronix has made available a Javascript library to make it easy to use the WebAPI to conduct status Actions and send data back and forth to the serial port. You can find the library, with documentation on all of the functions on Github.