Ethernet

Technical questions regarding the XTC tools and programming with XMOS.
User avatar
rp181
Respected Member
Posts: 395
Joined: Tue May 18, 2010 12:25 am

Ethernet

Post by rp181 »

I have never attempted to work with Ethernet, but I am exploring it as an alternative to USB. Some questions:

1) When the content is delivered to the host (XMOS -> PC), do you basically just send stored webpages (html files), such as from the flash?
2) Will just plugging it into a router allow it to be network accessible? Or is there something special to do?
3) How does input work? Say there is a text field, and the user presses enter or a button, is the data sent just like a normal serial stream? Or do you have to poll it every so often?

What do you guys think is better for something that is mostly a data dump? My hope is to interface with a Java host, multi-platform, but completely browser based would be better.

I don't have the ethernet dev kit yet, but may get soon to experiment (eventually for a custom board).


User avatar
TSC
Experienced Member
Posts: 111
Joined: Sun Mar 06, 2011 11:39 pm

Post by TSC »

I'd say that all the hassle and overhead of HTML formulation and parsing on the XMOS is probably not worth it unless there is a really good reason why you need the PC-side functionality to be completely browser based. Communication using plain UDP/TCP packets without HTML is definitely easier.

XSOCKETS is a really good XMOS network stack that you can have up and running in very little time. No HTML functionality though, since it's not required for most applications.

1) Just sending static HTML pages wouldn't be very interesting. Normally they would contain dynamic content E.g. (pseudocode)
char[] page = "<head><title>XMOS Server</title></head><body><b>Value from sensor: </b>" + int2str(getSensorReading()) + " volts</body>"

2) If there is a functional network stack running on your XMOS device, it should be accessible through routers/switches as long as the various IP addresses, gateways and firewalls are correctly configured, just like a regular PC.

3) I believe any input from that sort of thing would be received by the XMOS device and processed and spit out by the network stack as a char[] containing HTML markup and the input data. E.g. If you serve up a webpage from the XMOS server containing a textbox:
<input size="20" type="text" name="t1"><br>
When the user types into a text box and presses enter, the browser would send something like:
http://10.0.0.24/t1=This%20is%20some%20text
The network stack on the XMOS device would signal that there is an incoming packet and it would be up to your code to decode the array and extract the data.
So it's not serial. Everything is done with packets.