WiFi (zeroG)

Could you please take a close picture of your setup? I want to see how you connected the cable.

Photo of my Cobra with WiFi module connected.

Joe,
I’m still clueless on the MFDeploy thing. I’ve been doing the following:

[ol]1) I use Visual Studio to deploy the example WiFi program on the Cobra;

  1. Then I close visual studio, and open MFDeploy;

  2. I Connect MFDeploy to the Cobra;

  3. Then I see the Debug.Print info: “WiFi link is not available yet! Wrong AP settings?..
    Still waiting…” over and over again and nothing regarding the wifi module.[/ol]

Is this how I should be using MFDeploy? If not, please tell me the correct way that I should be using MFDeploy.

Thanks,
Carl

Joe,

After racking my brains for days, I finally figured out my wifi module problem by using the below code and a logic probe. The below code keeps toggling all the IO pins on the UEXT connector. Using the logic probe, it as easy to tell that IO26 was not functioning. I then used the probe to test pin 49 of the EMX module, and it was working fine.

Apparently, there is a fault between EMX pin 49 and UEXT IO26 on the Red Cobra board.

How do I contact customer service?

Thanks,
Carl

using System;
using System.Threading;
using Microsoft.SPOT;
using Microsoft.SPOT.Hardware;
using GHIElectronics.NETMF.FEZ;

namespace FEZ_Cobra_Console_Application1
{
    public class Program
    {
        public static void Main() // Blink board LED & IO Pins
        {
            bool ledState = false;

            OutputPort led_io48 = new OutputPort((Cpu.Pin)FEZ_Pin.Digital.LED, ledState);  // IO48 & LED
            OutputPort io2 = new OutputPort((Cpu.Pin)FEZ_Pin.Digital.IO2, ledState);
            OutputPort io3 = new OutputPort((Cpu.Pin)FEZ_Pin.Digital.IO3, ledState);
            OutputPort io26 = new OutputPort((Cpu.Pin)FEZ_Pin.Digital.IO26, ledState);
            OutputPort io35 = new OutputPort((Cpu.Pin)FEZ_Pin.Digital.IO35, ledState); 
            OutputPort io36 = new OutputPort((Cpu.Pin)FEZ_Pin.Digital.IO36, ledState); 
            OutputPort io38 = new OutputPort((Cpu.Pin)FEZ_Pin.Digital.IO38, ledState);
            OutputPort io75 = new OutputPort((Cpu.Pin)FEZ_Pin.Digital.IO75, ledState);

            while (true)
            {
                Thread.Sleep(500);   // Sleep for 500 milliseconds

                ledState = !ledState; // toggle LED state

                led_io48.Write(ledState);
                io2.Write(ledState);
                io3.Write(ledState);
                io26.Write(ledState);
                io35.Write(ledState);
                io36.Write(ledState);
                io38.Write(ledState);
                io75.Write(ledState);
            }
        }
    }
}

That’s great you found the problem.

You can contact us at ghielec at ghielectronics.com and please mention this thread link in the email.

Yes…more problems from me lol…OK…I can’t get my wireless network to connect either. Ran the little program CarlJ had on here…got LEDs for one loop, no LEDs for the next, and back and forth…i “think” that means the board is ok?

Does the wireless card support WPAPSK-TKIP? Can’t figure out how to set that. What does Wireless80211.AuthenticationType do? The documentation from Microsoft is the worst I have EVER seen and I have been coding their stuff for over 20 years!

Thanks in advance

Make sure that physical connection is correct and the settings are correct. Take a look at example code in GHI library documentation.

This Wifi module support WPA AES+TKIP.
You can either but the passphrase as it is. or you can put the 64-bit WPAPSK key. the Net.Wifi class documentation explains that more.

You can debug the Wifi connection internal process by connecting the debugger with MFDeploy. You will see in the debugging window messages like"searching… authentication…"

Thanks Joe…will try that tonight and let you know the results. Thanks again :slight_smile:

OK, have tried MFDeply…tried every settig it has, tried using the network key instead of the passphrase…no joy…no idea what is happening…obviously it SEES the wifi card…but no matter WHAT i put in there under configuration (in MFDeploy), it will not connect. I basically have the application bypassing any code that would change the configuration settings so only MFDeploy sets them…nothing…tried Shared, Open, every entry in the drop down list for Authentication…no joy…tried the 64-Bit Key…also no joy…Any ideas? About ready to just send the Cobra and card back to see if someone can make heads or tails of this…

What should I selec for TKIP? I assumed this would be shared…but that doesn’t work…

So you see the WiFi debugging messages don’t you?
I suggest that you disable the security on your wireless router (access point0 just to make sure that you can connect the wifi. then enable the securty back with different options WPA WPA2 WEP …etc.

OK, will go thru the disabling Wireless security deal…but so many other things (inlcuding THIS pc) use that router…I am not seeing any messages on MFDeploy other then the Debug messages I send and even those don’t show up unless I stop and start the Cobra, reconnect, etc.

If you could get it to work,Please do the following:

  1. Deploy the example code you find in the library documentation.
  2. Run MFDeploy. Connect (F5)
  3. toolbar->plug-in->Reboot CLR
  4. hit Ping.
  5. you will see all the booting log.
  6. copy paste what U see here.

OK, here is what I got:

ip address from interface info: 192.168.0.25
mac addrress from interface info: 0.1a.f1.0.42.d
EMX
Version: 4.1.3.0
Debug: USB1
LCD: 480x272
IP: 192.168.0.25
MAC: 00.1A.F1.00.42.0D
Managed heap size: 13631488
Custom heap size: 1048576
Created EE.
Started Hardware.
Estimated Network RAM usage: 129667 (bytes)
Initialize WiFi Module…
It should not take more than several seconds… make sure that MFW-WiFi Expansion in connected correctly
Initialize WiFi Module…done
ip address from interface info: 192.168.0.25
mac addrress from interface info: 0.1a.f1.0.42.d
WiFi link is not available yet! Wrong AP settings?
Still waiting. Attempt Number 1
WiFi link is not available yet! Wrong AP settings?
Still waiting. Attempt Number 2
WiFi link is not available yet! Wrong AP settings?
Still waiting. Attempt Number 3
WiFi link is not available yet! Wrong AP settings?
Still waiting. Attempt Number 4
WiFi link is not available yet! Wrong AP settings?
Still waiting. Attempt Number 5
WiFi Could not connect

Weird thing there…I have tried to set it to DHCP, but, since the built in Network port was origially set to …25, it is still picking that up…can’t imagine how that is making a differece right now, but strange none the less.

I don’t see any WiFi debugging messages so I thing the Wifi module was not initialized correctly.
Show me the WiFi.Enable() line in your code and tell what hardware you are using. Are you connecting the cable between the Wifi expansion and your system in the correct orientation?

here is te WiFi.Enable line:
WiFi.Enable(SPI.SPI_module.SPI2, (Cpu.Pin)FEZ_Pin.Digital.IO2, (Cpu.Pin)FEZ_Pin.Interrupt.IO26);

I have a cobra, had to track down this line…is this correct?

Have double checked my connections against the pictures…all seems to be correct. No idea why this is not working…

Just an update…reloaded all firmware for a fresh start…no change…still cannot connect to wifi…have tried every configuration option I can think of…looks like the board may need to go back to be looked at…I’m at a loss at this point.

And yet…another update…Progress…went and reloaded everything from scratch again, also, tried it on a couple of other networks…and got it to connect on an open hotspot as well as a secured hotspot. Interestingly enough, it seems to be random on how long it takes to connect…I have it timing out after 5 attempts, on one attempt it timed out, on another it connected immediately (FIRST TIME THAT HAS HAPPENED…VERY EXCITED :slight_smile: )…next time it had to try a few times and eventually connected. This seems to go back and forth, perhaps that is normal and is what is really going on under the hood of our PC’s even?

But, at least it looks like the board appears to be ok…Still not sure what settings to put in to get it to connect to my home network (WPAPSK-TKIP)…will keep trying later today.

OK good. You made a big progress.

It should not be that complicated after that. here is a copy paste from the library documentation:

Supported WiFi Settings:

  1. Radio: 801.11b
  2. SSID: string
  3. Authentication: None, Open or Shared.
  4. Encryption:

WEP: Use only the first Network Key.
64-Bit:
MaxNetworkKeyLength = 8 bytes (64-Bit in MFDeploy)
NetworkKey: 5 Bytes. (11 Hex digits in MFDeploy)
128-Bit:
MaxNetworkKeyLength = 16 bytes (64-Bit in MFDeploy)
NetworkKey: 13 Bytes. (26 Hex digits in MFDeploy)

WPA or WPA2:
Passphrase: string

WPA-PSK: Fill in pre-calculated 256-bit PSK:
You may use this tool as an example to calculate PSK:
256-bit PSK calculator.[url]http://www.wireshark.org/tools/wpa-psk.html[/url]
MaxNetworkKeyLength = 32 bytes (256-Bit in MFDeploy)
NetworkKey: 32 Bytes. (64 Hex digits in MFDeploy)

Edit the code example according to your settings or do so using MFDeploy.

TKIP is supported with WPA or WPA-PSK, the only difference is that with WPA option you fill in only the passphrase and EMX will calculate the PSK hey (it takes couple sec on start up to calcualte it), but with WPA-PSK option you need to fill in the passphrase and the PSK key

Joe,
thanks, I finally gotit to work here at home using MFDEPLOY, but can’t get it to work in code…how do you set the MaxNetworkKeyLength? I see that it is a Public Field for Wireless80211 (from the documentation)…but I can’t figure out how to set it…THIS part…is embarrasing lol

Joe, you should ask Stephen for a case of beer :wink: