[En-Nut-Discussion] Web Charts? Use java?

Tim Tait tim.tait1 at gmail.com
Tue Feb 21 19:12:50 CET 2006


José -

Thanks for the offer, I would be interested in trying it out. For my 
current application I am displaying data from the past 24 hours, so 
real-time updates are not needed. But in other applications it could be 
very useful, kind of like an oscilloscope. Just be able to send data 
from sockets to a java applet is very handy.

Tim

José Vallet wrote:

> Tim Tait wrote:
>
>>
>> José -
>>
>> I am also a java newbie.
>>
>> Real time data update via socket sounds cool, but that applet looks 
>> pretty big. How small did you get it?
>
>
> Do you mean the one shown at jchart2D web page?
>
> I changed that one a bit and now it includes 2 charts (linear and 
> histogram like), 5 slider controls (with entry type and range 
> checking), 1 button... but it will grow.
>
> I managed to put it all in a 73Kb .jar (before optimization it was 
> 137Kb) I use the entire flash for the web server, so in my opinion it 
> can still grow a lot more.
>
>>
>> What I did was very simple - you have to refresh the page to get new 
>> data, but it should do what I need.
>
>
> I cannot do that because I need "real time" measurements and data 
> presentation. Refreshing the page seems slow, and adds unnecessary 
> overhead to the process (all the httpd stuff). On the other hand the 
> applet is downloaded only once in the whole process, and the data 
> presentation is really fast (is done by the computer). The only extra 
> thing to do at the Ethernut side is the socket communication and data 
> sending.
>
> I was trying to post an example in the list (binaries), so you could 
> easily test it by yourself, but it was too big for posting it (172Kb 
> the .hex plus 117Kb the xflash.bin) (Sorry Harald for that, simply 
> didn't notice!)
>
> The xflash.bin includes all the web files of the httpd example plus 
> the .html that has the applet inside (1 line of code). So the gui 
> itself is basically 73kb (you have 512Kb in the flash)
>
> If you are interested let me know and I will send you personally the 
> binaries and instructions about how to run the example, so you can 
> judge by yourself.
>
> Regards
> José
>
>
>>
>> Tim
>>
>> José Vallet wrote:
>>
>>> Hello Tim
>>>
>>> That is exactly what I am doing.
>>>
>>> What I have at the moment:
>>>
>>> ETHERNUT SIDE: http server + web page with an applet inside
>>>
>>> DESKTOP SIDE: web browser with Java.
>>>
>>> I am reading ADC data from Ethernut and sending it to the applet 
>>> through a socket on real time. I use the library jchart2d for the 
>>> charts http://jchart2d.sourceforge.net/
>>>
>>> I chose it because its simplicity compared to others and because it 
>>> was exactly what I wanted.
>>>
>>> The resulting applet is packed in a .jar file with all the needed 
>>> classes, and after that optimized and obfuscated for optimal code 
>>> size using proguard (this step shrinks the applet size in about 
>>> 30%!). That has proved to be the best for me, although it took me a 
>>> while to make it work (I am a Java beginner).
>>>
>>> As the size of the applet is growing, I use the serial memory for 
>>> storing it (xflash from Michael Fischer), and it works nicely for 
>>> me. That gives me up to 512 Kbytes for the GUI, which is a lot!!
>>>
>>> Hope it helps. If you have any further question, don't hesitate 
>>> asking! I am not an expert but that is what I am doing.
>>>
>>> If you want an example I could send you some code, although a bit 
>>> messy (but working).
>>>
>>> Regards
>>> José
>>>
>>> Tim Tait wrote:
>>>
>>>>
>>>> Has anbody done anything with serving dynamic data charts from 
>>>> ethernut? I want to to display simple line graph of sensor readings 
>>>> over time. I am thinking that a java applet is the way to go. Most 
>>>> of the applets out there seem to big, one "tChart" seems reasonable 
>>>> at 17kb, put you have to pay to get source. Is there another way?
>>>>
>>>> Thanks-
>>>>
>>>> Tim
>>>>
>>



More information about the En-Nut-Discussion mailing list