Calling on the community for offering a Low-cost wifi option

Oooh… All we need now are some modules :wink:

Sweeeet. Going to support UDP by any chance?

Yes, in the code on codeplex there is an InternetTimeExample based upon UDP.

And I can confirm it is working, at least my try outs, I easily succeeded in sending UDP from CC3000 module using a previous version of the s/w that sends an UDP packet to my laptop. The only thing not I couldn’t get working was a broadcast on 239.255.255.250:1900 it seems though that is/was caused by the cc3000 not being on the last patch version. Still trying …

Is this the Lady Ada code?

The InternetTimeExample is from the code placed on codeplex by ValkyrieMT.

The UDP package code in c# that’s easy but the broadcast is not visible although I get answers back from very questionable IP adresses …

No. For good or bad, I wrote this code from scratch. I didn’t port it because the C++ from TI was too dissimilar from C# and the architecture was not great. The github link for the adafruit source returns a 404 (https://github.com/adafruit/Adafruit_CC3000), but it is likely just a modified version of the source code TI provides which is what the Arduino port is by Chris Magagna.

I can say that unlike the adafruit library, mine supports TCP right now as shown by the web server sample. Also, mine supports DHCP by default to get an IP address.

I look forward to trying it out … as soon as my CC shows up!

Any reason a Cerb couldn’t use it?

I did much of the development with a CerbuinoBee. It should work with any .NET MF device with SPI, which is probably all of them.

@ ValkyrieMT tried patch 11 UDP works ok although I’m not sure about the broadcast though …

Good news, as that’s the Cerb I have.

@ Valkyrie-MT - you are the man! I think this will greatly benefit everyone.

Super, thanks for validating that PiWi. If broadcast doesn’t work we’ll probably have to pester TI about a firmware fix.

Thanks Gus!

Question: Which framework version are you using on the CerbuinoBee ?

I’ve tried the exact same code to send to exact same msg via UDP to 239.255.255.250:1900. When I do this on PC, my monitoring tool detects the message and I can look at the details and msg arrives as defined in the sending part. When I execute the code on a CC3000 the msg does not show up in the monitoring tool but than again using your latest SW and patch 11 it kind of arrives since a lot of answer msgs arrive on the same port when listening to it.

The monitoring tool can be found on Blog - Mikula Beutl - SEO Consulting

Execute following code to replicate. Based upon codeflex and extended with the ToAscii funtion.


using System;
using Microsoft.SPOT;

using Microsoft.SPOT.Hardware;
using System.Text;

using Networking;

namespace WifiExampleUdp
{
    public class WifiExampleUdp
    {
        static UdpSocket s = null;
        static bool waiting = true;

        public static void Main()
        {
            Debug.Print("CC3000 UDP Example");

            // Set the systems time
            Utility.SetLocalTime(new DateTime(2013, 08, 21, 11, 12, 13));

            var wifi = new WifiAdapter("CC3000", InterfaceProfile.CerbuinoBee_Adhoc_CC3000);
            wifi.Connected += wifi_Connected;

            // Manually specify a network
            var ap = new AccessPoint() { Ssid = "Timbukto", Key = "secret", Security = WifiSecurityType.WPA2 };
            wifi.Connect(ap);

            while (waiting) System.Threading.Thread.Sleep(50);
        }

        static void wifi_Connected(WifiAdapter wifiAdapter)
        {
            Debug.Print("Woot!  We are now connected to Wifi!");
            Debug.Print("Network Name: " + wifiAdapter.SsidName);
            Debug.Print("IP address: " + wifiAdapter.IPAddress.ToAddress());
            Debug.Print("MacAddress: " + wifiAdapter.MacAddress.ToHexString());
            Debug.Print("Gateway: " + wifiAdapter.Gateway.ToAddress());
            Debug.Print("DNS Server: " + wifiAdapter.DomainNameServer.ToAddress());

            s = wifiAdapter.OpenUdpSocket();

            // Listen for UDP messages sent to activated ports
            s.OnDataReceived += s_OnDataReceived;

            // Activate the listener to see what's coming in
            s.Listen(1900);

            // Create a UPNP say hello message
            string sayhello = "NOTIFY * HTTP/1.1\r\n" +
                                  "Host: 239.255.255.250:1900\r\n" +
                                  "NT: urn:schemas-upnp-org:device:CC3000Boost:1\r\n" +
                                  "NTS: ssdp:alive\r\n" +
                                  "Location: http://192.168.39.126/cc3000.xml\r\n" +
                                  "Cache-Control: max-age=1800\r\n" +
                                  "Server: Microsoft-Windows-NT/5.1 UPnP/1.0 UPnP-Device-Host/1.0\r\n" +
                                  "USN: uuid:6859ddde-89cd-46df-bab8-08002856e5da::urn:schemas-upnp-org:device:CC3000Boost:1\r\n";

            // Let's see what happens using a UDP Message
            Debug.Print("Sending message to ... ");
            s.Send(Encoding.UTF8.GetBytes(sayhello), 
                    new byte[4] { 239, 255, 255, 250 }, 1900);  // 239.255.255.250:1900 as per UPnP spec

            while (waiting) System.Threading.Thread.Sleep(100);

            s.StopListening();
        }

        static void s_OnDataReceived(UdpSocket sender, byte[] message, byte[] remoteIP, ushort remotePort)
        {
            Debug.Print(DateTime.Today.ToString() + " - receiving message from " + remoteIP.ToAddress() + ":" + remotePort.ToString());
            Debug.Print("\r\n\t" + message.ToAscii());
            Debug.Print("\r\n");
            //waiting = false;
        }
    }
}

Cheers,

P.

@ Valkyrie-MT - have your received the email i sent to you? I used the one in your account.

Yup, got the message.

@ PiWi - I have switched back and forth between 4.3 and 4.2 during development. The version I checked into Codeplex was using the 4.3 Framework, but it should work just by retargeting to 4.2.

@ Valkyrie - 4.3 on the cerbuinobee or another device ?

I’m having considerable instabilities with the UDP stuff that will only work very sometimes. I got it to have it working just 2 times out of more than 10 times. Try a lot like rebooting power cycling but no succes yet … I was wondering if maybe 4.3 where to stable out something …

I just patched my second boost to the 19th patch (=V1.11) but that one does not go with the software.

In HT
Example App:driver version 5.14.7.13
MAC 08:00:28:01:6F:DB
SP: 0.6.1.19
01

Smart config DONE

DONE

But in VS using the same code:


CC3000 UDP Example
Sending - Simple Link Start
Send 4000 starting
Setting Event Mask
Send 0008 starting
Requesting SP Version
Send 0207 starting
Requesting Buffer Size
Send 400B starting
Configuring DHCP
Send 2001 starting
The thread '<No Name>' (0x3) has exited with code 0 (0x0).
Resetting Connection before setting Policy. 
Send 0002 starting
Setting Connection Policy.
Send 0004 starting
Attempting Connection to AK16-US
Send 0001 starting

This looks like the old story when updating the 1st one … no response … using same HW setup with resistors.

@ PiWi - It is 4.3 on CerbuinoBee using the GCC build that others on this forum have built.

@ Gus. Porting the firmware patch code is probably non-trivial but do-able. And currently, I patched my other devices with a TI Stellaris board, but that won’t work for folks buying a gadgeteer board as they won’t be able to hook it to a Stellaris easily. But, apparently, TI is distributing CC3000MOD chips with fully updated firmware. The board I just got from Adafruit appears to have the latest firmware – “SP Version is 0.6.1.19”. The ones I have from Digikey and the ones on the GHI CC3000 modules appear to be older. Notice the Adafruit cc3000 chip has completely different engraving with an FCC ID even. We NEED these to be on the Gadgeteer modules. The older firmware does not even work for TCP. So before ya’ll go off and buy a bunch of these, I wanted you to be aware of this. Attached is a picture for illustration…

What’s also interesting is that the picture on Adafruit’s page shows the old chip… Also, I read on their forum that some folks want to update the firmware but can’t because they don’t support it. So clearly, this was luck of the draw…

Oh, and by the way, to use the Adafruit board, you have to supply a separate power source with 5VDC otherwise, the Interrupt pin does not put out enough voltage for the CerbuinoBee to read it on the InputPin, so I can’t exactly recommend anyone try this…

Update: Found this: http://media.digikey.com/pdf/PCNs/Texas%20Instruments/PCN20130627004_CC3000MOD_R.pdf

This Update is great news. It looks like once the current supply is exhausted, everything will have the working firmware and FCC and CE certification!

1 Like