Websocket Test Program for W5500 or WIZ550io ( WIZnet, http://wizwiki.net ) LPC11U68 Xpresso v2 + WIZ550io Ethernet Board.

Dependencies:   W5500Interface WebSocketClient mbed

Fork of Websocket_Ethernet_W5500 by Bongjun Hur

Websocket example using Ethernet component of WIZ550io (W5500)

How to put W5500 on your mbed board?

It's tested on LPC11U68 Board.

Files at this revision

API Documentation at this revision

Comitter:
Bongjun
Date:
Tue Jul 08 08:37:08 2014 +0000
Parent:
1:22e5197655a9
Child:
3:4c02f6287752
Commit message:
Added DS18B20 Temperature Sensor.; send current Temperature information to Webserver

Changed in this revision

DS18B20Sensor.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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/DS18B20Sensor.lib	Tue Jul 08 08:37:08 2014 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/Bongjun/code/DS18B20Sensor/#0bcc4e42fec0
--- a/main.cpp	Tue Jul 08 06:03:03 2014 +0000
+++ b/main.cpp	Tue Jul 08 08:37:08 2014 +0000
@@ -1,8 +1,10 @@
 #include "mbed.h"
 #include "EthernetInterfaceW5500.h"
 #include "Websocket.h"
+#include "DS18B20Sensor.h"
 
 DigitalOut myled(LED1);
+DS18B20Sensor sensor(P1_25);
 
 int main()
 {
@@ -56,10 +58,20 @@
     ws.connect();
 
     char str[100];
+    char sensorBuf[25];
+    uint8_t result;
+    uint8_t sensor_cnt;
+    sensor_cnt = sensor.count();
 
     for(int i=0; i<0x10; ++i) {
         // string with a message
-        sprintf(str, "%d WebSocket for WIZnet W5500 Hello World over Ethernet", i);
+        result = sensor.startReading(true);     // start sensor readings and wait
+        if (result == DS18X20_OK) {
+            sensor.getReading(sensorBuf, 0);         // get result into buf
+            sprintf(str, "%d WebSocket for WIZnet W5500 Hello World over Ethernet : Current Temperature is %s", i, sensorBuf);
+        } else {
+            sprintf(str, "%d WebSocket for WIZnet W5500 Hello World over Ethernet", i);
+        }
         ws.send(str);
 
         // clear the buffer and wait a sec...