15 Dec

Firmware Update on an ESP8266

The ESP8266 is an incredibly cheap (as in $3) wifi module for use in embedded projects. A few weeks back I ordered several of these little jems, and have been having lots of fun connecting all sorts of stuff to my LAN. A  couple of weeks ago the manufacturer released an updated firmware build that really increases the stability of the ESP8266, so I spent some time over the weekend upgrading them. It’s not difficult, but there are a few tricks to it.

First, make sure you’re using a 3.3v serial interface. 5v will kill the module. I’m using a 3.3v generic Silicon Labs from Pololu. You can order them here.

Connect the module’s GPIO0 to ground. This puts it into firmware update mode.

Download esptool.py from here. If you don’t already have it installed, you’ll need to install pyserial as well.

<note to=”self”>your copy is in ~/src/pyserial-master</note>

Download the firmware – I’m currently using the version that can be found here.

Unzip the firmware into the same directory as the esptool.py script.

If you’re using a Mac, you might have some issues with the —port option. I wound up hard-coding the /dev/ttyXXX entry for my USB programmer into the script.

<note to=”self”>your programmer is on /dev/tty.SLAB_USBtoUART</note>

Upload the firmware as follows:

./esptool.py write_flash 0x00000 boot_v1.1.bin
./esptool.py 
…...
Read more »
2 Nov

The Grand Unified Asterisk API

(This post covers what the what of the API rather than the how.  The how of APIs – REST vs. RPC, sync vs. async – will be covered in a future post.)

The problem with programming is knowing when to stop.  The key to knowing when to stop is setting goals.  To that end, here are my goals for the new API:

  • After the initial installation, I do not want to have to use the Linux shell
  • I do not want to have to directly edit configuration files
  • I want to be able to script the configuration of a complex Asterisk server instance
  • I want to be able to build a management console that uses API calls to manage every aspect of a system (or cluster of systems)
  • I want to easily write voice applications in real languages: JavaScript (Node.js), Python, Perl, PHP, Clojure, Scala, .NET, etc.
  • I want performance that is 90% of what you can get using the Dialplan
  • I want to be able to build my own version of the monolithic apps currently trapped inside Asterisk (voicemail, queues, parking, etc.)

For a few stretch goals:

  • I want one Asterisk system to be able to automatically mirror another
  • I want Asterisk systems to be able to discover and share load with each other

I’m not being too …

...
Read more »
28 Oct

The Eight APIs of Asterisk

(The first of a multi-part series on APIs for Asterisk, this article covers the current interfaces, their strengths and weaknesses.  Check back in a few days for part two: a proposal for an enhanced, unified interface for Asterisk programming.)

At the AstriDevCon this year we talked about a number of aggressive projects to make significant improvements to the platform. At the top of the list were a rewrite of our SIP channel and better APIs for application development. Both efforts are important and, frankly, long overdue. I’ll leave the SIP efforts to others and concentrate on the APIs.

Asterisk currently includes a total of eight interfaces:

  1. The internal C language interfaces
  2. The Dialplan scripting language(s)
  3. The Asterisk Gateway Interface (AGI)
  4. The Asterisk Manager Interface (AMI)
  5. The External IVR interface / protocol
  6. The Asterisk Command Line Interface (CLI)
  7. The outgoing call file spool
  8. The Asterisk configuration files

These interfaces provide various means of interfacing with Asterisk. Unfortunately, they’re inconsistent, awkwardly structured, poorly documented and generally developer-unfriendly. Let’s take a look at the pros and cons of each.

The C API

Asterisk’s internal C API is used to write applications and functions which are then exposed to the Dialplan and other interfaces.  On the positive side, the resulting apps are fast, have virtually no overhead and have access to all of the …

...
Read more »
9 Feb

Asterisk In Action: Web Conferencing

About three weeks ago my company (Digium) launched AsteriskExchange, a marketplace of sorts for Asterisk add-ons and Asterisk-based solutions. The idea is to give users a single site that catalogs all the amazing products and projects that connect with Asterisk. Open source and free (as in no-strings-attached) products qualify for free listings, while commercial offerings pay a listing fee that helps cover the cost of maintaining and marketing AsteriskExchange.

One of the first open source projects to get listed is an absolutely fantastic collaboration and conferencing system called BigBlueButton. BigBlueButton (BBB) is similar in function to WebEx or GoToMeeting, but adds some really cool features including multi-presenter video, low-bandwidth document sharing and an open API for integration with other systems. The audio conferencing component of BBB is provided by Asterisk, which is one of fourteen open source “engine-level” components that power the system.

The BigBlueButton client is a browser-based Flash app, so there’s no software package to install or update. Unlike most other collaboration tools on the market, BBB works with Windows, Mac and Linux. The system was built for the distance learning market but works perfectly well as a collaboration or marketing tool for business. The package is licensed under a combination of the LGPL and the AGPL. The sponsoring company, Blindside Networks, offers installation, …

...
Read more »