Edison Setup Notes


Table of Contents

Booting from an SD Card

Setting up the SD card

Setting up Edison

Mount point for HOME

Disable Auto Mount SD card

Partitioning/Formatting an SD Card with Intel Edison

Partitioning

Formatting

Configure Edison & WiFi Access

Access Edison via SSH over WiFi

Static IP Address

IP Route Gateway

Opkg Setup

Utilities

Git

Bash Shell

Vim

Mpg123

Mplayer

Dependencies

Avahi Daemon

Pulse Audio

Yasm

Core utils

Alsa dev

Mplayer

Espeak

USB Audio

Dependencies

ALSA Utils

~/.asoundrc

Espeak with Alsa

Intel Edison as an MP3 Player

Bluetooth Audio (A2DP) on Intel Edison

Python

Pip

This document is a collation of posts, information on the Intel Community for its Maker board like Intel Galileo and Intel Edison, all at one place for my reference. All credit to many of the Intel Engineers and maker enthusiasts who have tried and uploaded a lot data. I have tried to add only a few inputs of mine while I was creating this “personal guide”.

Disclaimer: I am not responsible for any damage to your board, your cats or your relationship status - You are on your own!


Booting from an SD Card

The Intel Edison features an internal eMMC Flash of 4GB which is sufficient storage for a sophisticated application. However when the Intel Edison board is used as a development board with various packages being installed on the fly, having more storage for /root provides that extra space for experimental and development work.

A post on the Intel Make community website details the procedure for booting Intel Edison from an SD card. [All credit goes to AlexT Intel, MPayne Intel for brilliant work that they are doing on Intel Edison platform]

https://communities.intel.com/thread/61048 

I will mention these steps here for my reference - and a few additional customization that I have made for my use.

Setting up the SD card

Note: Commands are specific to my Debian machine

  1. Format your SD card with filesystem as ext4. Use gparted utility on GNU Linux to do this.

Note: Did you know you can partition and format an SD Card on the Intel Edison, see Partitioning/Formatting an SD Card with Intel Edison

  1. Re-mount your SD card

        > sudo mount /dev/sdb1 /media/usb0

  1. Download the latest Intel Edison Image from https://software.intel.com/en-us/iot/hardware/edison/downloads
  2. Unzip the image, copy contents into the SD card and unmount it.

        > mkdir image

> unzip edison-image-15ww25.5-15.zip -d image

> mkdir image/Rootfs

> sudo mount image/edison-image-edison.ext4 image/Rootfs

> sudo cp -rf image/Rootfs/* /media/usb0

> sudo umount /media/usb0

Setting up Intel Edison

Plug in the SD Card and boot the Intel Edison board with a recent image[flashed onto its eMMC] - refer the website https://software.intel.com/en-us/iot/hardware/edison/downloads

Few good tools on this website that can help you flash image on Edison are

  1. Flash Tool Lite

        Download - (Windows*, OS X*, Linux*)

  1. Driver software - If you are using Windows, I would suggesting using the Integrated Installer, a great tool that automatically installs Intel Edison drivers, XDK/Devkit tools[optional] and helps flash latest firmware image without any hassles.

Windows 64-bit Integrated Installer (11.8 MB, .exe)

Once booted, we will have to change a few bootargs so that we can choose which partition to boot from i.e. eMMC or our new SD Card.

Access Edison over Serial port on GNU Linux with minicom or screen command

> sudo minicom /dev/ttyUSB0 115200

OR

> sudo screen /dev/ttyUSB0 115200 

Sometimes, it might require one to need to soft link /dev/ttyUSB0 to /dev/modem

> fw_printenv | grep mmc-bootargs=

mmc-bootargs=setenv bootargs root=PARTUUID=${uuid_rootfs} rootfstype=ext4 ${bootargs_console} ${bootargs_debug} systemd.unit=${bootargs_target}.target hardware_id=${hardware_id} g_multi.iSerialNumber=${serial#} g_multi.dev_addr=${usb0addr}

The variable uuid_rootfs would be set to UUID of the eMMC card. We will now have to point root variable to boot from SD card instead of the eMMC.

        > fw_setenv mmc-bootargs ‘setenv bootargs root=${myrootfs} rootdelay=3 rootfstype=ext4 ${bootargs_console} ${bootargs_debug} systemd.unit=${bootargs_target}.target hardware_id=${hardware_id} g_multi.iSerialNumber=${serial#} g_multi.dev_addr=${usb0addr}’

        

Now, in order to boot either from SD card or eMMC points, we can set the fw variables appropriately and reboot.

        > fw_printenv uuid_rootfs

        uuid_rootfs=012b3303-34ac-284d-99b4-34e03a2335f4

Now we can set both variables myrootfs_emmc and myrootfs_sdcard to appropriate points.

        > fw_setenv myrootfs_emmc ‘PARTUUID=012b3303-34ac-284d-99b4-34e03a2335f4

        > fw_setenv myrootfs_sdcard ‘/dev/mmcblk1p1’

        > fw_setenv myrootfs ‘/dev/mmcblk1p1’

Now also set alias so that we can boot from SD Card or eMMC from the boot prompt.

        > fw_setenv do_boot_emmc ‘setenv myrootfs ${myrootfs_emmc}’; run do_boot’

        > fw_setenv do_boot_sdcard ‘setenv myrootfs ${myrootfs_sdcard}’; run do_boot’

        

Now reboot and since you have already set myrootfs to point to SD card, it would now boot into the SD Card.

Mount point for HOME

When you reboot now, you can check what are the mount points by using the following command.

        > df -h

Filesystem                    Size          Used Available Use% Mounted on

/dev/root                     7.2G        443.7M          6.3G   6% /

devtmpfs                    479.9M             0        479.9M   0% /dev

tmpfs                       480.2M             0        480.2M   0% /dev/shm

tmpfs                       480.2M        540.0K        479.6M   0% /run

tmpfs                       480.2M             0        480.2M   0% /sys/fs/cgroup

systemd-1                     5.8M          5.3M        460.0K  92% /boot

tmpfs                       480.2M          4.0K        480.2M   0% /tmp

tmpfs                       480.2M             0        480.2M   0% /var/volatile

/dev/mmcblk1p1                7.2G        443.7M          6.3G   6% /media/sdcard

/dev/mmcblk0p10               2.2G         92.1M          2.1G   4% /home

/dev/mmcblk0p7                5.8M          5.3M        460.0K  92% /boot

/dev/mmcblk0p5             1003.0K         19.0K        913.0K   2% /factory

If you notice, the highlighted sections show that the /root is now mounted with 6.3GB free space which indicates it is the SD card. However the /home is still mounted on the eMMC. We could change the /home to point to the SD card as well by playing around /etc/fstab file 

Note: Be very careful with /etc/fstab file, if not edited properly, you might go as well go back to Setting up Edison Back to square one

Delete the last line in /etc/fstab file.

However, I wanted access to my previous home as well. So I created a new directory /home_emmc and I now mount the previous /home to /home_emmc and the /home would now mount at the SD card.

Last line of my /etc/fstab would look like

> tail /etc/fstab

/dev/disk/by-partlabel/home         /home_emmc           auto noauto,x-systemd.automount,nosuid,nodev,noatime,discard,barrier=1,data=ordered,noauto_da_alloc 1   1

This is all one single line that is highlighted in grey

Disable Auto Mount SD card

Since SD card is already being used at boot time for /root, we can disable systemd daemon that auto mounts SD card. Do this your SD card has only 1 partition and that partition is being used to boot Intel Edison.  

        > systemctl stop media-sdcard.automount

        > systemctl disable media-sdcard.automount

        > df -h

/dev/root            7.2G                 451.8M          6.3G     7%         /

devtmpfs                    479.9M             0                479.9M   0%         /dev

tmpfs                       480.2M             0                480.2M   0%         /dev/shm

tmpfs                       480.2M                528.0K                479.6M   0%         /run

tmpfs                       480.2M             0                480.2M   0%         /sys/fs/cgroup

systemd-1              5.8M          5.3M                460.0K   92%         /boot

systemd-1             2.2G                 92.1M          2.1G     4%         /home_emmc

tmpfs                       480.2M          4.0K                480.2M   0%         /tmp

tmpfs                       480.2M             0                480.2M   0%         /var/volatile

/dev/mmcblk0p5             1003.0K         19.0K                913.0K   2%         /factory

/dev/mmcblk0p7                5.8M          5.3M                460.0K   92%         /boot

/dev/mmcblk0p10               2.2G         92.1M          2.1G     4%         /home_emmc

If there is a partition in your SD Card that you want to mount, instead of removing automount service from the systemd[which by default mounts mmcblk1p1], you can edit the scripts to mount that partition, in my case mmcblk1p2.

Edit /lib/systemd/system/media-sdcard.mount to change

BindsTo=dev-mmcblk1p1.device

to

BindsTo=dev-mmcblk1p2.device

And

        What=/dev/mmcblk1p1

to

        What=/dev/mmcblk1p2

Edit /lib/systemd/system/media-sdcard.automount to change

ConditionPathExists=/dev/mmcblk1p1

to

        ConditionPathExists=/dev/mmcblk1p2

Partitioning/Formatting an SD Card with Intel Edison

Partitioning

Did you know, you can partition an SD card with Intel Edison itself. You might find it helpful to partition a messed up SD card. Intel Edison official image has GNU Linux utilities like fdisk to create partitions and mkfs* to format partitions for appropriate file system formats. Once you plug in the SD card into the Arduino Expansion Development Board, one the console check mount command to list out the devices that are detected and then unmount the SD card disk that is mounted.

> mount | grep mmcblk

> umount /dev/mmcblk1

The fdisk utility has detailed documentation at http://www.tldp.org/HOWTO/Partition/fdisk_partitioning.html

But here’s how I created two partitions on the SD Card, eventually[1] I will use one partition for booting the Edison firmware and other partition to maintain my data.

> fdisk /dev/mmcblk1

The number of cylinders for this disk is set to 19165.

There is nothing wrong with that, but this is larger than 1024,

and could in certain setups cause problems with:

1) software that runs at boot time (e.g., old versions of LILO)

2) booting and partitioning software from other OSs

   (e.g., DOS FDISK, OS/2 FDISK)

Command (m for help):

You can type m for detailed command line options. Type in n for new partition

> n

Command (m for help): n
        Command action
          e   extended
          p   primary partition (1-4)

Choose p (primary partition)
Partition number (1-4):
2

enter partition number

> 1

Start of cylinder number - Just go with the default (would be 1 for the partition)

        First cylinder (1-19165, default 1):<RETURN>
        Using default value 1
        Last cylinder or +size or +sizeM or +sizeK ( default +19625):
+6000M

I created first partition of 6GB size. Similar other partition with reset of the space can be created. Once created, a command p would would show the partitions created.

Disk /dev/mmcblk1: 7948 MB, 7948206080 bytes

81 heads, 10 sectors/track, 19165 cylinders

Units = cylinders of 810 * 512 = 414720 bytes

Device Boot                  Start             End          Blocks  Id System

/dev/mmcblk1p1                   1                   14469         5859940  83 Linux

/dev/mmcblk1p2               14470           19165         1901880  83 Linux

Now exit with saving the changes by entering the command w.

Formatting

The mkfs* utilities in GNU Yocto Linux can be used to format the partitions to file system formats, preference here would be ext4 partition.

> mkfs.ext4 /dev/mmcblk1p1

> mkfs.ext4 /dev/mmcblk1p2

Now you will have two partitions on the SD card mmcblk1 named as p1 and p2 formatted in ext4 filesystem.


Configure Edison & WiFi Access

I prefer to connect my Intel Edison (I named it as eddie) to the Internet via my home WiFi network. However, out of the box, I have seen that Edison does not enable WiFi. The famous command is

> configure_edison --setup

This will help set up a login password, a device name for the board and enable WiFi access on the board.

If you just want to enable WiFi, you can use

        > configure_edison --wifi

Access Edison via SSH over WiFi[2]

Once WiFi is set-up, you can access Edison over your internal LAN connection since it is on the same sub-net. I prefer accessing Edison over WiFi than any of the wired means (LAN or Serial port over USB). However, out of the box, Edison prevents SSH on WiFi connection and only allows on Ethernet over USB[RNDIS?]. You can enable SSH over WiFi by changing the /lib/systemd/system/sshd.socket file.

Comment off the following line with a # at the beginning

#BindDeviceTo=usb0

Static IP Address[3]

Dynamic IP address is all good, but at home, I would always like to see my Edison on one IP address so I could power it ON and directly SSH into it via my GNU Linux box. One could assign a Static IP to Edison by changing the file /etc/wpa_supplicant/wpa_cli_actions.sh which sort of controls networking on WiFi connection.

Comment off line which has udhcp (Dynamic Host Control Protocol). Change

if [ "$CMD" = "CONNECTED" ]; then

        kill_daemon udhcpc /var/run/udhcpc-$IFNAME.pid

        udhcpc -i $IFNAME -p /var/run/udhcpc-$IFNAME.pid -S

fi

to

if [ "$CMD" = "CONNECTED" ]; then

        kill_daemon udhcpc /var/run/udhcpc-$IFNAME.pid

#        udhcpc -i $IFNAME -p /var/run/udhcpc-$IFNAME.pid -S

        ipconfig $IFNAME 192.168.1.108 netmask 255.255.255.0

fi

IP Route Gateway

Access the Internet would require you to add the default gateway to the above file. Add the gateway IP address to the /etc/wpa_supplicant/wpa_cli_actions.sh

ipconfig $IFNAME 192.168.1.108 netmask 255.255.255.0

route add default gw 192.168.1.1

Opkg Setup

Edison has opkg - the package manager to install software packages from a console. Again AlexT Intel is doing great work maintaining a package repository which he updates pretty regularly. So I have this in my opkg config file

> cat /etc/opkg/base-feeds.conf

src all http://repo.opkg.net/edison/repo/all

src edison http://repo.opkg.net/edison/repo/edison

src core2-32 http://repo.opkg.net/edison/repo/core2-32

Other than that I have IOT-DK [Intel official IoT Developer Kit] repository pointers in /etc/opkg/iotdk.conf

        > echo “src all intel-iotdk http://iotdk.intel.com/repos/1.5/intelgalactic” > /etc/opkg/iotkit.conf

Update your opkg package list by

        > opkg update

Utilities

Apart from those that are already available with the firmware image, I like a few utilities for productivity. For packages t        hat I need compiled on Edison, I have created a directory sw where I clone the source codes

        > mkdir /home/root/sw

Git

git package is available at the Intel official OPKG package repository at http://iotdk.intel.com/repos/1.1/iotdk/i586/

        > opkg install git

Bash Shell

You can install the bash shell from Intel official OPKG package repository.

        > opkg install bash

Change the default login shell to be bash

        > chsh -s /bin/bash root

Vim

The Intel Edison firmware image has ‘vi’ as the editor. But if you are a fan of vim, then you will have to compile vim on Edison and this is straightforward.

        > cd /home/root/sw

        > git clone https://github.com/b4winckler/vim

        > cd vim

> ./configure --with-features=huge

> make

> make install

Alias vi to vim by updating your /home/root/.bashrc file to add this line

alias vi ‘vim’

Mpg123

mpg123 is an mp3 player (I would think this is developed to interface with ALSA) which is available at AlexT’s repository http://repo.opkg.net/edison/repo/core2-32

        > opkg install mpg123

Mplayer

There are a few dependencies which need to be installed before installing compiling Mplayer.

Dependencies

Avahi Daemon

        I have had problems installing avahi-daemon with mDNS running already in systemd. I had to disable mDNs first.

                > systemctl disable mDNS

                > reboot

                > opkg install avahi-daemon

                > reboot

                > systemctl enable mDNS

                > reboot

                > systemctl status avahi-daemon.service

        This should show you that avahi-daemon.service is running successfully.

Pulse Audio

> opkg install --force-reinstall --force-overwrite pulseaudio

> opkg install --force-reinstall --force-overwrite pulseaudio-dev

Installing pulseaudio-dev might take longer than pulseaudio. Please be patient!

Yasm

        Execute the following commands in a directory where you can build softwares preferably on your SD card partition.

Compile directory of my choice

                > cd /media/sdcard/sw

        

> wget http://www.tortall.net/projects/yasm/releases/yasm-1.3.0.tar.gz

                > tar xvf yasm-1.3.0.tar.gz

                > cd yasm-1.3.0

                > sed -i 's#) ytasm.*#)#' Makefile.in && ./configure --prefix=/usr

> make

> make install

Core utils

        Install coreutils package from OPKG repository

                > opkg install coreutils

        Alsa dev

        Install alsa-dev package from the OPKG repository.

                > opkg install alsa-dev

        

Checking for libs - You can check for libraries before mplayer compile using the comands

        > pkg-config --libs --cflags pulse

        D_REENTRANT -lpulse

        > pkg-config --libs --cflags alsa

        -I/usr/include/alsa -lasound

Mplayer

Follow the instructions to compile Mplayer on Intel Edison. Make sure that the dependencies mentioned in the previous section are all installed.

        > cd /media/sdcard/sw/

> wget ftp://ftp.mplayerhq.hu/MPlayer/releases/MPlayer-1.1.1.tar.xz

        > tar xvf Mplayer-1.1.1.tar.xz

        > cd Mplayer-1.1.1

        > ./configure --enable-alsa --enable-pulse && make && make install

This process took me at least 20 minutes so don’t be surprised if it is taking longer than other utilities so far. To play sound with Mplayer, ALSA has to be set up as, as explained in some of the next sections.

Note: I had an issue where make would fail to locate -lpulse. It turns out that /usr/lib/libpulse.so soft-link was broken. You should link it to /usr/lib/libpulse.so.<version> on your system. On my eddie, I set it up to link as /usr/lib/libpulse.so.0.18.0

> ln -s /usr/lib/libpulse.so /usr/lib/libpulse.so.0.18.0 

How to check if pulse is enabled in Mplayer? Use the following command which should show pulse and alsa audio codes in the list

> mplayer -ao help

Available audio output drivers:

    oss    OSS/ioctl audio output

    alsa    ALSA-0.9.x-1.x audio output

    pulse    PulseAudio audio output

    mpegpes    DVB audio output

    v4l2    V4L2 MPEG Audio Decoder output

    null    Null audio output

    pcm    RAW PCM/WAVE file writer audio output

Espeak

espeak is a great text to speech utility. One of my friend Bhaskar, Navin had implemented an awesome personal-assistant application with Intel Edison at the Intel IoT Roadshow Hackathon (December, 2014). Here are some of the links to his post on his application, which involves a mail-reader!

https://plus.google.com/108445836272650362544/posts/8siW1wxkDhb

However with Firmware 2.0, espeak is available on the official Intel OPKG repository, to install, execute the following command

        > opkg install espeak

See espeak to convert text to speech on USB Headset here after setting up USB Audio.

USB Audio

I could directly connect a Plantronics USB Headset and Intel Edison detected this without requiring any additional driver updates. Once you connect the headset, use the following command to find out if the device is detected.

        > dmesg | tail

        [   41.771514] usb 1-1: new full-speed USB device number 3 using dwc3-host

[   42.010307] usb 1-1: New USB device found, idVendor=047f, idProduct=c002

[   42.010337] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0

[   42.010358] usb 1-1: Product: Plantronics Blackwire C220 M

[   42.010377] usb 1-1: Manufacturer: Plantronics

[   42.011252] usb 1-1: ep 0x84 - rounding interval to 64 microframes, ep desc says 80 microframes

[   42.183484] input: Plantronics Plantronics Blackwire C220 M as /devices/pci0000:00/0000:00:11.0/dwc3-host.2/usb1/1-1/1-1:1.3/input/input3

[   42.184935] hid-generic 0003:047F:C002.0002: input,hiddev0,hidraw0: USB HID v1.00 Device [Plantronics Plantronics Blackwire C220 M] on usb-dwc3-host.2-1/input3

[   42.604495] xhci_queue_isoc_tx_prepare: 2 callbacks suppressed

Dependencies

        ALSA Utils

        Install alsa-utils on your Intel Edison with the opkg command.

        > opkg install alsa-utils

        Alsa utils provides utilities like amixer and alsamixer for playing around with device configurations, sampling etc. See for ALSA wiki more details

https://wiki.archlinux.org/index.php/Advanced_Linux_Sound_Architecture/Troubleshooting

Installing alsa-utils downloads few wav audio samples as well at the following path

/usr/share/sounds/alsa/

~/.asoundrc

ALSA (Advanced Linux Sound Architecture) framework detects the audio devices and this can be listed using the following command.

        > aplay -Ll

null

        Discard all samples (playback) or generate zero samples (capture)

default:CARD=Loopback

        Loopback, Loopback PCM

        Default Audio Device

sysdefault:CARD=Loopback

        Loopback, Loopback PCM

        Default Audio Device

default:CARD=dummyaudio

        dummy-audio,

        Default Audio Device

sysdefault:CARD=dummyaudio

        dummy-audio,

        Default Audio Device

default:CARD=M

        Plantronics Blackwire C220 M, USB Audio

        Default Audio Device

sysdefault:CARD=M

        Plantronics Blackwire C220 M, USB Audio

        Default Audio Device

**** List of PLAYBACK Hardware Devices ****

card 0: Loopback [Loopback], device 0: Loopback PCM [Loopback PCM]

  Subdevices: 8/8

  Subdevice #0: subdevice #0

  Subdevice #1: subdevice #1

  Subdevice #2: subdevice #2

  Subdevice #3: subdevice #3

  Subdevice #4: subdevice #4

  Subdevice #5: subdevice #5

  Subdevice #6: subdevice #6

  Subdevice #7: subdevice #7

card 1: dummyaudio [dummy-audio], device 2: ((null)) []

  Subdevices: 1/1

  Subdevice #0: subdevice #0

card 2: M [Plantronics Blackwire C220 M], device 0: USB Audio [USB Audio]

  Subdevices: 1/1

  Subdevice #0: subdevice #0

The ~/.asoundrc file can be configured to identify your device as the default ALSA sound input output device. Add the following to the ~/.asoundrc file.

                pcm.!default {

                        type plug

                        slave {

                                pcm “hw:2,0”

                        }

                }

Espeak with Alsa

With the following in the ~/.asoundrc I could just espeak to shout out “Hello World” on my USB Audio headset.

        

Aplay        and Arecord Utilities

aplay and arecord utilities can be used play audio files of .wav format on Intel Edison. Here’s a how to.

The 2 and 0 for hw: option are determined by highlighted section of aplay -Ll command

                > aplay /usr/share/sounds/alsa/Front_Center.wav

                Have fun playing sounds!!

        

        Add the following to ~/.asoundrc to record audio from the microphone input of the USB headset

                ctl.!default {

                        type plug

                        slave {

                                pcm “hw:2,0”

                        }

                }

        To record, use arecord audio into a file hello.wav file, use

                > arecord hello.wav

Intel Edison as an MP3 Player

With Mplayer and pulse audio installed, one could use Intel Edison as a table-top MP3 player. Here’s a how-to. You would need the Intel Arduino Development Board which has the USB port so you can connect a USB headset or a USB sound card. Note that the board should be powered by the external power supply on the 7-12V DC jack and not by the microUSB cable.

Setup the your USB sound card/headset as the pulse audio sink. Here’s what I do

> pactl list sinks

Sink #0

    State: SUSPENDED

    Name: alsa_output.usb-Plantronics_Plantronics_Blackwire_C220_M-00-M.analog-stereo

    Description: Plantronics Blackwire C220 M Analog Stereo

    Driver: module-alsa-card.c

    Sample Specification: s16le 2ch 44100Hz

    Channel Map: front-left,front-right

    Owner Module: 1

    Mute: no

    Volume: front-left: 58409 /  89% / -3.00 dB,   front-right: 58409 /  89% / -3.00 dB

                balance 0.00

    Base Volume: 60694 /  93% / -2.00 dB

    Monitor Source: alsa_output.usb-Plantronics_Plantronics_Blackwire_C220_M-00-M.analog-stereo.monitor

    Latency: 0 usec, configured 0 usec

    Flags: HARDWARE HW_MUTE_CTRL HW_VOLUME_CTRL DECIBEL_VOLUME LATENCY

    Properties:

            alsa.resolution_bits = "16"

            device.api = "alsa"

            device.class = "sound"

            alsa.class = "generic"

            alsa.subclass = "generic-mix"

            alsa.name = "USB Audio"

            alsa.id = "USB Audio"

            alsa.subdevice = "0"

            alsa.subdevice_name = "subdevice #0"

            alsa.device = "0"

            alsa.card = "2"

            alsa.card_name = "Plantronics Blackwire C220 M"

            alsa.long_card_name = "Plantronics Plantronics Blackwire C220 M at usb-dwc3-host.2-1, full speed"

            alsa.driver_name = "snd_usb_audio"

            device.bus_path = "pci-0000:00:11.0-platform-dwc3-host.2-usb-0:1:1.0"

            sysfs.path = "/devices/pci0000:00/0000:00:11.0/dwc3-host.2/usb1/1-1/1-1:1.0/sound/card2"

            udev.id = "usb-Plantronics_Plantronics_Blackwire_C220_M-00-M"

            device.bus = "usb"

            device.vendor.id = "047f"

            device.vendor.name = "Plantronics, Inc."

            device.product.id = "c002"

            device.product.name = "Plantronics Blackwire C220 M"

            device.serial = "Plantronics_Plantronics_Blackwire_C220_M"

            device.string = "front:2"

            device.buffering.buffer_size = "17632"

            device.buffering.fragment_size = "4408"

            device.access_mode = "mmap"

            device.profile.name = "analog-stereo"

            device.profile.description = "Analog Stereo"

            device.description = "Plantronics Blackwire C220 M Analog Stereo"

            alsa.mixer_name = "USB Mixer"

            alsa.components = "USB047f:c002"

            module-udev-detect.discovered = "1"

            device.icon_name = "audio-card-usb"

    Ports:

            analog-output-headphones: Headphones (priority: 9000)

    Active Port: analog-output-headphones

    Formats:

            pcm

Use the name that is highlighted in the output to set sink

> pactl set-default-sink alsa_output.usb-Plantronics_Plantronics_Blackwire_C220_M-00-M.analog-stereo

Now you can use mplayer to play an mp3 file and it would route the audio to the USB headset.

> mplayer

Bluetooth Audio (A2DP) on Intel Edison

There is a comprehensive guide on enabling Bluetooth on Intel Edison on the Intel Support & Downloads developers here. I will document quick steps that I use to connect a Plantronics Legend Voyager Mobile Bluetooth headset. My goal is to be able to

  1. Play MP3 songs on Edison and stream audio output to the Bluetooth earpiece
  2. Record audio from the Bluetooth headset and use it for a simple speech controlled application.

Setup Bluetooth

Rfkill Unblock Bluetooth

Agent on

Scan

Pair

Connect

pactl list sinks - set the sink

mplayer

Python

Intel Edison has support for Python, comes installed with Python 2.7.3

        > python --version

        Python 2.7.3

Intel Edison has inbuilt support for MRAA and UPM libraries for Python that help develop Python program to interface hardware resources like digital GPIO and analog inputs.

Pip

Just like OPKG is the package manager for Yocto linux utilities on Intel Edison, Pip is the python package manager! However the official image does not come with pipe installed. AlexT’s fantastic repo has Pip package available, just have to use

        > opkg install python-pip

However to be able to use pipe to install packages, Python Setuptools have to be installed as well. Something called bootstrapping? See here https://pypi.python.org/pypi/setuptools for more information. Its pretty easy to set up as its name indicates!

        > wget --no-check-certificate https://bootstrap.pypa.io/ez_setup.py

        > python ./ez_setup.py


[1] I haven’t tried booting an Intel Edison from an SD card with multiple primary partitions. I will update this section once I have data on the same. 

[2] Reference solution from https://communities.intel.com/thread/55527

[3] Reference Solution from https://communities.intel.com/message/262958 Looks like this is fixed starting Edison Firmware 2.0 version