» EtherCard library API » JeeLabs

EtherCard library API

In Software on Jun 19, 2011 at 00:01

As you may have noticed in the last few weblog posts, the API of the EtherCard library has changed quite a bit lately. I’m not doing this to be different, but as part of my never-ending quest to try and simplify the calling interface and to reduce the code size of the library (these changes shaved several Kb off the compiled code).

The main change was to switch to a single global buffer for storing an outgoing Ethernet packet and for receiving the next packet from the controller. This removes the need to pass a buffer pointer to almost each of the many functions in the library.

Buffer space is scarce on an ATmega, so you have to be careful not to run out of memory, while still having a sufficiently large buffer to do meaningful things. The way it works now is that you have to allocate the global buffer in your main sketch:

Screen Shot 2011 06 15 at 09.32.45

This particular style was chosen because it allows the library to access the buffer easily, and more importantly: without requiring an intermediate pointer.

To make this work, you have to initialize the EtherCard library in the proper way. This is now done by calling the begin() function as part of your setup() code:

Screen Shot 2011 06 15 at 09.34.46

The ether variable is defined globally in the EtherCard.h header file. The begin() call also needs the MAC address to use for this unit. The simplest way to provide that is to define a static array at the top of the sketch with a suitable value (it has to be unique on your LAN):

Screen Shot 2011 06 15 at 09.37.18

Next, you can use DHCP to obtain an IP address and locate the gateway and DNS server:

Screen Shot 2011 06 15 at 09.39.27

The printIp() utility function can optionally be used to print some info on the Serial port.

If you are going to set up a server, then a fixed IP address might be preferable. There’s a new staticSetup() function you can use when not doing DHCP:

Screen Shot 2011 06 15 at 09.42.55

The gateway IP address is only needed if you’re going to access an IP address outside of your LAN, and the DNS IP addres is also optional (it’ll default to Google’s “8.8.8.8” DNS server if you do a DNS lookup). To omit values, pass a null pointer or leave the arguments off altogether:

Screen Shot 2011 06 15 at 09.45.55

Just remember to call either dhcpSetup() or staticSetup() after the begin() call.

DNS lookups are also very simple:

Screen Shot 2011 06 15 at 09.47.32

The one thing to keep in mind here, is that the website argument needs to be a flash-based string, which must be defined as follows:

Screen Shot 2011 06 15 at 09.51.10

Note the “PROGMEM” modifier. See the Saving RAM space weblog post for more info about this technique.

This concludes the intialization part of the EtherCard library. Next, we need to keep things going by frequently polling for new incoming packets and responding to low-level ARP and ICMP requests. The easiest way to do so is to use the following template for loop():

Screen Shot 2011 06 15 at 09.59.01

The packetReceive() function polls for new incoming data and copies it into the global buffer. The return value is the size of this packet (or zero if there is none).

The packetLoop() function looks at the incoming data and takes care of low-level responses. The return value is the offset in the global packet buffer where incoming TCP data can be found (or zero if there is none).

As to what to do next: it really all depends on what you’re after. Check out the examples in the Ethercard library for how to build web servers and web clients on top of this functionality.

To get an idea of the code overhead of the EtherCard library: a simple web client using DHCP and DNS is around 10 Kb, while an even simpler one using static IP addresses (no DHCP and no DNS) is under 7 Kb. The fairly elaborate EtherNode sample sketch, which includes DHCP and the RF12 library is now ≈ 13 Kb.

IOW, lots of room for adding your own app logic!

Source: » EtherCard library API » JeeLabs

» EtherCard library API » JeeLabs was last modified: July 13th, 2017 by Jovan Stosic

Fach

Fach

Page issues

Method of classifying singers according to the range, weight, and color of their voices

This article is about music. For the Fuerza Aérea de Chile (FACh), see Chilean Air Force.

The German Fach system (German pronunciation: [fax]; literally “compartment” or “subject of study”, here in the sense of “vocal specialization”) is a method of classifying singers, primarily opera singers, according to the rangeweight, and color of their voices. It is used worldwide, but primarily in Europe, especially in German-speaking countries and by repertory opera houses.

The Fach system is a convenience for singers and opera houses. It prevents a singer from being asked to sing roles which they are incapable of performing. Opera companies keep lists of available singers by Fach so that when they are casting roles for an upcoming production, they do not inadvertently contact performers who would be inappropriate for the part.

Below is a list of Fächer (German pronunciation: [ˈfɛçɐ]), their ranges as written on sheet music, and roles generally considered appropriate to each. When two names for the Fach are given, the first is in more common use today. Where possible, an English and/or Italian equivalent of each Fach is listed; however, not all Fächer have ready English or Italian equivalents. Note that some roles can be sung by more than one Fach and that many singers do not easily fit into a Fach: for instance some sopranos may sing both Koloratursopran and Dramatischer Koloratursopran roles. In addition, roles traditionally more difficult to cast may be given to a voice other than the traditional Fach. For instance, the “Queen of the Night” is more traditionally a dramatic coloratura role, but it is difficult to find a dramatic coloratura to sing it (particularly given the extreme range). Therefore, the role is often sung by a lyric coloratura.

https://en.m.wikipedia.org/wiki/Fach

Fach was last modified: September 25th, 2017 by Jovan Stosic

15 Arias for Coloratura Soprano

15 Arias for colortura soprano

Nr.Title sceneOperaComposerActTypeVoicesLang.Roles

1Una voce poco faBarbiere di Siviglia, IlRossini1.12-1ariacontralto or mezzoItalianRosina

2Ah! je ris de me voir si belleFaustGounod3.06-2ariasopranoFrenchMarguerite

3Chacun le saitFille du régiment, LaDonizetti1ariasopranoFrenchMarie

4Ou va la jeune hindoueLakméDelibes2.08-2ariasopranoFrenchLakmé

5Il dolce suonoLucia di LammermoorDonizetti3.05-2ariasopranoItalianLucia

6Je suis Titania la blondeMignonThomas2recitativesopranoFrenchPhiline

7Caro nome che il mio corRigolettoVerdi2.08-2ariasopranoItalianGilda

8Je veux vivre dans ce rêveRomeo et JulietteGounod1.07ariasopranoFrenchJuliette

9Ah! non credea mirartiSonnambula, LaBellini2.10ariasopranoItalianAmina/Elvino

10Ah! fors e lui che l’animaTraviata, LaVerdi1.09ariasopranoItalianVioletta

11Der hölle RacheZauberflöte, DieMozart2.11ariasopranoGermanQueen

http://www.opera-arias.com/sheetmusic/15-arias-for-coloratura-soprano/

15 Arias for Coloratura Soprano was last modified: July 13th, 2017 by Jovan Stosic

Percona

Percona is an open source software company specializing in MySQL, MongoDB, and other open source database support, consulting, managed services, and training. The company was founded in 2006 by Peter Zaitsev and Vadim Tkachenko[1][2] and is headquartered in Raleigh, North Carolina. The company launched a MySQL backup service in June 2014 as part of its managed services.[3] The company contributes to the open source MySQL community through its blog site, the MySQL Performance blog.[4] The company also hosts annual open source database user conferences[5] named “Percona Live” in Silicon Valley and Europe. The company’s founders have also published the O’Reilly book “High Performance MySQL.”[6]

The company builds and maintains free, open-source MySQL software for Percona Server, MySQL, and MariaDB users. Percona Server is a variant of the MySQL relational database management system and is a drop-in MySQL replacement.[7] The company also produces open source software including Percona XtraDB Cluster,[8] Percona XtraBackup and Percona Toolkit.

Source: Percona – Wikipedia

Percona was last modified: September 25th, 2017 by Jovan Stosic

10 reasons to migrate to MariaDB (if still using MySQL) – Seravo

10 reasons to migrate to MariaDB (if still using MySQL)

The original MySQL was created by a Finnish/Swedish company, MySQL AB, founded by David Axmark, Allan Larsson and Michael “Monty” Widenius. The first version of MySQL appeared in 1995. It was initially created for personal usage but in a few years evolved into a enterprise grade database and it became the worlds most popular open source relational database software – and it still is. In January 2008, Sun Microsystems bought MySQL for $1 billion. Soon after, Oracle acquired all of Sun Microsystems after getting approval from the European Commission in late 2009, which initially stopped the transaction due to concerns that such a merger would harm the database markets as MySQL was the main competitor of Oracle’s database product.

MariaDB logoOut of distrust in Oracle stewardship of MySQL, the original developers of MySQL forked it and created MariaDB in 2009. As time passed, MariaDB replaced MySQL in many places and everybody reading this article should consider it too.

At Seravo, we migrated all of our own databases from MySQL to MariaDB in late 2013 and during 2014 we also migrated our customer’s systems to use MariaDB.

We recommend everybody still using MySQL in 2015 to migrate to MariaDB for the following reasons:

1) MariaDB development is more open and vibrant

Unlike many other open source projects Oracle inherited from the Sun acquisition, Oracle does indeed still develop MySQL and to our knowledge they have even hired new competent developers after most of the original developers resigned. The next major release MySQL 5.7 will have significant improvement over MySQL 5.6. However, the commit log of 5.7 shows that all contributors are @oracle.com. Most commit messages reference issue numbers that are only in an internal tracker at Oracle and thus not open for public discussion. There are no new commits in the latest 3 months because Oracle seems to update the public code repository only in big batches post-release. This does not strike as a development effort that would benefit from the public feedback loop and the Linus law of “given enough eyes all bugs are shallow”.

MariaDB on the other hand is developed fully in the open: all development decisions can be reviewed and debated on a public mailing list of in the public bug tracker. Contributing to MariaDB with patches is easy and patch flow is transparent in the fully public and up-to-date code repository. The Github statistics forMySQL 5.7 show 24 contributors while the equivalent figure for MariaDB 10.1 is 44 contributors. But it is not just a question of code contributors – in our experience MariaDB seems more active also in documentationefforts, distribution packaging and other related things that are needed in day-to-day database administration.

Because of the big momentum MySQL has had, there is still a lot of community around it but there is a clear trend that most new activities in the open source world revolve around MariaDB.

As Linux distributions play a major role in software delivery, testing and quality assurance, the fact that the both RHEL 7 and SLES 12 ship with MariaDB instead of MySQL increases the likelihood that MariaDB is going to be better maintained both upstream and downstream in years to come.

2) Quicker and more transparent security releases

Oracle only has a policy to make security releases (and related announcements) every three months for all of their products. MySQL however has a new release every two months. Sometimes this leads situations where security upgrades and security information are not synced. Also the MySQL release notes do not list all the CVE identifiers the releases fix. Many have complained that the actual security announcements are very vague and do not identify the actual issues or the commits that fixed them, which makes it impossible to do backporting and patch management for those administrators that cannot always simply upgrade to the latest Oracle MySQL release.

MariaDB however follows good industry standards by releasing security announcements and upgrades at the same time and handling the pre-secrecy and post-transparency in a proper way. MariaDB release notes also list the CVE identifiers pedantically and they even seem to update the release notes afterwards if new CVE identifiers are created about issues that MariaDB has already released fixes for.

3) More cutting edge features

MySQL 5.7 is looking promising and it has some cool new features like GIS support. However, MariaDB has had much more new features in recent years and they are released earlier, and in most cases those features seem to go through a more extensive review before release. Therefore we at Seravo trust MariaDB to deliver us the best features and least bugs.

For example GIS features were introduced already in the 5.3 series of MariaDB, which makes storing coordinates and querying location data easy. Dynamic column support (MariaDB only) is interesting because it allows for NoSQL type functionality, and thus one single database interface can provide both SQL and “not only SQL” for diverse software project needs.

4) More storage engines

MariaDB in particular excels as the amount of storage engines and other plugins it ships with: Connect and Cassandra storage engines for NoSQL backends or rolling migrations from legacy databases, Spider for sharding, TokuDB with fractal indexes etc. These plugins are available for MySQL as well via 3rd parties, but in MariaDB they are part of the official release, which guarantees that the plugins are well integrated and easy to use.

5) Better performance

MariaDB claims it has a much improved query optimizer and many other performance related improvements. Certain benchmarks show that MariaDB is radically faster than MySQL. Benchmarks don’t however always directly translate to real life situations. For example when we at Seravo migrated from MySQL to MariaDB, we saw moderate 3-5 % performance improvements in our real-life scenarios. Still, when it all adds up, 5% is relevant in particular for web server backends, where every millisecond counts. Faster is always better, even if it is just a bit faster.

6) Galera active-active master clustering

Galera is a new kind of clustering engine which, unlike traditional MySQL master-slave replication, provides master-master replication and thus enables a new kind of scalability architecture for MySQL/MariaDB. Despite that Galera development already started in 2007, it has never been a part of the official Oracle MySQL version while both Percona and MariaDB flavors have shipped a Galera based cluster version for years.

Galera support will be even better in MariaDB 10.1, as it will be included in the main version (and not anymore in a separate cluster version) and enabling Galera clustering is just a matter of activating the correct configuration parameters in any MariaDB server installation.

7) Oracle stewardship is uncertain

Many people have expressed distrust in Oracle’s true motivations and interest in keeping MySQL alive. As explained in point 1, Oracle wasn’t initially allowed to acquire Sun Microsystems, which owned MySQL, due to the EU competition legislation. MySQL was the biggest competitor to Oracle’s original database. The European Commission however approved the deal after Oracle published an official promise to keep MySQL alive and competitive. That document included an expiry date, December 14th 2014, which has now passed. One can only guess what the Oracle upper management has in mind for the future of MySQL.

Some may argue that in recent years, Oracle has already weakened MySQL in subtle ways. Maybe, but in Oracle’s defense, it should be noted that MySQL activities have been much more successful than for example OpenOffice or Hudson, which both very quickly forked into LibreOffice and Jenkins with such a momentum, that the original projects dried up in less than a year.

However, given the choice between Oracle and a true open source project, the decision should not be hard for anybody who understands the value of software freedom and the evolutive benefits that stem from global collaborative development.

8) MariaDB has leapt in popularity

In 2013 there was news about Wikipedia migrating it’s enormous wiki system from MySQL to MariaDB and about Google using MariaDB in their internal systems instead of MySQL. One of the MariaDB Foundation sponsors is Automattic, the company behind WordPress.com. Other notable examples are booking.com andCraigslist. Fedora and OpenSUSE have had MariaDB as the default SQL database option for years. With the releases of Red Hat Enterprise Linux 7 and SUSE Enterprise Linux 12 both these vendors ship MariaDB instead of MySQL and promises to support their MariaDB versions for the lifetime of the major distribution releases, that is up to 13 years.

The last big distribution to get MariaDB was Debian (and based on it, Ubuntu). The “intent to package” bugin Debian was already filed in 2010 but it wasn’t until December 2013 that the bug finally got closed. This was thanks to Seravo staff who took care of packaging MariaDB 5.5 for Debian, from where it also got into Ubuntu 14.04. Later we have also packaged MariaDB 10.0, which will be included in the next Debian and Ubuntu releases in the first half of 2015.

9) Compatible and easy to migrate

MariaDB 5.5 is a complete drop-in-replacement for MySQL 5.5. Migrating to MariaDB is as easy as runningapt-get install mariadb-server or the equivalent command on your chosen Linux flavor (which, in 2015, is likely to include MariaDB in the official repositories).

Despite the migration being easy, we still recommend that database admins undertake their own testing and always back up their databases, just to be safe.

10) Migration might become difficult after 2015

In versions MariaDB 10.0 and MySQL 5.6 the forks have already started to diverge somewhat but most likely users can still just upgrade from 5.6 to 10.0 without problems. The compatibility between 5.7 and 10.1 in the future is unknown, so the ideal time to migrate is now while it is still hassle-free. If binary incompatibilities arise in the future, database admins can always still migrate their data by dumping it and importing it in the new database.

With the above in mind, MariaDB is clearly our preferred option.

One of our customers once expressed their interest in migrating from MySQL to MariaDB and wanted us to confirm whether MariaDB is bug-free. Tragically we had to disappoint them with a negative answer. However we did assure them that the most important things are done correctly in MariaDB making it certainly worth migrating to.

Source: 10 reasons to migrate to MariaDB (if still using MySQL) – Seravo

10 reasons to migrate to MariaDB (if still using MySQL) – Seravo was last modified: July 13th, 2017 by Jovan Stosic

themes – How to make Qt programs look good under Xfce? – Ask Ubuntu

I use Xfce.

My problem is – some programs look nice and some sort of ugly. AFAIK this is because Xfce is GTK and most programs use GTK theme, but some programs use Qt and thus don’t use GTK themes.

So – my question is – How can I apply some theme to these Qt programs? Can I download some qt theme and drop into ~/.themes? would that work? Qt programs don’t have to look absolutely the same as GTK ones – I don’t care about that. But I want them at least not to look so ugly.:)

Source: themes – How to make Qt programs look good under Xfce? – Ask Ubuntu

themes – How to make Qt programs look good under Xfce? – Ask Ubuntu was last modified: July 13th, 2017 by Jovan Stosic

ESP8266

ESP8266

The chip first came to the attention of western makers in August 2014 with the ESP-01 module, made by a third-party manufacturer, AI-Thinker. This small module allows microcontrollers to connect to a Wi-Fi network and make simple TCP/IP connections using Hayes-style commands. However, at the time there was almost no English-language documentation on the chip and the commands it accepted.[2] The very low price and the fact that there were very few external components on the module which suggests that it could eventually be very inexpensive in volume, attracted many hackers to explore the module, chip, and the software on it, as well as to translate the Chinese documentation.[3]

The ESP8285 is an ESP8266 with 1 MB of built-in flash, allowing for single-chip devices capable of connecting to Wi-Fi.[4]

The successor to these module(s) is ESP32.

Features[edit]

* Both the CPU and flash clock speeds can be doubled by overclocking on some devices. CPU can be run at 160 MHz and flash can be sped up from 40 MHz to 80 MHz. Success varies chip to chip.

SDKs[edit]

In late October 2014, Espressif released a software development kit (SDK) that allowed the chip to be programmed, removing the need for a separate microcontroller.[5] Since then, there have been many official SDK releases from Espressif; Espressif maintains two versions of the SDK — one that is based on FreeRTOS and the other based on callbacks.[6]

An alternative to Espressif’s official SDK is the open source esp-open-sdk[7] that is based on the GCC toolchain. ESP8266 uses the Cadence Tensilica LX106 microcontroller and the GCC toolchain is open-sourced and maintained by Max Filippov.[8] Another alternative is “Unofficial Development Kit” by Mikhail Grigorev.[9][10]

Other open source SDKs include:

  • NodeMCU: a Lua-based firmware.
  • Arduino: a C++ based firmware. This core enables the ESP8266 CPU and its Wi-Fi components to be programmed like any other Arduino device. The ESP8266 Arduino Core is available through GitHub.
  • MicroPython: a port of MicroPython (an implementation of Python for embedded devices) to the ESP8266 platform.
  • ESP8266 BASIC: An open source basic interpreter specifically tailored for the internet of things. Self hosting browser based development environment.
  • Zbasic for ESP8266: A subset of Microsoft’s widely used Visual Basic 6 which has been adapted as a control language for the ZX microcontroller family and the ESP8266.
  • Espruino An actively maintained javascript SDK and firmware — closely emulating node.js. Supports a few MCUs, including the ESP8266.
  • Mongoose Firmware: An open source firmware with complimentary cloud service[11]
  • + https://github.com/SuperHouse/esp-open-rtos open RTOS.

Espressif modules[edit]

This is the series of ESP8266-based modules made by Espressif.

Name Active pins Pitch Form factor LEDs Antenna Shielded? Dimensions (mm) Notes
ESP-WROOM-02[12] 18 0.1″ 2×9 DIL No PCB trace Yes 18 × 20 FCC ID 2AC7Z-ESPWROOM02

In the table above (and the two tables which follow), “Active pins” include the GPIO and ADC pins with which you can attach external devices to the ESP8266 MCU. The “Pitch” is the space between pins on the ESP8266 module, which is important to know if you are going to breadboard the device. The “Form factor” also describes the module packaging as “2 x 9 DIL”, meaning two rows of 9 pins arranged “Dual In Line”, like the pins of DIP ICs. Many ESP-xx modules include a small on-board LED which can be programmed to blink and thereby indicate activity. There are several antenna options for ESP-xx boards including a trace antenna, an on-board ceramic antenna, and an external connector which allows you to attach an external Wi-Fi antenna. Since Wi-Fi communications generates a lot of RFI (Radio Frequency Interference), governmental bodies like the FCC like shielded electronics to minimize interference with other devices. Some of the ESP-xx modules come housed within a metal box with an FCC seal of approval stamped on it. First and second world markets will likely demand FCC approval and shielded Wi-Fi devices.

ESP8266 was last modified: September 25th, 2017 by Jovan Stosic

How do deactivate plymouth boot screen? – Ask Ubuntu

Lately, booting Ubuntu on my desktop has become seriously slow. We’re talking two minutes. It used to take 10-20 seconds. Because of plymouth, I can’t see what’s going on. I would like to deactivate it, but not really uninstall it. What’s the quickest way to do that? I’m using Precise, but I suspect a solution for 11.10 would work just as well.

Source: How do deactivate plymouth boot screen? – Ask Ubuntu

How do deactivate plymouth boot screen? – Ask Ubuntu was last modified: July 13th, 2017 by Jovan Stosic

Fix boot splash screen (Plymouth) on Ubuntu · One Transistor

Pymouth is the Ubuntu application that displays the graphical splash screen when booting and shutting down the system[1]. It is long known that it has problems with proprietary Nvidia drivers. While on some computers it starts in low resolution mode, on others it works in text mode. It is claimed that this happens because Nvidia drivers load at a later point and are not available for GRUB and Plymouth[2]. Usually, Plymouth uses KMS (Kernel Mode Setting) to display graphics, but with proprietary drivers you must configure it to use framebuffer instead[3].

Source: Fix boot splash screen (Plymouth) on Ubuntu · One Transistor

Fix boot splash screen (Plymouth) on Ubuntu · One Transistor was last modified: July 13th, 2017 by Jovan Stosic

Notes on using the ESP8266 with the Arduino IDE · GitHub

Using ESP8266 with Arduino IDE

Methods for getting ESP82666 support into the Arduino IDE

FTDI_Basic_Hookup_for_ESP-01.jpg

There are several ways you can get ESP8266 support into your Arduino IDE.

As of May 2015, I recommend using Arduino 1.6.4+ and taking advangtage of the contributed board support from the Arudino ESP8266 project, Sparkfun and others. That way lies the future.

Hooking up the ESP-01 module

The ESP-01 is probably the most common ESP8266 module available right now. No one is really happy with the breadboard-unfriendlypin setup, the lack of an integrated voltage regulator, the number of pins broken out (two GPIO pins only?!?), or the fact that the board isn’t FCC/CE certified. But it’s cheap, was first to market and what folks could get their hands on. Fortunately, new boards are coming on the market, such as the Adafruit HUZZAH ESP8266 breakout and the Sparkfun ESP8266 Things.

There are a bunch of resources for how to hook this board up for both bootloading and use, but they’re a little confusing. See the diagram showing the connection of a Sparkfun FTDI Basic 3.3v to the ESP-01 included in this gist for a basic hookup that will work for reading and programming the board (something like the Adafruit FTDI Friend would work almost the same; just be 100% sure it’s set up for 3.3v power or put a regulator into the circuit). In that ciruit, holding down the button while cycling power on the ESP-01 will put the board in bootloader mode so you can upload new sketches.

Some useful resources

Alasdair Allan has written a nice walkthrough of getting things up and running with an ESP-01. I found that this article really helped me get over some issues I was waving getting the Arudino environment to work with the ESP-01.

Adafruit has several tutorials for the ESP8266, using either the ESP-01 or their own HUZZAH ESP8266 breakout board.

Resources, Wikis & Forums

Other Development tools

Arduino IDE support for the ESP8266 is still pretty new and maybe a little unstable. And perhaps you don’t like the Arduino IDE. Here are some other tools you can use to program an ESP8266.

  • nodeMCU — Lua scripting for the ESP8266
  • esptool.py — a handy little utility for flashing the ESP8266. Really great, saved one of my boards (see the story below). Also check out this short video on how to use esptool to flash your ESP8266.
  • esptool-ck — confusingly, there’s a second tool called esptool. This is the one that’s bundled into the Arduino ESP8266 support (though there have some requests to change this to esptool.py)
  • esp-open-sdk — the preferred method for installing an ESP8266 toolchain, if you want something more low-level than Arduino
  • embedXcode — a template for embedded/microcontroller development for Xcode

A little story about frustration

Check out the footnotes for some updates to the story, and a more or less happy ending to this tale!

I ran into an issue with one of my ESP-01 boards while trying to install a sketch with the Arduino IDE. I had the board hooked up to my Mac using an Adafruit TTL USB serial cable, with the TX, RX and GND connected to the ESP-01 and the 5V disconnected. The ESP-01 was powered from a 3.3V regulator. The board was already set up to run a sketch loaded from Arduino, but wouldn’t flash, even though I had ground GPIO0 to put it into programming mode.

As it turns out, there may be an issue with using the TTL USB cable as a programmer1. I never did get it to work (at least not until I switched to using an FTDI cable and/or FTDI breakout). But somehow, during all this, I did get a partial flash and it screwed up the board. I could flash it with various sketchs, but it just wouldn’t work. Pulling out another ESP-01, I confirmed that my setup was fine; the new board accepted the sketches and ran as expected. So I figured I’d do some troubleshooting.

The best way that I’ve seen to diagnose issues on an ESP8266 board is to take a look at the bootloader messages. This is a little tricky, since the board boots with its UART set to a baudrate of 74880, which is non-standard. I first attempted to connect to the board using screen in the terminal, but it couldn’t handle the weird bit rate and I just got garbage. The solution was to pull out CoolTerm, create a baudrates.ini file so I could define the custom rate, then connect to the chip.

Lo and behold, something was indeed wrong!

After the standard checksums, the board was throwing an error, system param error, then dumping a bunch of hex code. Apparently I’d screwed something up during that bad flashing.

My first thought was to try the Arduino IDE again, but to no avail: the board accepted the uploaded program, then went right back to not working. It occurred to me that Arduino might not be flashing the board completely, so I decided to try another solution. I was going to install the ESP8266 toolchain and SDK again, and try building the AT firmware. Then I remembered that building the toolchain takes forever. Instead, I ended up grabbing the Electrodragon update to the AT firmware and the ever-useful esptool.py. Esptool is a little utility for flashing the ESP8266. It can do all sorts of nifty stuff, such as reading the MAC address of the chip, dumping its memory or flash to files, and uploading new firmware.

With these tools in hand, I was able to flash the board directly with the AT firmware. A quick restart and…

…everything worked. Yay!

After all this I was able to use the AT commands to talk to the board. And replacing that firmware with Arduino sketches started working again, too.

That’s my little tale. This whole thing cost me a few hours of frustration, first at the TTL USB cable, and then at the unflashable ESP-01. But now I’m wiser, using FTDI Friends to program my boards, and I know how I can restore a board to working order if this happens again. And I’ve written this all down, on the chance that it might help someone else solve a similar issue in the future.


  1. See this thread on the Adafruit forum regarding describing upload issues use the USB TTL cable. I should note that I’m using the older revision of the Adafruit USB TTL cable. According to the product page, the black-body version that I use has the PL2303HX chipset in it. It’s possible the newer version, with the PL2303TA chipset, works as an ESP8266 programmer. I’ll snag a newer cable next time I order from Adafruit. Update: Nope, the newer cable doesn’t make a difference. I’ve got some Adafruit HUZZAH boards on the way, based on the ESP-12 module; we’ll see if they work with the console cables
  2. Another update, and this one matters: the problem was a combination of the version of esptool (not esptool.py!) that ships with the Arduino IDE. For some reason or another, the serial console cable can’t be used to program the board. But if you switch over to esptool.py, it works like a charm.
  3. Update on 1/3/17: I was able to flash an ESP-01 module using a PL2303 serial console cable,on macOS Sierra with Arduino 1.8.0 and the mac-usb-serial PL2303 driver (which I find is much more stable than the offical Prolific driver, and worth the $).

Useful esptool.py commands

Reading the MAC address of the board

$ python ./esptool.py --port [serial port address] -b 115200 read_mac

Reading the flash ID

Gives some information about the current board setup

python ./esptool.py --port [serial port address] -b 115200 flash_id

Erasing the board

I found that doing this allowed me to re-flash the board after it got into some weird states

python ./esptool.py --port [serial port address] -b 115200 erase_flash

Flashing the board

Flashing an ESP8266 board with NodeMCU firmware (You can/should build your own firmware with NodeMCU custom builds)

python esptool.py -p [serial port address] write_flash 0x00 nodemcu_integer_0.9.5_20150318.bin -fs 32m -fm dio -ff 40m

Or here’s flashing it with the latest Electrodragon AT Command firmware

python ./esptool.py -p [serial port address] write_flash 0x00000 AI-v0.9.5.0\ AT\ Firmware.bin

Source: Notes on using the ESP8266 with the Arduino IDE · GitHub

Notes on using the ESP8266 with the Arduino IDE · GitHub was last modified: July 13th, 2017 by Jovan Stosic