Archos 70 Android tablet with HTML pages for control and data display

P

P E Schoen

I just recently bought an Archos 70 Internet Tablet which has a 7"
multitouch display, Android OS, and WiFi network connection. I was able to
make an HTML web page on my laptop computer, with JavaScript to respond to
button clicks, just as a demo if the interface. The tablet device was able
to connect to the web page on the computer's localhost XAMPP Apache server
via the IP address, as well as a copy on my Dreamhost server:
http://pstech-inc.com/KeypadDemo.htm

What I want to do is make a WiFi enabled device using a Microchip PIC which
has an Http/IP stack and can appear as an internet web page. Of course this
is done through my WiFi router, and is available world-wide. This may have
some usefulness, but really I just want to use the tablet as a smart,
programmable GUI for the instrument. So, I think an ad-hoc network between
the tablet and the device can be set up.

I am not very familiar, yet, with the implementation of the TCP/IP stack for
the PIC controller, but that is where the actual hardware will reside that
needs to be controlled and monitored. The controls are mostly on/off, or
perhaps setting an 8-bit or 12 bit value, and the data may be as simple as
integer or floating point values updated 10 times a second, although in some
cases it may need to stream as 12 bit values at 2500 samples/second. The
resources of the PIC are limited, so it may only be able to handle simple
web pages. And I'm not sure if the hardware may be manipulated directly from
the web page, or if it will require some sort of server side scripting,
which of course implies it has its own server, and can run something like
PHP or even Ajax.

Another way to implement this may be to configure the Archos tablet as a USB
HID (Human Interface Device), instead of the Mass Storage Device as now
configured. It would be acceptable to use a USB cable connection rather than
wireless, and it may prove more reliable in some of the industrial
environments encountered by the instruments as they are used (high voltage,
high current, electrical and audible noise, etc).

I would like to use HTML with JavaScript and perhaps AJAX or JSON for data
and control exchanges, because of the relative ease of programming the GUI,
but another alternative is to create an Android application for the device.
I did some preliminary work in this direction where the development platform
is on my Win7 PC with a Java and JDK environment, through an Eclipse IDE,
and an emulator with an Android virtual device. I was able to get the simple
"Hello" app working but it seems like a daunting task to go in this
direction.

There are also the options of using an iPod or iPad, which uses the Apple
iOS and their browser. And, there are Win7 tablet PCs that could run an
Apache server for the GUI in HTML, and use the USB host to connect to the
instrument, which could then have a simple USB device interface (which I've
already done). But there is still the question of sending commands and
receiving data between the web page and the hardware. Of course, in that
case, the PC could simply run an ordinary Windows GUI (which I'm familiar
with, using Delphi). The Win7 tablets are about $700, compared to $500 for
iPad, and $300 for the Archos. But cost is not a major factor for this
application, since this will be replacing a dedicated proprietary touchpad
that was originally proposed, and its cost was comparable. But the generic
devices have the advantage of being useful for many other applications, and
if the customer already has (or wants) such a device, it is essentially
"free".

This may not be the best place for this discussion, but I had no luck on the
webmaster or networking newsgroups. There are many technologies potentially
involved in this project, and I have expertise only in a few - mostly the
actual hardware and PIC design, and less in HTML, JavaScript, PHP, and
networking, in about that order. I just want to do this right, and it may
have application for a large range of products. And I know that I should
sell my strengths, and purchase my weaknesses, so I plan to enlist the help
of expert consultants as needed. But I need enough understanding to know
whom I should use and to make sure I'm not misled. Thanks for any ideas and
assistance.

Paul

Some links:
http://www.archos.com/products/ta/archos_70it/index.html?country=us&lang=en
http://www.archos.com/products/tw/archos_9/index.html?country=us&lang=en
http://developer.android.com/index.html
http://www.eclipse.org/downloads/packages/eclipse-ide-java-developers/indigor
http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1406&dDocName=en553673
(Android)
http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=2504
(Ethernet)
http://netbooknavigator.com/index.php?option=com_virtuemart&Itemid=165&vmcchk=1&Itemid=9
http://www.apple.com/ipad/
http://www.apple.com/ios/ios5/features.html
 
T

Thomas 'PointedEars' Lahn

P said:
What I want to do is make a WiFi enabled device using a Microchip PIC
which has an Http/IP stack and can appear as an internet web page.

Having re-read this several times, something essential does appear to be
missing from that sentence for it to make sense. Did you mean "use"
(infinitive) instead of "using" (gerund)?
Of course this is done through my WiFi router, and is available world-
wide.

You might want to consider establishing a firewall then.
This may have some usefulness, but really I just want to use the
tablet as a smart, programmable GUI for the instrument.

Now *that* makes sense for once.
So, I think an ad-hoc network between the tablet and the device can be set
up.

No, the PIC board does not feature a WLAN adapter, and you said you want to
use your router.

[…]
The resources of the PIC are limited, so it may only be able to handle
simple web pages.

Having watched the video demonstration for it, ISTM you are overestimating
what the PIC board can do.
And I'm not sure if the hardware may be manipulated directly from the web
page, or if it will require some sort of server side scripting, which of
course implies it has its own server, and can run something like PHP or
even Ajax.

ISTM at the current state of development of client-side Web APIs, a server-
side application will be necessary if a "web page" is to be used for the
primary user interface.
I would like to use HTML with JavaScript and perhaps AJAX or JSON for data
and control exchanges, because of the relative ease of programming the
GUI, but another alternative is to create an Android application for the
device. I did some preliminary work in this direction where the
development platform is on my Win7 PC with a Java and JDK environment,
through an Eclipse IDE, and an emulator with an Android virtual device. I
was able to get the simple "Hello" app working but it seems like a
daunting task to go in this direction.

Developing an Android application with Eclipse and ADT is fairly easy, as
ADT provides helpful tools, is well-documented, and there are good tutorials
at the Google Web site. BTDT.

Also, along with the Starter Kit for Android you got the software library.
There are also the options of using an iPod or iPad, which uses the Apple
iOS and their browser. And, there are Win7 tablet PCs that could run an
Apache server for the GUI in HTML, […]

This may not be the best place for this discussion,

It most certainly is not. This has only very remotely to do with the topic
of this newsgroup.
but I had no luck on the webmaster or networking newsgroups.

Perhaps you have not been patient enough, you have been asking in the wrong
or in too many newsgroups at once, or the wrong question, or, as in the
positing I am replying to, no question at all.

There are many technologies potentially involved in this project, and I
have expertise only in a few - mostly the actual hardware and PIC design,
and less in HTML, JavaScript, PHP, and networking, in about that order.

You cannot build a steady house on quicksand.
I just want to do this right,

There are always alternatives. However, IIUC, as your goal is to make this
work on as many as mobile devices as possible, I suggest you develop a Web
application that serves as middleware between the mobile device and the PIC
board; virtually any mobile device features a Web browser. If and when
necessary, a native application could be built around that; a HTTP client is
part of the Android API and of iOS, of course. How the HTTP requests were
triggered (native, or client-side scripting), how they were created (low-
level TCP, direct, or XHR), and how they were transmitted (Wi-Fi, Bluetooth,
USB, etc.), would be secondary then. It might be necessary that you
installed an Android emulator on your server then, though, and this approach
might still not work with that board. RTFM to be sure beforehand.
and it may have application for a large range of products. And I know that
I should sell my strengths, and purchase my weaknesses, so I plan to
enlist the help of expert consultants as needed. But I need enough
understanding to know whom I should use and to make sure I'm not misled.

You will either have to acquire the knowledge through learning, or trust the
individuals who you are employing that they know what they are doing, and
that they are doing the best work that they can. Contracts can make sure of
the latter.


HTH

PointedEars
 
R

Ry Nohryb

I just recently bought an Archos 70 Internet Tablet which has a 7"
multitouch display, Android OS, and WiFi network connection. I was able to
make an HTML web page on my laptop computer, with JavaScript to respond to
button clicks, just as a demo if the interface. The tablet device was able
to connect to the web page on the computer's localhost XAMPP Apache server
via the IP address, as well as a copy on my Dreamhost server:http://pstech-inc.com/KeypadDemo.htm

What I want to do is make a WiFi enabled device using a Microchip PIC which
has an Http/IP stack and can appear as an internet web page. Of course this
is done through my WiFi router, and is available world-wide. This may have
some usefulness, but really I just want to use the tablet as a smart,
programmable GUI for the instrument. So, I think an ad-hoc network between
the tablet and the device can be set up.

I am not very familiar, yet, with the implementation of the TCP/IP stack for
the PIC controller, but that is where the actual hardware will reside that
needs to be controlled and monitored. The controls are mostly on/off, or
perhaps setting an 8-bit or 12 bit value, and the data may be as simple as
integer or floating point values updated 10 times a second, although in some
cases it may need to stream as 12 bit values at 2500 samples/second. The
resources of the PIC are limited, so it may only be able to handle simple
web pages. And I'm not sure if the hardware may be manipulated directly from
the web page, or if it will require some sort of server side scripting,
which of course implies it has its own server, and can run something like
PHP or even Ajax.

Another way to implement this may be to configure the Archos tablet as a USB
HID (Human Interface Device), instead of the Mass Storage Device as now
configured. It would be acceptable to use a USB cable connection rather than
wireless, and it may prove more reliable in some of the industrial
environments encountered by the instruments as they are used (high voltage,
high current, electrical and audible noise, etc).

I would like to use HTML with JavaScript and perhaps AJAX or JSON for data
and control exchanges, because of the relative ease of programming the GUI,
but another alternative is to create an Android application for the device.
I did some preliminary work in this direction where the development platform
is on my Win7 PC with a Java and JDK environment, through an Eclipse IDE,
and an emulator with an Android virtual device. I was able to get the simple
"Hello" app working but it seems like a daunting task to go in this
direction.

There are also the options of using an iPod or iPad, which uses the Apple
iOS and their browser. And, there are Win7 tablet PCs that could run an
Apache server for the GUI in HTML, and use the USB host to connect to the
instrument, which could then have a simple USB device interface (which I've
already done). But there is still the question of sending commands and
receiving data between the web page and the hardware. Of course, in that
case, the PC could simply run an ordinary Windows GUI (which I'm familiar
with, using Delphi). The Win7 tablets are about $700, compared to $500 for
iPad, and $300 for the Archos. But cost is not a major factor for this
application, since this will be replacing a dedicated proprietary touchpad
that was originally proposed, and its cost was comparable. But the generic
devices have the advantage of being useful for many other applications, and
if the customer already has (or wants) such a device, it is essentially
"free".

This may not be the best place for this discussion, but I had no luck on the
webmaster or networking newsgroups. There are many technologies potentially
involved in this project, and I have expertise only in a few - mostly the
actual hardware and PIC design, and less in HTML, JavaScript, PHP, and
networking, in about that order. I just want to do this right, and it may
have application for a large range of products. And I know that I should
sell my strengths, and purchase my weaknesses, so I plan to enlist the help
of expert consultants as needed. But I need enough understanding to know
whom I should use and to make sure I'm not misled. Thanks for any ideas and
assistance.

Paul

Hi Paul,

I think there's 3 blocks in this project:

1 - A tablet/mobile with a browser
2 - An http server for the controller/GUI page/webApp html+js+css
3 - A PIC or similar

1 and 2 use http to communicate via TCP/IP.
2 and 3 might be the same device, or might not.

There are linux servers the size of an rj45 female/socket you could
use for 2, with a serial port you could use to interface to 3.

Wether or not you want the server and the PIC to be the same device is
IMO the first thing you've got to decide.
 
P

P E Schoen

"Thomas 'PointedEars' Lahn" wrote in message
P E Schoen wrote:
Having re-read this several times, something essential does appear to
be missing from that sentence for it to make sense. Did you mean
"use" (infinitive) instead of "using" (gerund)?

I replaced "using" with "with".
You might want to consider establishing a firewall then.

I received the PICDEM.net2 board last night and finally got it working. I
had to reprogram the PIC and also load the web pages, and there were some
other networking problems (I connected it to my computer through a crossover
cable), but it now appears in my browser as a web page. I can also interact
with the hardware (LEDs, LCD display, and A/D converter).

There is a way to set up password access to certain web pages, but I'm not
sure if that's the same as a firewall. Security issues are what I'll
probably farm out to those who are more knowledgeable about networking and
hacking.
Now *that* makes sense for once.
set up.
No, the PIC board does not feature a WLAN adapter, and you said you want
to use your router.

At this point I have established the feasibility of the concept, but I still
need to see if I can set up a wireless network between the board and the
Android tablet. I have a wireless adapter for the board, but what I got does
not seem to be a simple plug-in solution. I really don't want to use the
router. I thought there might be a simple plug-in to convert the Ethernet
cable jack to WiFi, but what I've seen are essentially small routers. There
are lots of USB to WiFi adapters, but the demo board doesn't have USB and it
would have to be set up as a host which could accept Win7 drivers.

Microchip makes a WiFi "PICtail" for the board but it seems to be a
discontinued item at Newark. What I have is a WiFi module which connects via
SPI to the PIC:
http://ww1.microchip.com/downloads/en/DeviceDoc/70632A.pdf. I think what I
really need is the AC164132-4 PICtail which is available from Mouser:
http://www.mouser.com/ProductDetail...=sGAEpiMZZMsRr7brxAGoXbpDJGLtxbLWLdy1IWmzdTE=
http://ww1.microchip.com/downloads/en/DeviceDoc/51912A.pdf
[…]
The resources of the PIC are limited, so it may only be able to handle
simple web pages.
Having watched the video demonstration for it, ISTM you are overestimating
what the PIC board can do.

It seems to be able to do everything I need, if I can get it to use WiFi
instead of Ethernet, and be capable of an ad-hoc wireless connection to the
Android (or other) tablet device.
of course implies it has its own server, and can run something like PHP
or even Ajax.
ISTM at the current state of development of client-side Web APIs, a
server-side application will be necessary if a "web page" is to be used
for the primary user interface.

There seems to be a special way to use certain variables in the HTML that
map to memory or I/O on the board. It does not seem to be any sort of
full-featured server, but all I really need is to do some measurement and
control as the demo already shows.
Developing an Android application with Eclipse and ADT is fairly easy,
as ADT provides helpful tools, is well-documented, and there are good
tutorials at the Google Web site. BTDT.
Also, along with the Starter Kit for Android you got the software library.

I may look in that direction, but for now universal access via a generic
tablet device seems best.
It most certainly is not. This has only very remotely to do with the
topic of this newsgroup.
Perhaps you have not been patient enough, you have been asking in the
wrong or in too many newsgroups at once, or the wrong question, or, as
in the positing I am replying to, no question at all.

The posts on the other NGs have remained with no replies for more than 10
days, and they seem to be rather inactive although they have had some posts
since then.
You cannot build a steady house on quicksand.
There are always alternatives. However, IIUC, as your goal is to make
this
work on as many as mobile devices as possible, I suggest you develop a Web
application that serves as middleware between the mobile device and the
PIC
board; virtually any mobile device features a Web browser.

That's the plan ATM. I'm doing this now just to gain some experience, and
the actual application for this will be after I complete a much simpler
project which will be done around the end of the year. But I want to add the
"hooks" to be able to use it as a platform for the more complex devices that
will need the remote hand-held GUI.

[..]
You will either have to acquire the knowledge through learning, or trust
the individuals who you are employing that they know what they are
doing, and that they are doing the best work that they can. Contracts
can make sure of the latter.

Yes, it has been quite helpful. I realize that this is not quite in the
scope of this NG, or others where I have been active (such as PHP). Maybe
it's more on topic for the sci.electronics groups, but this is really more
about networking and configuring stock hardware. I also got some information
from the Microchip forum. I may need to contact some networking gurus
locally to make sure that part of the project is solid, especially regarding
security. I can get almost anything to work. But I need to know how to
prevent others with malicious intent from breaking it and making it NOT
work. It's a shame we live in a world where there are so many people
attacking technology either for sport or for illicit financial gain.

Thanks. I'll post later, perhaps, when I've made significant progress,
especially if it involves JavaScript or closely related items. There is some
JavaScript in the index page of the demo. It's freely available from
Microchip but I'll include it at the end of this post just for reference.

Paul

======================================== index.htm
=============================================
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Microchip TCP/IP Stack Demo App</title>
<link href="/mchp.css" rel="stylesheet" type="text/css" />
<script src="/mchp.js" type="text/javascript"></script>
</head>

<body>
<div id="shadow-one"><div id="shadow-two"><div id="shadow-three"><div
id="shadow-four">
<div id="page">

<div style="padding:0 0 5px 5px"><img src="/mchp.gif" alt="Microchip"
/></div>

<div id="title"><div class="right">TCP/IP Stack Demo Application</div><span
id="hello">&nbsp;</span></div>

<div id="menu">
<a href="/index.htm">Overview</a>
<a href="/dynvars.htm">Dynamic Variables</a>
<a href="/forms.htm">Form Processing</a>
<a href="/auth.htm">Authentication</a>
<a href="/cookies.htm">Cookies</a>
<a href="/upload.htm">File Uploads</a>
<a href="/email">Send E-mail</a>
<a href="/dyndns">Dynamic DNS</a>
<a href="/protect/config.htm">Network Configuration</a>
<a href="/snmp/snmpconfig.htm">SNMP Configuration</a>
</div>
<div id="content">

<div id="status">
<div id="loading" style="display:none">Error:<br />Connection to demo
board was lost.</div>
<div id="display">
<span
style="float:right;font-size:9px;font-weight:normal;padding-top:8px;text-indent:0px">(click
to toggle)</span>
<p>LEDs:<br /><span class="leds">
<a id="led7" onclick="newAJAXCommand('leds.cgi?led=7');">&bull;</a>
<a id="led6" onclick="newAJAXCommand('leds.cgi?led=6');">&bull;</a>
<a id="led5" onclick="newAJAXCommand('leds.cgi?led=5');">&bull;</a>
<a id="led4" onclick="newAJAXCommand('leds.cgi?led=4');">&bull;</a>
<a id="led3" onclick="newAJAXCommand('leds.cgi?led=3');">&bull;</a>
<a id="led2" onclick="newAJAXCommand('leds.cgi?led=2');">&bull;</a>
<a id="led1" onclick="newAJAXCommand('leds.cgi?led=1');">&bull;</a>
<a id="led0">&bull;</a>
</span></p>
<p>Buttons:<br />
<span id="btn3">?</span> &nbsp;
<span id="btn2">?</span> &nbsp;
<span id="btn1">?</span> &nbsp;
<span id="btn0">?</span></p>
<p>Potentiometer: <span id="pot0"
style="font-weight:normal">?</span></p>
</div>
</div>

<h1>Welcome!</h1>

<table style="padding-left: 10px;">
<tr><td><b>Stack Version:</b></td><td>&nbsp;</td><td>v5.36</td></tr>
<tr><td><b>Build Date:</b></td><td>&nbsp;</td><td>Jun 10 2011
00:08:00</td></tr>
</table>

<p>This site demonstrates the power, flexibility, and scalability of an 8,
16, or 32-bit embedded
web server. Everything you see is powered by a Microchip PIC
microcontroller
running the Microchip TCP/IP Stack.</p>

<p>On the right you'll see the current status of the demo board. For a
quick
example, click the LEDs to toggle the lights on the board. Press the push
buttons (except MCLR!) or turn the potentiometer and you'll see the status
update immediately. This examples uses AJAX techniques to provide real-time
feedback.</p>

<p>This site is provided as a tutorial for the various features of the HTTP
web server, including:</p>

<ul>
<li><b>Dynamic Variable Substitution</b> - display real-time data</li>
<li><b>Form Processing</b> - handle input from the client</li>
<li><b>Authentication</b> - require a user name and password</li>
<li><b>Cookies</b> - store session state information for richer
applications</li>
<li><b>File Uploads</b> - parse files for configuration settings and
more</li>
</ul>

<p>Several example applications are also provided for updating configuration
parameters, sending e-mails, and controlling the Dynamic DNS client. Thanks
to
built-in GZIP compression support, all these tutorials and examples fit in
the
32kB on-board EEPROM!</p>

<p>There is also an ICMP client example running on
the demo board. Pressing the rightmost button will cause the board to
send an ICMP Echo Request (a ping) to a Microchip web server. If the
ping was received and echoed successfully, the response time will be
displayed on the LCD. An error message will be displayed when attempting
to use this demo if the board isn't able to connect to the Internet.</p>

<p>For more information on the Microchip TCP/IP Stack, please refer to
the TCP/IP Stack API installed with the stack. This manual can be
launched from your Windows Start menu.</p>

</div>

<script type="text/javascript">
<!--
// Parses the xmlResponse from status.xml and updates the status box
function updateStatus(xmlData) {
var mainstat = document.getElementById('display').style.display;
var loadstat = document.getElementById('loading').style.display;

// Check if a timeout occurred
if(!xmlData)
{
mainstat = 'none';
loadstat = 'inline';
return;
}

// Make sure we're displaying the status display
mainstat = 'inline';
loadstat = 'none';

// Loop over all the LEDs
for(i = 0; i < 8; i++)
document.getElementById('led' + i).style.color =
(getXMLValue(xmlData, 'led' + i) == '1') ? '#090' : '#ddd';

// Loop over all the buttons
for(i = 0; i < 4; i++)
document.getElementById('btn' + i).innerHTML = (getXMLValue(xmlData,
'btn' + i) == 'up') ? '&Lambda;' : 'V';

// Update the POT value
document.getElementById('pot0').innerHTML = getXMLValue(xmlData,
'pot0');
}
setTimeout("newAJAXCommand('status.xml', updateStatus, true)",500);
//-->
</script>

<script type="text/javascript">
<!--
document.getElementById('hello').innerHTML = "";
//-->
</script>

<div class="spacer">&nbsp;</div>
<div id="footer">Copyright &copy; 2010 Microchip Technology, Inc.</div>

</div></div></div></div></div>

</body>
</html>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,043
Latest member
CannalabsCBDReview

Latest Threads

Top