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:
Tue Apr 16 16:10:41 2013 +0000
Revision:
3:335512e81ba9
Parent:
1:82b8312c78a1
Child:
4:00b4e7596014
update onchip content

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 3:335512e81ba9 6 * local filesystem support.
nyatla 3:335512e81ba9 7 */
nyatla 3:335512e81ba9 8 LocalFileSystem lf("local");
nyatla 3:335512e81ba9 9
nyatla 3:335512e81ba9 10 /**
nyatla 1:82b8312c78a1 11 * MiMic RemoteMCU httpd.<br/>
nyatla 1:82b8312c78a1 12 * <p>Service list</p>
nyatla 1:82b8312c78a1 13 * <pre>
nyatla 1:82b8312c78a1 14 * /rom/ - romfs
nyatla 1:82b8312c78a1 15 * /setup/ - MiMic configulation REST API.
nyatla 1:82b8312c78a1 16 * /local/ - mbed LocalFileSystem
nyatla 1:82b8312c78a1 17 * /mvm/ - MiMicVM REST API
nyatla 1:82b8312c78a1 18 * </pre>
nyatla 1:82b8312c78a1 19 */
nyatla 1:82b8312c78a1 20
nyatla 1:82b8312c78a1 21 class MiMicRemoteMcu:public MiMic::Httpd
nyatla 1:82b8312c78a1 22 {
nyatla 1:82b8312c78a1 23 private:
nyatla 1:82b8312c78a1 24 ModRomFiles modromfs; //ROM file module
nyatla 1:82b8312c78a1 25 ModMiMicSetting mimicsetting; //mimic setting API
nyatla 1:82b8312c78a1 26 ModRemoteMcu remotemcu; // remotemcu API
nyatla 3:335512e81ba9 27 ModLocalFileSystem modlocal; //basic URL parser
nyatla 3:335512e81ba9 28
nyatla 1:82b8312c78a1 29 public:
nyatla 1:82b8312c78a1 30 MiMicRemoteMcu():Httpd(80)
nyatla 1:82b8312c78a1 31 {
nyatla 3:335512e81ba9 32 this->modromfs.setParam("rom",RMCU_FSDATA,19);
nyatla 3:335512e81ba9 33 this->mimicsetting.setParam("setup");
nyatla 3:335512e81ba9 34 this->remotemcu.setParam("mvm");
nyatla 3:335512e81ba9 35 this->modlocal.setParam("local");
nyatla 1:82b8312c78a1 36 }
nyatla 1:82b8312c78a1 37 virtual void onRequest(HttpdConnection& i_connection)
nyatla 1:82b8312c78a1 38 {
nyatla 1:82b8312c78a1 39 //try to ModRomFS module.
nyatla 1:82b8312c78a1 40 if(this->modromfs.execute(i_connection)){
nyatla 1:82b8312c78a1 41 return;
nyatla 1:82b8312c78a1 42 }
nyatla 1:82b8312c78a1 43 //try to ModMiMicSetting module.
nyatla 1:82b8312c78a1 44 if(this->mimicsetting.execute(i_connection)){
nyatla 1:82b8312c78a1 45 return;
nyatla 1:82b8312c78a1 46 }
nyatla 1:82b8312c78a1 47 //try to ModRemoteMcu module.
nyatla 1:82b8312c78a1 48 if(this->remotemcu.execute(i_connection)){
nyatla 1:82b8312c78a1 49 return;
nyatla 1:82b8312c78a1 50 }
nyatla 3:335512e81ba9 51 //try to ModLocalFileSystem
nyatla 3:335512e81ba9 52 if(this->modlocal.execute(i_connection)){
nyatla 3:335512e81ba9 53 return;
nyatla 3:335512e81ba9 54 }
nyatla 3:335512e81ba9 55
nyatla 1:82b8312c78a1 56 //Otherwise, Send the redirect response to /rom/index.html
nyatla 1:82b8312c78a1 57 i_connection.sendHeader(301,
nyatla 1:82b8312c78a1 58 "text/html",
nyatla 1:82b8312c78a1 59 "Status: 301:Moved Permanently\r\n"
nyatla 1:82b8312c78a1 60 "Location: /rom/index.html\r\n");
nyatla 1:82b8312c78a1 61 return;
nyatla 1:82b8312c78a1 62 }
nyatla 1:82b8312c78a1 63 };
nyatla 1:82b8312c78a1 64
nyatla 1:82b8312c78a1 65 int main()
nyatla 1:82b8312c78a1 66 {
nyatla 1:82b8312c78a1 67 NetConfig cfg; //create network configulation
nyatla 1:82b8312c78a1 68 Net net(cfg); //create a net instance.
nyatla 1:82b8312c78a1 69 MiMicRemoteMcu httpd; //create a httpd instance.
nyatla 1:82b8312c78a1 70 httpd.loop(); //start httpd loop.
nyatla 1:82b8312c78a1 71 return 0;
nyatla 1:82b8312c78a1 72 }