Go Down

Topic: Arduino and WIZ810MJ ethernet module status update (Read 3591 times) previous topic - next topic

follower

We've been talking about this over here but I thought it might be worth mentioning it in the forums as well.

I'm working on porting the driver for the WIZ810MJ ethernet module to a form usable in the Arduino. A couple of other people are working on a PCB breakout board for the module as it uses non-breadboard/protoboard-compatible 2mm pitch headers (instead of the usual 0.1"). I've been using 2mm pitch jumpers salvaged from a floppy drive or you could also try 2mm pitch IDC ribbon connectors/cable.

You can track my Arduino and WIZ810MJ ethernet module progress here but the current state is I've got it working with ported driver routines enough to be a simple echo server that sends data okay but has some problems with receiving it. :-) The data's received okay, it's just a matter of *accessing* it. :-) Example source code and (currently only) binaries of the library files are linked from the page.

The reason why this particular module is of note at the moment is that Circuit Cellar and WIZnet are currently running a design competition and are (presumably, still) handing out a sample module if you request one.

follower

Well, it turned out I fixed the receiving issue a few minutes later, but it's taken me until now to upload an all-in-one archive.

So, I've now updated the page:

http://code.rancidbacon.com/LearningAboutArduinoWIZ810MJ

with library binaries and demo source for echo server. (Version 0.0.3)

It's all rough at present but should be enough to get you started.

I'd be interested in feedback from anyone who tries it.

--Phil.

nkcelectronics


follower

Just a brief update while I think of it:

 * Constructed a IDC ribbon cable.

 * Have working echo server.

 * Have rough demo of webserver.

Check out http://code.rancidbacon.com/LearningAboutArduinoWIZ810MJ for more details.

--Phil.

nkcelectronics

Follower, I think there is a bug in the WizDemo2.pde file:

Code: [Select]
byte config_gateway[] = {192,168,0.1};

I guess everybody is changing config_gateway anyway, and fixing the problem... but some n00bs can get confused with the 0.1 at the end, instead of 0,1

The webserver demo works great!!!

sean@cc

Indeed, Circuit Cellar is still accepting requests for free WIZnet samples of the 810 module but not for much longer. So if you want one, please make your request very soon. I am looking forward to seeing what this special community can build for this design contest. I'm already seeing a number of interesting sample requests referencing Arduino. I know WIZnet isn't asking for a lot. A cool project is always appreciated, but WIZnet is interested in basic applications as well and Circuit Cellar is known for making it worthwhile for contest entrants (whether they win or not). Good luck to all of you.

http://www.circuitcellar.com/wiznet/sample.html

-Sean (Publisher, Circuit Cellar)

follower

Quote
Follower, I think there is a bug in the WizDemo2.pde file:

Code: [Select]
byte config_gateway[] = {192,168,0.1};

I guess everybody is changing config_gateway anyway, and fixing the problem... but some n00bs can get confused with the 0.1 at the end, instead of 0,1

Thanks for pointing out the issue--the current version should now work correctly. Also, for now the strings are back in RAM but that removes the need for a dependency which was causing problems as it wasn't included in the directory.

Quote
The webserver demo works great!!!

Cool, thanks for the feedback, much appreciated.

--Phil.

follower

Time for another update:

I've been working on tidying up the code and pulling everything into nicely encapsulated classes in preparation for a "usable" 0.1 release.

The code I discuss here is all in the SVN repository.

The "demo of the moment" is four simultaneous echo server connections which is pretty cool--and also something that the Xport can't do... :-)

Of course, the code you have to use to setup four listening echo server connections on port 7 is pretty complicated:

Quote
 // This uses the 1-argument constructor of EchoServer and supplies it with 7 for each instance.
 EchoServer servers[MAX_SOCK_NUM] = {7, 7, 7, 7}; // This will break if MAX_SOCK_NUM changes.
 
 while (1) {
   for (int i=0; i<MAX_SOCK_NUM; i++) {
     servers.next();
   }
 }


Oh, wait, no it's not... :)

I've had this working with three nc (netcat) sessions and one interactive telnet session running--no major lag issues.

If you want to do it the hard way you can skip the EchoServer class and do something like this (only one connection):
Quote
 NetworkConnection conn = Network.listen(7);

 Serial.println("Waiting for connection...");

 while (!conn.isConnected()) {
   delay(500);
 }
 
 Serial.println("Connected...");

 while (conn.isConnected()) {
    if (conn.available()) {
      conn.print(conn.read());
    }
 }
 
 Serial.println("");

 conn.close();


The demo with the classes and four connections is about 8.9K in size with no major optimisation effort.

--Phil.

follower

Hmmm, the code indentation seems to have been lost compared to the preview... :-( (And the edit function doesn't like in the code!).

--Phil

follower

#9
Dec 22, 2007, 07:06 pm Last Edit: Dec 22, 2007, 07:07 pm by follower Reason: 1
If you're interested, here's an update on some progress with Arduino and IRC.

--Phil.

trialex

Awesome work on this.

I tried to use your code - I grabbed WizDemo3 and the associated library files, but I can't get it to compile. I get lots of warnings about "Stray '#' in program" and so on.

Not a lot to go on I know, but any ideas on what I can do to get it to compile?

I'm using a USB arduino, currently AtMega8, but also tried AtMega168.

follower

Quote
I grabbed WizDemo3 and the associated library files, but I can't get it to compile. I get lots of warnings about "Stray '#' in program" and so on.

Not a lot to go on I know, but any ideas on what I can do to get it to compile?

Thanks for trying out the code. Could you please post the complete error message you're getting?

Quote
I'm using a USB arduino, currently AtMega8, but also tried AtMega168.

FWIW I've only tried it with the ATMega168 and currently I don't think it'd fit in a ATMega8.

--Phil.

trialex

Quote

FWIW I've only tried it with the ATMega168 and currently I don't think it'd fit in a ATMega8.


Could have something to do with it - also the reigsters and timers have different names between the 8 and 168, don't know if you get down to that level.

OK last time I tried it on version 0010, and maybe I stuffed up where the libraries are supposed to go, as they changed paths in that version. I'll try back in 0008.

I can't say I've ever used SVN before, so let me make sure I'm doing/grabbing the right things.

Starting at

root/branches/follower/wiz810mj

I go to src -> demo -> WizDemo4 -> WizDemo2.pde -> Download in Other Formats -> raw

saved that into a new sketch in the IDE.

then went back to

root/branches/follower/wiz810mj

Went to src -> lib

saved all the files with their extensions into a created directory

arduino-0008\lib\targets\libraries\WIZ810MJ



trialex

Yeah! It compiles on my work computer using IDE 0008.

Will try connecting it all up and writing it to the 168 when I get home.

follower

Quote
Could have something to do with it - also the reigsters and timers have different names between the 8 and 168, don't know if you get down to that level.

Yeah, that might be an issue also.

Quote
OK last time I tried it on version 0010, and maybe I stuffed up where the libraries are supposed to go, as they changed paths in that version.

According to the README (who knows if it's accurate :-) ):

Quote
For Arduino version 0010 the library directory location is:

 <ARDUINO>/hardware/libraries/

For Ardino version 0009 the library directory location was:

 <ARDUINO>/lib/targets/libraries/


Quote
I can't say I've ever used SVN before

Yeah, once the code's more prepared I'll cut a tarball...

Quote
so let me make sure I'm doing/grabbing the right things.

Thanks for persisting. :-) BTW what are you using to connect the WIZ810MJ module to your Arduino?

Quote
I go to src -> demo -> WizDemo4 -> WizDemo2.pde -> Download in Other Formats -> raw

Hmmm, that's really weird, that file WizDemo2.pde shouldn't even be there--it's not on my system, so I don't no why it's not deleted in the repository. Anyway, you'll really want the WizDemo4.pde file.

Glad to see you got it working in your next post--hopefully WizDemo4.pde will work just as well. :-)

Please let me know how it goes--if you're ever on IRC on the #arduino channel I'm often there.

--Phil.

Go Up