December 14, 2017

Python 3 virtual environments

As I have been trying to learn Python by dabbling with voice recognition and home automation project, it has become obvious that I had to familiarize myself with virtual Python environments. The principle is not difficult, but I ran into practical problems. This post, more than two weeks in the writing, describes how I now manage and use virtual environments on three different Debian based Linux distributions. [...more]

October 17, 2017

HTTPS, HTTP and GTML

Since the end of May, the company hosting my website has been providing SSL certificates (OpenSSL from cPanel.inc). The site can be browsed securily with the HTTPS protocol. That should inspire confidence; the little green padlock is now visible in the address bar. There was a catch, the style files and images were no longer found when viewing files in sub-directories. A solution had to be found. [...more (in French)]

September 11, 2017

A Better ESP8266 Loop Watchdog and Better Recovery

This post continues with improvements to the third loop watchdog introduced in the previous post. But most importantly, it provide a useful technique to recover in a hands-off way to watchdog timeouts and exceptions. [...more]

August 28, 2017

Arduino Sketch Managed ESP8266 Watchdog

Adding a third watchdog is a good idea for some ESP8266/Arduino based projects. That's because it is very easy to write code that feeds the built-in watchdogs but nevertheless goes off the deep end. The task of this watchdog is to ensure that the Arduino loop is executed regularly. [...more]

August 26, 2017
Updated: August 27, 2017

ESP8266 Watchdogs in Arduino

While the hardware and software watchdog timers of the ESP8266 are essential, they are not sufficient to ensure the kind of reliability needed in an IoT device. In a future post, I will discuss how to implement yet a third watchdog to further improve the dependability of the firmware programmed into this chip. In the mean time, I thought it would be useful to discuss watchdogs in general and to delve into some of the details of the ESP8266 watchdogs. [...more]

March 14, 2017

Translating Console Applications in Free Pascal

Lately, I noticed that DefaultTranslator and LCLTranslator cannot be used to select a language in a console applications. They pull in the complete LCL package and the SetDefaultLang wants to translate all of the forms in the project even as there are none. So I decided to rip out the form updating code in LCLTranslator and to save that modified version in a unit called UnitTranslator [...more].

I found this out when looking at the tcalc demonstration program for my simple parser. I have updated that project accordingly [...more]

January 30, 2017

NodeMCU, MQTT and Domoticz - part 2

This post continues the exploration of NodeMCU, MQTT and Domoticz begun on the 15th and 17th of January. The subject is how to subscribe to MQTT messages in NodeMCU so as to perform a task based on messages published by other devices to the MQTT broker. In particular a virtual switch in the home automation software will set the WeMos D1 Mini LED on or off [...more]

January 21, 2017

Wemos D1 mini and NodeMCU - reworked

The January 15th post has been reworked slightly to better explain the work flow when using NodeMCU with command line tools. In particular, setting the baud rate correctly makes for a smoother experience [...more]

January 17, 2017

NodeMCU, MQTT and Domoticz - part 1

This post continues with the previous one. In it I show how to establish a WiFi connection and how to update a device (a temperature sensor) in the home automation software Domoticz. This is done in two ways: using an MQTT broker and directly using an HTTP request [...more]

January 15, 2017

Wemos D1 mini and NodeMCU

When I purchased my first ITEAD Sonoff WiFi switches, I also got a Wemos D1 mini board. I thought using a ESP8266 development kit would be a good way to prepare for hacking the switches. In this post, I relate how I learned to program the ESP8266 using a tool chain made up of NodeMCU firmware and Python command line utilies: esptool, nodemcu-uploader and miniterm. [...more]

August 30, 2016

Conversion of measurement units

Free Pascal's run time library contains Delphi compatible units ConvUtils and StdConvs. Unfortunately, both units contain a few errors. Lately, I have attempted to fix the code and hope to eventually submit these corrections for inclusion in a future version of the compiler [...more]

July 13, 2016

One Pass Mathematical Parser

While porting code to FreePascal/Lazarus, I have made some changes changes to the mathematical expression parser I initially wrote in Delphi. The one pass parser for Free Pascal is complete, so is the documentation [...more]

July 6, 2016

List Separator in Linux

There is no default list separator in Linux. In that case, what value does Free Pascal assign at startup to the ListSeparator field of the DefaultFormatSettings? The short answer is that the list separator is the comma ‘,’ as used in the USA and it is not adjusted according to the user’s locale. That is not always acceptable [...plus]

April 4, 2016

Free Pascal/Lazarus gotchas

After running into yet another small difference between Free Pascal/Lazarus and Delphi, I decided to write up a few of these gotcha's. They have to do with assigning procedural types and event handlers, calling a function without parameters using a procedural variable, and the rather similar problem of recursion of functions without parameters. I have also covered the creation of Debug and Release build modes and the addition of DEBUG and RELEASE symbols in the appropriate build mode [...more].

January 27, 2016

Sliderbars - Part 2

Two new components have been added to the package discussed on the 24th. The first, called TSliderPlane, is a two-dimensional version of TSliderBar. The second component is called TColorPlane. It is very specialized, showing any plane in the RGB cube. It can be used to build a colour selector with just two or three lines of code. [...more]

January 24, 2016

First Lazarus component: sliderbars

My first components for Lazarus, slider bars, , are now available. They can be used to make an RGB colour selector dialogue. See how simple it can be in the second demonstration program included in the archive. [...more]