Introduction: Setting Up/Reflashing Your Edison for Beginners - OS X Edition
I was lucky enough to attend an Intel IoT Roadshow event and even luckier to be among those who received a complementary Edison to toy around with! I wanted to make a simple guide for those of us who are connecting our Edisons to OSX machines.
I'm working with an older model macbook (2008) running Lion (10.7.5), but this guide should hold up for newer flavors of OSX.
This guide should also help those who have issues getting their Edison to communicate with their mac. If all else fails, follow this guide to start with a clean slate!
Step 1: Setting Up the Hardware
I won't spend too much time here as connecting your Edison to the breakout board has been well documented on the Intel site.
- Line up the Edison with the square in the lower-left hand corner.
- Press the Edison into place. You'll hear a rewarding "snap".
- Screw in the hex-nuts.
- Screw on the legs to prevent accidental short-circuits.
Step 2: Connect the Wires
- Here I'm using TWO micro-usb cables to connect my Edison.
- The middle port is what powers the board, provides ethernet, and storage.
- The bottom port is used to communicate with the Edison via USB-to-serial.
- Switch-down (device mode): Allows you to mount your Edison and program it.
- Switch-up (host mode): Allows you to use the normal-sized usb-port for peripherals.
- No LED? Check the switch, try different USB cables.
Step 3: Check to See If Edison Is Mounted
Check to see if your mac detected the Edison and mounts it. You'll see it as a storage device in the Finder window or on the desktop.
Not seeing it?
Step 4: Format to Fat32
Before we can move on, Intel suggests that your Edison should be FAT32 partitioned.
- Right-click the Edison device found under "Devices" in a Finder window.
- Click on "Get Info"
- Under "General:", if your Edison is formatted MS-DOS (FAT16), continue on with these steps.
- If the Edison is already partitioned as FAT32, skip to Step 5.
- Open up "Disk Utility".
- You can find this via a search with Spotlight (Command (⌘)+Space bar on most macs).
- In the left pane, click on "...Linux File-CD Gadget"
- Select the "Partition" tab with the following changes:
- Partition Layout: 1 Partition
- Name: anything_you'd_like (Edison perhaps?)
- Format: MS-DOS (FAT)
- Size: default_size_here (805.30 MB)
- Hit "Apply" and you can check to see your Edison now has a FAT32 partition.
Step 5: Communicate With Edison Over Serial
Here is the part where I got stuck in trying to communicate with my Edison. On my newly formatted mac, I did not have the correct drivers to allow serial communication to the Edison across USB. Without the drivers, my Edison would not show up in my terminal so I could not connect and send commands to it! Here's how to check if your mac can communicate with your Edison:
Check for device via terminal:
- In a new terminal shell (open it via Spotlight: Command (⌘)+Space bar > "terminal"), type the following command and press enter:
- What this command does is list the devices connected to your mac that start with "tty.", including your Edison.
- If you don't see a device listed as "/dev/...usbserial-xxxxxxxx",which is your Edison, then check your USB cables or it could be that you too don't have the necessary drivers!
Install FTDI drivers:
There is a FTDI chip on your board that allows your mac to communicate with it via serial across USB. You won't be able to do this without the drivers so let's go grab them!
- Mosey on over to the FTDI drivers page and download the VCP Driver for your mac (Mac OS X, 2.2.18).
- You'll see two installations in the package, choose the one corresponding to your OS X (most likely the one as shown in the picture here).
- Now retry the above command and you should your Edison!
Step 6: Download and Copy Contents of Latest Image
- Download the latest firmware (Yocto complete image) on the Edison Support & Downloads page.
- Extract the contents (not folder!) of the .zip file and copy them over into your Edison storage.
Step 7: Log in to Your Edison
Make a connection with Edison:
- In a terminal window, type in: "screen /dev/cu.usbserial", then press TAB to autocomplete with your Edison's serial id, then type "115200 -L".
- "screen" is the utility that we'll use to communicate with the Edison
- 115200 is the baud rate, which is the speed of communication
- -L allows us to see the results of our commands when talking to Edison
screen /dev/cu.usbserial-A90xxxxx 115200 -L
Log in to Edison:
- If you see a blank page, press "Enter" until you can type "root" at the Edison login prompt.
- By default there is no password.
Step 8: Flash Your Edison
Enter in the command, and watch the magic happen! Your Edison will take a few minutes to be flashed the new image. You'll be asked to log back in once it's finished. I encountered an error about my Edison being ejected but I believe it's safe to ignore it.
Step 9: (Optional) Remove Image Files
Optionally, you can do a little bit of cleanup by removing the image files from your Edison:
In a terminal window type in the following commands to delete the image files:
Navigate to the Edison storage device:
Remove all visible files and folders:
rm –rf *
Remove all hidden files and folders:
rm –rf \.*
Step 10: Done! Where to Now?
Configure your edison!
Setup your Edison's name, password, wifi and wifi password using the built-in wizard:
Choose your favorite language + IDE
The obligatory LED blink test
A great first step in learning how to program with your Edison!
Step 11: Troubleshooting
Here are some common obstacles I ran into when setting up my Edison for the first time:
My Edison doesn't show up when I list the devices in my terminal!
- Install the FTDI drivers
- Check the usb cables, switch them around, etc.
- Sometimes a USB cable is only providing power so find one that will provide data too.
Edison mount not showing up in Finder?
- Make sure Edison has power to the board
- Flip the switch DOWN
- Check USB cables
When I try to send commands or connect to Edison, I get "Cannot open line '/dev/tty.usbserial-xxxxxxxxx' for R/W: Resource busy"? or similar errors!
- The Edison might be in use so you can't open up a new connection to it.
- Try killing the process and try to log back in:
- In a terminal, type:
- Take note of the PID number that corresponds to your Edison.
- Then "kill" the process: