diff --git a/.travis.yml b/.travis.yml index 7c486f1..01207a2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,67 +1,28 @@ -# Continuous Integration (CI) is the practice, in software -# engineering, of merging all developer working copies with a shared mainline -# several times a day < https://docs.platformio.org/page/ci/index.html > -# -# Documentation: -# -# * Travis CI Embedded Builds with PlatformIO -# < https://docs.travis-ci.com/user/integration/platformio/ > -# -# * PlatformIO integration with Travis CI -# < https://docs.platformio.org/page/ci/travis.html > -# -# * User Guide for `platformio ci` command -# < https://docs.platformio.org/page/userguide/cmd_ci.html > -# -# -# Please choose one of the following templates (proposed below) and uncomment -# it (remove "# " before each line) or use own configuration according to the -# Travis CI documentation (see above). -# - - -# -# Template #1: General project. Test it using existing `platformio.ini`. -# - -# language: python -# python: -# - "2.7" -# -# sudo: false -# cache: -# directories: -# - "~/.platformio" -# -# install: -# - pip install -U platformio -# - platformio update -# -# script: -# - platformio run - - -# -# Template #2: The project is intended to be used as a library with examples. -# - -# language: python -# python: -# - "2.7" -# -# sudo: false -# cache: -# directories: -# - "~/.platformio" -# -# env: -# - PLATFORMIO_CI_SRC=path/to/test/file.c -# - PLATFORMIO_CI_SRC=examples/file.ino -# - PLATFORMIO_CI_SRC=path/to/test/directory -# -# install: -# - pip install -U platformio -# - platformio update -# -# script: -# - platformio ci --lib="." --board=ID_1 --board=ID_2 --board=ID_N +language: python +python: +- '2.7' +sudo: false +cache: + directories: + - "~/.platformio" +install: +- pip install -U platformio +- platformio update +script: +- mkdir build +- platformio ci --keep-build-dir --build-dir ./build --lib="./lib/esp_framework/src" --lib="./lib/esp_framework/include" --project-conf=platformio.ini + src/main.cpp +before_deploy: +- platformio ci -h +- ls -a +- find . -name "*.bin" +# deploy: +# provider: releases +# api_key: +# secure: FNZS+KTgsSo6QAZgncYmZLNHfuqCnD2yRQkjj4GYl5M1vNGTSncmZMTVoH3oFHmpsNG3wZ0G/c8yT48Fxhn1T/aGSAXxlffeJ36XN+5gSrPFk+dkHdV26X9tpCglUTkOMydtlJCQQJBd0km0XlniFKV0guDezWADvwERegHXf/CaiZY/YccorfHbJxDF9e765aYVY+bvkixOoC9iXMYBdbYTACqFPddr5x2LfdRNDMLlP29XYO/5909e9xU3fy06LgisYHQgYpTfAyASYqmxL0Qhugd2Z71VY098NRDfdA1agmnKM9nhjwYG791eqmKVSVZ4UUe7dCjHe9czd0tHMGiP8nz+bxCKNIZsDm/drHwP6FPx0eHyKb8eY3czvRT6onrBdzJHUtCl55NbUgk3W/ijj9U1BlzyA3uSIavNAXsK4R8Tf24G4qXtcq6MJos/STh2viBxHGvboTfAqxy3F/pVwNmgupW4GIZYds0/OZ302xSpUtFO37IR9SaAaMb0/O/3Td768DkuesaWymU7Gv1NDkMMYX3lttGLIOTz/qyXp8FAn5zvDyMhJDkb3xyJ45yQajp+LRwxxZ7bQmmoAzIO18Tst/GWDe8NxpeQCA3eKmLGvjunV+WfIto5O6cSfMjZKtI15WTbh25IXWEIABjD2BMiOoCt7oh6mXIGACM= +# file: +# - "build/.pio/build/dc1/firmware.bin" +# skip_cleanup: true +# on: +# repo: IoTDevice/esp_dc1 +# tags: true \ No newline at end of file diff --git a/OpenIoTHubSupport.md b/OpenIoTHubSupport.md new file mode 100644 index 0000000..1ab2456 --- /dev/null +++ b/OpenIoTHubSupport.md @@ -0,0 +1,20 @@ + + +本文档介绍对于[OpenIoTHub](https://github.com/OpenIoTHub/OpenIoTHub)app的支持. + + + +## app操作界面 +* 目前初步是以webUI方式打开,从[v1.2.7](https://github.com/OpenIoTHub/OpenIoTHub/releases/tag/v1.2.7)开始支持,以后通过app升级方式提供native操作界面 +![image](./file/images/app/device-list.jpg) +![image](./file/images/app/ui.jpg) +![image](./file/images/app/device-info.jpg) + +## 如何配网 +1、第一次使用自动进入配网模式 +2、以后通过长按【总开关】进入配网模式 + +## 使用方法 +- app下载:https://github.com/OpenIoTHub/OpenIoTHub/releases v1.2.7+ +- app打开“智能”选项卡(如图1)即可搜索到之前已经配网成功的插排 +- app远程控制可以使用OpenIoTHub[网关](https://github.com/OpenIoTHub/gateway-go) (通过网关可以支持本固件插排的远程使用) \ No newline at end of file diff --git a/README.md b/README.md index 1fcb84b..e349938 100644 --- a/README.md +++ b/README.md @@ -72,7 +72,12 @@ ioBroker是基于nodejs的物联网的集成平台,为物联网设备提供核 #### 接入方法 ioBroker相关接入问题可以加QQ群776817275咨询 -### 3、其他支持mqtt的平台 +### 3、OpenIoTHub(云易连) +OpenIoTHub是一个开源的物联网平台,系统由app,网关,服务器组成,支持app配网和发现,通过网关可以是原本只能在局域网操控的设备支持远程操控。 +#### 接入方法 +详见[OpenIoTHubSupport.md](./OpenIoTHubSupport.md) + +### 4、其他支持mqtt的平台 理论上来说,只要是支持MQTT的平台都可以实现接入。 #### 接入方法 @@ -80,10 +85,10 @@ ioBroker相关接入问题可以加QQ群776817275咨询 # 固件截图 -![image](https://github.com/qlwz/esp_dc1/blob/master/file/images/tab1.png) -![image](https://github.com/qlwz/esp_dc1/blob/master/file/images/tab2.png) -![image](https://github.com/qlwz/esp_dc1/blob/master/file/images/tab3.png) -![image](https://github.com/qlwz/esp_dc1/blob/master/file/images/tab4.png) +![image](./file/images/tab1.png) +![image](./file/images/tab2.png) +![image](./file/images/tab3.png) +![image](./file/images/tab4.png) ## 致谢 以下排名不分先后,为随机。 diff --git a/file/images/app/device-info.jpg b/file/images/app/device-info.jpg new file mode 100644 index 0000000..6715264 Binary files /dev/null and b/file/images/app/device-info.jpg differ diff --git a/file/images/app/device-list.jpg b/file/images/app/device-list.jpg new file mode 100644 index 0000000..80e9209 Binary files /dev/null and b/file/images/app/device-list.jpg differ diff --git a/file/images/app/ui.jpg b/file/images/app/ui.jpg new file mode 100644 index 0000000..d398c23 Binary files /dev/null and b/file/images/app/ui.jpg differ diff --git a/lib/esp_framework/src/Http.cpp b/lib/esp_framework/src/Http.cpp index 5bb6048..548cd6f 100644 --- a/lib/esp_framework/src/Http.cpp +++ b/lib/esp_framework/src/Http.cpp @@ -804,7 +804,24 @@ void Http::begin() { module->httpAdd(server); } - MDNS.begin(UID); + //MDNS.begin(UID); + while (WiFi.status() != WL_CONNECTED) { + Debug::AddInfo("wait wifi connection..."); + delay(500); + } + if (!MDNS.begin(UID)) { + Debug::AddInfo("Error setting up MDNS responder!"); + } + MDNS.addService("iotdevice", "tcp", globalConfig.http.port); + MDNS.addServiceTxt("iotdevice", "tcp", "name", module->getModuleCNName()); + MDNS.addServiceTxt("iotdevice", "tcp", "model", "com.94qing.devices.esp_dc1"); + MDNS.addServiceTxt("iotdevice", "tcp", "mac", WiFi.macAddress()); + MDNS.addServiceTxt("iotdevice", "tcp", "id", ESP.getSketchMD5()); + MDNS.addServiceTxt("iotdevice", "tcp", "author", module->getModuleAuthor()); + MDNS.addServiceTxt("iotdevice", "tcp", "email", "qlwz@qq.com"); + MDNS.addServiceTxt("iotdevice", "tcp", "home-page", "https://github.com/qlwz"); + MDNS.addServiceTxt("iotdevice", "tcp", "firmware-respository", "https://github.com/qlwz/esp_dc1"); + MDNS.addServiceTxt("iotdevice", "tcp", "firmware-version", module ? module->getModuleVersion() : F("0")); server->begin(globalConfig.http.port); Debug::AddInfo(PSTR("HTTP server started port: %d"), globalConfig.http.port); } diff --git a/platformio.ini b/platformio.ini index c92e4c6..b6f8355 100644 --- a/platformio.ini +++ b/platformio.ini @@ -16,7 +16,7 @@ board = esp01_1m board_build.f_cpu = 80000000L board_build.flash_mode = dout board_build.ldscript = eagle.flash.1m.ld - +lib_ldf_mode = deep ; *** Esp8266 core for Arduino version 2.6.1 platform = espressif8266@2.3.3 build_flags = -D NDEBUG