Arduino mega Perl internet shield

Adafruit Ethernet, Motor, Proto, Wave, Datalogger, GPS Shields - etc!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
poledust
 
Posts: 26
Joined: Thu Jan 03, 2013 8:25 pm

Arduino mega Perl internet shield

Post by poledust »

I followed this tutorial http://learn.adafruit.com/arduino-lesso ... r/overview and it works really well with my Arduino plugged via usb. My question is can I use a internet shield/wifi instead of using the serial connection. For example I have the computer that is running Perl up stairs and I have the Arduino down stairs plugged into an internet port or running a wifi shield. Thanks for any help

User avatar
adafruit_support_mike
 
Posts: 67446
Joined: Thu Feb 11, 2010 2:51 pm

Re: Arduino mega Perl internet shield

Post by adafruit_support_mike »

Perl == awesome! ;-)

It's certainly possible to send information from an Arduino to a Perl server over the internet. The nature of the connection would be completely different from the one shown in the tutorial though. The PySerial module reads information coming in through one of the computer's serial ports, and there are Perl modules that will do the same thing. Neither is relevant if you use a TCP/IP connection though.

For network connections, there are three main options:

1) You can use a webserver as a wrapper that executes the Perl code and passes information both ways. That's enormously common, and there are gigabytes of reference information online.

2) If you're using a unix-based OS, you can write a Perl script that reads data from STDIN and writes information to STDOUT, then use inetd. That's the generic network services interface that associates specific programs with specific network ports, handles the mechanics of setting up a connection, then lets the service handler take over once the connection exists.

3) You can write a full-scale daemon that handles its own port binding and connections. That sounds intimidating, but there are examples in the perldocs and The Usual Manuals. A basic server framework only takes about 50 lines of code.

poledust
 
Posts: 26
Joined: Thu Jan 03, 2013 8:25 pm

Re: Arduino mega Perl internet shield

Post by poledust »

Do you think it would be easier if I used a linux os or windows? Also what type of search would I use to find what you suggested? That tutorial is the most I have ever done with Perl! Thanks!!

User avatar
adafruit_support_mike
 
Posts: 67446
Joined: Thu Feb 11, 2010 2:51 pm

Re: Arduino mega Perl internet shield

Post by adafruit_support_mike »

A Linux/unix server will make things easiest. That's where the protocols for the internet were invented and grew up, so it's really easy to tinker with things.

The Official Manuals are _Learning Perl_ and _Programming Perl_, both of which are easy reads and good to keep on hand. There's also an online repository of documentation at http://perldoc.perl.org

Start with the FAQs: http://perldoc.perl.org/index-faq.html Those contain a whole book worth of information about working with Perl in general, and tons of examples for how to do specific things.

Locked
Please be positive and constructive with your questions and comments.

Return to “Arduino Shields from Adafruit”