Regarding 5400W Coding

Hello guys, I having a problem regarding the coding for 5400W. With the sample given BROWSELED.C I am able to compile and control the 2 LEDs using web browser.However, my project is to use the S2 and S3 to control the light and to display in the web browser. But seem that if I change the coding of BROWSELED.C it onli keep on causing a loop at costate function.
So hope someone could give me so advise or suggestion thx…

Hi friend,
I have a RCM5400W wifi module which i bought recently. Just i need to toggle my onboard LEDs using browseled.c program. For that do i need Wifi receiver on my PC to which i want to communicate with? then is there any name fixed name or no for it? pls reply.

If i do this succesfully then there is a mile to go on this. I will be posting on my next visit.

I would like to know that, I’ve “RCM5600W” module. I want to set IP address in one LAN, that network has a WAP key. The problem is that, I don’t know how to set IP for that network. Without WAP key is ok (Static, DHCP). FTP also ok. Only thing is how to resolve WAP key.

Hi dhanraj_kmr,

U need a wifi pc or a laptop to recieve the connection for 5400w. By default the name is already given which is rabbittest. U can press ctrl+H to see the guide for Tconfig. It will help u when u go along.

Hi friend,
Really thanks for your reply. I dont have much knowledge abt wifi. but I had to realised that. so i bought a wireless-G USB 2.0 Adapter from NETGEAR 2.4Ghz, 802.11g(WG111).
So i ran the software which came along with it. Then i found a window NETGEAR WG111V3 smartwizard. then i added SSID as ‘rabbitwifi’, and network type as computer to computer(AdHoc) then thats it. Then i had to run a sample pro Wifiscan.c. As a result i was geeting like this

"Starting scan…
WiFi Scan Results: 1 entries
Channel Signal MAC Access Point SSID

  6      32    02:e0:60:52:28:84  [rabbitwifi]                              

Scan done, exiting… ".
Here i have some doubts 1st on my USB MAC address is :001E2AAf609C
But here on my result its printing something else. And whats that term singal 32?:confused:
When i run the same pro next time i was getting like this

"Starting scan…
WiFi Scan Results: 3 entries
Channel Signal MAC Access Point SSID

  6      38    02:e0:6d:71:2c:e1  [rabbitwifi]                              
  6      14    00:1b:11:a2:2d:06  [Indus1]                                  
  6      14    00:13:46:70:4d:46  [Indus2]                                  

Scan done, exiting… "

what are those Indus1 and Indus2. Now see my signal is 38???

And even my USB and rabbit wifi getting some heat morethan what i expected while its communicating eachother. I’ve connected my rabbit USB program cable and USB adapter’s cable on my PC’s near by slot. Can i do like this? or should i connect my USB adapter on another system? even i haven’t changed my PC’s IP add. here’s the code which i am using…

#define TCPCONFIG 5
#define _PRIMARY_STATIC_IP “10.10.6.100”
#define _PRIMARY_NETMASK “255.255.255.0”
#define MY_GATEWAY “10.10.6.1”
#define MY_NAMESERVER “10.10.6.1”
#define IFC_WIFI_SSID “rabbitTest”
#define IFC_WIFI_ROAM_ENABLE 1
#define IFC_WIFI_ROAM_BEACON_MISS 20
#define IFC_WIFI_CHANNEL 1
#define IFC_WIFI_MODE IFPARAM_WIFI_ADHOC
#define IFC_WIFI_REGION IFPARAM_WIFI_REGION_AMERICAS
#define IFC_WIFI_ENCRYPTION IFPARAM_WIFI_ENCR_NONE

#define DISABLE_TCP
#define DISABLE_DNS

#use “dcrtcp.lib”

#memmap xmem

/****************************************************************************
print_macaddress

Routine to print out mac_addr types.

****************************************************************************/
void print_macaddress(far unsigned char *addr)
{
printf(“%02x:%02x:%02x:%02x:%02x:%02x”, addr[0], addr[1], addr[2],
addr[3], addr[4], addr[5]);
}

/****************************************************************************
rxsignal_cmp

qsort comparison, based on rx signal strength.

Inputs:
a, b – far pointers to _wifi_wln_scan_bss, a struct populated by
the WIFI SCAN, including rx_signal (relative receive signal
strength).

Return value: > 0 if a > b
				  < 0 if a < b
				  0   if a == b

****************************************************************************/
int rxsignal_cmp(far _wifi_wln_scan_bss *a, far _wifi_wln_scan_bss *b) {
return b->rx_signal - a->rx_signal;
}

/****************************************************************************
scan_callback

Prints out the sorted results of a BSS scan.
Called when WIFI SCAN is complete.

The argument is a pointer to the wifi_scan_data structure generated by
the scan.

We use _f_qsort to sort the data since the data is `far.’ _f_qsort
requires a comparison function, and we use the rxsignal_cmp() function
above.

Inputs:
data – far pointer to wifi_scan_data structure, which contains a
count of the number of responses, and an array of
_wifi_wln_scan_bss structures, with the first `count’
containing valid data for the responses.

***************************************************************************/
char scandone;
root void scan_callback(far wifi_scan_data
data)
{
uint8 i, j;
far _wifi_wln_scan_bss *bss;
char ssid_str[33];

bss = data->bss;
// Sort results by signal strength.  Need to use _f_qsort, since bss is
// far data.
_f_qsort(bss, data->count, sizeof(bss[0]), rxsignal_cmp);
// Print out results

printf("WiFi Scan Results: %d entries
", data->count);
printf("Channel Signal MAC Access Point SSID
“);
printf(”-------------------------------------------------------
“);
for (i = 0; i < data->count; i++) {
printf(” %2d %2d “,
bss[i].channel, bss[i].rx_signal);
print_macaddress(bss[i].bss_addr);
wifi_ssid_to_str (ssid_str, bss[i].ssid, bss[i].ssid_len);
printf(” [%s]
", ssid_str);
}
scandone = 1;
}

/****************************************************************************
main

Scan for BSS's.  Must call tcp_tick(NULL) to drive scanning process.

****************************************************************************/
void main(void)
{
int val0, val1, i, level;
unsigned long int end;

sock_init();

scandone = 0;

// Enable Roaming
ifconfig (IF_WIFI0, IFS_WIFI_ROAM_ENABLE, 1, IFS_END);

// Set roam event to loss of 20 beacons
ifconfig (IF_WIFI0, IFS_WIFI_ROAM_BEACON_MISS, 20, IFS_END);

// Bring the interface down before starting a scan
ifdown(IF_WIFI0);
while (ifpending(IF_WIFI0) != IF_DOWN)
tcp_tick(NULL);

// Set the callback before requesting scan
printf("Starting scan…
“);
ifconfig(IF_WIFI0, IFS_WIFI_SCAN, scan_callback, IFS_END);
while ( ! scandone) {
tcp_tick(NULL);
}
printf(”

Scan done, exiting…");
exit(0);
}

Am i doing correctly?
pls correct me if i am wrong…

Hi fren,

Sorry to tell u that I not a pro for this kit yet. But regarding Wifiscan.c. I did try this sample in school before. If I not wrong it is scanning the surrounding for the available wifi Mac Access point. But for the digit change from 32 to 38 I do not know wat does it stands. Maybe need to look up old book -.-. For the heat problem, I also do encounter it after I compiled my code to run wifi. It will heat up after so time. Dun worri will not have any problem. I on it more than 9hrs or so. hmm… if ur coding is gotten from the sample.c think it will be much a problem…

Anyway frnd thans for the reply. I didnt learn much networking concepts in college days. Thats the problem. K leave that code its exactly a sample code only;). but we should use the IP confic for both trsnsmitting as well as receiving on ethernet communication right ? But in wifi where we do this at wifi pc side. and in system tray it says “wireless connection is not connected”. is it affecting my infrastructure mode?

Now i stepped up the BROWSELED.c pro. While i compilin he i am getting
1 error and 4 warrnings. they are

line 142 : ERROR WIFI_MAC_MGMT.LIB : ) is missing/expected.
line 142 : WARNING WIFI_MAC_MGMT.LIB : Conversion to incompatible pointer type
line 142 : WARNING WIFI_MAC_MGMT.LIB : Conversion to incompatible pointer type
line 142 : WARNING WIFI_MAC_MGMT.LIB : Conversion to incompatible pointer type
line 154 : WARNING WIFI_MAC_MGMT.LIB : Conversion to incompatible pointer type
if i clik on them they just go to WIFI_MAC_MGMT.LIB. but there is nothing.
whats goin on? can you fix it even if u r not a pro…