Go Down

Topic: SerialIP library - network access without shields (Read 11063 times) previous topic - next topic

Malvineous

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!

TBAr

#1
Mar 01, 2010, 12:02 am Last Edit: Mar 01, 2010, 12:11 am by TBAr Reason: 1
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.

Malvineous

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.

TBAr

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.

ChrisS

#4
Mar 02, 2010, 06:28 pm Last Edit: Mar 02, 2010, 06:36 pm by ChrisS Reason: 1
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
Sturmfabrik - mediale Dienstleistungen
www.sturmfabrik.de

stimmer

Followed the instructions as written and it worked fine first time  :) 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  :D
Due VGA library - http://arduino.cc/forum/index.php/topic,150517.0.html

Zandaa

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?


ChrisS

mmh, i've done that exactly...

stops while calling....
then Error 777.

:(

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

Thank you
ChrisS


Sturmfabrik - mediale Dienstleistungen
www.sturmfabrik.de

Malvineous

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

ChrisS

#10
Mar 08, 2010, 12:16 pm Last Edit: Mar 08, 2010, 12:31 pm by ChrisS Reason: 1
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 :)

Thank you.... and bye bye... :)
ChrisS
Sturmfabrik - mediale Dienstleistungen
www.sturmfabrik.de

Malvineous

It's port 10,000 not port 1000 :-)  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.)

ChrisS

Ahm,

10.000 .... are you sure? :)

*confused*

Greetings ChrisS

Code: [Select]
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


Code: [Select]
 // Listen for incoming connections on TCP port 1000.  Each incoming
 // connection will result in the uip_callback() function being called.
 SerialIP.listen(1000);
Sturmfabrik - mediale Dienstleistungen
www.sturmfabrik.de

Malvineous

Gah ok, sorry, was thinking of the wrong project :-$  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.)

ChrisS

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

Greetings
ChrisS
Sturmfabrik - mediale Dienstleistungen
www.sturmfabrik.de

Go Up