The WiFly
After many tries, I finally got the WiFly module to work as a AdHoc server, and to serve NMEA data via Wi-Fi, using the UDP protocol.I want to configure the WiFly module to act as a UDP server using a terminal connection. I use Putty, connect the WiFly using the USB connection break-out board, and fire up the terminal, then type $$$ to enter command mode.
First I reset the WiFly back to factory settings:
factory RESET
save
reboot
Then I configure the WiFly module using the following commands:
set wlan join 4
set wlan channel 1
set wlan ssid MyArduino
set wlan tx 6
set uart baudrate 38400
set ip address 192.168.1.1
set ip netmask 255.255.255.0
set ip dhcp 0
set ip protocol 1
set ip remote 50000
save
reboot
Please notice that I am using baudrate 38400, as I will be sending AIS data later via this channel. It means that if you re-enter command mode via a terminal emulator, you will need to connect on 38400 baud.
I am using port 50000 as my UDP port. I will be configuring the other Wi-Fi device using static IP, so I disable DHCP.
The Arduino
I insert the WiFly module back into my Arduino setup.
I have already put together a sketch that multiplexes incoming NMEA data, and outputs this data using the UDP protocol, on port 50000. See my previous posting for source code on this sketch.
The iPhone
On my iPhone, I see and connect to the "MyArduino" WiFi network. I click on the right blue arrow, and specify "Static" IP Address. I then type in the following configuration:
- IP Address: 192.168.1.1
- Subnet Mask: 255.255.255.0
- Router: 192.168.1.1
I leave the other fields blank.
I use a WiFi UDP Test Tool app downloaded from the App Store to monitor incoming UDP data. It shows that the NMEA data is flowing nicely via the UDP protocol all the way from my GPS, via my Arduino to my iPhone.
Sketch Arduino for Wifly RN-XV modem configuration without Wifly library and
ReplyDeletewith front-end: https://dl.dropboxusercontent.com/u/101922388/WiflySanUSB.zip
Type in browser address bar: 192.168.1.195/YT to toggle Led and open a HTML page