Pages: [1]   Go Down
Author Topic: Xport -> Displaying Analog Values on a Webpage?  (Read 1025 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 22
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Using the Xport (or I suppose you could use the matchport as well), I'd like to display the analog readings of a temperature sensor on a webpage (generated from the arduino).  It wouldn't have to be real time, perhaps update the temperature every 30 seconds or a minute.

I already have the xport/matchport communication code working (thanks to ladyada) and I just need help modifying it to perform the operation listed above.  Thanks in advance!
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 22
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Perhaps using Processing or modifying ladyada's twitter code would work? Please help!  Thank you.

http://www.ladyada.net/make/eshield/twittersend.pde
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 14
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

It all kind of depends on what kind of setup you want.  Are you going to need continuous datalogging?  Will the web server be the device, your computer, or will the webpage be hosted elsewhere?  Which device are you thinking of using?  If I remember correctly, some of the Xport devices can serve web pages and some cannot.

If you don't need continuous data logging, then I think the easiest way is to have a java applet on your webpage make a socket connection to your device.

  

Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 22
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Currently, the webpage code is hosted on the atmel 168 itself as seen in ladyada's examples.  At first datalogging won't be necessary, but it would be neat to have that as a future capability.  How much more complex would that be?

Also, for non-datalogging (just displaying the temp every 30 seconds), do you have some sample code for the "java applet" and socket connection?  Could this be accomplished using processing or something?

Thank you!
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 14
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hmmm.... I must be missing something.  Are you planning on using an xport, an xport direct, or an xport direct+?  If using the xport, why have a page hosted by the arduino?  Why not have it hosted by the xport?  You've got 384kb of storage for webpages on the xport and that would free up the arduino to do more.

Since it isn't an absolutely necessary requirement, I'd leave it alone for now until you get the rest working.  

I posted a link to the lantronix site in your other thread that gives you sample java code for an applet that will allow you to connect to the xport and send/recieve data.  


edited


« Last Edit: March 25, 2009, 02:50:32 pm by ScooterTDI » Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 22
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm actually using the matchport but the code for the xport works just fine in the matchport (so far).  I tried hosting the page on the xport before using cob files but that didn't work out at all, so I just hosted the page on the arduino since that's what ladyada did and that's what worked.

If pages aren't hosted on the arduino (and thus hosted on the xport) will that java code still work?

Thank you again.
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 14
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

What kind of problems did you have serving pages from the matchport?  Did you successfully tftp it to the matchport? Did you put it in WEB1?  Was the page less than 64kb?

In most cases, I'd expect I think it makes a lot more sense to use the matchport to handle the webpage stuff and have the arduino just send and recieve data through a socket.  This sounds exactly like what you want to do.  You want a page that displays temperature and periodically updates.

The matchport can host pages that incorporate java.  I think it should work no differently.  The javascript is being run on your browser, not on the arduino.

Scott
 


Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 22
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

No, i didn't try tftp because I was trying first to use the page currently hosted on the arduino.  Is there any way to get temp display on the page without using the webserver hosted file?
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 14
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Seriously, read the entire lantronix link I posted.  Everything will make a lot more sense after you read that.  

Its really easy to just tftp a .cob file onto the matchport.

If you can access you web page on the arduino, then I'm sure there is a way to display the temp.  If you can't get a javascript to periodically update, you could just have the arduino do a string manipulation to the html lines to display temp but it would only update when you refreshed the page.
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 22
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I've read that page before when I did this with the Xport.  I thought there would be a better way than to mess with javascript (I don't know js).
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 14
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Well its not really javascript.  Its a java applet.  They are different.  I'm not familiar with javascript either.  99% of the code given there you wouldn't need to change at all.  

For a test you can just follow the instructions and the code there exactly as it is given.

Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 22
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Guess I'll have to try that, thanks for your help.

Can you post your code if you still have it please?  
Logged

Pages: [1]   Go Up
Jump to: