Skip to main content

Posts

Showing posts with the label mongoose-os

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 2 (ESP32 and Mongoose OS setup)

There are many ESP32 form factor breakout boards that can be purchased cheaply. In this mini project, I am using a form factor that looks like Wemos D1 Mini, so that I can reuse my shield without any wiring. Although no wiring is required, the pinout is different from Wemos D1 Mini. The DHT11 GPIO is 16 in ESP32 instead of 2 (note that Mongoose is using port pin definition. in Arduino, it is defined as D4 but it is mapped IO2).   ESP32 mini board is quite warm when in operation. I have put a dummy shield in between to reduce the interference it may cause to the DHT11 temperature reading. The source code for the mongoose-os javascript can be found on  github . The setup of Mongoose OS is straightforward. Go to  Mongoose  site and download the binary, select the board type and change the init.js. Part 1 Using Google App Scripts to collect telemetry data

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