Archive

Posts Tagged ‘esp8266’

A Day at Chiang Mai Maker Party 4.0

December 6th, 2017 6 comments

The Chiang Mai Maker Party 4.0 is now taking place until December 9, and I went there today, as I was especially interested in the scheduled NB-IoT talk and workshop to find out what was the status about LPWA in Thailand. But there are many other activities planned, and if you happen to be in Chiang Main in the next few days, you may want to check out the schedule on the event page or Facebook.

I’m going to go though what I’ve done today to give you a better idea about the event, or even the maker movement in Thailand.

Click to Enlarge

Booth and activity area should be the same over the 4 days, but the talks, open activity, and workshop will be different each day. Today, people could learn how to solder in the activity area.
The even was not really big with manufacturers/sellers like ThaiEasyElec, INEX, or Gravitech closer to the entrance…


… and slighter higher up in a different zone, companies and makers were showcasing their products or projects. I still managed to spent 5 interesting hours at the event attending to talks and checking out the various projects.

I started my day with a talk entitled “Maker Movement in South East Asia” presented by William Hooi, previously a teacher, who found One Maker Group and setup the first MakerSpace in Singapore, as well as helped introduce the Maker Faire in Singapore in 2012 onwards.


There was three parts to talk with an history of the Maker movement (worldwide), the maker movement in Singapore, and whether Making should be integrated into school curriculum.
He explained at first the government who not know about makers, so it was difficult to get funding, but eventually they jump on the bandwagon, and are now puring money on maker initiative. One thing that surprised me in the talk is that before makers were hidden their hobby, for fear of being mocked by other, for one for one person doing an LED jacket, and another working on an Iron Man suit. The people around them would not understand why they would waste their time on such endeavors, but the Maker Space and Faire helped finding like minded people. Some of the micro:bit boards apparently ended in Singapore, and when I say some, I mean 100,000 units. Another thing that I learned is the concept of “digital retreat for kids” where parents send kids to make things with their hands – for example soldering -, and not use smartphone or tablets at all, since they are already so accustomed to those devices.

One I was done with the talk, I walked around, so I’ll report about some of the interesting project I came across. I may write more detailed posts for some of the items lateron.

Click to Enlarge

Falling object detection demo using OpenCV on the software side, a webcam connected to…

Click to Enlarge

ASUS Tinker board to handle fall detection, and an NVIDIA Jetson board for artificial intelligence. If fall is detection an alert to send to the tablet, and the system also interfaces with Xiaomi Mi band 2.

Katunyou has also made a more compact product, still based on Tinker Board, for nursing home, or private home where an elderly may live alone. The person at the stand also organizes Raspberry Pi 3 workshops in Chiang Mai.

I found yet another product based on Raspberry Pi 3 board. SRAN is a network security device made by Global Tech that report threats from devices accessing your network using machine learning.

Click to Enlarge

Nordic Technology House showcased a magic mirror based on Raspberry Pi 3, and a webcam to detect your dance move, but their actual product shown above is a real-time indoor air monitoring system that report temperature, humidity, CO2 level, and PM 2.5 levels, and come sent alerts via LINE if thresholds are exceeded.

One booth had some drones including the larger one above spraying insecticides for the agriculture market.

Click to Enlarge

There was also a large about sewing machines, including some smarter one where you can design embroidery in a table before sewing.

There were also a few custom ESP8266 or ESP32 boards, but I forgot to take photos.

The Maker Party is also a good place to go with your want to buy some board or smart home devices.

Click to Enlarge

Beside Raspberry Pi Zero W / 3, ESP8266 boards and Asus Tinker board seem to be popular items in Thailand. I could also spot Sonoff wireless switch, and an Amazon Dot, although I could confirm only English is supported, no Thai language.

BBC Micro:bit board and accessories can also be bought at the event.


M5Stack modules, and Raspberry Pi 3 Voice Kit were also for sale.

Click to Enlarge

Books are also available for ESP32, Raspberry Pi 3, IoT, etc… in Thai language.

Click to Enlarge

But if you can’t read Thai there was also a choice of book in English about RPi, Arduino, Linux for Makers, IoT and so on. I then attended the second talk of the day: “NB-IoT” by AIS, one of the top telco company in Thailand. Speakers included Phuchong Charoensub, IoT Marketing Specialist, and Pornsak Hanvoravongchai, Device Innovation Manager, among others. They went through various part include a presentation of AIS current M2M business, what IoT will change (e.g. brings in statups and makers), some technical details about NB-IoT, and the company offering for makers.

I’ll go into more details in a separate post tomorrow, but if you want to get started the good news is that it’s now possible to pre-order a 1,990 THB Arduino Shield ($61) between December 6-9, and get it shipped on February 14, 2018. NB-IoT connectivity is free for one year, and will then cost 350 Baht (around $10) per year per device. However, there’s a cost to enable NB-IoT on LTE base stations, so AIS will only enable NB-IoT at some universities, and maker spaces, meaning for example, I would most certainly be able to use such kit from home. An AIS representative told me their no roadmap for deployment, it will depend on the business demand for such services.

If you are lucky you may even spot one or two dancing dinosaurs at the event.

This Tiny ESP8266 Board is Designed for DIY WiFi Switches

December 5th, 2017 3 comments

Various breadboard-friendly boards based on ESP8266 or other chips are available on the market, but some readers are not quite satisfied with the offerings, and need more available pins on the breadboard so they ended up hacking the board matching their needs by either bending header pins, or soldering modules to stripboards. As I browsed new arrivals on ICstation website, I found a tiny board with ESP8266 module that exposes I/Os via what looks like 2.54 mm pitch header that should fit right into a breadboard.

But after further checking only three I/Os are exposed, and the board is actually specifically designed for wireless switches, and comes with firmware that works with eWelink app used in Sonoff devices. So the module could be useful for people wanting to control devices without doing programming at all, and limited to no soldering. Just connect the module, and control it without smartphone.

Board specifications:

  • PSA-B ESP8266 module supporting 802.11 n/g/n WiFi
  • Ceramic antenna
  • 6-pin header with 5V, 2x GND, OUT pin, LED pin, and key input pin.
  • Misc – Status LED , matching button
  • Dimensions – 2.7 x 2.5 x 0.8 mm

The boards looks very convenient if you plan to use eWelink app, but the UART pins are not directly exposed. However, Tinkerman also found PSA-B module inside ITEAD Studio 1-Ch self-locking board, and located Tx, Rx, and GND pins on the top side of the board, managed to upgrade the firmware to ESPurna using a cable with 3 pogo pins. For reference, PSA-B module is sold for $3.00 on ITEAD Studio, so total price for the board above could be a little lower than the $6.23  currently offered on ICstation, but at least it may save you time.

Categories: Espressif, Hardware Tags: automation, esp8266, IoT, wifi

Cheap Evil Tech – WiFi Deauther V2.0 Board and Autonomous Mini Killer Drones

November 24th, 2017 10 comments

Most technological advances usually improve life of people, and with the costs coming down dramatically over the years, available to more people. But technology can be used for bad, for example by governments and some hackers. Today, I’ve come across two cheap hardware devices that could be considered evil. The first one is actually pretty harmless and can be use for education, but disconnects you from your WiFi, which may bring severe physiological trauma to some people, but should not be life threatening, while the other is downright scary with cheap targeted killing machines.

WiFi Deauther V2.0 board

Click to Enlarge

Specifications for this naughty little board:

  • Wireless Module based on ESP8266 WiSoC
  • USB – 1x Micro USB type changed, more stable.
  • Expansion – 17-pin header with 1x ADC, 10x GPIOs, power pins
  • Misc – 1x power switch,  battery status LEDs
  • Power Supply
    • 5 to 12V via micro USB port
    • Support for 18650 battery with charging circuit (Over-charge protection, over-discharge protection)
  • Dimensions – 10×3 cm

The board is pre-flashed with the open source ESP8266 deauther firmware, which allows you to perform a deauth attack with an ESP8266 against selected networks. You can select target IP address, and the board will then disconnect that node constantly, either blocking the connection or slowing it down. You don’t need to be connect to the access point or know the password for it to work. You’ll find more details on how it works on the aforelinked Github page. Note: The project is a proof of concept for testing and educational purposes.

WiFi Deauther V2.0 board can be purchased on Tindie or Aliexpress for $10.80 plus shipping.

A.I. Powered Mini Killer Drones

The good news is that those do not exist yet (at least not for civilians), but the video shows what could happen once people, companies, or governments weaponize face recognition, and drone technology to design mini drones capable of targeted killings. You could fit the palm-sized drones with a few grams of explosives (or lethal poison), tell them who to target, and once they’d find it, land on the skull of the victim, and trigger the explosive for an instant kill. Organizations or governments could also have army of those drones for killing based on metadata obtained from phone records, social media posts, etc… The fictional video shows how those drones could work, and what may happen to society as a consequence.

Technology is already here for such devices. Currently you could probably get $400+ DJI Spark drone to handle face recognition, but considering inexpensive $20+ miniature drones and $50 smart cameras are available (but not quite good enough right now), sub $100 drones with face recognition should be up for sale in a couple of years. The explosive and triggering mechanism would still need to be added, but I’m not privy to the costs… Nevertheless, it should be technically possible to manufacture such machine, even for individuals, for a few hundreds dollars. Link to fictitious StratoEnergetics company.

The Future of Life Institute has published an open letter against autonomous weapons that has been signed by various A.I. and robotics researchers, and other notable endorsers, stating that “starting a military AI arms race is a bad idea, and should be prevented by a ban on offensive autonomous weapons beyond meaningful human control”, but it will likely be tough to keep the genie in the bottle.

Bolt IoT Platform Combines ESP8266, Mobile Apps, Cloud, and Machine Learning (Crowdfunding)

November 22nd, 2017 4 comments

There are plenty of hardware to implemented IoT projects now, but in many cases a full integration to get data from sensors to the cloud requires going though a long list of instructions. Bolt IoT, an Indian and US based startup, has taken up the task to simplify IoT projects with their IoT platform comprised of ESP8266 Bolt WiFi module, a cloud service with machine learning capabilities, and mobile apps for Android and iOS.

Bolt IoT module hardware specifications:

  • Wireless Module – A.I Thinker ESP12 module based on ESP8266 WiSoC
  • Connectivity – 802.11 b/g/n WiFi secured by WPA2
  • USB – 1x micro USB for power and programming
  • Expansion – 4-pin female header and 7-pin female header with 5 digital I/Os, 1x analog I/O, and UART
  • Misc – Cloud connection LED

The hardware is not the most interesting part of Bolt IoT, since it offers similar functionalities as other ESP8266 boards. But what may make the project worthwhile is built-in support for the company’s cloud service (lifetime access to backers) that simplifies node and data management, as well as Bolt IoT mobile app to control the board with your smartphone (Android or iOS)

Some other noticeable features of the Bolt IoT cloud platform include:

  • Remote configuration of the pins on Bolt WiFi module from the dashboard
  • Built-in code editor, and code deployment to all your Bolt based IoT devices with a single click.
  • Data Visualization
  • Machine learning for future data prediction and anomaly detection with just a few clicks.
  • Notifications over SMS and E-Mail.
  • Integration with systems like IFTTT and Zapier
  • Integration with smart home devices like Alexa and Google Home

The whole ecosystem supposedly allows developers to work 10 times faster, and use 80% less code than other methods.  The company will also provide an API that let you manage notifications, select third party visualization tools, and control devices from your own app.

The company launched their platform on Kickstarter at the beginning of November, and they’ve now surpassed their $10,000 funding target, having raised close to $30,000 from about 700 backers. Bolt IoT module with lifetime access to Bolt Cloud requires a $12 pledge, but they also have kits with Arduino baseboard and sensors starting with a $37 Starter Kit to the $650 Legendary kit with multiple Bolt board, and a very long list of modules. For some reasons that I may have missed all kits also include $10 credit with DigitalOcean VPS provider. Bolt Cloud will be free to all backers for life, but after the KS campaign Bolt IoT will charge a fee for commercial projects, and potentially for hobbyist projects too. Shipping adds $5 to $100 depending on the selected reward, and delivery is scheduled for February 2018.

Upgrading Sonoff Stock Firmware to Sonoff-Tasmota – USB to Serial, and OTA Update Methods

October 4th, 2017 7 comments

This post was initially supposed to be part 2 of Sonoff B1 light bulb review, where I would have explained how easy it was to use OTA mechanism to update to Sonoff-Tasmota open source firmware, and shortly show about its features and capabilities. However, it took me over 10 hours to make that work, mostly due to misunderstand in the documentation, and time spent to configure routers. I also failed the first time with Sonoff B1, so I used the serial console method, and instead managed to use SonOTA method with Sonoff POW switching from stock firmware to Sonoff-Tasmota without having to solder or tear down anything.

Updating software with a USB to Serial Board

Using a USB to serial board is the most common method to switch from stock firmware to open source firmware such as ESPurna or Sonoff-Tasmota in Sonoff devices or other ESP8266 based devices. It’s quite straightforward with Sonoff switches like Sonoff TH16.

Click to Enlarge

You just need to solder a 4-pin 2.54mm pitch header, connect the board, and use esptool to flash the image. One it’s done you can simply remove the wire, leave the header in place, and put the case back in place. But with Sonoff B1 light bulb, it’s quite as easy. First there are no through holes in the board, and you need to solder up to 6 wires on small solder pads.

Click to Enlarge

The GND, Tx, Rx, and 3.3V must be soldered and connected to the USB to serial board, while GPIO0 must be shorted to enter programming mode, so I also added two more wires for GPIO0, and an extra GND pin.

Click to Enlarge

Important warning: Never connect the serial board and AC/mains at the same time. Your equipment and life may be at risk.

Now we can download the latest version of the firmware, install esptool, connect the USB to serial board to your computer – which will also provide powered to the board -, and run esptool to flash the firmware:

That’s pretty straightforward, and the output should look as below if everything runs normally:

Most products on the market defaults to access point mode when they are first booted, but Sonoff-Tasmota’s developer have instead decided to provide pre-built image in client mode connecting to a default access point with SSID: indebuurt1 ; password: VnsqrtnrsddbrN. That’s a bit of a pain, as you need to configure another router with those credentials, before changing it to your home router. An alternative way is to build some source, and change the default AP settings, so the device can connect right away after flashing. Still, I’d wish an image that default to AP mode would be nice. It’s actually not a problem for most Sonoff devices, as you can switch to AP mode with the button (4 short presses), but Sonoff B1 does not have one.

Now imagine you have a dozen or more of Sonoff B1 light bulbs that need to be update to Sonoff-Tasmota. That would be a real pain to solder and unsolder the required wires for each bulbs. One solution is to create a jig with pogo pins for firmware update, as the one shown below specifically designed for AI Light. You just need to pop out the bulb, click the jig, flash over serial, remove the jib, refit the bulb, and you’re done.

I don’t know if one exists for Sonoff B1, but the jig above could certainly be customized to work with it.

SonOTA – Sonoff OTA Firmware Update Method

However, in an ideal world you’d prefer not to mess with the hardware at all. If only ITEAD Studio provided a way to upload custom firmware with their stock firmware that’d be ideal, but it’s not the case right now. Luckily, the OTA mechanism was reverse-engineered, and SonOTA is an (experimental) implementation that allow to flash alternative firmware to Sonoff devices without altering the hardware or needing special jigs.

The method on Sonoff-Tasmota wiki does not work on Sonoff B1 because there SSID is not advertised in pairing mode, but somebody in github had managed to update one light bulb using DNS spoofing. Since I used the first method with Sonoff B1, but only partially managed to make it work, I switched to Sonoff POW, and succesfully tested the DNS spoofing method.  Several items are required, so I’ve drawn a diagram showing how those interact.

  1. The Home Router is just the WiFi router you’d normally use to access the Internet
  2. The smartphone with eWelink is requirement to configure WiFI on the Sonoff device, and update it to the latest stock firmware version. It can also be used to easily check access points.
  3. The WiFi laptop runs SonOTA, and will act as ITEAD Studio firmware update server located at xx-disp.coolkit.cc (for example cn-disp.coolkit.cc, eu-disp.coolkit.cc, etc…)
  4. “Temporary” Router with DNS spoofing will make sure xx-disp.coolkit.cc redirect to your laptop/computer running SonOTA, so it takes over when Sonoff device tries to update the firmware. It still needs to be connected to the Internet.
  5. Sonoff device – The device we want to update

Potentially, you could combine the router, router with DNS spoofing, and WiFi laptop into one device, if you have a Debian based router, but I still separate all three in my case, since home router does not support DNS spoofing, and I failed to install SonOTA on the temporary router.

The very first step is to pair the Sonoff device with eWelink app, connect it to your home router, and update the firmware to the latest version, in my case 2.0.4.

Click to Enlarge

Now you can configure your temporary router to use DNS spoofing. I did not have any spare router with such feature, so I instead used VS-RK3399 board with Debian, and configured it as a router with hostapd, and isc-dhcp-server using those instructions. This part will heavily depend on your router, and whether you use Debian, or other Linux distributions. For reference, here are some of the main configuration files I used:

  • /etc/hostapd/hostapd.conf

  • /etc/network/interfaces

  • /etc/dhcp/dhcpd.conf

The next step was to configure DNS spoofing. I first went with dnsmasq, and I could successfully confirm it worked with dig, but for whatever reason Sonoff B1/POW would still connect the ITEAD server. Finally I tried with dnsspoof, and it worked OK.  Installation in Debian:

/etc/dnsspoof.conf configuration file to redirect traffic to ITEAD / eWelink update servers to my WiFi laptop:

You can run it as follows:

DNS spoofing took me the most time, as beside restarting service in the router itself, you have to restart the devices connected to it to reflects the changes. I also messed with /etc/hosts file in the router and laptop, but it should not be necessary, as the important is to fool the Sonoff device.

Let’s switch the WiFi laptop configuration. It should work with both Linux and Windows, but mine is running Ubuntu 16.04, so that’s what I used. Let’s create a working directory, get SonOTA code, and install all required libraries and tools.

Now we’re ready for the update. Launch SonOTA script in legacy and no provision modes:

This will first ask you to select the WiFi interface, and enter your SSID and password, and start probing for the Sonoff device:

Delete your Sonoff device in eWelink app, and restart pairing, this time connecting it to your temporary router with DNS spoofing enabled, and shortly after the SonOTA script should start to transfer the image to the device:


Now you should be able to use your smartphone or the laptop to connect to FinalStage access point, start a browser to access http://192.168.4.2. You should see the interface below, click on scan for Wifi network, and select the one you want to replace indebuurt1 SSID, in order to connect to your “home router”.

Click to Enlarge

Click on the button Save on the bottom of that page, and after a while you should be able to access Sonoff web interface into your home network

Output log of SonOTA.py script for that last step:

Success! Finally… Now you can configure Sonoff-Tasmota to use your actual device – in my case Sonoff POW – instead of Sonoff Basic. I’ll show a bit more about that while testing Sonoff B1 with Sonoff-Tasmota in an upcoming post. Whether you choose between the serial or OTA method will depend on the number of devices you have to update, and/or whether you prefer soldering or messing around with network settings. If you are after maximum efficiency for a large number of Sonoff B1 light bulbs, then a jig with pogo pins should be by far the fastest way to reflash them all.

Geolocation on ESP8266 without GPS Module, only WiFi

October 3rd, 2017 8 comments

When I think about geolocation in I normally think about global navigation satellite systems such as GPS, GLONASS, Galileo, or Beidou, as well as IP geolocation, but the latter is highly inaccurate, and often only good for find out about the country, region, or city.

But if you’ve ever been into your phone location settings, you’d know GPS is only one option, as it can also leverage cellular base stations and WiFi SSIDs, where the former working where there’s coverage, and the later in area with a high enough density of access points. Somehow, I had never thought about using such technology to find location with WiFi modules until Espressif Systems released an application note entitled “Geolocating with ESP8266“.

This document describes how the ESP8266 module may be used to scan for nearby Wi-Fi access points and, then, use their SSID, RSSI and MAC address to obtain a potential fix on the device’s geolocation, using Google geolocation API.

That’s basically a two step process with an AT command returning the list of available APs, SSID, RSSI, and MAC Address:

and after setting up a secure SSL connection, you can then feed that data to Google Geolocation API to get the location with a command that looks like (wifiAccessPoint data not filled here):

Further research led me to m0xpd experimentation with Geolocation on ESP8266 last year, using both IP geolocation (found to be very inaccurate), and Google or Mozilla APIs, and posted his Arduino source code on Github. The Google API found his actual home in Manchester with just the information retrieved from the list of access points.

That also means that unsecured devices on the public Internet can easily be located, as an hacker logins to a router or IoT device, he just needs to run a command to find out the information required by his preferred geolocation API.

2.9″ ESPaper Lite Kit is a $40 ePaper Display Kit with an ESP8266 WiFi Module

September 28th, 2017 8 comments

Squix (Daniel Eichhorn) has designed a 2.9″ ESPaper Lite Kite is a battery powered kit based on a black and white ePaper module, and ESP-WROOM-02 module based on Espressif Systems ESP8266 WiSoC.

Click to Enlarge

2.9″ ESPaper Lite Kit specifications:

  • Wireless Module – ESP-WROOM-02 WiFi module with Espressif ESP8266
  • Display – 2.9″ B&W ePaper module with 296×128 pixels resolution connect over SPI to ESP8266
  • Debugging / Programming – 6-pin serial port header
  • USB – 1x micro USB port for programming
  • Misc – 3 buttons: Reset (wake up from deep sleep);  S0 (flash/GPIO0); S1: user button connected to GPIO12; power switch; charging and (firmware) flashing LEDs
  • Power – JST connector for LiPo battery; charging circuit

You’ll need a 3.3V USB to TTL debug board for flashing the firmware to the board, and a LiPo battery to power it up. The solution is particularly useful if you want a battery powered display that is infrequently updated, since such display only consumes electricity when updated. They could run the module for several weeks with a 800m Ah battery while updating weather info every 20 minutes. MiniGrafx library provides drivers and samples for the board. It is available on Github.

The 2.9″ ESPaper Lite kit can be purchased for $39.90, but if you want something easier to get started you may want to get the 2.9″ ESPaper Plus Kit instead for $49.90, as it adds a USB to serial converter, a 600 mAh battery, an enclosure, and a USB cable.

ESPurna Firmware Now Supports Power Meters “Augmented” with ESP8266 Modules/Boards

September 25th, 2017 15 comments

Sonoff-Tasmota and ESPurna are the two main open source firmware used in home automation devices, such as Sonoff wireless switches, based on Espressif ESP8266 WiSoC. Xose Pérez – aka Tinkerman – has recently purchased “dumb” power meters / kill-a-watt meters, added WiFi to them with ESP-01 module and Wemos D1 mini board, and implemented support in ESPurna firmware leveraging earlier reverse-engineering work by Karl Hagström.

The power meter above looks exactly like the one I’ve been using for review for over two years, and has been more more reliable than other models, such as Broadlink SP2 (with built-in WiFi) that gave up on me after a few months.

Xose actually noticed that old and newer models of the power meters were based on different solutions. Karl’s meter relied on ECH1560, while Xose’s new meter was instead based on Vango V9261F, which has a public datasheet, and was already being worked on by Domoticz community.

While he connect ESP-01 to one of the meter, he found Wemos D1 mini was much easier to connect thanks to a built-in 5V support. He still had to include a Hilink AC to 5V DC power supply module, a baseboard for the Wemos board with an optocoupler and resistor. Finally (not shown in pictures), he hot-glued all cabling to make sure nothing move, and that’s important as you don’t want anything bad happens with AC voltages…

Click to Enlarge

The power meter can then be calibrated and configure in ESPurna user interface, and you can also handle the data through MQTT, Domoticz, a REST API, and/or Home Assistant. Support for V9261F has been implemented and tested, but while the older ECH1560 solutions have been implemented, they have yet to be tested.

The power meter can be purchased for about $12 and up on eBay or Aliexpress, ESPurna firmware on BitBucket.