Case for the GM328A Components Tester

By adminNo Comments

A “Case for the GM328A Components Tester” is now available. More details at Case for the GM328A Components Tester .

3D Printing, object

Prusa i3 Simple LCD Holder

By ctherouxNo Comments

A “Prusa i3 Simple LCD Holder” is now available. More details at Prusa i3 Simple LCD Holder .

3D Printing, object

Parametric Screw to Zip Tie Adapter

By ctherouxNo Comments

A “Parametric Screw to Zip Tie Adapter” is now available. More details at Parametric Screw to Zip Tie Adapter .

3D Printing, object

Customizable Small Linear Carriage

By ctherouxNo Comments

A “Customizable Small Linear Carriage Generator” is now available. More details at Customizable Small Linear Carriage .

3D Printing, object

Script to create a shared git project

By ctherouxNo Comments

This script creates a git project to be shared among the users of the Unix group $GIT_GROUP. Every git project will be created into the directory $REPOSITORIES_BASE_DIR.


# Base directory where the shared git project are.
# Group in which the user's of the repositories must be a member of

if [ $# -ne 1 ]; then
        echo 'Usage:' `basename $0` 'project-name'
        exit 1


git init --shared --bare "$PROJECT_NAME"
cd ..
find git/$PROJECT_NAME -type d | xargs setfacl -R -m d:g:$GIT_GROUP:rwX
sudo setfacl -R -m g:$GIT_GROUP:rwX git/$PROJECT_NAME
GIT, Linux, Ubuntu, Unix

VirtualBox fails on startup

By ctherouxNo Comments

Result Code: NS_ERROR_FAILURE (0x80004005) / Kernel driver not installed (rc=-1908) are the errors displayed when the kernel driver needs to be recompiled. It usually happens when updates to Ubuntu are installed.

The kernel driver can be recompiled by issuing one the following commands:

sudo /etc/init.d/vboxdrv setup


sudo /sbin/rcvboxdrv setup

The former one works for Ubuntu versions prior to Ubuntu 16.04. If the first one is not found on your system, try the second one.

Ubuntu, Virtual Box

Port forwarding using SSH

By ctherouxNo Comments

SSH port forwarding let you connect to a server using another server a relay.

For example, if you host a web server in a DMZ behind your office router, you will not be able to access it using its public URL if your workstation is behind the same router.

You can easily implement a workaround if you have access to a server on the Internet. Issue this command on one of the machines connected on the same network as your workstation.

ssh -fN -t -C -D


  • is the address of the machine that will accept connections from your LAN on port 2080.
  • is the machine on the Internet that will establish connections to the final destination

You may need to add the port number on which listen to using the -p option. If SSH listens to port 8787 on, the command would be:

ssh -p 8787 -fN -t -C -D

You may also need to supply a user name to connect to The command would then look like:

ssh -p 8787 -fN -t -C -D

You can use this setup with a browser if you configure it to use a proxy to connect to the Internet. For example, access the proxy configuration of Firefox: preferences >> advanced >> network >> settings. Choose Manual proxy configuration and fill-out the SOCKS host parameters.

SSH Port Forwarding

The result will be that Firefox will open the URLs you type-in using the server

SSH, Ubuntu, Unix

Reset Unity Top Menu Bar Widget Panel

By ctherouxNo Comments

Sometimes, widget disappears from the Top Menu Bar Widget Panel of Unity. The Widget Panel can be reset using the following command:

killall unity-panel-service
Ubuntu, Unity

Make Linux use the hardware clock set to local time

By ctherouxNo Comments

Ubuntu sometimes assumes that the hardware clock of the computer is set to GMT. If the hardware clock is set to local time, set UTC=no in /etc/default/rcS.

Linux, Ubuntu

Move and secure the MySQL data directory

By ctherouxNo Comments

By default, the data directory of MySQL is /var/lib/mysql. This can be a security issue, especially on a laptop. If your home directory is encrypted, you can easily secure you MySQL data. Backup you data before using this information. Read the procedure until the end before doing anything.

First, follow these steps to move the data directory of MySQL.

  1. Stop MySQL.
  2. sudo service mysql stop
  3. Copy the current database to its new location /home/yourhomedir/mysql.
  4. sudo mv /var/lib/mysql /home/yourhomedir/
  5. Create a link to prevent issues with innoDB tables
  6. ln -s /home/yourhomedir/mysql /var/lib/mysql
  7. Change the value of datadir in the file /etc/mysql/mysql.conf.d/mysqld.cnf for your new data directory location /home/yourhomedir/mysql
  8. Modify the two occurences of /var/lib/mysql with /home/yourhomedir/mysql in /etc/apparmor.d/usr.sbin.mysqld
  9. Reload apparmor
  10. sudo service apparmor reload

If you moved the MySQL data directory to an encrypted home directory, you will need to perform these supplementary steps.

  1. Disable MySQL from starting at system boot.
  2. sudo update-rc.d mysql remove
  3. Add MySQL to the group related to the user that owns the encrypted home directory
  4. sudo usermod -a -G yourhomedir mysql
  5. Change the permissions of the encrypted directory
  6. sudo chmod 750 /home/yourhomedir

In this scenario, you will need to start MySQL after you logged on and shut it down before loggoff which include shutting down the system. To start mysql, use the following command:

sudo service mysql start

To stop MySQL, use the following command:

sudo service mysql stop

If everything works fine, you can remove the original MySQL data directory using this command:

sudo rm -fr /var/lib/mysql
Linux, MySQL, Ubuntu

hwclock: ioctl(RTC_RD_TIME) to /dev/rtc to read the time failed: Invalid argument

By ctherouxNo Comments

This error occurred on Raspbian Jessie using an ARPI600. I was trying to set up the real-time clock. I could resolve the issue by running the following command:

hwclock --systohc -D --noadjfile --utc

after enabling it with the command

echo pcf8563 0x51 > /sys/class/i2c-adapter/i2c-1/new_device

0x51 may differs on you installation. Run i2cdetect -y 1 to find the right value.

ARPI600, Raspberry PI, Raspbian

Extrusion Rail Customizable Fastener

By ctherouxNo Comments

A “Extrusion Rail Customizable Fastener” is now available. More details at Extrusion Rail Customizable Fastener .

3D Printing, object

Customizable Linear Carriage Generator

By ctherouxNo Comments

A “Customizable Linear Carriage Generator” is now available. More details at Customizable Linear Carriage Generator .

3D Printing, object

Fix “The Update Information Is Outdated”

By ctherouxNo Comments

Sometimes, the message “The Update Information Is Outdated” is displayed when you click on a red warning red icon in the status bar. It happened to me last week. This time, it was caused by a Google Chrome update that failed. First, open a terminal (Control + Alt + T) and run the command

sudo apt-get update

If you get an error message related to Google, you can fix it by editing the /etc/apt/sources.list.d/google-chrome.list file. You can do so by issuing the previously opened terminal window

sudo gedit /etc/apt/sources.list.d/google-chrome.list

Make sure that the repository line looks like

deb [arch=amd64] stable main
Ubuntu, Ubuntu 14.04, Ubuntu 15.04

Parametric utility box

By ctherouxNo Comments

A “Parametric Utility Box” is now available. More details at Parametric utility box .

3D Printing, object

Maximum Frequency of a ESP8266 – Revisited

By ctherouxNo Comments

The ESP8266 can yield a 163 kHZ wave using the Arduino IDE and writing the code in C.  The code used is:

int pin = 5;
void setup() {
  pinMode(pin, OUTPUT);
void loop() {
  digitalWrite(pin, HIGH);
  digitalWrite(pin, LOW);

Nevertheless the wave form is far from being square as show on the picture below.  Click on the picture to enlarge it.

ESP8266 generated wave In C

By adding a 5 uS delay, we get a pretty good square wave.  The frequency is then 85.6 kHZ.  The code used is:

int pin = 5;
void setup() {
  pinMode(pin, OUTPUT);
void loop() {
  digitalWrite(pin, HIGH);
  digitalWrite(pin, LOW);

The yielded wave form is given below.  Click on the picture to enlarge it.

ESP8266 generated wave In C with correction

The frequency is 60 times higher than running a similar code on the ESP8266 with NodeMCU.

ESP8266, Internet of Things, IoT

Maximum Frequency an ESP8266 can yield

By ctherouxNo Comments

An ESP8266 running NodeMCU can yield maximum frequency of 1.44 kHz with a duty cycle of 61%.  The wave form is given below.  The code used to perform this test is:

pin = 8
gpio.mode(pin, gpio.OUTPUT);
while true do
 gpio.write(pin, gpio.LOW)
 gpio.write(pin, gpio.HIGH)

Without clearing the watch dog (tmr.wdclr), the device can yield a frequency of 1.84 kHz.  Without clearing the watch dog, the device reboots after a few seconds.

ESP8266 Wave Form

Click on the picture to enlarge it.

ESP8266, Internet of Things, IoT, NodeMCU

Interrupt NodeMCU init.lua

By ctherouxNo Comments

It can be sometimes challenging to regain control of the NodeMCU running on a ESP8266 when init.lua has a tight loop in it.  To do so,  first, download from GitHub.

Execute the following command

python --port /dev/ttyUSB0 --baud <baud-rate> erase_flash


<baud-rate> is the baud rate of the connection between the ESP8266 and your PC.  Typically, 9600.

<serial-port> is the serial port the ESP8266 is connected to.  Typically,  /dev/ttyUSBn on Linux.

After having done this, you will need to re-install NodeMCU.  It can be done using the following command:

python --port /dev/ttyUSB0 --baud <baud-rate> 
     write_flash 0x00000 <nodemcu-path>


<baud-rate> is the baud rate of the connection between the ESP8266 and your PC.  Typically, 9600.

<serial-port> is the serial port the ESP8266 is connected to.  Typically,  /dev/ttyUSBn on Linux.

<nodemcu-path> is the filename an path of the NodeMCU image.  Example: ../nodemcu_float_0.9.6-dev_20150704.bin

ESP8266, Internet of Things, IoT, Linux, NodeMCU

ESP8266 Resources Page

By ctherouxNo Comments

I have written a page that contains many useful links about the ESP8266 platform.  You can display this page either using the top menu option “ESP8266 Resources” or by cliking on this link.

ESP8266, Internet of Things, IoT, NodeMCU

ESP8266 – Remarkable free book

By ctherouxNo Comments

NodeMCU LUA base ESP8266 Development Kit

A remarkable book about the ESP8266 is freely available.  It can be downloaded from Kolban’s book on the ESP8266.  It contains more than 300 pages of information.  This book is a very good overview of the technology and a great starting point if you want to develop around this device.

Table of Contents

  • Introduction
  • Overview
  • Connecting to the ESP8266
  • WiFi Theory
  • AT Command Programming
  • Assembling circuits
  • Programming
    • Boot mode
    • The ESP8266 SDK
    • Compiling
    • Linking
    • Debugging
    • Architecture
    • WiFi at startup
    • Working with WiFi
    • Working with TCP/IP
    • ESP-NOW
    • Working with I2C
    • Hardware SPI
    • Working with serial
    • Task handling
    • Timers and time
    • Working with memory
    • Working with flash memory
    • Pulse Width Modulation – PWM
    • Analog to digital conversion
    • Sleep modes
    • Watchdog timer
    • Security
    • Mapping from Arduino
    • Partner TCP/IP APIs
    • Programming using Eclipse
    • Programming using the Arduino IDE
    • Programming with JavaScript
    • Programming with Lua
    • Programming with Basic
    • Integration with Web Apps
    • Mobile apps
    • Sample Snippets
    • Sample applications
    • Sample Libraries
    • Reference materials
    • C++ Programming
    • Simple class definition
    • Lambda functions
    • Ignoring warnings
    • Eclipse
    • ESPFS breakdown
    • ESPHTTPD breakdown
    • Makefiles
    • Forums
    • Reference documents
    • Github
    • SDK
  • Heroes
  • Areas to Research
ESP8266, Internet of Things, IoT, NodeMCU
Blue Taste Theme created by Jabox