Review “Building an IoT Node for less than 15 $”

In this article I am going to review the book ”Building an IoT Node for less than 15 $” by Claus Kühnel.

TL;DR

Building an IoT Node for less than 15 $
Building an IoT Node for less than 15 $

“Building an IoT Node for less than 15 $” is the book I wish I had had when I started my endeavor into the IoT/ESP8266/NodeMCU world in May 2015. I covers everything you need to know to get you started even if you don’t have a any prior experience in electronics or low-level programming (firmware, C/C++ etc.). It teaches you a bit about the chip and modules equipped with it, gives you a Lua primer and contains lots of helpful examples.

The book is available in paperback for the DACH region (or CreateSpace for international) and for the Kindle.

Disclaimer

There are a few things you should know upfront:

  • I’m not associated with the author in any way. Even though we both live less than an hour apart in a small country we don’t know each other, we never met.
  • I wasn’t asked to write this review. Instead I contacted the author and offered to write it. The author sent me a free copy of the book by mail in return.
  • The author’s blog and mine have a few kickback-free cross references to each other.
  • This is my first book review. I’ve go no clue how to do that “properly” but simply follow my instincts.
  • The review is based on the 1st revision of the paperback version of the book.
  • I had no idea my NodeMCU custom build service at http://nodemcu-build.com/ would be featured in the book so prominently.
  • I’m one of several community members who currently maintain the NodeMCU firmware project on GitHub.

With that out of the way let’s dig right in.

Format

I assume the book was written on some kind of self-publishing platform (softcover.io et.al.) and then published from this common base to two output formats (paperback & Kindle). This must be a low-cost process as both versions are fairly cheap, between $10 and $12 I believe.

The book is in English. So, kudos to the author for writing a book in a non-native language. As I’m obviously not an English-nativ either I shouldn’t even be commenting on that. Yet…the only thing that really bothers me about the language in that book is that to talk about the average person the author consistently choose “one” over “you”. While both are grammatically correct it sounds really odd if you overdue it. How about “If one wants to build a customized NodeMCU firmware for the ESP8266, then one can compile the firmware by oneself, or one can use…”? I feel that for technical books the less formal “you” would be more appropriate.

The paperback is a 6″ x 9″ black & white book of roughly 170 pages. Nice pocket size and rather light, I like that.

The missing color is quite a drawback because all the photos of chips, modules and peripherals look a lot less lively. It also means that all the code examples are a bit less legible due to missing syntax highlighting. On the other hand pretty much every tech book I own is in black & white, it’s normal.
I’ve never read an eBook so I can’t judge how that would be different.

Also, the layout is absolutely minimal – no fluff, just stuff. This being a kind of self-made on-demand book it’s of course no surprise it doesn’t look as polished as books from O’Reilly, Manning, or Addison-Wesley to name a few. Again, no big deal. “Form follows function” is a mantra that’s dear to me.

The publishing platform doesn’t seem to handle cross references (i.e. “links”) very well. Rather than placing HTTP URLs inline with the text it should have created foot notes for them. Legibility of the content could thus be greatly improved. I find the three following random samples very irritating.

Inline URLs don't allow for smooth reading.
Inline URLs don’t allow for smooth reading.

In my opinion it doesn’t really help that throughout the book the Google URL shortener is used for most URLs. Inline URLs just break the flow no matter how short they are.

For a clearer structure each top-level chapter should start on a new page. This isn’t always the case.

Structure & TOC

“Building an IoT Node for less than 15 $” starts off with an IoT primer labeled “Preface” (that isn’t even listed in the TOC). It’s really short and can easily be skipped. I personally didn’t find anything useful in there. It mixes everything from Gardner IoT figures to conventions used in the book.

Chapter 2 introduces the ESP8266 SoC. It’s really helpful it doesn’t just list its features and characteristics but goes on to list all “bare-bone” modules and to describe many development boards that embed the ESP8266. The chapter is somewhat related to my very popular blog post “Comparison of ESP8266 NodeMCU development boards”.

Chapter 3 describes the various ways in which the ESP8266 can be programmed (SDK, Arduino, NodeMCU/Lua). As the book focuses on NodeMCU it’s nothing but logical that the next chapter is dedicated to the Lua scripting language. Rather than starting with the real basics the author points to good Lua introduction material and focuses on some Lua quirks instead which are important to grasp in oder to understand all the example code in later chapters.
As a Lua newbie I can’t judge on the correctness of the content but I can say that I find chapter 4 very valuable. Also, by now most readers will have realized that the author is really good at presenting possibly complicated technical material in an easy to follow manner. As a NodeMCU committer I’m thankful “Building an IoT Node for less than 15 $” has a dedicated Lua chapter to talk about the event-driven asynchronous NodeMCU programming model. This can be a real pitfall for beginners.

The very short chapter 5 briefly describes a few software tools you need to flash firmware to the ESP8266 and to upload code to it. Particularly non-Windows users might feel a bit at loss because no non-Windows tools for flashing firmware are discribed. I think the NodeMCU documentation has a more helpful collection of tools and practices as for how to build & flash firmware and to upload code.

Once readers arrive at chapter 6 “NodeMCU Applications” they should be well prepared to follow and understand the wealth of small real-world applications. That’s essential because chapter 6 alone makes up for more than half of “Building an IoT Node for less than 15 $”.

Sample Projects

The applications and snippets in chapter 6 are extremely helpful because they’re based on real-world use cases. All Lua scripts are well documented and are freely available on the author’s SourceForge account.

For someone without a background in electronics like myself chapter 6.2 “Connecting Peripherals” is super interesting. You get an introduction into protocols like 1-wire and I²C, learn about digital and analog input/output, and familiarize yourself with OLED displays and LED strips. Those are all building blocks for the sample projects.

The sample projects are anything but dry theory, they’re actually cool to re-implement yourself with the guidance of the author’s code. What you’ll learn:

  • Build a HTTP webserver for NodeMCU. If you’re unfamiliar with how web servers work this is a good intro but if you intend to actually run an NodeMCU web server I suggest you use a dedicated project by Marcos Kirsch.
  • Data exchange via dweet.io, an IoT messaging platform.
  • Publish/subscribe over MQTT (using the hosted broker CloudMQTT), a very light-weight messaging protocol specifically designed for constrained devices.
  • Integrating your ESP8266 into IFTTT.

CAUTION: the author explicitly states on which NodeMCU version the sample code depends and most were tested on ancient versions from spring/summer 2015 (0.9.x). As the NodeMCU team has long stopped supporting those versions I strongly suggest you stay away from them. Most of the code presented in the book should run fine as-is on current versions.

Conclusion

As I wrote in the introductory TL;DR paragraph I whole heartedly recommend “Building an IoT Node for less than 15 $” to anyone who starts with ESP8266 and NodeMCU. It covers all relevant topics and the author does so very logically and systematically. The explanations are easy to follow and “things make sense”.

The only thing that I really dislike are the inline URLs which should be printed as foot notes instead in paperback books. I’m quite sure they render find, though, in the Kindle version.

Leave a Reply