This is RPC_HTTP Example for using WIZnetInterface

Dependencies:   HTTPServer WIZnetInterface mbed-rpc DHT mbed-src

I want to make example which can use mbed RPC library and Python interface so I made this project. This project is led controller and temperature/humidity checker with android application. In brief, This project has function as below.

  • Controlling tri-color led in the mbed platform ( On/Off )
  • Checking current led status ( It can check led color using TTS(Text to Speech) on Android)
  • Checking temperature and humidity information using Android

This example used mbed RPC library to control WIzwiki-W7500 board with Android and Android application is made using kivy library of Python.

https://farm1.staticflickr.com/470/20036515102_d298ed0b5f_o.png

Simple Application in Android

I explain how to make android application using kivy library of Python. This android application can control mbed device and get information from mbed device. For implementation and operation this application, you have to have step as below.

https://farm1.staticflickr.com/297/19891752250_3853ef53aa_z.jpg

Demo Video

For more detailed information, refer to this URL.

http://www.life4iot.com/2015/07/28/remote-temperaturehumidity-checker-led-controller-using-mbed-rpc/?lang=en

Files at this revision

API Documentation at this revision

Comitter:
kaizen
Date:
Wed Jul 22 09:41:02 2015 +0000
Child:
1:cffa64d79a8b
Commit message:
First release

Changed in this revision

HTTPServer.lib Show annotated file Show diff for this revision Revisions of this file
WIZnetInterface.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-rpc.lib 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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/HTTPServer.lib	Wed Jul 22 09:41:02 2015 +0000
@@ -0,0 +1,1 @@
+https://developer.mbed.org/users/sarahmarshy/code/HTTPServer/#c690fb2de477
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/WIZnetInterface.lib	Wed Jul 22 09:41:02 2015 +0000
@@ -0,0 +1,1 @@
+http://developer.mbed.org/teams/WIZnet/code/WIZnetInterface/#bda61525ac71
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Wed Jul 22 09:41:02 2015 +0000
@@ -0,0 +1,45 @@
+#include "mbed.h"
+#include "EthernetInterface.h"
+#include "HTTPServer.h"
+#include "mbed_rpc.h"
+
+RpcDigitalOut led1(LED1,"led1");
+
+EthernetInterface eth;  
+HTTPServer svr;
+
+int main() {
+  //Turn the LEDs off
+  uint8_t mac_addr[6] = {0x00, 0x08, 0xDC, 0x00, 0x00, 0x00}; 
+  led1.write(1);
+  
+  RPC::add_rpc_class<RpcDigitalOut>();
+
+  printf("Setting up...\n");
+  eth.init(mac_addr);
+  int ethErr = eth.connect();
+  if(ethErr < 0)
+  {
+    printf("Error %d in setup.\n", ethErr);
+    return -1;
+  }
+  
+  svr.addHandler<HTTPRpcRequestHandler>("/rpc");
+  
+  //attach server to port 80
+  svr.start(80, &eth);
+  
+  printf("Listening...\n");
+    
+  Timer tm;
+  tm.start();
+  //Listen indefinitely
+  while(true)
+  {
+    svr.poll();
+    if(tm.read()>.5)
+    {
+      tm.start();
+    }
+  }
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-rpc.lib	Wed Jul 22 09:41:02 2015 +0000
@@ -0,0 +1,1 @@
+http://developer.mbed.org/users/kaizen/code/mbed-rpc/#daa4e94588d4
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Wed Jul 22 09:41:02 2015 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/bad568076d81
\ No newline at end of file