Skip to main content

Posts

Two routers configuration for Smart Home

When setting up the smart home system using WIFI as the core network infrastructure, it is important to split the surfing traffic and smart home traffic. This will ensure that the smart switches respond timely.  For my smart home setup,  I have used  2  Asus routers (RT-AC1200G+ & RT- AC68U), one is configured as the main the other configured as the slave. There is no reason why a particular model is chosen as it is based on what I have on-hand but it is better to have dual-band routers because I will have 4 separate bands (Two 5Ghz and two 2.4 GHz) of network bandwidth. The router is configured as a Master-slave mode with different subnets and network route is added to make sure that the traffic can flow both ways.  The smart switches are all connected to a dedicated 2.4 GHz bandwidth and the remaining 3 bands are for normal surfing. For normal surfing, in order to the client devices to automatic connect to the strongest signal frequency...

A simple ESP-01 USB adapter with toggle switch for reprogramming

ESP-01 is a simple ESP8266 module which can be purchased cheaply from Aliexpress. At one of promotion, I purchased an ESP-01 for just S$1.97. That's very cheap for a wifi enabled microcontroller. An ESP-01 can be a WIFI bridge for non-connected microcontroller such as Arduino UNO, Mega, Nano etc. Communication between the microcontroller can be done using the serial link between them. I have written a post on this using ESP-Link to connect to an Arduino Pro Mini. Together with the client library provided, the Pro Mini can easily transfer sensor data via MQTT. http://iotdiary.blogspot.sg/2017/09/using-esp-link-transparent-bridge.html For the most part, once the firmware is in place, normally I will use OTA to update. Sometimes, I wanted to reuse the same controller for another firmware and I have rewired up the controller for reflashing. This makes it very inconvenient to use. Recently, I bought a USB ESP-01 adapter thinking that my problem is solved. When I received it and r...

Google Cloud IoTCore with UDOO Quad

UDOO Quad is a maker SBC board from UDOO . It has a built-in Arduino microcontroller and can run Linux on the SBC. On the web, most of the Google IoT Core samples have been focused using Mongoose OS and I have written a post on " Journey into Google Cloud IoT Core with ESP8266 and Mongoose OS ". Recently, Google releases code samples which make the initial handshaking with Cloud IoTCore simpler.  For UDOO, the tedious part is to get all supporting tools to work with a particular version of Linux Distribution. UDOO supports a few Linux distributions (Ubuntu, Debian and others). I have installed Ubuntu and the current version supported by UDOO is 14.04 LTS. For this demo, I wanted to work on Python 3.5 and I have compiled the Python from source. This is step may not be necessary if you use the version that is installed (Python 3.4). The idea for this project is to read the temperature and humidity reading from UDOO Arduino side, transfer the data to Linux side and forward t...

Using ESP-Link transparent bridge (ATmega2560+ESP8266 board)

I have found this interesting board selling on Aliexpress website. It is an Arduino Mega 2650 with a built-in ESP8266 which allows the Mega to connect to wifi. This board has cut down a lot of wiring and bring out interesting possibilities. One of this is to connect up both the microcontrollers using ESP-link firmware. I have an earlier blog post  that described how to wire up an ESP-01 and Arduino Pro Mini. One of the tricky parts in this setup is the sequence of flashing the ESP firmware. Flashing the onboard ESP8266 requires some setting changes to the dip switches. The following are the sequences which I get both the microcontrollers to talk to each other. Set the jumper 5,6,7 to ON and the rest OFF. This will set the ESP to update mode. I am using version 3.0.14  and flashed the ESP using the following parameters: esptool --port com26 --baud 230400 write_flash -fm dio -fs 4MB -ff 80m 0x0 boot_v1.6.bin 0x1000 user1.bin 0x3fc000 esp_init_data_defa...

Import CSV file from Google Drive to Big Query

I have written about using  App Scripts to collect telemetry data  and the ease of integrating it to Google Sheet to chart the temperature and humidity reading. In this post, I shall describe the approach using a CSV uploaded via Google File Stream and a scheduled job which is written in App Script to load the data into Big Query. This approach is very good for integrating the transactional capability of ERP system and the Analytics capability of Visualisation system (Data Studio). ERP system has rich built-in business process workflow and transactional control, When performing Dashboard and Data Analytics functionality, it will slow down the entire system. In this case, it may be better for analytics features to be performed by another system. Fortunately, most ERP system is capable of auto execute a query to export CSV data. I have made use of this capability to import the daily files generated by ERP to Big Query via Google Drive. This CSV file is picked up by an App Scri...

Source Control for Google App Scripts

[update 30 May 2019: This post has been outdated. Google has released  clasp  which allows the development of app script locally] Google App Script (GAS) is a very versatile tool for writing scripts to control many of the GSuites and Google Cloud services. One can build many small applications using GAS and hosts it seamlessly on Google Drive for free. It has a built-in editor, debugging tool and logging of logs to StackDriver. The main drawback I had with GAS is the difficulty to create save the scripts to source control like Github. Fortunately, danthareja  shared his tools to read/write app script into GDrive seamlessly, but the script has a limitation, it can only handle a single project. This is because it is writing the OAuth information into %UserProfile%\.gapp . I wrote a simple wrapper script pull.bat and push.bat that synchronous the App Script.  pull.bat copy .gapps %UserProfile%\.gapps gapps init [REPLACE YOU PROJECTID] -o C...

Journey into Google Cloud IoT Core with ESP8266 and Mongoose OS

Google recently take the IoT Core to Public Beta. IoT Core is one of the product lines of Google entry to the IoT arena. It is a device registry for controlling and tracking the IoT devices. On top of this, it provides connectivity to the rest of the Google services. Below is the standard diagram provided by Google for the IoT Core. As we can see, there are 10 big parts in this entire chain (including the edge devices). Some parts are more complicated than the others. For this article, I will start the journey by exploring the following path. I will be using an ESP8266 running on the Mongoose OS because Mongoose OS has native support for Cloud IoT Core. This will reduce the work required to perform the authentication between the device and the IoT Core. ESP 8266 & Mongoose IoT Core setup Mongoose OS website has a set of setup instructions  on configuring the devices to connect to IoTCore. The Mongoose OS example stopped at when the message is successfully del...