SlideShare uma empresa Scribd logo
1 de 5
Baixar para ler offline
openPicus                                                                                             Application Note


                                                     Application Note: OP-AN-0009
                                         Webserver with Wi-Fi Parameter Configuration




Device: Openpicus Flyport Wi-Fi
IDE version: 2.1
Author - version: Simone Marra - v1.1
External libs: -
Connections: -
Description:
One of the great feature of openPICUS framework with Wi-Fi devices is the ability to handle 2 different configurations
for the Wi-Fi network parameters.
The “WF_DEFAULT” can be configured inside the IDE Wizard tool, and it can not be changed at run-time. It is a fixed
configuration that must be stored inside the microcontroller with the download of the firmware.
The second configuration, called “WF_CUSTOM”, can be changed at run-time, saved inside the internal Flash memory
of microcontroller, loaded and deleted. This configuration is used to let the user to change the information related to
the router or access point where the Flyport Wi-Fi has to connect itself, or if Flyport should create an adhoc
connection, etc.
The “WF_CUSTOM” parameters can be handled by user task, and the user can provide for example serial commands
to change them when the “taskFlyport” firmware is executed, but this solution requires a hardware connection, so the
customization should be done in the nearby of any Flyport module.


The solution for this problem could be to permit the change of “WF_CUSTOM” parameters using the Wi-Fi connection.
In this application note it is shown how a smart configuration web page can be integrated to configure Flyport Wi-Fi
Network parameters.
The configuration page has some input forms to enter the new parameters, and some scripts to check the validation of
the data added by user. In fact, if a parameter is filled with an incompatible value, the browser will automatically show
a message of what parameter must be corrected. In this way, the human errors are reduced.


The proposed solution also has a configurable starting time firmware, where the Flyport Wi-Fi connects only to its
WF_DEFAULT configuration (the parameters entered inside the IDE Wizard settings); On the other hand, when the
code is in execution, the pressure of a input button for more than 3 seconds forces the microcontroller to delete the
WF_CUSTOM customizable parameters, and after connects again to the “WF_DEFAULT” settings.


In a typical application with more Flyport Wi-Fi modules used, or with a physical position not easily reachable from the
user, the replacement of Wi-Fi routers is an easy task. The customer can change the configuration of every Flyport one
by one, using the web browser of a PC or SMARTPHONE or TABLET, without the worry about the hardware cable
connections.
Using the Flyport Wi-Fi embedded web server, the user can anytime not only to control the hardware I/O status, but
also to change the Wi-Fi network parameters.



09.02.2012 (v.1.1)                              www.openpicus.com                                                         1
openPicus                                                                                              Application Note




The above picture shows the typical use of the webserver with the configuration page. The user can access to the
Flyport Wi-Fi using a PC, a Smart-Phone, or any other internet enabled device. Surfing with a web browser to the
Flyport Wi-Fi IP address or host name, the user can access to the first page of the webserver (the index.htm file); this
page is related to the “I/O real-time control”, and has a tab to access the “Configuration Page” (the conf.htm file).




 2                                     www.openpicus.com                                              09.02.2012 (v.1.1)
openPicus                                                                                                Application Note




The conf.htm page has a router-like interface, with all the customizable parameters accessible by the user.
The section related to the SSID and the Security type changes dynamically in relation of the security type chosen by
user, and enables the forms to fill with the pass-phrases and passkeys only where expected.
On the right side of the page, it is located a section called “Network Scanner”. This tool reports a list of all the Wi-Fi
network reachable from the Flyport Wi-Fi module. The list is updated by the pressure of the button “Scan it!” inside
the web-page, or with the pressure of the button at the pin “scanPinNumber” (defined in firmware) of the module.


Webserver Files structure:
                         The two pages of webserver are “index.htm” and “conf.htm”.
                         Both pages share some files inside the images folder and the style.css file.


                         The index.htm page uses the script mchp.js, inside the “scripts” folder, and the leds.cgi and
                         status.xml files too.
                         The conf.htm page uses instead the scripts main_conf.js and mchp.js, inside the “scripts”
                         folder, and refresh.cgi and refresh.xml files too.


                         The mchp.js file is the scripting file responsible of the handle of I/Os control and any other
                         related hardware/firmware resource that user would like to embed into the webpage. The
                         code of index.htm, in conjunction with status.xml and the microcontroller firmware can be
                         modified by the user to show and to control the other dynamic resources, like sensor values
                         (temperature, humidity, etc...), relays or PWMs (for example to turn on/off a light, or take
                         advantage of a dimmer to control the brightness of a lamp). The script updates also the
                         network list of the Network Scanner tool inside the config.htm, using refresh.xml




09.02.2012 (v.1.1)                               www.openpicus.com                                                           3
openPicus                                                                                                    Application Note

The main_conf.js is the scripting file responsible to pass the Wi-Fi parameters to the Flyport's firmware, using a POST
method; it checks if a data is correct for every specific parameter, for example it checks if an IP address is written in the
correct format (clearly it can't check if an IP address is correct, but only if it was written in a correct format). This file is
very important since it checks the human input, so it can reduce a lot the probability of errors (like bad typing, or
parameter exchange...).


          NOTE: When the user press the “Save Parameters” button on the bottom-right side of the configuration
          page, the parameters validation is done by a JavaScript, so all the calculation is done by the browser (the PC
          or the Smart-Phone or the Tablet, etc...but outside of the Flyport). If the data is verified and correct, they are
          sent to the Flyport firmware HTTPApp with the using of a POST method.


Firmware of Flyport:
The Flyport has to execute some functions to store, to change and to reload the WF_CUSTOM parameters. When the
user changes the network parameters inside the web-server configuration page, the Flyport receives data and store
them inside the WF_CUSTOM configuration.




Above is a schematic diagram of the flow of the flyportTask.c execution firmware.
After the initializations of hardware and RTCC module, the Flyport Wi-Fi connects to WF_DEFAULT parameters to
permit the user to configure the network parameters, before using the customizable configuration. The Flyport waits
for a time (customizable in firmware) before to proceed with the code execution. The time is configurable with two
const int variables: setuptimeSec and setuptimeMin. Changing those variables the developer can change the RTCC
alarm, and so the waiting time for this “setup pause” phase of the firmware. At the end of this process, the RTCC
module is stopped.




 4                                       www.openpicus.com                                                  09.02.2012 (v.1.1)
openPicus                                                                                              Application Note

The next step on firmware execution is to choose the network parameters to connect with.
If the WF_CUSTOM configuration does exist, it means that a custom configuration was previously saved inside the flash
memory of the Flyport Wi-Fi microcontroller. In this case, the firmware connects the module to the customized
network parameters.
In case WF_CUSTOM does not exist it could mean that it is the first start of Flyport Wi-Fi, or that WF_CUSTOM
configuration was never saved. In this case, the firmware connects the module to the default network parameters.


After the Wi-Fi connection successful created, the firmware enters in a “infinite loop” and checks at every cycle the
state of the variable “ParamSet” and the state of the p5 input pin.
If the input pin is tied low for a time greater then “waitbuttonSec” seconds, the WF_CUSTOM configuration is deleted,
and the Flyport returns in its “factory default” (or first start) state.
The “ParamSet” variable is changed by the HTTPApp.c file if the user provide a new configuration inside the
configuration webpage of Flyport Wi-Fi's webserver. The function responsible of the handle of the update of
parameters is the HTTPExecutePost that changes all the WF_CUSTOM parameters, and the saving of the new
configuration is done by the taskFlyport.c.


Conclusions:
A special attention should be payed when you choose the WF_DEFAULT parameters. This configuration is prepared
inside the openPICUS IDE, using the Wizard tool. All the information related to the WF_DEFAULT configurations is
written directly inside the microcontroller firmware, and cannot be changed at run-time. The only way to change the
default configuration is to prepare and download again the microcontroller firmware inside the Flyport Wi-Fi, but it
needs a hardware connection between a PC and the Flyport Wi-Fi module.


In the specific context of this application note, it is suggested to use the WF_DEFAULT parameters as an “adhoc”
connection, to be sure that Flyport Wi-Fi is reachable from every PC; Due to this specific network type, Flyport Wi-Fi
acts as a one-to-one access point and the customer can configure the parameters easily. This solution is very
comfortable in an environment with few Flyport Wi-Fi modules, so every module can change its network configuration
one by one.


A solution for an architecture with more modules could be to setup the default parameters to access to a
“infrastructure” network, with a access point with fixed SSID and protection settings (like the safe WPA2), specifically
designed for setup purpose (it is not necessary to have a internet connection). In this case, every Flyport can connect
with default parameters at the “always accessible” access point, and also the customer can connect to the same
network to setup all the Flyport Wi-Fi modules to connect to a new network.
In this case, one access point is used to setup the Flyport Wi-Fi modules, and another access point is used on the
specific application, maybe with internet connection available.


The “Network Scanner” tool embedded inside the web-server configuration page, helps the customer to choose the
network parameters, and to check them if a specific network is reachable from the Flyport Wi-Fi module.




09.02.2012 (v.1.1)                              www.openpicus.com                                                          5

Mais conteúdo relacionado

Mais procurados

md firmware upgrade UI spec Demo
md firmware upgrade UI spec Demomd firmware upgrade UI spec Demo
md firmware upgrade UI spec Demo
yiwensyao
 
Ultima mentor version_7_0_-_required_data_inputs_for_huawei
Ultima mentor version_7_0_-_required_data_inputs_for_huaweiUltima mentor version_7_0_-_required_data_inputs_for_huawei
Ultima mentor version_7_0_-_required_data_inputs_for_huawei
ergash nigmatov
 
An overview of the ims connect client interface
An overview of the ims connect client interfaceAn overview of the ims connect client interface
An overview of the ims connect client interface
Jeff Pearce
 

Mais procurados (17)

Ccna day2
Ccna day2Ccna day2
Ccna day2
 
Ccna 2
Ccna 2Ccna 2
Ccna 2
 
Ccna day2
Ccna day2Ccna day2
Ccna day2
 
Ccna day2
Ccna day2Ccna day2
Ccna day2
 
Automotive embedded systems part7 v1
Automotive embedded systems part7 v1Automotive embedded systems part7 v1
Automotive embedded systems part7 v1
 
Day1
Day1Day1
Day1
 
What is AUTOSAR Communiation Stack
What is AUTOSAR Communiation StackWhat is AUTOSAR Communiation Stack
What is AUTOSAR Communiation Stack
 
Autosar Basics hand book_v1
Autosar Basics  hand book_v1Autosar Basics  hand book_v1
Autosar Basics hand book_v1
 
ESM High Availability Module User's Guide
ESM High Availability Module User's GuideESM High Availability Module User's Guide
ESM High Availability Module User's Guide
 
Wireless iSeries Performance Monitoring
Wireless iSeries Performance MonitoringWireless iSeries Performance Monitoring
Wireless iSeries Performance Monitoring
 
Automotive embedded systems part6 v2
Automotive embedded systems part6 v2Automotive embedded systems part6 v2
Automotive embedded systems part6 v2
 
md firmware upgrade UI spec Demo
md firmware upgrade UI spec Demomd firmware upgrade UI spec Demo
md firmware upgrade UI spec Demo
 
Readme
ReadmeReadme
Readme
 
Flyport GPRS programmer's guide 2.3 rev1.0
Flyport GPRS programmer's guide 2.3   rev1.0Flyport GPRS programmer's guide 2.3   rev1.0
Flyport GPRS programmer's guide 2.3 rev1.0
 
Introduction to TTCN-3 and AUTOSAR Conformance Testing
Introduction to TTCN-3 and AUTOSAR Conformance TestingIntroduction to TTCN-3 and AUTOSAR Conformance Testing
Introduction to TTCN-3 and AUTOSAR Conformance Testing
 
Ultima mentor version_7_0_-_required_data_inputs_for_huawei
Ultima mentor version_7_0_-_required_data_inputs_for_huaweiUltima mentor version_7_0_-_required_data_inputs_for_huawei
Ultima mentor version_7_0_-_required_data_inputs_for_huawei
 
An overview of the ims connect client interface
An overview of the ims connect client interfaceAn overview of the ims connect client interface
An overview of the ims connect client interface
 

Destaque

Colubris Basic Customer Presentation
Colubris Basic Customer PresentationColubris Basic Customer Presentation
Colubris Basic Customer Presentation
daten
 
Network topology
Network topologyNetwork topology
Network topology
jasmeen kr
 

Destaque (7)

Wifi (2)
Wifi (2)Wifi (2)
Wifi (2)
 
Colubris Basic Customer Presentation
Colubris Basic Customer PresentationColubris Basic Customer Presentation
Colubris Basic Customer Presentation
 
Matrix cam air_wifi_configuration
Matrix cam air_wifi_configurationMatrix cam air_wifi_configuration
Matrix cam air_wifi_configuration
 
Wi fi technology
Wi fi technologyWi fi technology
Wi fi technology
 
An Interactive Learning Management System: Special focus on United Institute ...
An Interactive Learning Management System: Special focus on United Institute ...An Interactive Learning Management System: Special focus on United Institute ...
An Interactive Learning Management System: Special focus on United Institute ...
 
Understanding WiFi Security Vulnerabilities and Solutions
Understanding WiFi Security Vulnerabilities and SolutionsUnderstanding WiFi Security Vulnerabilities and Solutions
Understanding WiFi Security Vulnerabilities and Solutions
 
Network topology
Network topologyNetwork topology
Network topology
 

Semelhante a Flyport wifi webserver configuration page

EMBEDDED WEB SERVER
EMBEDDED WEB SERVEREMBEDDED WEB SERVER
EMBEDDED WEB SERVER
kavya Reddy
 
Web Enabling Variable Frequency Drives
Web Enabling Variable Frequency DrivesWeb Enabling Variable Frequency Drives
Web Enabling Variable Frequency Drives
Najam Siddiqui
 
On an LAS-integrated soft PLC system based on WorldFIP fieldbus
On an LAS-integrated soft PLC system based on WorldFIP fieldbusOn an LAS-integrated soft PLC system based on WorldFIP fieldbus
On an LAS-integrated soft PLC system based on WorldFIP fieldbus
ISA Interchange
 
2232016 Sample Implementation Plan1.htmlfileCUsers.docx
2232016 Sample Implementation Plan1.htmlfileCUsers.docx2232016 Sample Implementation Plan1.htmlfileCUsers.docx
2232016 Sample Implementation Plan1.htmlfileCUsers.docx
eugeniadean34240
 
It04 roshan basnet
It04 roshan basnetIt04 roshan basnet
It04 roshan basnet
rosu555
 

Semelhante a Flyport wifi webserver configuration page (20)

Technical paper
Technical paperTechnical paper
Technical paper
 
How to Self-Provision over WLAN with Intel(R) vPro(TM) Technology
How to Self-Provision over WLAN with Intel(R) vPro(TM) TechnologyHow to Self-Provision over WLAN with Intel(R) vPro(TM) Technology
How to Self-Provision over WLAN with Intel(R) vPro(TM) Technology
 
How to Self-Provision over WLAN with Intel(R) vPro(TM) Technology
How to Self-Provision over WLAN with Intel(R) vPro(TM) TechnologyHow to Self-Provision over WLAN with Intel(R) vPro(TM) Technology
How to Self-Provision over WLAN with Intel(R) vPro(TM) Technology
 
WebKilit Manual
WebKilit ManualWebKilit Manual
WebKilit Manual
 
NetSim VANET User Manual
NetSim VANET User ManualNetSim VANET User Manual
NetSim VANET User Manual
 
EMBEDDED WEB SERVER
EMBEDDED WEB SERVEREMBEDDED WEB SERVER
EMBEDDED WEB SERVER
 
Web Enabling Variable Frequency Drives
Web Enabling Variable Frequency DrivesWeb Enabling Variable Frequency Drives
Web Enabling Variable Frequency Drives
 
Ak4103212215
Ak4103212215Ak4103212215
Ak4103212215
 
On an LAS-integrated soft PLC system based on WorldFIP fieldbus
On an LAS-integrated soft PLC system based on WorldFIP fieldbusOn an LAS-integrated soft PLC system based on WorldFIP fieldbus
On an LAS-integrated soft PLC system based on WorldFIP fieldbus
 
2232016 Sample Implementation Plan1.htmlfileCUsers.docx
2232016 Sample Implementation Plan1.htmlfileCUsers.docx2232016 Sample Implementation Plan1.htmlfileCUsers.docx
2232016 Sample Implementation Plan1.htmlfileCUsers.docx
 
Configuring lifa for remote communication using web architecture
Configuring lifa for remote communication using web architectureConfiguring lifa for remote communication using web architecture
Configuring lifa for remote communication using web architecture
 
2008.12.23 CompoWeb
2008.12.23 CompoWeb2008.12.23 CompoWeb
2008.12.23 CompoWeb
 
F5 BigIP LTM Initial, Build, Install and Licensing.
F5 BigIP LTM Initial, Build, Install and Licensing.F5 BigIP LTM Initial, Build, Install and Licensing.
F5 BigIP LTM Initial, Build, Install and Licensing.
 
It04 roshan basnet
It04 roshan basnetIt04 roshan basnet
It04 roshan basnet
 
Network & security startup
Network & security startupNetwork & security startup
Network & security startup
 
Backtrack Manual Part4
Backtrack Manual Part4Backtrack Manual Part4
Backtrack Manual Part4
 
Embedded Web Server based Home Automation using Raspberry PI
Embedded Web Server based Home Automation using Raspberry PIEmbedded Web Server based Home Automation using Raspberry PI
Embedded Web Server based Home Automation using Raspberry PI
 
Data Acquisition and Control System for Real Time Applications
Data Acquisition and Control System for Real Time ApplicationsData Acquisition and Control System for Real Time Applications
Data Acquisition and Control System for Real Time Applications
 
Manual Sophos
Manual SophosManual Sophos
Manual Sophos
 
Pivotal Cloud Foundry 2.5: A First Look
Pivotal Cloud Foundry 2.5: A First LookPivotal Cloud Foundry 2.5: A First Look
Pivotal Cloud Foundry 2.5: A First Look
 

Mais de Ionela

openPicus Proto Nest Datasheet
openPicus Proto Nest DatasheetopenPicus Proto Nest Datasheet
openPicus Proto Nest Datasheet
Ionela
 
Windows phone 7 è l’ultima occasione di microsoft 2010-10-18
Windows phone 7 è l’ultima occasione di microsoft   2010-10-18Windows phone 7 è l’ultima occasione di microsoft   2010-10-18
Windows phone 7 è l’ultima occasione di microsoft 2010-10-18
Ionela
 
Videocamera cam ball un mare di caratteristiche nella piccola videocamera a ...
Videocamera cam ball  un mare di caratteristiche nella piccola videocamera a ...Videocamera cam ball  un mare di caratteristiche nella piccola videocamera a ...
Videocamera cam ball un mare di caratteristiche nella piccola videocamera a ...
Ionela
 
Utente premium 2010-10-17
Utente premium   2010-10-17Utente premium   2010-10-17
Utente premium 2010-10-17
Ionela
 
Unity sostituisce gnome su ubuntu 11.04 2010-11-01
Unity sostituisce gnome su ubuntu 11.04   2010-11-01Unity sostituisce gnome su ubuntu 11.04   2010-11-01
Unity sostituisce gnome su ubuntu 11.04 2010-11-01
Ionela
 
Una retina artificiale per ridare la vista 2010-11-10
Una retina artificiale per ridare la vista   2010-11-10Una retina artificiale per ridare la vista   2010-11-10
Una retina artificiale per ridare la vista 2010-11-10
Ionela
 
Un orologio elettronico completo basato su i2 c rtcc mcp79410 2010-10-29
Un orologio elettronico completo basato su i2 c rtcc mcp79410   2010-10-29Un orologio elettronico completo basato su i2 c rtcc mcp79410   2010-10-29
Un orologio elettronico completo basato su i2 c rtcc mcp79410 2010-10-29
Ionela
 
Ultimo lancio discovery delle perdite rinviano l’ultimo lancio dello shuttle...
Ultimo lancio discovery  delle perdite rinviano l’ultimo lancio dello shuttle...Ultimo lancio discovery  delle perdite rinviano l’ultimo lancio dello shuttle...
Ultimo lancio discovery delle perdite rinviano l’ultimo lancio dello shuttle...
Ionela
 
Ubuntu passa a wayland 2010-11-08
Ubuntu passa a wayland   2010-11-08Ubuntu passa a wayland   2010-11-08
Ubuntu passa a wayland 2010-11-08
Ionela
 
Touchatag un'applicazione di internet delle cose 2010-11-10
Touchatag  un'applicazione di internet delle cose   2010-11-10Touchatag  un'applicazione di internet delle cose   2010-11-10
Touchatag un'applicazione di internet delle cose 2010-11-10
Ionela
 
Tianhe 1, il supercomputer cinese - 2010-11-05
Tianhe 1, il supercomputer cinese - 2010-11-05Tianhe 1, il supercomputer cinese - 2010-11-05
Tianhe 1, il supercomputer cinese - 2010-11-05
Ionela
 
Thread o processo quale usare - 2010-11-02
Thread o processo  quale usare  - 2010-11-02Thread o processo  quale usare  - 2010-11-02
Thread o processo quale usare - 2010-11-02
Ionela
 
Termometro digitale usando pic16 f84a schema elettrico - 2010-11-03
Termometro digitale usando pic16 f84a   schema elettrico - 2010-11-03Termometro digitale usando pic16 f84a   schema elettrico - 2010-11-03
Termometro digitale usando pic16 f84a schema elettrico - 2010-11-03
Ionela
 
Telescopio webb il sistema di engineering del telescopio webb della nasa si ...
Telescopio webb  il sistema di engineering del telescopio webb della nasa si ...Telescopio webb  il sistema di engineering del telescopio webb della nasa si ...
Telescopio webb il sistema di engineering del telescopio webb della nasa si ...
Ionela
 
Tecnologia light peak intel potrebbe adottarla da inizio 2011, apple a segui...
Tecnologia light peak  intel potrebbe adottarla da inizio 2011, apple a segui...Tecnologia light peak  intel potrebbe adottarla da inizio 2011, apple a segui...
Tecnologia light peak intel potrebbe adottarla da inizio 2011, apple a segui...
Ionela
 
Tastiere capacitive 2010-11-10
Tastiere capacitive   2010-11-10Tastiere capacitive   2010-11-10
Tastiere capacitive 2010-11-10
Ionela
 

Mais de Ionela (20)

IoT with OpenPicus Flyport
IoT with OpenPicus FlyportIoT with OpenPicus Flyport
IoT with OpenPicus Flyport
 
openPicus Proto Nest Datasheet
openPicus Proto Nest DatasheetopenPicus Proto Nest Datasheet
openPicus Proto Nest Datasheet
 
How to Integrate Internet of Things with Webserver with
How to Integrate Internet of Things with Webserver with How to Integrate Internet of Things with Webserver with
How to Integrate Internet of Things with Webserver with
 
Openpicus Flyport interfaces the cloud services
Openpicus Flyport interfaces the cloud servicesOpenpicus Flyport interfaces the cloud services
Openpicus Flyport interfaces the cloud services
 
Flyport openPicus datasheet
Flyport openPicus datasheetFlyport openPicus datasheet
Flyport openPicus datasheet
 
Windows phone 7 è l’ultima occasione di microsoft 2010-10-18
Windows phone 7 è l’ultima occasione di microsoft   2010-10-18Windows phone 7 è l’ultima occasione di microsoft   2010-10-18
Windows phone 7 è l’ultima occasione di microsoft 2010-10-18
 
Videocamera cam ball un mare di caratteristiche nella piccola videocamera a ...
Videocamera cam ball  un mare di caratteristiche nella piccola videocamera a ...Videocamera cam ball  un mare di caratteristiche nella piccola videocamera a ...
Videocamera cam ball un mare di caratteristiche nella piccola videocamera a ...
 
Utente premium 2010-10-17
Utente premium   2010-10-17Utente premium   2010-10-17
Utente premium 2010-10-17
 
Unity sostituisce gnome su ubuntu 11.04 2010-11-01
Unity sostituisce gnome su ubuntu 11.04   2010-11-01Unity sostituisce gnome su ubuntu 11.04   2010-11-01
Unity sostituisce gnome su ubuntu 11.04 2010-11-01
 
Una retina artificiale per ridare la vista 2010-11-10
Una retina artificiale per ridare la vista   2010-11-10Una retina artificiale per ridare la vista   2010-11-10
Una retina artificiale per ridare la vista 2010-11-10
 
Un orologio elettronico completo basato su i2 c rtcc mcp79410 2010-10-29
Un orologio elettronico completo basato su i2 c rtcc mcp79410   2010-10-29Un orologio elettronico completo basato su i2 c rtcc mcp79410   2010-10-29
Un orologio elettronico completo basato su i2 c rtcc mcp79410 2010-10-29
 
Ultimo lancio discovery delle perdite rinviano l’ultimo lancio dello shuttle...
Ultimo lancio discovery  delle perdite rinviano l’ultimo lancio dello shuttle...Ultimo lancio discovery  delle perdite rinviano l’ultimo lancio dello shuttle...
Ultimo lancio discovery delle perdite rinviano l’ultimo lancio dello shuttle...
 
Ubuntu passa a wayland 2010-11-08
Ubuntu passa a wayland   2010-11-08Ubuntu passa a wayland   2010-11-08
Ubuntu passa a wayland 2010-11-08
 
Touchatag un'applicazione di internet delle cose 2010-11-10
Touchatag  un'applicazione di internet delle cose   2010-11-10Touchatag  un'applicazione di internet delle cose   2010-11-10
Touchatag un'applicazione di internet delle cose 2010-11-10
 
Tianhe 1, il supercomputer cinese - 2010-11-05
Tianhe 1, il supercomputer cinese - 2010-11-05Tianhe 1, il supercomputer cinese - 2010-11-05
Tianhe 1, il supercomputer cinese - 2010-11-05
 
Thread o processo quale usare - 2010-11-02
Thread o processo  quale usare  - 2010-11-02Thread o processo  quale usare  - 2010-11-02
Thread o processo quale usare - 2010-11-02
 
Termometro digitale usando pic16 f84a schema elettrico - 2010-11-03
Termometro digitale usando pic16 f84a   schema elettrico - 2010-11-03Termometro digitale usando pic16 f84a   schema elettrico - 2010-11-03
Termometro digitale usando pic16 f84a schema elettrico - 2010-11-03
 
Telescopio webb il sistema di engineering del telescopio webb della nasa si ...
Telescopio webb  il sistema di engineering del telescopio webb della nasa si ...Telescopio webb  il sistema di engineering del telescopio webb della nasa si ...
Telescopio webb il sistema di engineering del telescopio webb della nasa si ...
 
Tecnologia light peak intel potrebbe adottarla da inizio 2011, apple a segui...
Tecnologia light peak  intel potrebbe adottarla da inizio 2011, apple a segui...Tecnologia light peak  intel potrebbe adottarla da inizio 2011, apple a segui...
Tecnologia light peak intel potrebbe adottarla da inizio 2011, apple a segui...
 
Tastiere capacitive 2010-11-10
Tastiere capacitive   2010-11-10Tastiere capacitive   2010-11-10
Tastiere capacitive 2010-11-10
 

Último

EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
Earley Information Science
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
giselly40
 

Último (20)

A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 

Flyport wifi webserver configuration page

  • 1. openPicus Application Note Application Note: OP-AN-0009 Webserver with Wi-Fi Parameter Configuration Device: Openpicus Flyport Wi-Fi IDE version: 2.1 Author - version: Simone Marra - v1.1 External libs: - Connections: - Description: One of the great feature of openPICUS framework with Wi-Fi devices is the ability to handle 2 different configurations for the Wi-Fi network parameters. The “WF_DEFAULT” can be configured inside the IDE Wizard tool, and it can not be changed at run-time. It is a fixed configuration that must be stored inside the microcontroller with the download of the firmware. The second configuration, called “WF_CUSTOM”, can be changed at run-time, saved inside the internal Flash memory of microcontroller, loaded and deleted. This configuration is used to let the user to change the information related to the router or access point where the Flyport Wi-Fi has to connect itself, or if Flyport should create an adhoc connection, etc. The “WF_CUSTOM” parameters can be handled by user task, and the user can provide for example serial commands to change them when the “taskFlyport” firmware is executed, but this solution requires a hardware connection, so the customization should be done in the nearby of any Flyport module. The solution for this problem could be to permit the change of “WF_CUSTOM” parameters using the Wi-Fi connection. In this application note it is shown how a smart configuration web page can be integrated to configure Flyport Wi-Fi Network parameters. The configuration page has some input forms to enter the new parameters, and some scripts to check the validation of the data added by user. In fact, if a parameter is filled with an incompatible value, the browser will automatically show a message of what parameter must be corrected. In this way, the human errors are reduced. The proposed solution also has a configurable starting time firmware, where the Flyport Wi-Fi connects only to its WF_DEFAULT configuration (the parameters entered inside the IDE Wizard settings); On the other hand, when the code is in execution, the pressure of a input button for more than 3 seconds forces the microcontroller to delete the WF_CUSTOM customizable parameters, and after connects again to the “WF_DEFAULT” settings. In a typical application with more Flyport Wi-Fi modules used, or with a physical position not easily reachable from the user, the replacement of Wi-Fi routers is an easy task. The customer can change the configuration of every Flyport one by one, using the web browser of a PC or SMARTPHONE or TABLET, without the worry about the hardware cable connections. Using the Flyport Wi-Fi embedded web server, the user can anytime not only to control the hardware I/O status, but also to change the Wi-Fi network parameters. 09.02.2012 (v.1.1) www.openpicus.com 1
  • 2. openPicus Application Note The above picture shows the typical use of the webserver with the configuration page. The user can access to the Flyport Wi-Fi using a PC, a Smart-Phone, or any other internet enabled device. Surfing with a web browser to the Flyport Wi-Fi IP address or host name, the user can access to the first page of the webserver (the index.htm file); this page is related to the “I/O real-time control”, and has a tab to access the “Configuration Page” (the conf.htm file). 2 www.openpicus.com 09.02.2012 (v.1.1)
  • 3. openPicus Application Note The conf.htm page has a router-like interface, with all the customizable parameters accessible by the user. The section related to the SSID and the Security type changes dynamically in relation of the security type chosen by user, and enables the forms to fill with the pass-phrases and passkeys only where expected. On the right side of the page, it is located a section called “Network Scanner”. This tool reports a list of all the Wi-Fi network reachable from the Flyport Wi-Fi module. The list is updated by the pressure of the button “Scan it!” inside the web-page, or with the pressure of the button at the pin “scanPinNumber” (defined in firmware) of the module. Webserver Files structure: The two pages of webserver are “index.htm” and “conf.htm”. Both pages share some files inside the images folder and the style.css file. The index.htm page uses the script mchp.js, inside the “scripts” folder, and the leds.cgi and status.xml files too. The conf.htm page uses instead the scripts main_conf.js and mchp.js, inside the “scripts” folder, and refresh.cgi and refresh.xml files too. The mchp.js file is the scripting file responsible of the handle of I/Os control and any other related hardware/firmware resource that user would like to embed into the webpage. The code of index.htm, in conjunction with status.xml and the microcontroller firmware can be modified by the user to show and to control the other dynamic resources, like sensor values (temperature, humidity, etc...), relays or PWMs (for example to turn on/off a light, or take advantage of a dimmer to control the brightness of a lamp). The script updates also the network list of the Network Scanner tool inside the config.htm, using refresh.xml 09.02.2012 (v.1.1) www.openpicus.com 3
  • 4. openPicus Application Note The main_conf.js is the scripting file responsible to pass the Wi-Fi parameters to the Flyport's firmware, using a POST method; it checks if a data is correct for every specific parameter, for example it checks if an IP address is written in the correct format (clearly it can't check if an IP address is correct, but only if it was written in a correct format). This file is very important since it checks the human input, so it can reduce a lot the probability of errors (like bad typing, or parameter exchange...). NOTE: When the user press the “Save Parameters” button on the bottom-right side of the configuration page, the parameters validation is done by a JavaScript, so all the calculation is done by the browser (the PC or the Smart-Phone or the Tablet, etc...but outside of the Flyport). If the data is verified and correct, they are sent to the Flyport firmware HTTPApp with the using of a POST method. Firmware of Flyport: The Flyport has to execute some functions to store, to change and to reload the WF_CUSTOM parameters. When the user changes the network parameters inside the web-server configuration page, the Flyport receives data and store them inside the WF_CUSTOM configuration. Above is a schematic diagram of the flow of the flyportTask.c execution firmware. After the initializations of hardware and RTCC module, the Flyport Wi-Fi connects to WF_DEFAULT parameters to permit the user to configure the network parameters, before using the customizable configuration. The Flyport waits for a time (customizable in firmware) before to proceed with the code execution. The time is configurable with two const int variables: setuptimeSec and setuptimeMin. Changing those variables the developer can change the RTCC alarm, and so the waiting time for this “setup pause” phase of the firmware. At the end of this process, the RTCC module is stopped. 4 www.openpicus.com 09.02.2012 (v.1.1)
  • 5. openPicus Application Note The next step on firmware execution is to choose the network parameters to connect with. If the WF_CUSTOM configuration does exist, it means that a custom configuration was previously saved inside the flash memory of the Flyport Wi-Fi microcontroller. In this case, the firmware connects the module to the customized network parameters. In case WF_CUSTOM does not exist it could mean that it is the first start of Flyport Wi-Fi, or that WF_CUSTOM configuration was never saved. In this case, the firmware connects the module to the default network parameters. After the Wi-Fi connection successful created, the firmware enters in a “infinite loop” and checks at every cycle the state of the variable “ParamSet” and the state of the p5 input pin. If the input pin is tied low for a time greater then “waitbuttonSec” seconds, the WF_CUSTOM configuration is deleted, and the Flyport returns in its “factory default” (or first start) state. The “ParamSet” variable is changed by the HTTPApp.c file if the user provide a new configuration inside the configuration webpage of Flyport Wi-Fi's webserver. The function responsible of the handle of the update of parameters is the HTTPExecutePost that changes all the WF_CUSTOM parameters, and the saving of the new configuration is done by the taskFlyport.c. Conclusions: A special attention should be payed when you choose the WF_DEFAULT parameters. This configuration is prepared inside the openPICUS IDE, using the Wizard tool. All the information related to the WF_DEFAULT configurations is written directly inside the microcontroller firmware, and cannot be changed at run-time. The only way to change the default configuration is to prepare and download again the microcontroller firmware inside the Flyport Wi-Fi, but it needs a hardware connection between a PC and the Flyport Wi-Fi module. In the specific context of this application note, it is suggested to use the WF_DEFAULT parameters as an “adhoc” connection, to be sure that Flyport Wi-Fi is reachable from every PC; Due to this specific network type, Flyport Wi-Fi acts as a one-to-one access point and the customer can configure the parameters easily. This solution is very comfortable in an environment with few Flyport Wi-Fi modules, so every module can change its network configuration one by one. A solution for an architecture with more modules could be to setup the default parameters to access to a “infrastructure” network, with a access point with fixed SSID and protection settings (like the safe WPA2), specifically designed for setup purpose (it is not necessary to have a internet connection). In this case, every Flyport can connect with default parameters at the “always accessible” access point, and also the customer can connect to the same network to setup all the Flyport Wi-Fi modules to connect to a new network. In this case, one access point is used to setup the Flyport Wi-Fi modules, and another access point is used on the specific application, maybe with internet connection available. The “Network Scanner” tool embedded inside the web-server configuration page, helps the customer to choose the network parameters, and to check them if a specific network is reachable from the Flyport Wi-Fi module. 09.02.2012 (v.1.1) www.openpicus.com 5