Skip to main content

Posts

Showing posts with the label Google

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...

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...

Using Google App Scripts to collect telemetry data - part 1

This is one of Google best-kept secrets, Google App Script (GAS). GAS is a Javascript engine that can link various Google front and back end services together. e.g. Periodic scanning a GDrive folder, detect a CSV file and insert into MySQL. The best part of this, it is FREE !!! Having said that, is there a limit? Yes, there is.  Quotas for App Scripts In the next few articles, I am going to demonstrate how we can collect the IoT data into Google Sheet and dynamically visualise the data using Google Sheet and/or Data Studio. For this simple demo, I will use an ESP32 and runs Mongoose OS to act as the bridge between GAS and local MQTT server and send temperature/humidity data from DHT11 to Google Sheet. As written in my previous article on  Mongoose OS , the connectivity aspect of Mongoose is very powerful. it provides simple and easy to use Javascript APIs which glued the underlying C/C++ library. To read the sensor value and to Google Apps Script, it needs less than 20...

Mongoose OS

Recently I was experimenting on the  Mongoose OS . It is an open source IoT platform for developing applications on ESP32, ESP8266, STM32, TI CC3200 and TI CC3220 microcontrollers. It supports a simplified version of Javascript (mJS) and C/C++ as the development language for calling the OS APIs. What are the features that impressed me? 1. Installation There is only 1 executable. (mos.exe) to be downloaded. Just clicked on the EXE and the web based IDE is displayed. Then I connect up ESP32 using the selected serial port, flashed the firmware and connect to my WIFI network. That's it! The MCU is setup! Amazingly simple. 2. Connection to MQTT After the initial setup, the connection to MQTT is only a few clicks away and the ESP32 is setup to send/receive message from MQTT server. Zero code for this entire process. Super impressed!! Publishing to the MQTT is only a single line of code. load('api_mqtt.js'); let topic = 'myesp32/topic'; let...