Datasheet

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.
To switch from one state to another some thought must be used, for example, if the user tries to
connect to the Wi-Fi network when the transceiver is turned OFF, Flyport will attempt unsuccessfully
to open a connection, but no warnings messages will be shown on the UART.
QUESTION: In the above example, are there some defined commands to use for switching between
the different Power Saving Modes?
The following command sequences can be used without problems:
To switch to transceiver off user should use:
off
To switch to normal mode user should use:
on”
NOTE: with this command, if the Flyport was connected before, the user should then connect again to
Wi-Fi network using “up”
To switch between normal state and transceiver off, the commands “on” and “off” are used, with
attention to re-connecting the Flyport to the Wi-Fi profile after turning on the transceiver.
To switch to sleep mode user should use:
“sleep”
NOTE: with this command, only interrupts can wake up Flyport. In this specific example the RTCC
alarm or external interrupt 2 connected to pin 5 with pull up resistor may be used. To wake up Flyport
from sleep the user can wait for an RTC ALARM or connect pin 5 to Ground (which will generate an
external interrupt).
NOTE: after the wake up from sleep, the user must manually connect Flyport to Wi-Fi network using
the command “up”.
To check if the microcontroller is running or sleeping, the user can use :
“rtcc”
NOTE: This command makes Flyport transmit the value of the RTCC over the UART, but works only
when the microcontroller is active; Flyport will not reply when in sleep state!
Switching between normal and sleep states can be done with the command “sleep” and then
waiting for an RTCC alarm or changing state of the interrupt pin, remembering to re-connect the
Flyport to the Wi-Fi after wakeup.
Warning: Pay attention also to reinitialization of the sockets used in the application. All the TCP
sockets used in the User task should be reinitialized to “INVALID_SOCKET” value before opening
them again; the same is true for UDP Sockets, which should be reinitialized to “0”. This is
necessary, and it is suggested to do it each time the user turns on the transceiver, and also before
any network connection.
74