SerialIP library - network access without shields

Hi everyone,

Thanks to some help from people on this forum I have fixed the last couple of issues and am now able to release the first version of the SerialIP library.

It's an Arduino-specific wrapper around the uIP library, which implements a TCP/IP stack in software. It works by establishing a SLIP connection over the serial port to your PC. (Remember SLIP? It was used in the early days of dial up Internet.)

Once you have the SLIP connection established you can communicate with the Arduino like any other network device. It will respond to pings and the library currently includes two examples - one that runs a simple server and one that sends an e-mail.

There are instructions and a download link on the wiki.

I've developed it under Linux, but unfortunately I don't have enough experience with Windows or Mac to know how to establish a SLIP connection under these operating systems. If anyone knows this please update the wiki page so that others can make use of the library.

I hope someone finds this useful!

Thanks for this library. It's always good to have another avenue to connect to an Arduino.

I got ping to connect fine under Ubuntu 9.10 by following the instructions on the Playground page. I needed to run all of the commands there (modprobe, slattach, ifconfig) with sudo, so you may want to consider changing them in the directions to sudo modprobe slip, etc. Either that, or include a note to establish su before the series, and revert afterwards. Nowadays, people who do this kind of thing on Linux should know that, but you may want to think about that change to your directions.

You may also want to include a & at the end of the slattach command to put it directly into background execution, or include a note to press [Ctrl-Z] after it starts running. I never used that command before, and I was initially confused when it started and appeared to hang. Putting it in the background with [Ctrl-Z] and continuing with the rest of the directions did the trick for me.

Compliments on a clean set of directions for a clean and painless implementation.

Thanks for the feedback! Glad to hear you got it working.

In the instructions I did put the prompt as "#" instead of "$" which traditionally means root, but perhaps that's too subtle. Anyone who knows that will also know that you don't have to use sudo so I will change the instructions to include sudo.

I didn't want to include a "&" to make slattach run in the background (there is a note on the page that says it won't return) because while slattach is running the serial port is locked, which means you won't be able to upload any new sketches. Rather than explain how to resume tasks and/or kill them, I figured running it in a different terminal and pressing Ctrl+C was easiest.

Well, I did totally miss noticing the # as the prompt in the directions, so that's my fault.

Also, thanks for the explanation of the side effect of running the slattach command in the background. You probably saved me lots of head scratching when it came time to upload a sketch.

The updated Playground page looks great.

Dear Community,

does anyone got it work with WindowsXP?

Tried much, but with no result...

Please post StepByStep Guide for XP....

That would be very nice....

Thank you!!!!

Greetings
ChrisS

Followed the instructions as written and it worked fine first time :slight_smile: It does seem to generate a bit of garbage when the connection is closed, is it supposed to do that?

By using rfcomm and an RN-41 module I even managed to get it working over bluetooth :smiley:

This sounds really nice, though I was wondering if there really isn't any sort of way to use this with Windows 7.. Can't exactly install XP on this machine seeing as the hardware is too new, so.. Anyone with the know-how to rig this up on newer windows systems?

For those looking for some info on how to set this up under windows.

Windows XP: http://www.sics.se/~bg/telos/slipintro.pdf

Windows 7: http://social.answers.microsoft.com/Forums/en-US/w7network/thread/24d3913a-46f1-4673-a358-1e80366675df

Greetings,
EriSan500

mmh, i've done that exactly...

stops while calling....
then Error 777.

:frowning:

Ok, i try it tomorrow on another PC... maybe it works there...

Thank you
ChrisS

I found a trial version of a program that is supposed to provide SLIP support on Vista, maybe you could give that a go and see if it works? http://www.ngsoft.com/category/SLIP

Wow, Ping works.... no Paketloss... but i can't get a connection via telnet... on Port 1000.

While configured on Port1000 connecting to Port80 is possible... getting cryptic chars on screen.

I have also reduced speed to check if it is a speed problem...
the same...

No connection to 1000 via telnet, Port 80 throws some cryptic chars...

If i call IP with a browser... there is a white screen.... on Port 80, on 1000 nothing happens.

1st Step is made... idea to get further steps done?

Thank you for that hint with Slip-Connection-Manager...

Greetings ChrisS

ADDITION:
Ok, i disconnected Arduino from PC...
Ping is possible too... delivered by ConnectionManager...
i will give up in this... buying an Ethernetshield :slight_smile:

Thank you.... and bye bye... :slight_smile:
ChrisS

It's port 10,000 not port 1000 :slight_smile: Make sure you are pinging the correct IP address (the one belonging to the Arduino, not the one your connection manager is using.)

You will need to assign a static IP to the connection manager network interface, make sure this is not the IP of the Arduino! (But it must be in the same subnet, see the docs for an example.)

Ahm,

10.000 .... are you sure? :slight_smile:

confused

Greetings ChrisS

SLIP connection set up under Linux:
 *
 *  # modprobe slip
 *  # slattach -L -s 115200 -p slip /dev/ttyUSB0     (see note below)
 *  # ifconfig sl0 192.168.5.1 dstaddr 192.168.5.2
 *
 *  # ping 192.168.5.2
 *  # telnet 192.168.5.2 1000
  // Listen for incoming connections on TCP port 1000.  Each incoming
  // connection will result in the uip_callback() function being called.
  SerialIP.listen(1000);

Gah ok, sorry, was thinking of the wrong project :blush: Port 1000 is correct.

It still sounds like the connection manager IPs weren't being assigned correctly though, you should see the RX/TX LEDs blink when you ping the Arduino, if the IPs and gateway are set correctly on your PC (the RX LED will blink even if you don't have the firmware installed, because the PC will send the ping message regardless. You just won't get a response/TX blink until you flash something using SerialIP.)

Ok, i will give it a last try now...

Greetings
ChrisS

Anyone have a clue on how to do this with OS X on a mac via the usb-serial driver?

Apparently the slattach command is available under OS X so I guess the Linux instructions should mostly work for Macs too, apart from the module loading part of course.

I don't get how you are supposed to connect to the arduino. I have the manager connected but what do you do to connect?

Have a look on the library's wiki page and read the comments at the top of the source code for the example you're compiling. If that still doesn't answer your questions let me know why and I'll update it.

well in the example the setup is for linux but i'm using xp.