For a recent project of mine, I needed to download a simple TXT file from the web to my Arduino. Unfortunately, for some reason, my Arduino would not connect to my iPhone’s hotspot – so I found the next best solution was to tether the network connection from my MacBook Pro.
However for those of you who have an Arduino Yun, you should consider using the built in WiFi or ethernet port before resorting to the tutorial outlined here!
You will need:
Note: If your Mac does not have an Ethernet socket, this tutorial will not work for your *cough* MacBook Air *cough*. Consider getting a USB-to-Ethernet adapter.
This tutorial is primarily aimed at the Arduino Yun, but should work with all other Arduino’s that have an Ethernet port or are compatible with the Ethernet sheild.
Step 1: Connect your Mac to the internet via WiFi. This is likely to be a standard procedure, and one that has already been done if you’re viewing this page over WiFi!
Step 2: Go to System Preferences. The easiest way to do this is to click on the Apple logo in the top left-hand corner, and then select System Preferences.
Step 3: Next select Sharing.
Step 4: From the Share your connection from dropdown menu, select WiFi. Then check the box next to Ethernet.
Step 5: Now ensure the checkbox next to Internet Sharing has also been ticked. A message will appear asking you to confirm your action; click on Start.
Step 6: Connect one end of your Ethernet cable to the Ethernet port on your Mac, and the other end in to your Arduino Yun. After a few seconds run a test code on your Arduino which fetches a file from the internet. Your Arduino should now be connected to the internet via your Mac.