WiFi DipCortex USB CDC

Dependencies:   HTTPClient NTPClient USBDevice WebSocketClient cc3000_hostdriver_mbedsocket mbed

Fork of WiFiDip-UsbKitchenSink by Carl - SolderSplash Labs

http://www.soldersplash.co.uk/products/wifi-dipcortex/

Demo shows you how to implement the CC3000 library with the WiFi DipCortex.

The demo shows :

  • USB CDC ( Serial ) Menu system allow control of the module and starting each example
  • Smart Connect
  • Manual connect
  • Connection status
  • Ping
  • TCP Client
  • TCP Server
  • Web Socket read/write to sockets.mbed.org
  • HTTP Client test Post, Put, Delete
  • Posting ADC data to Xively every 1 second
  • UDP Client
  • UDP Server
  • NTP Example, contacts time server to get the current time

You will need a Driver for the USB CDC port which can be found here : http://www.soldersplash.co.uk/docs/DipCortex-USB-CDC.zip

Please refer to : http://mbed.org/users/SolderSplashLabs/notebook/dipcortex---getting-started-with-mbed/ as well as the SolderSplash Forum for support http://forum.soldersplash.co.uk/viewforum.php?f=15

Revision:
3:15828ac052f1
Parent:
2:8f5776c287c5
Child:
4:ce953c80c5b3
--- a/tcpTests.cpp	Tue Nov 12 09:19:13 2013 +0000
+++ b/tcpTests.cpp	Wed Nov 13 21:33:37 2013 +0000
@@ -9,21 +9,22 @@
 
 using namespace mbed_cc3000;
 
-
 extern cc3000 wifi;
 extern USBSerial pc;
 
 HTTPClient http;
 
+// NOTE : Change SolderSplashLabs to anything else for your own channel
 // Goto the viewier page here : http://sockets.mbed.org/SolderSplashLabs/viewer to see the websocket writes
-const char WEB_SOCKET_URL[] = {"ws://sockets.mbed.org/ws/SolderSplashLabs/wo"};
+const char WEB_SOCKET_URL[] = {"ws://sockets.mbed.org/ws/SolderSplashLabs/rw"};
 const char* ECHO_SERVER_ADDRESS = "192.168.0.10";
 const int ECHO_SERVER_PORT_TCP = 80;
 char hello[] = "Hello World\r\n";
-char tmpBuffer[512];
 
+// Put the tmpbuffer into RAM1
+char tmpBuffer[512] __attribute__((section("AHBSRAM0")));
 
-//char XivelyUrl[] = "http://api.xively.com/v2/feeds/1197891669";
+// Add your own feed Id and API key here..
 char XivelyHostname[] = "api.xively.com";
 char XivelyPath[] = "/v2/feeds/YOUR-FEED-ID-HERE";
 char XivelyApiKey[] = "YOUR-API-KEY-HERE";
@@ -252,6 +253,10 @@
         ws.close();
         pc.printf("Websocket Closed \r\n");
     }
+    else
+    {
+        pc.printf("Websocket connection failed\r\n");
+    }
 }
 
 // ------------------------------------------------------------------------------------------------------------
@@ -325,6 +330,10 @@
         ws.close();
         pc.printf("Websocket Closed \r\n");
     }
+    else
+    {
+        pc.printf("Websocket connection failed\r\n");
+    }
 }
 
 // ------------------------------------------------------------------------------------------------------------