Arduino Ethernet! When?

@mrmeval

try this

http://www.google.ca/search?q=arduino+xport

see ladyada's site for ethernet shield using aforementioned module.
http://www.ladyada.net/make/

The Xport looks pretty interesting. Now I need to figure out something cool to do with the darned thing.

I've downloaded the Xport User's Guide, and am reading the configuration instructions.

If one of you Internet guru's can sanity check the following connection idea, I'd appreciate it.

First of all, I have an always-on DSL connection, with dynamic IP periodically changed by my ISP. I have a wireless router and a Buffalo Linkstation NAS drive, with a built-in FTP server.

I use a free dyndns.org account to provide my FTP server a URL in the format ftp..dyndns.org. I've configured my router to send an email to dyndns.org each time my IP address changes. That always keeps ftp..dyndns.org pointing to my FTP server.

In my router, I've mapped port 21 to the hard IP address I've assigned the Linkstation.

To my utter amazement, it all seems to work.

So, would the same thing work to put the Xport on the air as a web server?

I'm thinking, assign the Xport a hard IP address. In the router, map port 80 to the Xport's IP. Would a connection to www..dyndns.org forward a connection to my IP address of the moment on port 80?

If so, it looks like I have a solid way of connecting the Xport to the net.

If that all works, the question becomes "what to do with it?" I'm open to ideas.

I gather I can load web pages. Can I export a Processing app to a web page, then load that page into the sever to get something intelligent running? And would such an app be able to talk to the Xport's serial port (and thus, to the Arduino?) Or is there an easier way of providing some automation?

A lot of this is probably RTFM stuff. Some of these questions might be answered in the User's Guide, but it didn't look like I'd find all the info there.

I'd appreciate any help and discussion you're willing to provide.

Thanks!

Tom

Tom, Tom Igoe's book Making Things Talk contains some pretty interesting ideas on how to apply XPORT and other devices to real life situations, using Arduino.

I have made an Arduino Ethernet shield based on Mircochip's ENC28J60 and an open-source TCP/IP library available for downloading.

There is the link for the post that I've just put on the forum --
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1206024602

The Xport looks pretty interesting. Now I need to figure out something cool to do with the darned thing.
I'm thinking, assign the Xport a hard IP address. In the router, map port 80 to the Xport's IP. Would a connection to www..dyndns.org forward a connection to my IP address of the moment on port 80?

If so, it looks like I have a solid way of connecting the Xport to the net.

If that all works, the question becomes "what to do with it?" I'm open to ideas.

That should all work fine.

The XPort does act as a webserver, but it is limited. There is no ability to run scripts on the XPort, only serving static web pages - except, you can write a java applet to store with your html which gets loaded and runs on the browser. This java applet can open a telnet type connection back to the XPort (you'd need another port open on your router) which will send the data through its serial port to your processor, your processor would then return the appropriate data to the XPort which sends it via the telnet connection to the java applet in the browser.

Phew.

The webserver memory on the XPort is split into 6 x 64k chunks. It means that a web page can be no more than 64k and (I'm not 100% on this) you only get 6 pages. (It might be more accurate to say 6 applications, I'm not sure).

Another thing - the datasheet overview mentions SMTP. As far as I can tell, you can only configure the device to send preset emails to a preset address based on the state of the GPIO pins.

Also, the XPort doesn't support DNS. If you want to use it to access information on a server on the internet (say page scrape traffic info for your city) you have to specify the IP address of the server. These are not fixed, which could cause problems in the future. A work around for this is to use PING and parse the IP address from that.

I think the XPort is a great little device, but it does have some limitations which are not apparent when first reading the datasheets.

Regards,

Mike

I suppose I should plug my Netduino Ethernet Expansion Shield and code library in this thread also. :slight_smile:

More details start in this thread.

--Phil.

I'd be very interested in seeing how much smaller the code is for a wiznet based solution (which does up through TCP/IP at least in hardware, but may be complex to talk to) vs a solution that does all the work on the AVR (but can be customized to only do the pieces needed.)

A very simple http server implemented on Arduino using the TCP/IP stack on the wiznet takes only a few lines of code. There is an example and I think uses some 250 lines of code corresponding to 3.5K sketch size and uses SPI to communicate with wiznet. Wiznet is about to announce a chip with 50Mbps transmission speed, the current chip supports up to 25Mbps... I think you need to use the direct addressing mode to get these speeds, instead of SPI. It is worth mentioning that the TCP/IP stack on the wiznet is much robust than the open source version.

a wiznet based solution (which does up through TCP/IP at least in hardware, but may be complex to talk to)

The vendor supplied a sample driver that provides a Unix-like socket interface which I have ported to create an Arduino library libw5100.

This code produces a simple serial <-> network proxy using the high level Serial-like interface of the NetworkConnection object (from simple_serial_proxy.pde):

  // Configure the network device
  SpiConfiguration SPI = SpiConfiguration();
  SPI.begin();
  W5100Device W5100 = W5100Device(PIN_RESET);
  NetworkInterface Network = NetworkInterface(W5100);

  // You need to customise these to your own environment
  Network.device.setIp(210,55,77,111);
  Network.device.setMask(255,255,255,128);
  Network.device.setGateway(210,55,77,1);

  Serial.begin(9600); // Read the output in the Arduino serial monitor
  
  while (1) {
    NetworkConnection conn = Network.listen(7);
    
    Serial.println("Waiting for client...");
    
    while (!conn.isConnected()) {
      delay(500);
    }

    Serial.println("Connected...");

    while (conn.isConnected()) {
       if (conn.available()) {
         Serial.print(conn.read(), BYTE);
       }

       if (Serial.available()) {
          conn.print(Serial.read());
       }
    }

  conn.close();
  Serial.println("Connection closed.");
      
  }

vs a solution that does all the work on the AVR (but can be customized to only do the pieces needed.)

Incidentally, the W5100 does provide raw network socket access as well so you could theoretically port the usual AVR network libraries to it also.

--Phil.

Wiznet is about to announce a chip with 50Mbps transmission speed, the current chip supports up to 25Mbps... I think you need to use the direct addressing mode to get these speeds, instead of SPI.

I found some somewhat vague W5100/WIZ810MJ throughput figures but suffice to say I don't think you'll be getting 50Mbps :slight_smile: or even 25Mbps via SPI--in fact I don't think SPI's even an option on the new W5300.

I would be interested to see what sort of numbers people get with libw5100 and a WIZ810MJ.

--Phil.

That should all work fine.

The XPort does act as a webserver, but it is limited. There is no ability to run scripts on the XPort, only serving static web pages - except, you can write a java applet to store with your html which gets loaded and runs on the browser. This java applet can open a telnet type connection back to the XPort (you'd need another port open on your router) which will send the data through its serial port to your processor, your processor would then return the appropriate data to the XPort which sends it via the telnet connection to the java applet in the browser.

Phew.

Regards,

Mike

Mike,

Many thanks for your reply.

Yes, I was aware of all you posted. That stuff was fairly well covered in the published documentation. What wasn't covered, and what I was unable to locate, was the specifics of using the web server to do something over the serial interface.

I decided that if the Xport folks don't care enough to document their chip, I don't care enough to waste any of my time or money on that flaky outfit's products. Life is too short.

I appreciate your time and effort.

Once again, many thanks.

Tom

i think you need to be more specific what you mean by "the webserver to do something over the serial interface"
the xport (not xport direct) can run its own webserver and 'talk' to the arduino thru the serial connection via java
ie http://ltxfaq.custhelp.com/cgi-bin/ltxfaq.cfg/php/enduser/std_adp.php?p_faqid=943
which is in the XPort product technical library

or you can 'fake' a website by simply parsing the GET command over serial and spitting out whatever data
ie http://ladyada.net/forums/viewtopic.php?t=5458

do you mean something else?

LadyAda,

I originally asked the question in my Reply #10 in this thread.

Thanks for your response.

Tom

if you mean
"I gather I can load web pages. Can I export a Processing app to a web page, then load that page into the sever to get something intelligent running?"

this is not an xport question, this is a java/processing question. in theory, any java app will run. however processing is (from what i have heard) rather bulky and may not fit into the xport space provided, without some effort.

and
"And would such an app be able to talk to the Xport's serial port (and thus, to the Arduino?) Or is there an easier way of providing some automation?"

this is answered here:
http://ltxfaq.custhelp.com/cgi-bin/ltxfaq.cfg/php/enduser/std_adp.php?p_faqid=943
which has step-by-step examples on how to use java to talk to the serial port

what im confused by is
"I decided that if the Xport folks don't care enough to document their chip, I don't care enough to waste any of my time or money on that flaky outfit's products. Life is too short."

are you saying you are looking for a step-by-step on how to install processing on an xport to communicate with an arduino? what documentation, specifically, are you missing?

The "magic" functionality I think we want here is a web page that can display status info the arduino reads from the real world, as well as controlling devices. As simple as the temperature sensor we've seen, to monitoring which doors are open or closed to a web interface to control every light in the house.

The "magic" functionality I think we want here is a web page that can display status info the arduino reads from the real world, as well as controlling devices. As simple as the temperature sensor we've seen, to monitoring which doors are open or closed to a web interface to control every light in the house.

Yes, exactly.

For stuff like that, it looks like the SimpleLAN might be a better choice. Its web page storage is minimal -- only 31k -- but in this thread, a user demonstrates that the SimpleLAN can interpret standard Javascript , making interactive web page construction simple and straightforward. You can do a lot with 31k of Javascript.

It has a well-defined API, too. No hocus pocus.

I believe that's the direction I'll pursue.

Many thanks, everybody.

Tom

what im confused by is
"I decided that if the Xport folks don't care enough to document their chip, I don't care enough to waste any of my time or money on that flaky outfit's products. Life is too short."

are you saying you are looking for a step-by-step on how to install processing on an xport to communicate with an arduino? what documentation, specifically, are you missing?

No, I was looking for a web API reference for the Xport that would let you design interactive web pages that would interact with an Arduino connected to the Xport's serial port.

Thanks,

Tom

The "magic" functionality I think we want here is a web page that can display status info the arduino reads from the real world, as well as controlling devices. As simple as the temperature sensor we've seen, to monitoring which doors are open or closed to a web interface to control every light in the house.

Yes, exactly.

For stuff like that, it looks like the SimpleLAN might be a better choice. Its web page storage is minimal -- only 31k -- but in this thread, a user demonstrates that the SimpleLAN can interpret standard Javascript , making interactive web page construction simple and straightforward. You can do a lot with 31k of Javascript.

OK well at least now its clear what you want. FYI, the SimpleLAN doesnt interpret Javascript (like Java applets, they are run on the web client), it does a find-and-replace type thing