Flyport Wi-Fi Flyport Ethernet Programmer's Guide Framework version 2.3 release 1.
Flyport Wi-Fi and Ethernet Programmer's guide framework 2.3 (rev 1.0) www.openpicus.
Flyport Wi-Fi and Ethernet Programmer's guide framework 2.3 (rev 1.0) www.openpicus.com Contents Flyport Overview..................................................................................................................................6 Flyport Hardware.............................................................................................................................6 Bootloader ...............................................................................................................
Flyport Wi-Fi and Ethernet Programmer's guide framework 2.3 (rev 1.0) www.openpicus.com SNTP Client.....................................................................................................................................66 SNTP Functionalities..................................................................................................................66 SNTP Usage Example.................................................................................................................
Flyport Wi-Fi and Ethernet Programmer's guide framework 2.3 (rev 1.0) www.openpicus.com Flyport Overview Flyport Hardware Flyport Wi-Fi is a wireless device embedding a Microchip PIC24FJ microcontroller and a Wi-Fi transceiver. It has a 26 pin connector to communicate with external electronics, and it can be powered with 3.3 or 5V. Flyport Ethernet is a wired LAN device embedding a Microchip PIC24FJ microcontroller and an Ethernet transceiver.
Flyport Wi-Fi and Ethernet Programmer's guide framework 2.3 (rev 1.0) www.openpicus.com components), Flyport needs only a power supply. Flyport can also send email, and connect with remote TCP or UDP client/server and much more. To program the Flyport both the USBNest and miniUSB Programmer can be used, simply connecting them to the standard USB port of a PC.
Flyport Wi-Fi and Ethernet Programmer's guide framework 2.3 (rev 1.0) www.openpicus.com If the PC sends any instruction to write to a “dangerous” memory address, the bootloader stops writing, avoiding “killing” itself. The IDE gives feedback to the user, saying “the code can damage the bootloader, so it has not been written it”. QUESTION: The bootloader is another program resident inside the microcontroller.
Flyport Wi-Fi and Ethernet Programmer's guide framework 2.3 (rev 1.0) www.openpicus.com Pinout JP1 (connector male 2*13 ways pitch 2.
Flyport Wi-Fi and Ethernet Programmer's guide framework 2.3 (rev 1.0) www.openpicus.
Flyport Wi-Fi and Ethernet Programmer's guide framework 2.3 (rev 1.0) www.openpicus.com Hardware functions This chapter shows how to control the hardware of Flyport: the digital IOs, the analog inputs, how to create PWM and how to communicate with other devices or peripherals. QUESTION: Usually, to control the hardware of an embedded device it is required to know specific registers and how change them.
Flyport Wi-Fi and Ethernet Programmer's guide framework 2.3 (rev 1.0) www.openpicus.
Flyport Wi-Fi and Ethernet Programmer's guide framework 2.3 (rev 1.0) www.openpicus.com In the pull-down circuit of the figure, we can see that when the switch is opened (no other sources are connected), the input pin “reads” a low voltage value. If we close the switch (and connect a high voltage source), we change the what the pin “reads” to a high value.
Flyport Wi-Fi and Ethernet Programmer's guide framework 2.3 (rev 1.0) www.openpicus.com Example: if(IOButtonState (p5) == pressed) { // Code to do when p5 is pressed... } else { // Code to do when p5 is not pressed... } To know what kind of value you have to substitute instead of pressed in the above example, check the table above. In the case of an “inup” resistor substitute “OFF” (that is a low voltage level). In the case of an “indown” resistor substitute “ON” (that is a high voltage level).
Flyport Wi-Fi and Ethernet Programmer's guide framework 2.3 (rev 1.0) www.openpicus.com Remappable Pins A great feature of Flyport module is the possibility of remap the peripheral to almost any pin. As you can see in the pinout table, almost each pin is remappable. Pin remapping allows you to add more UARTs, PWMs, SPIs, TIMER and External interrupts. For PWMs you can use the PWM dedicated functions (see PWM section).
Flyport Wi-Fi and Ethernet Programmer's guide framework 2.3 (rev 1.0) www.openpicus.com The pin configuration depends on your specific application, so the “Hardware Architecture” should be decided first: which pins will be used as peripherals, and which pins will be “simple I/Os” Remappable Pins Functions To REMAP a pin you can simply use the IOInit function.
Flyport Wi-Fi and Ethernet Programmer's guide framework 2.3 (rev 1.0) www.openpicus.com Analog Inputs Flyport has several analog channels connected to the internal 10bit ADC of the microcontroller. QUESTION: What is the relation between number and voltage? Flyport has a precise Voltage reference inside at 2.048V. This means that the max voltage on an analog input is 2.048V. The ADC is 10 bit. So it means 2^10 = 1024 different values (0-min voltage to 1023-max voltage).
Flyport Wi-Fi and Ethernet Programmer's guide framework 2.3 (rev 1.0) www.openpicus.com Analog Inputs Functions Read an Analog Input → ADCVal(channel); This function returns an int value (from 0 to 1023...) related to the Analog channel (from 1 to 4) as reported on the pinout table.
Flyport Wi-Fi and Ethernet Programmer's guide framework 2.3 (rev 1.0) www.openpicus.com PWMs Flyport provides up to 9 PWMs using remappable pin function. QUESTION: What is a PWM signal? PWM, Pulse Width Modulation, is a digital periodic signal. It is like a square wave, but the duty cycle is variable. The duty cycle is the ratio between the high level period duration and the low level period duration, often expressed in %.
Flyport Wi-Fi and Ethernet Programmer's guide framework 2.3 (rev 1.0) www.openpicus.
Flyport Wi-Fi and Ethernet Programmer's guide framework 2.3 (rev 1.0) www.openpicus.com A more complex example (to add on taskFlyport.c): #include “taskFlyport.
Flyport Wi-Fi and Ethernet Programmer's guide framework 2.3 (rev 1.0) www.openpicus.com Serial Communication (UART) The UART is a serial asynchronous communication module to communicate with an external device such as a GPS receiver. You must know the baud rate of the signal or the UART will not be able to work properly. Flyport has a UART input buffer of 256 characters that stores the incoming chars. You don't have to poll the UART buffer, but just check the number of received chars.
Flyport Wi-Fi and Ethernet Programmer's guide framework 2.3 (rev 1.0) www.openpicus.com UART Functions First of all you must initiate the UART at a specific baudrate. Then you must enable the UART. Note: In the IDE wizard, there is the possibility to use the uart 1 as “TCP debug on UART1”. In this case the UART1 module is initialized at 19200 baud and turned on at startup. Initialize the UART →UARTInit(int port, long int baud); This is a mandatory function that initializes the module to work properly.
Flyport Wi-Fi and Ethernet Programmer's guide framework 2.3 (rev 1.0) www.openpicus.com Send a string to the UART →UARTWrite(int port, char *buffer); This function writes the specific string on the UART port. Parameters: port: the UART port buffer the string to write (a NULL terminated char array) Send a char to the UART →UARTWriteCh(int port, char chr); This function writes a specific char to the UART port.
Flyport Wi-Fi and Ethernet Programmer's guide framework 2.3 (rev 1.0) www.openpicus.com I2C Communication Protocol I2C is a 2 wire serial communication widely used in embedded electronics to connect devices such as external memory and more. Unlike the UART, I2C has a Master-Slave architecture, where the Master starts all the requests of communication. The baud rate is given by the Master, and the most used values are 100kb/s (low speed) and 400kb/s (high speed).
Flyport Wi-Fi and Ethernet Programmer's guide framework 2.3 (rev 1.0) www.openpicus.com Write a byte on I2C → I2CWrite(BYTE data); This function writes a byte of data .
Flyport Wi-Fi and Ethernet Programmer's guide framework 2.3 (rev 1.0) rwDelay: www.openpicus.com The delay (expressed in 10us) between write and read operations performed. This delay is needed by some I2C devices (please see slave datasheet for further info) Returns: BOOL result of operaXon: TRUE → operaXon success, FALSE → operaXon failed Write a single register → I2CWriteReg( BYTE DeviceAddr, BYTE RegisterAddr, BYTE valueToWrite); This function writes a byte of data to specific device.
Flyport Wi-Fi and Ethernet Programmer's guide framework 2.3 (rev 1.0) www.openpicus.com RTCC module RTCC – Real Time Clock Calendar – is a hardware clock module embedded on Flyport. It provides automatic clock counter and customizable interrupt driven alarm. Using openPicus framework libraries it's possible to read and write values of RTCC (date and time) and set an alarm. Alarm event can be both assigned to a callback function, or read in a dedicated status function.
Flyport Wi-Fi and Ethernet Programmer's guide framework 2.3 (rev 1.0) www.openpicus.com Reads Alarm status of RTCC module → BOOL RTCCAlarmStat(); Returns the actual status of alarm event. This function can be polled continuously to get alarm trigger. Returns: BOOL status of alarm: TRUE → Alarm was triggered. The funcXon is automaXcally set to FALSE unXl next alarm. FALSE → No alarm event.
Flyport Wi-Fi and Ethernet Programmer's guide framework 2.3 (rev 1.0) www.openpicus.com Using the TCP/IP Stack Flyport TCP/IP management is based on the Microchip TCP/IP stack. On that basis, the openPicus framework integrates the stack with the operating system FreeRTOS, to ease the management of any TCP/IP operation.
Flyport Wi-Fi and Ethernet Programmer's guide framework 2.3 (rev 1.0) www.openpicus.com QUESTION: What are the profiles? The profiles are structures which store basic Ethernet/Wi-Fi information, necessary for Flyport to know how to connect to the network.
Flyport Wi-Fi and Ethernet Programmer's guide framework 2.3 (rev 1.0) www.openpicus.com Flyport Ethernet Ethernet Connection Functions To handle the ethernet connections the framework supports the user variable MACLinked.
Flyport Wi-Fi and Ethernet Programmer's guide framework 2.3 (rev 1.0) www.openpicus.com For more info about the IDE Wizard please refer to the openPicus IDE Manual. QUESTION: How can I check Wi-Fi connection? Actually there is a very important variable called WFStatus. Its value is directly dependent on Wi-Fi connection status, and can be (them are defined in Hwlib.
Flyport Wi-Fi and Ethernet Programmer's guide framework 2.3 (rev 1.0) www.openpicus.com These values of the WFStatus variable can be used in the user task, for example, to control the Wi-Fi connection or to stop the retries for a while after reaching a retry limit. To Connect to a Wi-Fi net → WFConnect( int pconn ); The WFConnect() function starts opening a connection using the provided Wi-Fi profile.
Flyport Wi-Fi and Ethernet Programmer's guide framework 2.3 (rev 1.0) www.openpicus.com QUESTION: How can I know what kind of connection profile I have used? The WFConnection variable stores the Wi-Fi profile number used to connect Flyport to the Wi-Fi network. The “if(WFConnection == WF_CUSTOM)” can be used to find out if a Wi-Fi custom profile has been used.
Flyport Wi-Fi and Ethernet Programmer's guide framework 2.3 (rev 1.0) www.openpicus.com keypass: the key or passphrase fot the network A key must be specified also for open connections (you can put a blank string, like “”). keylenght:lenght of the key/passphrase. Must be specified also for open connections (can be 0). keyind: index of the key (used for WEP security, but must be specified also for all others, in that case can be 0).
Flyport Wi-Fi and Ethernet Programmer's guide framework 2.3 (rev 1.0) www.openpicus.com Network Functions and Variables There are more functions and system variables to control the Wi-Fi state and use the Hibernation mode: AppConfig is a variable which contains many network parameters. It is an APP_CONFIG struct type. The majority of parameters are found in ETH_DEFAULT/WF_DEFAULT and in ETH_DEFAULT/WF_CUSTOM, but the IP address of Flyport can change from its default value if DHCP is enabled.
Flyport Wi-Fi and Ethernet Programmer's guide framework 2.3 (rev 1.0) www.openpicus.com WFScan() is a utility function to start scanning for all the available Wi-Fi networks. Each of the Wi-Fi networks found will be indexed with an int number. Note: this function cannot be called inside “WF_Event.c”! WFNetworkFound() returns an int number of how many networks are found. At startup it returns 0. This function is useful to know the maximum number of networks found, 0 for no Wi-Fi networks found yet.
Flyport Wi-Fi and Ethernet Programmer's guide framework 2.3 (rev 1.0) www.openpicus.com TCP Protocol TCP, Transmission Control Protocol, is a packet oriented protocol. It can be used to transmit and receive packets of data through the network between server and client. • • • • • To use this kind of transmission, server and client should establish a connection.
Flyport Wi-Fi and Ethernet Programmer's guide framework 2.3 (rev 1.0) www.openpicus.com The parameters to set are the same for “GENERIC_TCP_CLIENT” and for “GENERIC_TCP_SERVER”.
Flyport Wi-Fi and Ethernet Programmer's guide framework 2.3 (rev 1.0) www.openpicus.com The data exchange can be full-duplex, so both Server and Client can send and receive packets. To write data Parameters: socktowrite: writech: wlen: → TCPWrite(TCP_SOCKET socktowrite, char* writech, int wlen); the TCP socket connection to write the char array of data to write out the length of data to write NOTE: The receive method is a little bit different.
Flyport Wi-Fi and Ethernet Programmer's guide framework 2.3 (rev 1.0) www.openpicus.com TCP Usage Basic usage example of a TCP Client and Server connection This short example shows how a user should configure the taskFlyport.c file to use a TCP connection in both Server and Client mode using two different sockets. #include "taskFlyport.
Flyport Wi-Fi and Ethernet Programmer's guide framework 2.3 (rev 1.0) www.openpicus.
Flyport Wi-Fi and Ethernet Programmer's guide framework 2.3 (rev 1.0) www.openpicus.com UDP Protocol The UDP (User Data Protocol) is another packet oriented protocol. This kind of protocol is very similar to TCP, but it does not perform flow control. There are less header bytes used with UDP than with TCP.
Flyport Wi-Fi and Ethernet Programmer's guide framework 2.3 (rev 1.0) www.openpicus.com In the IDE Wizard there is the above configuration page where UDP sockets are set up. QUESTION: How can I open a UDP connection? There are 3 ways to open a UDP Connection: Flyport can be a Server for point to multipoint (broadcast, only transmission is available), or point to point (server, both tx and rx available). In this case the Framework needs only the port number to open for the connection.
Flyport Wi-Fi and Ethernet Programmer's guide framework 2.3 (rev 1.0) www.openpicus.
Flyport Wi-Fi and Ethernet Programmer's guide framework 2.3 (rev 1.0) www.openpicus.com UDP Usage Example Here is a basic example of the usage of UDP protocol with Flyport as the Server. As can be seen in the example, UDP is full-duplex, but the connection with the Client is not necessary, and the UDP server can write strings even when no client is connected. #include "taskFlyport.
Flyport Wi-Fi and Ethernet Programmer's guide framework 2.3 (rev 1.0) www.openpicus.com SMTP Protocol The SMTP (Simple Mail Transfer Protocol) is used to send emails, and Flyport can send emails using a Non-SSL connection. The user can customize sender, receiver, subject and message at runtime. The usage of SMTP is not recommended for frequent communication, since it can overflow servers. It should be used to report occasional errors, daily reports or similar tasks.
Flyport Wi-Fi and Ethernet Programmer's guide framework 2.3 (rev 1.0) www.openpicus.com SMTPSetMsg(MSG_FROM, "user@lavabit.com"); SMTPSetMsg(MSG_SUBJECT, "Flyport SMTP test!!"); UARTWrite(1,"Client SMTP initialized!\r\n"); vTaskDelay(100); // wait for sending complete if(SMTPSend()) { UARTWrite(1,"sending email...\r\n"); while(SMTPBusy() == TRUE) { UARTWrite(1,".
Flyport Wi-Fi and Ethernet Programmer's guide framework 2.3 (rev 1.0) www.openpicus.com FTP Client FTP Client can handle file exchange between Flyport and PC (or any other FTP Server). Flyport can only be the Client, so other devices have to provide the FTP server service (for example a PC with FileZilla Server). Basically, an FTP connection is a special set of instructions that use TCP protocol. With those commands the files and directories handling, user login, logout, etc. can be controlled.
Flyport Wi-Fi and Ethernet Programmer's guide framework 2.3 (rev 1.0) www.openpicus.com FTP_SOCK_NOT_CONNECTED (-10) Returned in case the FTP command socket is not connected, in this case the operation is aborted. FTP_ERR_SERV_DISCONNECTED (-11) FTP server disconnected client during the operation. FTP_FILE_ERROR (-12) Some error occurred while accessing file, maybe user has not permission, or file is actually in use.
Flyport Wi-Fi and Ethernet Programmer's guide framework 2.3 (rev 1.0) www.openpicus.com NOTE: both the functions take a command socket and open the data socket, write the data on file and close the socket. To keep the data socket opened and write data multiple times without reopening it, use the stream functions instead. Parameters: *cmdSock: The command socket previously connected to the server. fileName: A string with the file name to read the size.
Flyport Wi-Fi and Ethernet Programmer's guide framework 2.3 (rev 1.0) www.openpicus.com example in an sd card, and retrieve the data later. Opening the stream in read mode → Read data from stream → FTPStreamOpen(TCP_SOCKET cmdSock, char fileName[], char mode[]); To open the file stream in read mode, the function FTPStreamOpen() must be used specifying the mode RETR. Parameters: *cmdSock: The command socket previously connected to the server.
Flyport Wi-Fi and Ethernet Programmer's guide framework 2.3 (rev 1.0) www.openpicus.com FTP Low level functions Low level functions allow the user to manage basic FTP functionalities, as creating a socket, or reading/writing chars on FTP command or data socket. Using this set of command, the user can build its own functions to access FTP services, but has to manage the timeouts and parse the answers from the server.
Flyport Wi-Fi and Ethernet Programmer's guide framework 2.3 (rev 1.0) www.openpicus.com TRUE - The remote connection is established. FALSE - The remote connection is not established. Read data from FTP client → FTPRead(TCP_SOCKET ftpsockread, char ftpreadch[], int ftprlen ) Reads the specified number of characters from a FTP socket and puts them into the specified char array. Parameters: ftpsockread: The handle of the socket to read (the handle returned by the command FTPClientOpen).
Flyport Wi-Fi and Ethernet Programmer's guide framework 2.3 (rev 1.0) www.openpicus.com The Webserver and HTTPApp.c The webserver is a great feature of Flyport. It permits monitoring and controlling Flyport's functions using a simple web browser. The browser can be installed on a PC, a smartphone or a tablet. The webserver service is performed by HTTPApp.c and webserver files, which use dynamic variables.
Flyport Wi-Fi and Ethernet Programmer's guide framework 2.3 (rev 1.0) www.openpicus.com Flyport Wi-Fi The Web Pages import tool, using the Flyport Wi-Fi module, generates a MPFSImg2.s file, and also all the references to the dynamic variables inside the HTTPPrint.h file. Those files, with the customized HTTPApp.c that should be used (and modified) to handle all the callback functions, must be compiled and downloaded inside the hardware.
Flyport Wi-Fi and Ethernet Programmer's guide framework 2.3 (rev 1.0) www.openpicus.com This page permits the upload of the MPFSImg2.bin file directly into the External Flash memory. In this way it is not needed to reboot the Flyport to have a upgraded webserver. Warning: Pay attention! The pages can be updated with the using of the mpfsupload page, but not the related callback functions.
Flyport Wi-Fi and Ethernet Programmer's guide framework 2.3 (rev 1.0) www.openpicus.com As can be seen, the only content of the body of this webpage is the ~string_serial~ dynamic variable. If this index.htm is opened with a browser in a pc, the result will be: In this case, since there is no Flyport to change the dynamic variable value, the browser regards the statement as a constant text. What happens in Flyport's webserver? If we define the variable string_serial inside our “taskFlyport.
Flyport Wi-Fi and Ethernet Programmer's guide framework 2.3 (rev 1.0) www.openpicus.com NOTE: The address pointed to by the web browser (http://192.168.1.115/) is the IP address of Flyport in the network. This is the way to access a Flyport webserver on a local network. QUESTION: How can I change value of a dynamic variable? The value “dynamic value!” above is the value that Flyport places in the variable ~string_serial~ when the page is sent to a Client due to a request to access the page.
Flyport Wi-Fi and Ethernet Programmer's guide framework 2.3 (rev 1.0) www.openpicus.com // add a terminator character string_serial[len_s] = '\0'; strlen(string_serial); } } The result on a web browser if user writes the string “changed value...” on UART1 will be the shown above, only when the whole web page has been reloaded: NOTE: if user does not refresh the web page, the old value will be displayed even if actually a new value of dynamic variable “string_serial” is assigned.
Flyport Wi-Fi and Ethernet Programmer's guide framework 2.3 (rev 1.0) www.openpicus.com #if defined(HTTP_USE_AUTHENTICATION) BYTE HTTPNeedsAuth(BYTE* cFile) { //If you want to restrict the access to some page, include it in the folder "protect" // here you can change the folder, or add others if(memcmppgm2ram(cFile, (ROM void*)"protect", 7) == 0) return 0x00; // Authentication will be needed later // // // // You You You You can match additional strings here to password protect other files.
Flyport Wi-Fi and Ethernet Programmer's guide framework 2.3 (rev 1.0) www.openpicus.com This function processes every POST request from the pages.
Flyport Wi-Fi and Ethernet Programmer's guide framework 2.3 (rev 1.0) • • • • • www.openpicus.com images/barul.gif images/bg.gif images/h3bg.gif images/intro.jpg images/leftintrobg.gif The browser rendering of the example web page is shown below: The images are not necessary, but are used to make a better looking webpage; “header.inc”, “footer.inc” and “style.css” are used by “index.htm”. In status.xml the dynamic variable ~test~ is associated to “testing” id in the index.
Flyport Wi-Fi and Ethernet Programmer's guide framework 2.3 (rev 1.0) www.openpicus.com The updated value is written to the status.xml file by a specific callback function in Flyport's HTTP firmware. Each time Flyport handles a dynamic variable, it executes the related callback function, for example HTTPPrint_test(). All the callback functions start with “HTTPPrint_” plus the name of the dynamic variable (“test” in this case). When Flyport sends the file “status.
Flyport Wi-Fi and Ethernet Programmer's guide framework 2.3 (rev 1.0) www.openpicus.com SNTP Client SNTP service is a Simple Network Time Protocol, a simplified version of NTP protocol for embedded devices. Using this feature, Flyport can download from the internet network very precise time information from dedicated time servers. Using this feature, Flyport can always be in sync with “real world” time.
Flyport Wi-Fi and Ethernet Programmer's guide framework 2.3 (rev 1.0) www.openpicus.com SNTP Usage Example A very short usage example of SNTP features is shown here: #include "taskFlyport.h" #include "time.h" time_t now; struct tm* ts; DWORD epoch = 0; DWORD epochtime = 0xA2C2A; char dateUTC[50] = "waiting..."; // to properly set GMT by adding or removing // the hours for GMT zone (for example Rome = +1 or +2 GMT) // negative values are supported too...
Flyport Wi-Fi and Ethernet Programmer's guide framework 2.3 (rev 1.0) www.openpicus.com if(ts->tm_hour > 24) { ts->tm_hour = ts->tm_hour - 24; } else if(ts->tm_hour < 0) { ts->tm_hour = ts->tm_hour +24; } strftime(dateUTC, sizeof(dateUTC), "%Y-%m-%d / %H:%M.%S", ts); if(UARTBufferSize(1) > 0) { UARTWrite(1, dateUTC); UARTWrite(1, "\r\n"); // Removes all data in UARTRxBuffer, since we do not need it! UARTFlush(1); } } } This example illustrates the code necessary to implement SNTP. First of all, “time.
Flyport Wi-Fi and Ethernet Programmer's guide framework 2.3 (rev 1.0) www.openpicus.com This formats the values in the desired format, copying the result string to “dateUTC1” The string format can be customizable at user preferences, for example it can be changed to be: “%H:%M.%S of the day %d of month %m of the year %Y” QUESTION: How can a local time-zone reference with respect for GMT be setup? In the previous example the variable “int GMT_hour_adding” permits adjusting to different timezones.
Flyport Wi-Fi and Ethernet Programmer's guide framework 2.3 (rev 1.0) www.openpicus.com Advanced Features In this chapter are shown some advanced features of the openPicus Framework. It is suggested to first learn and use the standard functions of the Framework. The advanced features described below can lock the overall system if used incorrectly. The Energy Saving Modes (Flyport Wi-Fi Only) The openPicus Framework permits using advanced energy saving methods.
Flyport Wi-Fi and Ethernet Programmer's guide framework 2.3 (rev 1.0) www.openpicus.com This function turns ON the Wi-Fi transceiver again NOTE: this function does NOT reconnect Flyport to Wi-Fi network automatically. The User should handle the connection of the Wireless LAN after the transceiver is enabled. Sleep Mode When Sleep mode is activated, the Wi-Fi transceiver is turned OFF, and also PIC enters a low power mode to save energy.
Flyport Wi-Fi and Ethernet Programmer's guide framework 2.3 (rev 1.0) www.openpicus.com Energy Saving Usage Example Here is a simple power saving example, using Serial commands to switch from normal operation to hibernate or sleep, and then use the RTCC or External interrupt 2 to wake up from Sleep mode. NOTE: remember to enable RTCC Library from IDE wizard before to use this example #include "taskFlyport.
Flyport Wi-Fi and Ethernet Programmer's guide framework 2.3 (rev 1.0) www.openpicus.
Flyport Wi-Fi and Ethernet Programmer's guide framework 2.3 (rev 1.0) www.openpicus.com In this example all the code needed to use the power saving modes is shown. Using UART commands the user can control switching between normal operation, sleep mode, Wi-Fi off, connection, disconnection and printing the dynamic value of the RTCC.
Flyport Wi-Fi and Ethernet Programmer's guide framework 2.3 (rev 1.0) www.openpicus.com Rome, Italy • +39.06.92916378 • www.openpicus.