Weekend Reads [2016/06/04]

This week we have a couple of hardware projects at the front of our queue, so you might want to switch your soldering iron on to heat up now.

Finally, here’s a teaser from a high-school in Spain where they are using cascaded ESP8266’es (rather than mesh networking).  I class it as a teaser because there’s an explanation and a video (in Spanish), but no code or example configs that I can see (updates welcome in the comments section, below).


More SDK Strangeness

Recently I read a post on the ESP8266 forum where the author was attempting to use the powf() function call, but running out of memory during compile.  That sounded very familiar to me, as I’ve been experimenting with the DS3231 RTC clock module recently (inside an MQTT application) and found that if I tried to use any of the standard “time.h” library functions, such as gmtime() or localtime(), my compile would also bomb with the infamous “iram1_0_seg” out-of-memory errors.  This would happen no matter how many struct tm‘s worth of memory I freed up in the code, to the point where using time.h calls from within MQTT seemed to be an unworkable combination, even with the eagle.app.v6.ld modifications for .literal. and .text. storage.

I don’t have a “silver bullet” answer to this problem (and, so far, according to the thread referenced above, neither does anyone else), but the latest SDK (V1.2 as of the time of writing) does seem to help, although not enough for most people, including me (see page 2 of the thread).  In the end I modified a cut-down version of an Arduino C++ time.h lookalike (mem’s Arduino Playground Time.h) to add the functionality I wanted and still have memory left over for other things.

Kudos to mem for the original Arduino Time.h and my apologies for the terrible,  slash-and-burn mess I’ve made of it.  Gomen-ne!  My exceedingly ugly versions are available here for anyone who is really, really desperate:-  ESP8266/time.h_hacks



More, Useful C Code For The ESP8266

Richard Burton has a new-ish blog with some interesting, clock related stuff.  Half of the blog is devoted to his restoration of an actual, mechanical turret clock and the other half is a very nice collection of his C code for the ESP8266, mainly related to the DS3231 RTC.  As well as the driver for the DS3231 (and the EEPROM usually found on the same PCB with these devices), he also has a simple NTP client (for setting the time) and timezone support.

Definitely worth a visit!