How to save a Java Program to mbed?

28 Mar 2011

Hello All! I have been waiting for a long time to become part of the mbed community! Very Happy!

I saw the "Prototyping The Internet of Things Project" http://www.youtube.com/watch?v=CQm2B6BqU1I I am sure a lot of you must be quite familiar with it.

The thing is I am trying to do the same using JAVA with Netbeans or Eclipse. I am not looking for the code, I can do that, But how do I save and run my Java program on mbed and run it from PC ?

The program will read RFID tags and mbed will get that data from RFID reader and transmit it using the Ethernet cord to either Tweet or send an SMS, this would be an automatic way to keep track of student attendance or pets at home or something like that. But its a prototype for now. So how do I save and run my Java program on mbed, from PC?

Thank you all in advance.

28 Mar 2011

You cannot. The mbed is programmed in C++ (or C, or assembler, if you really need to). But it won't run Java programs. (you might want to port a small JVM like KVM).

28 Mar 2011

You can use java on mbed not directly but indirectly as Java applet file, my project was demonstrate that clearly. The indirectly means that you have to access to mbed from ethernet port and load the webpage with java applet which is just stored on mbed fat disk as a regular file and then the pc will run the java applet which was written in java and will run your code on the pc.

28 Mar 2011

Thank you so Much! Is it your: My connected mbed World Project? Thats where you made the java applet right?

I will go through it and try to see how its done! Once again much thanks for your help. Best Regards.

28 Mar 2011

Yes you are right. The idea is to create on the java applet TCP socket biridectional communication and also similar create TCP socket communication on the mbed, then you can talk from web interface send and request any data from and to mbed.

28 Mar 2011

Wow, I have never done something like that. Its a little beyond my scope of Java knowledge. Does your video have steps for that. I will go through it as soon as I save some time and can work on it without any other distractions. :)

Thank you once again Anastasios Kanakis, then I will try to attach the RFID reader and get Tag info.

29 Mar 2011

Hi

You could also save the java applet on the mbed flash disk, read from flash it into the mbed and serve it as part of a web page when a http request is made to the mbed.

29 Mar 2011

Hi

I can confirm that it is possible. For the mbed challenge I did exactly that! An http server that served a tiny html page and the java applet. The applet then set up a TCP socket connection to a TCP server on the same mbed (hence no cross domain problems). The only problem was application dependent, any client can get the applet but not all of them are allowed to control things on the mbed. The clients who are not in control may need to be notified about what is happenening though.

Ad

29 Mar 2011

In my video I am not present in details the TCP/IP socket development, because if I will present the software development I will need few hours to explain in details everything as for mbed the same for the java applets. But very shortly I can say that: I use HTTP Web Server of Donatien which I improve from bugs and also setup better the TCP/IP library of lwIP. The HTTP Web Server serves the web pages, images and applets to client from ethernet communication. When applet will be load it ask for a password. Then if password is correct the java applet start to communicate with mbed on specific port and exchange the data.

18 Apr 2011

Sounds good. I was trying to work on that. I bought a RJ45 netjack but I didnt get the proper breakout board so I coudlnt connect it properly. Now i have ordered some male headers and when they come I will do that. But I completely understand that. I am hoping it can read and display RFID strings as a way to check attendance remotely.

Thanks Kanakis and Weiden.

20 Nov 2012

I wrote this code in matlab when i execute it in matlab captures active screen and saves it as a "jpg" file. It uses some functions of java. How to make it compatible with mbed compiler?

robo = java.awt.Robot;
t = java.awt.Toolkit.getDefaultToolkit();
rectangle = java.awt.Rectangle(t.getScreenSize());
image = robo.createScreenCapture(rectangle);
filehandle = java.io.File('screencapture.jpg');
javax.imageio.ImageIO.write(image,'jpg',filehandle);
y=filehandle;
y=imageview('screencapture.jpg');