Page 1 of 1

DeviceHive firmware for ESP8266

Posted: Thu Aug 13, 2015 1:13 am
by Nikolay
Hello everyone!
I'm happy to present DeviceHive firmware for ESP8266!
DeviceHive is an Open Sources platform for IoT solutions.

DeviceHive firmware for ESP8266 is suppose to connect simple electronic devices with common interfaces to DeviceHive cloud service. Having this firmware on ESP8266 there is no need to write programs for hardware. Chip connects to specified remote DeviceHive server(which can be deployed in local network or in some cloud service) and waits for commands. Each command suppose to use some electronic interface to control some hardware connected to chip. It can be simple interaction with GPIO pins for turning on/off simple LED, relay or waiting some changes on pin from sensor. Also it is possible to connected more complicated sensors and actuators using UART or I2C bus. In other words, this firmware move the most commonly used interfaces right into cloud service where you can control your devices or even network of devices from any distance, from any point.

Example of connecting SSD1306 base OLED display:
Source code of program that sends data to display: ... ample.html

DeviceHive server have two endpoints to send command commands or receive notifications: HTTP and Websocket. Developers can use any programming languages, any developer tools, any SDK that they prefer to interact with server and as a result with hardware. It is possible because all commands represent simple JSON string which sends via HTTP or Websocket. For example sending command with JavaScript looks like:

Code: Select all

      var xmlhttp = new XMLHttpRequest();'POST','', true);
      xmlhttp.setRequestHeader('Authorization', 'Basic ' + btoa('user:password'));
      xmlhttp.setRequestHeader('Content-type', 'application/json;charset=UTF-8');
      var myjson = {};
      myjson['command"] = 'uart/write';
      myjson['parameters'] = {'data':'SGVsbG8sIHdvcmxkIQ=='};

After receiving this command chip prints 'Hello, world!' in UART bus. The same idea with other interfaces.

Getting started:
First at all firmware have to be flashed into chip memory and chip have to be configured for using specified Wi-Fi network and DeviceHive server. Developers can build firmware and all tools for flashing and configuring by himself from sources. Or it can be downloaded from git repository: go to ... er/release and download archive with the latest version.
For flashing chip needs to be connected to computer via USB-UART converter, CH_PD pin have to be connected to Vcc, GPIO15 and GPIO0 have to be connected to ground and 3.3 power supply should be used.
After assembling, connect it to computer. Install driver for your USB->UART converter. Make sure that virtual serial port is available in your system( virtual COM is present on Windows OS, '/dev/ttyUSB*' on Linux, '/dev/tty.*' on OS X). Unpack archive with firmware and flash it running 'esp-flasher-<your-os>' in terminal. Flasher automatically detects serial port and use '0x00000.bin' and '0x40000.bin' files for flashing. You can also you esp-tool for flashing -
Now remove wire from GPIO0(live it float or connect to high), reboot device and connect to firmware with with 'esp-terminal-<your-os>' util. You can also use any other util that can connect to terminal via UART and support escape sequences, PuTTY or GNU 'screen' for example. Port parameters are: 115200 8N1.
Firmware terminal is a unix like terminal with few commands. It exists for chip configuring and debugging. To see debug output type 'dmesg'. To configure run 'configure' command. Follow instructions in terminal. You need to know DeviceHive server credentials for configuring. If you don't have DeviceHive server instance you could use free playgroun on DeviceHive site. Follow to and register there and you will have your own DeviceHive server instance. DeviceHive server can be deployed in local network or on some cloud hosting services. Follow for DeviceHive server deployment instructions on
After rebooting you can send commands to DeviceHive server and ESP8266 perform them. List of accepted command is in this document - ... SP8266.pdf You can use DeviceHive web admin control panel to send command for test purpose or learning. Go in web admin, 'Devices' tab, 'commands' subtab, 'enter new command'. Type command and parameters and press 'push'. After ESP8266 perform your command you can press 'refresh' button to see result.

You can find more detail instructions with images in 'DeviceHiveESP8266.pdf' file in archive with firmware. Or ... SP8266.pdf (but be careful with only version, it can be newer than your firmware version)


Hope this firmware will be useful for your IoT or DIY projects! Any questions are welcome. Thank you!

Re: DeviceHive firmware for ESP8266

Posted: Mon Sep 07, 2015 8:30 pm
by Nikolay

I'm glad to present new version of DeviceHive Fimrware for ESP8266 - v0.3
New key features:
- SPI support (mrfc522 connected with SPI sample - )
- onewire (1-wire master and DHT devices) support (iButton, DS18B20, DHT11 sample - )
- wireless configuring (see )

Re: DeviceHive firmware for ESP8266

Posted: Mon Nov 07, 2016 11:10 pm
by Nikolay
Great news! DeviceHive firmware was updated to version 0.5.
What's new:
- uploadable web page
- mDNS
- local embedded web server with tools and samples
- local RESTful API
- support for some popular sensor devices
- bug fixes

This release contains plenty of features for usage in LAN. Each chip with DeviceHive firmware v0.5 becomes RESTful API service with HTTP server. Just connect your sensor and send HTTP request to chip. For example for BMP180 request is

Code: Select all

curl -i -X POST  \
     -H "Authorization: Bearer YourAccessKeyHere="  \

and response will be something like:

Code: Select all


You can also upload your own web page and use JS for communication with REST. Build your devices with web interface easily with DeviceHive.
Full article about new firmware feature is here - ... or-esp8266

Re: DeviceHive firmware for ESP8266

Posted: Mon Nov 07, 2016 11:10 pm
by Nikolay
Documentation, list of new commands and supported sensors are available here - ...

And latest firmware in action:

Re: DeviceHive firmware for ESP8266

Posted: Thu Mar 02, 2017 6:30 pm
by Nikolay
DeviceHive firmware v0.6 was released!

- fixes and improvements
- new devices support. Overall firmware supports:
- DS18B20, LM75 - temperature sensors,
- DHT11, DHT22, SI7021 - humidity sensors
- BMP180, BMP280 - barometric pressure sensor
- BH1750 - light sensor
- MPU6050 - 3-axis gyroscope and a 3-axis accelerometer
- HMC5883L - magnetometer
- PCF8574 - GPIO extender
- HD44780 - 2x16 4x20 displays(with PCF8574 adapter)
- MH-Z19 - CO2 sensor
- MCP4725 - digital to analog convertor
- PCF8591 - analog to digital and digital to analog converter
- ADS1115 - analog to digital converter
- INA219 - power monitor
- MFRC522 - RFID tag reader
- PCA9685 - PWM controller
- MLX90614 - contactless IR thermometer
- MAX6675, MAX31855 - thermocouple thermometers
- TM1637 - 8 segments LED display controller
- WS2812B - LED strip controller
- access point mode
- embedded pages redesign
- sample of using D3.js for plotting graphs from different sensors on embedded web server

You can download binary release here -
sources also available there.