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!
Perhaps using Processing or modifying ladyada's twitter code would work? Please help! Thank you.
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.
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?
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.
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.
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.
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?
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.
For a test you can just follow the instructions and the code there exactly as it is given.
Guess I'll have to try that, thanks for your help.
Can you post your code if you still have it please?