MiMic RemoteMCU for mbed. This program provides MCU control API over REST API. It can control MCU from Javascript,PHP or any HTTP rest client directly. And, The application has self development environment.

Dependencies:   libMiMic mbed-rtos mbed NySDFileSystem

English

This is MiMic project product.

Recently modern browser is very useful. If we write small HTML code, we can draw graphics, play music. And more, we can use a lot of libraries. For example, physics engine and WebGL and .

However, the browser is clumsy for things of outside computer. For example, it can not control switching of LED and read sensor value easily.

If you can control the device outside of the computer like writing a Web page HTML, it is very convenient.

MiMicRemoteMCU enables to control directly mbed(LPC1768/LPC4088/LPCXpresso1769) by browser application .

Feature 

This is the features of MiMicRemoteMCU to experience for the user.

MiMicRemoteMCU has builtin web content in on-chip memory and some WebAPI. Browser can access contents through internal web server. The web server can handle 4 connections in parallel. Average transport speed is 1.6Mbps.

/media/uploads/nyatla/function_block.png

Browser(User interface) centralized system

From the perspective of the web browser, MiMicRemoteMCU is a standard web server. There is a Web browser is the center of the system.

By designing the browser center system, you can easily implement cooperation with multi-media system or external Web services. And, You can take advantage of all online resources that you can access from the browser. It was difficult in the standalone microcomputer legacy applications design.

/media/uploads/nyatla/fig3.png

Getting started

See more information here(Japanese).

This is old documentation(English).

日本語

新しいAPIを搭載したmbedJSをリリースしました。mbedJSのご利用をご検討ください。

Import programmbedJS

This is a Json-RPC/2.0 server with websocket and httpd. You can control mbed(s) by Javascript, processing, Java. LPCXpresso1769/LPC1768/FRDM-K64F/LPC4088

このアプリケーションはMiMic project を使った製品です。

最近のブラウザって便利ですよね。HTMLをちょこっと書けば、絵を描いたり音楽を再生したり、OpenGLやら物理演算やらなんでも出来てしまいます。

でもコンピュータの外の事、例えばその辺にあるLEDを点滅させたいとかちょっとセンサの値を読み出したいとか。そういったものには途端に不器用になります。

Webページを書くような感覚でコンピュータの外にあるデバイスを操作できれば便利だと思いませんか?

MiMicRemoteMCUをインストールしたmbed(LPCXpresso1769)を使えば、コンピュータの外にあるデバイスを、ブラウザから直接扱うことができます。

/media/uploads/nyatla/mimicrmcu1.4.png

機能

MiMicRemoteMCUの機能を紹介します。対外的な機能はMiMicRemoteMCUのROMContentsに収録されており、内蔵Webサーバを通じてWebブラウザから提供します。このWebサーバは最大4接続までのコネクションを、平均1.6Mbpsで提供することができます。

/media/uploads/nyatla/function_block.png

MiMicのアプリケーション開発

MiMicRemoteMCUはブラウザ中心のフィジカルコンピューティングを実装することに適しています。ブラウザ中心のシステムを設計することで、従来のマイコン単体アプリケーションでは難しかった外部Webサービスやマルチメディアシステムとの連携を容易に実装できます。さらにブラウザからアクセスできる全ての場所にあるオンラインリソースを活用することが出来ます。

/media/uploads/nyatla/fig3.png

導入方法

こちらの記事をご覧ください。

Committer:
nyatla
Date:
Thu Apr 04 10:15:38 2013 +0000
Revision:
1:82b8312c78a1
Child:
3:335512e81ba9
update

Who changed what in which revision?

UserRevisionLine numberNew contents of line
nyatla 1:82b8312c78a1 1 #include "mimic.h"
nyatla 1:82b8312c78a1 2 #include "fsdata.h"
nyatla 1:82b8312c78a1 3
nyatla 1:82b8312c78a1 4
nyatla 1:82b8312c78a1 5 /**
nyatla 1:82b8312c78a1 6 * MiMic RemoteMCU httpd.<br/>
nyatla 1:82b8312c78a1 7 * <p>Service list</p>
nyatla 1:82b8312c78a1 8 * <pre>
nyatla 1:82b8312c78a1 9 * /rom/ - romfs
nyatla 1:82b8312c78a1 10 * /setup/ - MiMic configulation REST API.
nyatla 1:82b8312c78a1 11 * /local/ - mbed LocalFileSystem
nyatla 1:82b8312c78a1 12 * /mvm/ - MiMicVM REST API
nyatla 1:82b8312c78a1 13 * </pre>
nyatla 1:82b8312c78a1 14 */
nyatla 1:82b8312c78a1 15
nyatla 1:82b8312c78a1 16 class MiMicRemoteMcu:public MiMic::Httpd
nyatla 1:82b8312c78a1 17 {
nyatla 1:82b8312c78a1 18 private:
nyatla 1:82b8312c78a1 19 ModRomFiles modromfs; //ROM file module
nyatla 1:82b8312c78a1 20 ModMiMicSetting mimicsetting; //mimic setting API
nyatla 1:82b8312c78a1 21 ModRemoteMcu remotemcu; // remotemcu API
nyatla 1:82b8312c78a1 22 public:
nyatla 1:82b8312c78a1 23 MiMicRemoteMcu():Httpd(80)
nyatla 1:82b8312c78a1 24 {
nyatla 1:82b8312c78a1 25 this->modromfs.setParam("/rom/",RMCU_FSDATA,4);
nyatla 1:82b8312c78a1 26 this->mimicsetting.setParam("/setup/");
nyatla 1:82b8312c78a1 27 this->remotemcu.setParam("/mvm/");
nyatla 1:82b8312c78a1 28 }
nyatla 1:82b8312c78a1 29 virtual void onRequest(HttpdConnection& i_connection)
nyatla 1:82b8312c78a1 30 {
nyatla 1:82b8312c78a1 31 //try to ModRomFS module.
nyatla 1:82b8312c78a1 32 if(this->modromfs.execute(i_connection)){
nyatla 1:82b8312c78a1 33 return;
nyatla 1:82b8312c78a1 34 }
nyatla 1:82b8312c78a1 35 //try to ModMiMicSetting module.
nyatla 1:82b8312c78a1 36 if(this->mimicsetting.execute(i_connection)){
nyatla 1:82b8312c78a1 37 return;
nyatla 1:82b8312c78a1 38 }
nyatla 1:82b8312c78a1 39 //try to ModRemoteMcu module.
nyatla 1:82b8312c78a1 40 if(this->remotemcu.execute(i_connection)){
nyatla 1:82b8312c78a1 41 return;
nyatla 1:82b8312c78a1 42 }
nyatla 1:82b8312c78a1 43 //Otherwise, Send the redirect response to /rom/index.html
nyatla 1:82b8312c78a1 44 i_connection.sendHeader(301,
nyatla 1:82b8312c78a1 45 "text/html",
nyatla 1:82b8312c78a1 46 "Status: 301:Moved Permanently\r\n"
nyatla 1:82b8312c78a1 47 "Location: /rom/index.html\r\n");
nyatla 1:82b8312c78a1 48 return;
nyatla 1:82b8312c78a1 49 }
nyatla 1:82b8312c78a1 50 };
nyatla 1:82b8312c78a1 51
nyatla 1:82b8312c78a1 52 int main()
nyatla 1:82b8312c78a1 53 {
nyatla 1:82b8312c78a1 54 NetConfig cfg; //create network configulation
nyatla 1:82b8312c78a1 55 Net net(cfg); //create a net instance.
nyatla 1:82b8312c78a1 56 MiMicRemoteMcu httpd; //create a httpd instance.
nyatla 1:82b8312c78a1 57 httpd.loop(); //start httpd loop.
nyatla 1:82b8312c78a1 58 return 0;
nyatla 1:82b8312c78a1 59 }