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

Revision:
0:ca442200bc8a
Child:
1:cffa64d79a8b
--- /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