Short: I do not like the developing environment provided by Espressif. Then I rewrite Makefile (mostly) to:
This dev env will use as much (closed blobs) libs from Espressif as possible. However, current json parsing of SDK (taken from Contiki OS) is not good enough, I have no way to check if this/that string is a valid one, then I decided to use jsmn
All examples have been testing with SDK 1.3.0, 4MB Module-12. Module-01 512KB is considered out of date.
Install compiler for ESP with esp-open-sdk. It would be good if you install at HOME.
Clone this project
git clone --recursive https://github.com/nqd/esp8266-dev.git
Try OTA example under examples/ota-update
I setup an OTA server at http://103.253.146.183/, you may need to
apiKey, _id
, at Profile
for OTA_UUID, OTA_TOKEN
at user_config.h
tools/fotaclient/.fotaclient-config.json.example
to $HOME/.fotaclient-config.json
, and update APIKEY
. You will need node.js to register new firmwareotaupdate
(check Makefile for other names)make
to compile the example. Then make flash
to flash the fist firmware. By default, this new firmware labeled with version 0.0.1..version
, e.g. 0.0.2 for this new cool update. make clean && make && make IMAGE=2 && make register
to label your image with new version, and then upload to OTA serverVia UART logging, you should see new version 0.0.2 downloaded, then ESP boots new firmware, print out your last compiling time.
By default, flash size is 4096 KB (1024+1024 with OTA=1). Pull request for Makefile to work with all flash options is more than welcome.
Command to use:
make OTA=1/0 # default OTA=1
make OTA=1 IMAGE=1/2 # generate image user1/user2
make OTA=1 IMAGE=1/2 flash # program with OTA enable
make register # upload, register new version. Must setup OTA server first
Look at Makefile for program under /examples
:
PROJECT = yourprojectname
ROOT = ../..
APPS += fota
APPS += mqtt
include ${ROOT}/Makefile.common
All credit of apps/ belong to their authors. Mis config and/or using belong to me.
MIT