Go Down

Topic: Arduino Ethernet! When? (Read 3 times) previous topic - next topic

westfw

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.)

nkcelectronics

#16
Mar 24, 2008, 01:05 am Last Edit: Mar 24, 2008, 01:40 am by nkcelectronics Reason: 1
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.

follower

Quote
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):
Code: [Select]
 // 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.");
     
 }  


Quote
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.

follower

Quote
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 :-) 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.

TJ

Quote


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.

<snip>

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

Embedded Arduino Digicam Remote & Intervalometer
http://www.mindspring.com/~tom2000/Projects/AI-1_Remote/AI-1_Remote.html

ladyada

#20
Mar 31, 2008, 01:54 am Last Edit: Mar 31, 2008, 01:56 am by ladyada Reason: 1
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?

TJ

LadyAda,

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

Thanks for your response.

Tom
Embedded Arduino Digicam Remote & Intervalometer
http://www.mindspring.com/~tom2000/Projects/AI-1_Remote/AI-1_Remote.html

ladyada

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?

Oracle

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.

TJ

Quote
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

Embedded Arduino Digicam Remote & Intervalometer
http://www.mindspring.com/~tom2000/Projects/AI-1_Remote/AI-1_Remote.html

TJ

Quote

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

Embedded Arduino Digicam Remote & Intervalometer
http://www.mindspring.com/~tom2000/Projects/AI-1_Remote/AI-1_Remote.html

ladyada

Quote
Quote
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

Go Up