websocket over 3g using VodafoneUSBModem and app-board on-board sensors (acc - tmp)
Dependencies: LM75B MMA7660 VodafoneUSBModem WebSocketClient mbed-rtos mbed
Diff: main.cpp
- Revision:
- 1:89d8a05a8f4d
- Parent:
- 0:c589d2050144
diff -r c589d2050144 -r 89d8a05a8f4d main.cpp --- a/main.cpp Fri Feb 08 12:34:40 2013 +0000 +++ b/main.cpp Fri Feb 08 13:11:17 2013 +0000 @@ -17,7 +17,9 @@ char json_str[100]; VodafoneUSBModem modem; - Websocket ws("ws://sockets.mbed.org:443/ws/sensors/wo"); + + // See the output on http://sockets.mbed.org/app-board/viewer + Websocket ws("ws://sockets.mbed.org:443/ws/app-board/wo"); int ret = modem.connect("pp.vodafone.co.uk"); @@ -30,7 +32,7 @@ printf("Connect result: %s\n", c?"OK":"Failed"); while(1) { - sprintf(json_str, "{\"id\":\"3g_app_board_EW2013\",\"ax\":%d,\"ay\":%d,\"az\":%d, \"tmp\":%d}", (int)(acc.x()*360), (int)(acc.y()*360), (int)(acc.z()*360), (int)tmp.read()); + sprintf(json_str, "{\"id\":\"app_board_3g_EW2013\",\"ax\":%d,\"ay\":%d,\"az\":%d, \"tmp\":%d}", (int)(acc.x()*360), (int)(acc.y()*360), (int)(acc.z()*360), (int)tmp.read()); // send str ret = ws.send(json_str);