Initial experiments with ReSpeaker

Last year I backed a Kickstarter project called ReSpeaker, which is a (Linux-based) hardware module designed to make it as easy as possible to add speech recognition to projects. The main selling point for me is that a "far-field" microphone array is available for it, which allows far better isolation of audio sources and enables recognition over greater distances, which is ideal for speech recognition applications - my ReSpeaker is going to be an interface to my home automation system.
I won't go into detail about the ReSpeaker itself, as it's well documented elsewhere online. This post is mainly to document some less-obvious things I encountered when setting it up.

Where are the intro docs?

Some docs are located here. There are a number of interesting/useful repos in the same GitHub organisation.

Connecting to Wi-Fi

Initially the ReSpeaker broadcasts its own wireless network. After connecting to this, visit http://192.168.100.1/home.html to access the main ReSpeaker menu, which contains an option to connect the ReSpeaker to a wireless network of your choice.

There's also an installation of JUCI running at http://192.168.100.1/#!/overview, which is a web interface to most of OpenWRT's configuration (since ReSpeaker's Linux core is based on OpenWRT).

Side note about networking

The ReSpeaker can act in station and access point mode simultaneously; it uses a bridge with an IP of 192.168.100.1 to bridge the station interface (WAN) of apcli0 (also listed as ra0) with eth0.1 (LAN):

root@ReSpeaker:~# brctl show  
bridge name   bridge id           STP enabled   interfaces  
br-lan        7fff.9c65f91dc3cf   no            eth0.1  
                                                ra0

If you set up a route on your PC manually, you can access 192.168.100.1 when connected to your normal wireless network. The firewall is configured to allow WAN traffic into the LAN but not vice-versa.

The config files for this are in the standard OpenWRT location of /etc/config/{firewall,network,wireless}. Most of these settings are also editable through JUCI.

After connecting the ReSpeaker to your wireless network, you can disable the ReSpeaker's own access point by going to JUCI, then Wifi => Interfaces => ReSpeakerXXXXXX @, and turning off "Enabled".

Accessing the ReSpeaker console

If you mess up your networking somehow and can't access its web UI, you can access a shell through an emulated serial console to fix it when connected over USB. Example command to connect:

screen /dev/tty.usbmodem1411 57600

Running code samples

I wanted to play with the LEDs, but out of the box the music player Mopidy has exclusive claim to their usage (presumably to support the intro "Hi, ReSpeaker" demo) - attempting to use them within Python will give you a "resource busy" error. Stop Mopidy running with:

/etc/init.d/mopidy stop

Now you can use the LEDs as described in the Programming Guide.

It may have just been because I was powering ReSpeaker from my laptop, but it doesn't seem to be able to supply enough power to the LEDs to run them at full power - the board browned out at around 80% of full power (setting them to colour 0xCCCCCC made it a bit unstable).

Misc useful info I've gleaned

The onboard Atmega32u4 is running this code by default.