Advantech AE Technical Share Document

Date2018/3/16
CategoryFAQ
SR#1-2280808513
Related OSN/A
AbstractCan WISE and ADAM accept the REST http request from different IP address
KeywordWISE, ADAM, REST, GET, http method, OPTION, cross-domain communication
Related ProductWISE-4012, WISE-4012E, WISE-4050, WISE-4060, WISE-4010/LAN, WISE-4050/LAN, WISE-4060/LAN, ADAM-6050, ADAM-6051, ADAM-6052, ADAM-6060, ADAM-6066

Problem Description:

A user has been trying to get the WISE-4060 module working with JSON communication. The unit functioned correctly when reading Digital Inputs/Outputs through the web server, and toggling Digital Outputs from the web server also worked without issue. The same functionality was achievable through Chrome Advanced Rest Client using GET requests to read DI/DO and PUT requests to set/reset Digital Output.

However, when attempting to toggle Digital Output from HTML using jQuery, the following error message was encountered:

"No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access. The response had HTTP status code 400."

The HTML file in question is located on the user's PC (without a web server). The understanding is that performing an XMLHttpRequest to a different domain than the page's origin (in this case, the local PC) causes the browser to block the request due to same-origin security policies.

The user is seeking a solution to this problem, such as JSONP.

Brief Solution - Step by Step:

A user agent (e.g., an external HTML file) initiates a cross-origin HTTP request when it requests a resource from a domain, protocol, or port different from its own origin.

For cross-domain applications, browsers typically send a "preflight" HTTP "OPTIONS" method request to the resource on the other domain first. This determines if the actual request is safe to send.

Advantech WISE modules support HTTP methods like "GET", "PUT", "PATCH", and crucially, "OPTIONS" for cross-domain application structures. Advantech ADAM D version modules also support "GET", "POST", and "OPTIONS" methods. Users can verify firmware and module support in the table below.

An example setup to retrieve Digital Input (DI) status from multiple WISE-4060 modules using an external HTML file on a PC is as follows:

The HTML file resides on a local PC connected to the WISE modules via a wireless Access Point (AP) to simultaneously monitor the status of all DI points.

Figure 1. Network Diagram Description: The diagram illustrates a network setup for monitoring Advantech WISE modules. It shows multiple WISE modules (represented by small rectangular devices with antennas, labeled 'ADVANTECH WISE-4012S', 'ADVANTECH WISE-4012D', 'ADVANTECH WISE-4012S') with different IP addresses. These modules are depicted with wireless signals indicating their connection to a central Wireless AP (represented by a flat, white rectangular device with two antennas). The Wireless AP then connects to a PC (represented by a desktop computer monitor and tower), which hosts a local HTML file. This setup allows the PC to monitor the status of all Digital Input points on the WISE modules in an infrastructure mode.

For more detailed information, customers can download a sample HTML file for WISE series modules from the following link: https://www.dropbox.com/s/rlffdq3t5bmjz78/WISE.zip?dl=0

Figure 2. WISE CROS example HTML file description: This image displays a screenshot of a web interface for WISE-4000 Series devices, version 1.0.0. It shows three distinct WISE Device panels, each with its own IP address (e.g., http://10.1.1.42, http://10.1.1.60, http://10.1.1.11). Each device panel lists four channels (Channel 0, Channel 1, Channel 2, Channel 3), with some channels highlighted in green (e.g., Channel 2 on WISE Device 2), indicating their status.

The following table details the module and firmware (FW) version support for the "OPTIONS" method required for cross-domain requests. It is recommended to upgrade the firmware to the latest version on the Advantech support portal if any errors are encountered.

Table 1. Module and FW Support Table

ModuleFW Version Support
WISE-4012ALL
WISE-4012EALL
WISE-4050ALL
WISE-4060ALL
WISE-4010/LANvA111B00 and higher version
WISE-4050/LANvA111B00 and higher version
WISE-4060/LANvA111B00 and higher version
ADAM-6050-Dv601B13 and higher version
ADAM-6051-Dv601B13 and higher version
ADAM-6052-Dv601B13 and higher version
ADAM-6060-Dv601B13 and higher version
ADAM-6066-Dv601B13 and higher version

PDF preview unavailable. Download the PDF instead.

IAG FAQ ADAM WISE Can WISE and ADAM accept the REST http request from different IP address Microsoft Word 2010 Microsoft Word 2010

Related Documents

Preview Advantech WISE-4000 Series Wireless IoT Sensing and I/O Modules
Explore Advantech's WISE-4000 series, including WISE-4012E, WISE-4012, WISE-4050, WISE-4060, and WISE-4051, along with ADAM-4000 and ADAM-6000 I/O modules. This overview details wireless IoT sensing devices, Ethernet I/O, and RS-485 I/O modules, featuring LPWAN, LoRa, Wi-Fi, MQTT, RESTful API, and cloud integration for industrial automation and remote management.
Preview Advantech WISE-4000 Series IoT Ethernet I/O Module User Manual
This user manual provides comprehensive information for the Advantech WISE-4000 Series IoT Ethernet I/O Modules, covering their features, specifications, hardware installation, and system configuration. Learn about data acquisition, processing, publishing functions, RESTful web services, data storage, and IoT cloud integration for these advanced industrial IoT devices.
Preview Connecting Advantech WISE-4000 to ThingsBoard via iSensing MQTT
A technical guide from Advantech detailing the steps to connect WISE-4000 series IoT devices to the ThingsBoard platform using iSensing MQTT for cloud data upload and monitoring.
Preview ADVANTECH WISE-4000/LAN Series IoT Ethernet I/O Modules
Explore the ADVANTECH WISE-4000/LAN Series, a new IoT Ethernet I/O module supporting RESTful web API for IoT applications. Features include HTML5 web configuration, built-in data logging, wide operating temperatures, and robust industrial design. Ideal for data acquisition and industrial automation.
Preview Advantech WISE-4060: 4-ch Digital Input and 4-ch Relay Output IoT Wireless I/O Module
Advantech WISE-4060 is a versatile IoT Wireless I/O Module featuring 4 digital inputs and 4 relay outputs, Wi-Fi connectivity, data logging, and RESTful API support for seamless cloud integration.
Preview Advantech ADAM-6000 Series P2P & GCL FAQ
Frequently asked questions about Advantech's ADAM-6000 series modules, focusing on Peer-to-Peer (P2P) and Group Control Logic (GCL) functionalities, including firmware requirements, compatibility, and configuration.
Preview Advantech WISE-4220 Industrial Wi-Fi 2.4G Wireless I/O Module Datasheet
Detailed datasheet for the Advantech WISE-4220, an industrial Wi-Fi 2.4G wireless I/O module. Covers features, specifications, data storage, cloud connectivity, HTML5 web configuration, and ordering information for IoT applications.
Preview Advantech ADAM Series: Industrial Automation Devices for IT, OT, and IoT
Explore the evolution of Advantech's ADAM series industrial automation devices, including remote I/O, I/O gateways, and controllers, designed to meet the challenges of IT, OT, and IoT integration.