Pages: [1] 2   Go Down
Author Topic: SerialIP library - network access without shields  (Read 10087 times)
0 Members and 1 Guest are viewing this topic.
Brisbane, Australia
Offline Offline
Newbie
*
Karma: 0
Posts: 30
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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!
Logged

0
Offline Offline
Sr. Member
****
Karma: 0
Posts: 388
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
« Last Edit: February 28, 2010, 06:11:12 pm by TBAr » Logged

Brisbane, Australia
Offline Offline
Newbie
*
Karma: 0
Posts: 30
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

0
Offline Offline
Sr. Member
****
Karma: 0
Posts: 388
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Dresden / Germany
Offline Offline
Sr. Member
****
Karma: 4
Posts: 451
Entwicklungsklaus
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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
« Last Edit: March 02, 2010, 12:36:17 pm by ChrisS » Logged

Sturmfabrik - mediale Dienstleistungen
www.sturmfabrik.de

Offline Offline
God Member
*****
Karma: 32
Posts: 507
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Followed the instructions as written and it worked fine first time  smiley 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-grin
Logged


+B011111
Offline Offline
Newbie
*
Karma: 0
Posts: 10
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
Logged

Oppuurs, Belgium
Offline Offline
Jr. Member
**
Karma: 0
Posts: 94
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Dresden / Germany
Offline Offline
Sr. Member
****
Karma: 4
Posts: 451
Entwicklungsklaus
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

mmh, i've done that exactly...

stops while calling....
then Error 777.

smiley-sad

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

Thank you
ChrisS


Logged

Sturmfabrik - mediale Dienstleistungen
www.sturmfabrik.de

Brisbane, Australia
Offline Offline
Newbie
*
Karma: 0
Posts: 30
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Dresden / Germany
Offline Offline
Sr. Member
****
Karma: 4
Posts: 451
Entwicklungsklaus
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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 smiley

Thank you.... and bye bye... smiley
ChrisS
« Last Edit: March 08, 2010, 06:31:53 am by ChrisS » Logged

Sturmfabrik - mediale Dienstleistungen
www.sturmfabrik.de

Brisbane, Australia
Offline Offline
Newbie
*
Karma: 0
Posts: 30
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Dresden / Germany
Offline Offline
Sr. Member
****
Karma: 4
Posts: 451
Entwicklungsklaus
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Ahm,

10.000 .... are you sure? smiley

*confused*

Greetings ChrisS

Code:
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:
 // Listen for incoming connections on TCP port 1000.  Each incoming
  // connection will result in the uip_callback() function being called.
  SerialIP.listen(1000);
Logged

Sturmfabrik - mediale Dienstleistungen
www.sturmfabrik.de

Brisbane, Australia
Offline Offline
Newbie
*
Karma: 0
Posts: 30
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Dresden / Germany
Offline Offline
Sr. Member
****
Karma: 4
Posts: 451
Entwicklungsklaus
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Greetings
ChrisS
Logged

Sturmfabrik - mediale Dienstleistungen
www.sturmfabrik.de

Pages: [1] 2   Go Up
Jump to: