ESP8266 ESP NOW
来自Jack's Lab
(版本间的差异)
(→概述) |
(→快速尝试) |
||
第48行: | 第48行: | ||
<br><br> | <br><br> | ||
+ | |||
+ | == SDK API == | ||
+ | |||
+ | * esp_now_set_peer_role(slave_mac, ESP_NOW_ROLE_SLAVE); 在 ctrl 边,调用常常失败,建议慎用 | ||
+ | |||
<br><br> | <br><br> | ||
<br><br> | <br><br> |
2015年11月14日 (六) 20:10的版本
1 概述
所谓 ESP NOW 就是乐鑫官方为智能照明应用提供的集群控制功能
2 快速尝试
准备两片 Noduino Falcon 开发板 或 nodemcu v1.0 开发板,USB 连上 PC
下载 SDK:
# clone the whole sdk $ git clone git://github.com/icamgo/noduino-sdk.git noduino-sdk # fetch the toolchain of esp8266 $ cd noduino-sdk $ git submodule init $ git submodule update $ cd toolchain $ ./gen.py # generate the toolchain (you need Python 2.7)
插上开发板,刷上 ctrl:
$ cd ../example/esp-now/ctrl $ make flash
插上另外一片开发板,刷上 slave:
$ cd ../example/esp-now/slave $ make flash
完成后,查看各自的串口输出
3 SDK API
- esp_now_set_peer_role(slave_mac, ESP_NOW_ROLE_SLAVE); 在 ctrl 边,调用常常失败,建议慎用