Arduino Local Ethernet Connections via Shared WiFi

There are a ton of great ideas out there for intertube-connected Arduino projects, but you may find yourself in this situation:

  • Router has no more unused ports
  • You prefer not to be chained to your router, which may be inconveniently located
  • Your Arduino network shield is not WiFi enabled

I prefer to work on a Mac laptop with a WiFi connection, but wanted to do network experiments with an ethernet Arduino shield. Here’s the solution:

  1. Go to System Preferences | Sharing
  2. Enable Internet Sharing
  3. Share the connection from WiFi to Ethernet

Now you can connect an Ethernet cable from your Mac to your Ethernet shield. Because the Mac takes care of crossovers automatically, this will “just work.”

Next you need to find out what IP address to use in your Arduino sketches. Open  a Terminal and type:

ifconfig en0

A few lines down, you’ll see something like:

inet 192.168.2.1

Change that “.1″ at the end to any number under 255 and you should have an address that’s shared through your WiFi network, through your Mac, and usable in any Arduino ethernet sketches (I’m using 192.168.2.10).  Now you can work without worrying about being tethered to a physical router, or being out of free ports.

 

 

3 thoughts on “Arduino Local Ethernet Connections via Shared WiFi

  1. shacker Post author

    kobe, there is no code related to this blog post. If you are having trouble connecting, you should post your question in an arduino forum.

  2. kobe

    Thanks it works but only local.
    So I have an other question, do you know if its possible to speak to an arduino(with ethernet shield) if you are outside his local network ?

Leave a Reply