chipKIT® Development Platform

Inspired by Arduino™

MRF24WB0M picTail WiFi

Created Mon, 23 Jan 2012 21:12:54 +0000 by chipkit_andy


chipkit_andy

Mon, 23 Jan 2012 21:12:54 +0000

Hi all, I recently bought a pictail to ad Wifi support to my Max32 - in the beginning I was really happy to about my progress in setting up the chipkit tcp/ip stack to work with max32: i achieved wpa2-psk connection to my AP, got a dhcp assignment from the router but then no further steps/reactions to client request are possible...

If I ping to my pictail there are arp requests visible with wireshark but no reactions from my board (i made a putsUart - output within _WFInterrupt service routine which echoes correctly during dhcp assignment).

Does anyone have an idea about this problem?

Thx, Andy

Protocol so far: [7001: _WFInterrupt() : the ones after dhcp are output during several minutes and are thrown away in MACGetHeader() with len=0]

***7001 ***
***7001 ***
***7001 ***
***7001 ***
***7001 ***
***7001 ***
***7001 ***
***7001 ***
***7001 ***
***7001 ***
***7001 ***
***7001 ***
***7001 ***
***7001 ***
***7001 ***
***7001 ***
***7001 ***
***7001 ***
***7001 ***
***7001 ***
***7001 ***
***7001 ***
***7001 ***
***7001 ***
***7001 ***
***7001 ***
***7001 ***
***7001 ***
Set SSID (AM24G)
***7001 ***
***7001 ***
***7001 ***
***7001 ***
***7001 ***
***7001 ***
***7001 ***
***7001 ***
Set Security: xxxxxxx
***7001 ***
***7001 ***
***7001 ***
***7001 ***
Set Scan Type
***7001 ***
***7001 ***
***7001 ***
***7001 ***
Set Channel List
***7001 ***
***7001 ***
***7001 ***
***7001 ***
Set list retry count
***7001 ***
***7001 ***
***7001 ***
***7001 ***
Set Event Notify
***7001 ***
***7001 ***
***7001 ***
***7001 ***
Set Beacon Timeout
***7001 ***
***7001 ***
***7001 ***
***7001 ***
Start WiFi Connect
***7001 ***
***7001 ***
***7001 ***
***7001 ***
---ChipKITClientConnect
***7001 ***
***7001 ***
***7001 ***
***7001 ***
***7001 ***
***7001 ***
***7001 ***
***7001 ***
***7001 ***
***7001 ***
***6114 ***
***7001 ***
***7001 ***
remoteMAC: XXXXXXXXXXX
***7001 ***
***7001 ***
***7001 ***
***6112 ***
***7001 ***
***7001 ***
***6114 ***
***7001 ***
***7001 ***
remoteMAC: XXXXXXXXXXXX
dhcp-ip: 192.168.1.119
dhcp-mask: 255.255.255.0
dhcp-gw: 192.168.1.1
dhcp-dns: 192.168.1.1
***6112 ***
***7001 ***
***7001 ***
***7001 ***
***7001 ***
***7001 ***
***7001 ***
***7001 ***
***7001 ***
***7001 ***
***7001 ***
***7001 ***
***7001 ***

KeithV

Thu, 26 Jan 2012 18:17:56 +0000

Andy,

I am not going to specifically answer your question because I am working on an alternative solution. I got the okay to let the cat-out-of-the-bag as shortly Digilent will be providing a WiFi library for the chipKIT compatible boards.

I currenlty have alpha level code working on the MX3cK, MX4cK, and MX7ck; as these are boards that accept the MRF24WBOMA Pmod WiFi. I have not attempted to attach this to the MAX32 with a Pmod Shield installed, but maybe I will take a look at that. I assume if you are using the WiFi Pmod on a Max32, you must be using the Pmod Shield?

The library is called DWIFIcK and is complementary to the latest DNETcK IP library we just released last month with the Network Shield library download. DNETcK is a full featured enhancement of the original Ethernet library. It works a little differently, so I would read the document that comes with it.

The good news is: I am having great success with WiFi. The bad news is, I am using the Microchip MAL and there are some annoyances with the Microchip WiFi MAL that I just can't a handle on, and there isn't much documentation on the SPI calls to the WiFi MAC for me to figure it out. It has been a lot of trial an error work for me.

Anyway, I think I will lobby to release the library even if there are some annoyances as it is just too useful to have WiFi. What I have found is, once the WiFi connection is made, it works very well.

As for your specific problem; I don't know... but I do know that I spent a ton of time getting my interrupts and SPI masks just right for the various processors. It took some time for me to understand all of the in's and out's of how to get the PIC32 SPI properly configured for the WiFi MAC.


KeithV

Thu, 26 Jan 2012 19:47:12 +0000

Andy,

I just updated my DWIFIcK to support the Max32 with a Pmod Shield and a Pmod WiFi on connector JC on the Pmod Shield; it works just fine! This should also work exactly with the Uno32. And there are no wires to fool with :)


Jacob Christ

Fri, 27 Jan 2012 05:27:17 +0000

Keith,

When can we order the shield?

Jacob


chipkit_andy

Fri, 27 Jan 2012 10:06:15 +0000

Keith, Thx for your answer and detailed informations!

As for your question:

I'm not using the Pmod on Max32: i wired the microchip wifi pictail (AC164136-4) directly to max32 on SPI1/INT1 And I enhanced the "Ethernet" class with a wf_connect() function which calls itself ChipKITWifiBegin() in the enhanced chipKITEthernetAPI.c I thougt, the only enhancement consists in the SSID, KEY and securitykind parameters...

Till yesterday I always tested with your ChipKITWebServer sample with no succes and then (quite frustrated) i tried the ChipKITWebClient: success - worked like a charm!

So conclusion is: request sent from MRF24WB0M are ok and the response is handled ok - but request from lan to MRF24WB0M are not detected (no interrupt, arp requests from client not answered at all in wireshark...)

So could it be that this is the same issue like in [url]http://www.microchip.com/forums/m519388-print.aspx[/url]? I am using a Netgear WNDR3700 as AP.

Greets, Andy


KeithV

Fri, 27 Jan 2012 17:11:30 +0000

Jacob,

The Pmod Shield is available now from Digilent

http://www.digilentinc.com/Products/Detail.cfm?NavPath=2,892,993&Prod=CHIPKIT-PMOD-SHIELD-UNO

More specifically, all of the hardware I am talking about is available today. Only the DWIFIcK library is not.... yet...


KeithV

Fri, 27 Jan 2012 17:25:47 +0000

Andy,

You are going to have problems with SPI1 because it is shared with UART1 which is the serial monitor. It is possible that writing to serial.print could get killing you. I had this problem.

I had to move the MAX32 off of SPI1 to SPI2; however if you do this with the MAL as you have it, you will also have to move to INT3. But that should work.

In what I am working on, I moved the Max32 to SPI2 and INT1, but that required modifying the MAL.

I use a Cisco router, so I really don't know what other routers will do; this could be ugly, but if they are not following the spec, that is not Microchip's problem. Unfortunately, Wireless-B is getting old and router manufactures are probably not testing that as much anymore.


MGLSOFT

Fri, 27 Jan 2012 18:37:43 +0000

At some point there will be an official library Digilent to use the module with Max32 MRF24WB0M shield?


KeithV

Sat, 28 Jan 2012 01:18:15 +0000

What is an MRF24WB0M shield?

What Digilent has is a Pmod Shield which you can then plug in a Pmod WiFi; and YES the DWIFIcK library Digilent (I) am writing will support that configuration on both an Uno32 and Max32. Just select the board type in MPIDE, plug the Pmod WiFi into connector JC on the Pmod Shield, and it should work.

Here are the links to the Pmod Shield and Pmod WiFi:

http://www.digilentinc.com/Products/Detail.cfm?NavPath=2,892,993&Prod=CHIPKIT-PMOD-SHIELD-UNO

http://www.digilentinc.com/Products/Detail.cfm?NavPath=2,401,884&Prod=PMOD-WIFI

I currently have the following configurations working with DWIFIcK:

Uno32 with Pmod Shield and Pmod WiFi Max32 with Pmod Shield and Pmod WiFi MX7cK with Pmod WiFi MX4cK with Pmod WiFi MX3cK with Pmod WiFi


chipkit_andy

Sun, 29 Jan 2012 11:55:15 +0000

Keith,

Further results so far: I i make an ARP table entry on my Windows box for MRF24WB0M communication is ok - but this is no solution at all. So it seems to be this AP 1mbps management broadcasting issue... Then I got my old SMC 802.11g router from cellar for testing - only worked when setting WLAN speed manually to 1mbps on the router - also no solution for me...

My conclusion so far: with a failure-rate of 70% (my experience) these gear is not usable in modern 11g/n environments and IMHO it seems that these MRF24WB0M are technologically outdated - even if microchip followed the 802.11 spec... and moreover they even don't provide any compatibility recommendation.

If there won't be any further hint to implement MRF24WB0M i will have to look for an alternative like "RN-XV module by Roving Networks" or "LS Research TiWi-R2" where tcp/ip stack is on module - does anyone have experiences with those?

Andy


KeithV

Mon, 30 Jan 2012 16:21:46 +0000

Andy,

I just don't have these problems with my Cisco router, but then again; that is the only router I have.

As for compatibility help, you will have to contact Microchip as Digilent is not the manufacture of the MRF24WB0M, we just use thier products.

However, your concerns are noteded and I will be sure test our code against another router brand. If I go down to Staples/Best Buy, what brand of router should I buy that you think the MRF24WB0M will fail against? Clearly not a Cisco LinkSys, that seems to work.


KeithV

Mon, 30 Jan 2012 16:56:39 +0000

Andy,

I am having another thought here. I found that making my scan parameter PASSIVE worked much better as all routers do not repond to an ACTIVE queries. Also, make sure you scan ALL channels. Clearly if you are asking the MRF24WB0M to only look as specific channels, and that is not the channel that the router is broadcasting on, you won't make the connection. And that would seem real erratic from router to router.

I am sorry Andy, but I am just running out of ideas....


chipkit_andy

Mon, 30 Jan 2012 22:09:27 +0000

Keith, I just tried with WF_PASSIVE_SCAN and WF_CASetChannelList(channelList, 0) to have all channels scanned - but no effect: that's very unfortunate because i lke the TCP/IP stack and its environment as far as i worked with it...

I am using the Netgear WNDR3700 wifi router - which (an its succesor models) seems to be wide spread.

Andreas


KeithV

Tue, 31 Jan 2012 03:44:24 +0000

Andy,

Have you looked at the DNETcK library that is now available with the Network Shield download? I will shortly have a WiFi solution that works with that. Any code you write to DNETcK should be very easy to update to DWIFIcK when I get it out.

I see that the Microchip datasheet says that the MRF24WB0M is fully compatible with the Netgear WNDR3300, I see nothing in there about the WNDR3700,but there are some proprietary modes in the Netgear Prosafe that must be managed.

Here are the notes for the Prosafe:

The Netgear Prosafe 802.11g WG103 mode can be either wireless AP or wireless bridge. The AP should be configured for Wireless AP mode. 6 — The AP will send de-authentication (unicast packet) to a station or node (STA) in idle with no traffic. STA should utilize RETRY-FOREVER in infrastructure mode to maintain wireless connection. 7 — When STA is received DHCP IP address from different source and not from the AP own DHCP server, ICMP ping to STA does not work. STA should enable gratuitous ARP, or static ARP must be assigned. 8 — The AP will send data packets randomly at any of the data rates (1,2,5.5,11) advertised by the STA. Select 2 Mbps data rate in AP. Avoid “Best” option for data rate in AP


chipkit_andy

Tue, 31 Jan 2012 09:57:10 +0000

Keith, I tried with USE_GRATUITOUS_ARP: no effect - the minimum data rate on WNDR3700 is 54mbps so I cannot select 2mbps

Andreas


KeithV

Tue, 31 Jan 2012 20:05:59 +0000

but your basic rate must be set to 1&2 Mbps. Can you set that?

This is a problem if you can not set the basic rate to 1,2Mbps the MRF24WB0M will not respond to management commands at higher rates. That is, you must support .11b from the router at 1,2 Mbps for the MRF24WB0M to work. This is acutally specified in the MRF24 spec.

For a try, set the router to support .11b ONLY and see what happens.

I think I am running out of steam to help you!


MGLSOFT

Tue, 31 Jan 2012 20:13:46 +0000

Where I can find specifications and list of commands MRF24WB0M module?


KeithV

Thu, 02 Feb 2012 00:59:24 +0000

Don't know, I don't have it either. You will have to talk to Microchip.

I do a lot of trial and error.


chipkit_andy

Fri, 03 Feb 2012 17:32:03 +0000

Keith, Thanks for all your efforts! The minimum selctable datarate on the WNDR3700 is 54mbps. Gratuitous ARP lead to the efect that some devices like iOS could communicate with the shield - definitely no reliable solution!

Yesterday I finally tried to install the DD-WRT open souce Firmware on my WNDR3700. It is said to have much more configuration options than the original one. ...and strike: TCP/IP stack is working like a charm, even in mixed b/g/n mode - like it should be!!

Greets, Andreas


KeithV

Fri, 03 Feb 2012 23:58:50 +0000

Sweet!

So painful sometimes.

I learned you MUST have a basic rate of 1,2Mbps or the WiFi will not connect. This can come from enabling b or sometimes g, or setting the basic rate, or some units just always listen at that rate. But some units think the world has moved on and don't do beacon data at 1,2Mbps; and that is when things start to break.

Glad you got something to work!