
Dear Larry,
I'm trying to connect the 5600W to an iPhone using ad-hoc networking, static IP and a fixed channel. The iPhone sees the ad-hoc network and appears to connect, but a browser cannot make a connection. Is there a specific example of ad-hoc networking?
Michael F.
Hello Michael,
Thanks for the question. I had never set up a webpage on an iPhone before so I borrowed a colleague's iPhone and did the following:
First, you need to set up the Rabbit’s network configuration for ad-hoc mode. You can put the following ad-hoc parameters (modified for your own network) into the Project Options -> Defines window:
TCPCONFIG = 1;
_PRIMARY_STATIC_IP = "10.10.6.100";
_PRIMARY_NETMASK = "255.255.255.0";
MY_GATEWAY = "10.10.6.1";
MY_NAMESERVER = "10.10.6.1";
IFC_WIFI_SSID = "rabbitTest";
IFC_WIFI_ROAM_ENABLE = 1;
IFC_WIFI_ROAM_BEACON_MISS = 20;
IFC_WIFI_CHANNEL = 1;
IFC_WIFI_MODE = IFPARAM_WIFI_ADHOC;
IFC_WIFI_REGION = IFPARAM_WIFI_REGION_AMERICAS;
IFC_WIFI_ENCRYPTION = IFPARAM_WIFI_ENCR_NONE;
I omitted the TCPCONFIG macro above as I was using samples\RCM5600W\tcpip\browseled.c which already has this defined at the top of the file. I just used the default parameters listed above. Then I compiled browseled.c to my RCM5600W.
In the iPhone I went to Settings -> WiFi Networks and selected the ad-hoc network I had set up in the RCM5600W, which was "rabbitTest" – the IFC_WIFI_SSID parameter.
After the ad-hoc network was set up I opened the Safari browser and typed in 10.10.6.100 – the _PRIMARY_STATIC_IP parameter. The 4 LEDs appeared in the browser window. I was also able to access the source page.
This should be all you have to do.
If you decide to use an AP (Wireless Access Point) with security instead of an ad-hoc network, that's easy to set up too. All configuration parameters for the various Wi-Fi settings are in vol. 1 of the TCPIP User Manual, Section 2.4.1. You will need to modify the macros to fit with the parameters of the AP you are using in your local network. You can place the correct set of parameters in the Defines window in Project Options.
Again, compile the browseled.c program to the RCM5600W.
Select the correct Wi-Fi network in your IPhone and enter any necessary security information such as a password.
Open Safari and point to the static IP address of your Rabbit board.
That's all there is to it! Remember that Safari is not Internet Explorer, so be sure to test your code in the Safari browser as you develop your webpages.
- Larry C.
Larry Cicchinelli is Rabbit’s Technical Support Manager. He has 30 years of embedded experience, and is considered one of the foremost authorities on Rabbit products. Larry and his staff offer comprehensive technical support to Rabbit customers.
Submit your questions for Larry via email at AskLarry@rabbit.com
Read more Ask Larry Answers
