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

Files at this revision

API Documentation at this revision

Comitter:
SolderSplashLabs
Date:
Wed Nov 13 21:33:37 2013 +0000
Parent:
2:8f5776c287c5
Child:
4:ce953c80c5b3
Commit message:
Fixed websocket read, now two dipcortex's can talk to each other via a websocket.; Moved tmpbuffer to RAM1

Changed in this revision

USBDevice.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
tcpTests.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/USBDevice.lib	Tue Nov 12 09:19:13 2013 +0000
+++ b/USBDevice.lib	Wed Nov 13 21:33:37 2013 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/users/SolderSplashLabs/code/USBDevice/#01e56c952fe0
+http://mbed.org/users/SolderSplashLabs/code/USBDevice/#722133315bbb
--- a/main.cpp	Tue Nov 12 09:19:13 2013 +0000
+++ b/main.cpp	Wed Nov 13 21:33:37 2013 +0000
@@ -592,6 +592,10 @@
     
     // SysTick set to lower priority than Wi-Fi SPI bus interrupt
     NVIC_SetPriority(SysTick_IRQn, 0x2); 
+    
+    
+    // Enable RAM1
+    LPC_SYSCON->SYSAHBCLKCTRL |= (0x1 << 26);
 }
 
 // ------------------------------------------------------------------------------------------------------------
--- a/mbed.bld	Tue Nov 12 09:19:13 2013 +0000
+++ b/mbed.bld	Wed Nov 13 21:33:37 2013 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/users/mbed_official/code/mbed/builds/a9913a65894f
\ No newline at end of file
+http://mbed.org/users/mbed_official/code/mbed/builds/f37f3b9c9f0b
\ No newline at end of file
--- 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");
+    }
 }
 
 // ------------------------------------------------------------------------------------------------------------