This demo was provided by Coocox and is based on their Arduino Wifi shield firmware for the Freescale FRDM-KL25Z available HERE
This tutorial was published with Coocox agreement. If you need more information, please visit Coocox website : www.coocox.org
Introduction
This example shows the compatibility (hardware and software) of the Freescale Freedom Development Platform with the Arduino Wifi Shield thanks to the driver for the FRDM-KL25Z provided by Coocox.
Board will connect to a wifi network and automatically upload periodically simple data (which could be easily replaced by some sensor measurements) to a webserver.
Requirements
To run this demo you will need the following hardware and software tools :
- FRDM-KL25Z
- Arduino Wifi shield
- Wifi connection (with access code) with internet access
- Jumper wires
- Hyperterminal software tool (like Tera Term : http://ttssh2.sourceforge.jp/ )
Hardware modifications
Since the Digital interface and ICSP interface are not connected together on the Arduino Wi-Fi Shield, you need to connect them manually as shown in the figure below.
Then you must connect UART1 with UART0 via jumper wires.
Note : In current version driver, the Wi-Fi Shield configuration uses the serial port UART1_TX and UART1_RX.
So finally your FRDM-KL25Z_WIFI kit should look like as below
Board Configuration
This demo has already been precompiled so you can simply download the hexadecimal file "Coocox Wifi Arduino Demo v2.0beta.srec" and program it in flash thanks to the OpenSDA MSD Application.
1. Keep pressing the reset button while plugging the USB cable in the OpenSDA port of the Freescale FRDM-KL25z board
2. Release the Reset button ... A new drive "BOOTLOADER" will appear in Windows Explorer
3. Drag'n drop or Copy-paste the OpenSDA application file "MSD-FRDM-KL25Z_Pemicro_v107.SDA" in the BOOTLOADER drive in Windows Explorer
3. Unplug and replug the USB cable ... A new drive "frdm-kl25z" will appear in Windows Explorer and a new peripheral OpenSDA -CDC Serial Port (COM15) will be detected in Device Manager
4. Drag'n drop / copy-paste the file "Coocox Wifi Arduino Demo v2.0beta.srec" in the frdm-kl25z drive in Windows Explorer
Software Configuration
Launch the Hyperterminal (Tera Term)
Start a NEW CONNECTION
Choose SERIAL and the COM port of your OpenSDA - CDC Serial Port (COM15 in my case)
Select SETUP then SERIAL PORT ... and change BAUD RATE: 115200 (keep unchanged Data:8-bit, Parity: None, Stop: 1 bit, Flow Control: None)
Run the demo
Press FRDM-KL25Z reset button
Following message should appear in Hyperterminal window
FRDM Board will automatically detect the hardware connections. The following message will confirm that connections are all right.
Note : if any connection is detected, for example because you have not respected the Hardware Modifications (check it first) or the Arduino Wi-Fi Shield is broken, the following message will appear :
Sorry, we can not detect the wifi module on your freedom board!
Please check your hardwire connection.
Press <Enter> and it will begin to scan available networks and display their SSID.
Enter the ID of the network you want to join (e.g. enter <2> to join GregSansFil network), and press <Enter>, the network SSID selected will be shown.
Note : You can also input “R” to refresh networks, or exit the demo by pressing <Esc>.
Enter the WPA/WEP encryption key requested to connect the network,
Note : it will connect automatically to the network if it is Open.
Press <Enter> after entering the encryption key ... Wi-Fi will start to connect to the network.
Note : If Wi-Fi is not connecting to the network after a long time, just press <Esc> to exit the demo and start the search of the available networks again.
The IP will be demonstrated if Wi-Fi successfully connects to the network.
Afterwards the FRDM Board will push data to the COSM website periodically.
Visit https://cosm.com/feeds/106382 to see data count.