Web Based project

09 Sep 2010 . Edited: 09 Sep 2010

Hi,  I am new to mBED and am trying to build a simple controller with a web based front end,  enabling user to connecet  to MBed via browser and view data,  turn switches on/off etc.  I have preveiously developed a similar controler using Dallas Tini which is all Java based and am finding the C++ sysntax a struggle although mBED hardware  peripherals e.g Acceleromoter, A2D, I2C is all working okay.  What I need to know is how i get from the client browser page to the HTTP server in MBed,  i have searched this site for Javscript and RPC but cannot follow the examples and am out of my depth ( In java it seemed easy to deploy an applet but not sure how this workls in C++ world) ,  any clues/ or simple examples ?

 

Many thanks,

13 Sep 2010 . Edited: 13 Sep 2010

Hi Stephen

I don't know if you've manged to make any progress since you posted but here's some information you might find useful.

It is possible to serve an applet from mbed using the HTTP server, you just have to host it on mbed and then navigate to the HTML file on mbed which has the applet embedded in it. The applet can then control the mbed from the client browser using RPC over HTTP as the http server includes a handler for rpc commands. To make this easy to implement there's now a java library in the cook book which will do this interfacing for you. Theres a demo applet on this page (at the bottom of the page) which is a simple applet to control the mbed's LEDs from a browser.  The library hasn't been tested much yet so there may be a few issues but it is working.

You can also use Javascript to use RPC, you just need to use http requests, the interfacing using RPC page has more information on the structure of the URL for such requests.

Hope some of this is useful

Michael

14 Sep 2010

Michael

Many thanks,  most helpful.

Regards

Steve

02 Nov 2010

Michael

I have now tried using Coolcomponents Ethrenet and USB board and all i get when running the Ethernet test program ( both yours and DonAtiens ) is

Setting up...

[..\fwk\if\eth\EthernetNetIf.cpp:setup@86] HW Addr is : 00:02:f7:f0:24:65.

[..\fwk\if\eth\EthernetNetIf.cpp:setup@142] Connected, IP : 192.168.0.123

Setup OK

Error 3

have fixed the IP address using

EthernetNetIf eth(

IpAddr(192,168,0,123), //IP Address

IpAddr(255,255,255,0), //Network Mask

IpAddr(192,168,0,1), //Gateway

IpAddr(192,168,0,1)  //DNS

);


as I dont have DHCP.  I really want to move onto java dev but cant get past the basic,  any guidance would be appreciated.

Regards

Steve