Getting Started with Noduino on Mac OS X
(→扩展阅读) |
(→准备开发板和USB连接线) |
||
第2行: | 第2行: | ||
准备一块 nodemcu v1.0 开发板,一根 micro USB 连接线: | 准备一块 nodemcu v1.0 开发板,一根 micro USB 连接线: | ||
+ | |||
+ | [[文件:Noduino-falcon-v0.9-800.jpg | 600px]] | ||
[[文件:Nodemcu-v1.0-board.jpg | 600px]] | [[文件:Nodemcu-v1.0-board.jpg | 600px]] |
2015年12月8日 (二) 11:44的版本
目录 |
1 准备开发板和USB连接线
准备一块 nodemcu v1.0 开发板,一根 micro USB 连接线:
2 下载Arduino软件
2.1 Git 安装
先从 arduino.cc 下载 1.6.6 版本的压缩包,解压后,进入:
$ cd /PATH/TO/arduino $ cd Contents/Java/hardware $ mkdir esp8266com $ cd esp8266com $ git clone git://github.com/icamgo/Noduino.git esp8266 # fetch the toolchain of esp8266 $ cd esp8266 $ git submodule init $ git submodule update $ cd tools/xtensa-toolchain # Generate the toolchain (you need Python 2.7) $ ./gen.py
重启 Arduino 即可
2.2 压缩包
Arduino 软件开发环境是一个压缩包,下载解压后直接运行,即可使用。定制的版本位于:
百度云:http://pan.baidu.com/s/1qWkVJgo
微盘:http://vdisk.weibo.com/s/dn5OZrwbJHDa
下载 noduino-1.6.6-osx.tar.xz 留意一下用 md5sum 对压缩包进行完整性检查:
解压 noduino-1.6.6-osx.tar.xz
3 连接开发板
Micro USB 线的 microUSB 口连接 nodemcu 开发板,USB 口接 PC 的 USB 口。
开发板从 USB 口取电,开发板带 USB 转串口功能
PC 可通过这个 USB 线与开发板交换数据
4 安装驱动程序
开发板使用 CP2102 这颗 USB 转串口芯片,到芯片厂家官网下载 Mac OS X 版的驱动:http://www.silabs.com/products/mcu/Pages/USBtoUARTBridgeVCPDrivers.aspx
下载后安装,插上开发板,就能发现:
$ sudo dmesg|tail -n 27 hfs: unmount initiated on Recovery HD on device disk0s3 USB (XHCI Root Hub USB 2.0 Simulation):Port 1 on bus 0xa connected or disconnected: portSC(0xe0206e1) com_silabs_driver_CP210xVCPDriver: init com_silabs_driver_CP210xVCPDriver(0xffffff8039194000)::attach com_silabs_driver_CP210xVCPDriver(0xffffff8039194000)::probe com_silabs_driver_CP210xVCPDriver(0xffffff8039194000)::detach com_silabs_driver_CP210xVCPDriver(0xffffff8039194000)::attach com_silabs_driver_CP210xVCPDriver(0xffffff8039194000)::start - Registered for Power Management com_silabs_driver_CP210xVCPDriver(0xffffff8039194000)::start! com_silabs_driver_CP210xVCPDriver(0xffffff8039194000)::start - Found device at interface 0 com_silabs_driver_CP210xVCPDriver(0xffffff8039194000)::setPowerState - Waking up com_silabs_driver_CP210xVCPDriver(0xffffff8039194000)::SelectInterfaces - BulkInput Pipe is 0xffffff8031e15480 on EP1 com_silabs_driver_CP210xVCPDriver(0xffffff8039194000)::SelectInterfaces - BulkOutput Pipe is 0xffffff802bac6900 on EP1 com_silabs_driver_CP210xVCPDriver(0xffffff8039194000)::GetCP210xInfo - Part Number Found: 0x02 com_silabs_driver_CP210xVCPDriver(0xffffff8039194000)::GetCP210xInfo - UsbConfigurationDescriptor - com_silabs_driver_CP210xVCPDriver(0xffffff8039194000)::GetCP210xInfo .bLength = 9 com_silabs_driver_CP210xVCPDriver(0xffffff8039194000)::GetCP210xInfo .bDescriptorType = 0x02 com_silabs_driver_CP210xVCPDriver(0xffffff8039194000)::GetCP210xInfo .wTotalLength = 32 com_silabs_driver_CP210xVCPDriver(0xffffff8039194000)::GetCP210xInfo .bNumInterfaces = 1 com_silabs_driver_CP210xVCPDriver(0xffffff8039194000)::GetCP210xInfo .bConfigurationValue = 1 com_silabs_driver_CP210xVCPDriver(0xffffff8039194000)::GetCP210xInfo .iConfiguration = 0 com_silabs_driver_CP210xVCPDriver(0xffffff8039194000)::GetCP210xInfo .bmAttributes = 0x80 com_silabs_driver_CP210xVCPDriver(0xffffff8039194000)::GetCP210xInfo .MaxPower = 50 com_silabs_driver_CP210xVCPDriver(0xffffff8039194000)::start - Sucessfully loaded the driver com_silabs_driver_CP210xVCPDriver(0xffffff8039194000)::message com_silabs_driver_CP210xVCPDriver(0xffffff8039194000)::message com_silabs_driver_CP210xVCPDriver::setPowerState(0x193cbab37128ae0d, 0 -> 1) timed out after 10205 ms
5 启动Arduino软件
Finder 里,双击解压后 arduino-1.6.6 即可运行 Arduino:
6 选择开发板
7 选择串行端口
从“工具|串口”菜单中选择开发板的串口设备,由前面设备驱动安装后,开发板的串口为 /dev/cu.SLAB_USBtoUART
至此板级相关的参数为:
- Board: "NodeMCU 1.0 (ESP-12E Module)"
- CPU Frequency: "80 MHz"
- Upload Speed: "115200"
- Port: "/dev/cu.SLAB_USBtoUART"
8 打开闪烁示例
9 上传程序
在 Arduino IDE 中点击“上传”(Upload) 按钮。稍等片刻,你就会看到板子上模块的蓝色 LED 灯在快闪。
如果上传成功,状态栏会出现“上传成功”(Done uploading) 的字样
上传完之后,你会很快看到板子靠近 USB 口的 LED 开始在慢闪(大概 1s 间隔),证明上传成功,你已经把 Noduino IDE 跑起来了!
10 扩展阅读
- Arduino 的 其他版本可以参考此页:
- Getting Started with Noduino on Linux
- Getting Started with Noduino on Mac OS X
- Getting Started with Noduino on Windows
- 产品级开发建议使用我们的专业 SDK:
- Getting Started with Noduino SDK on Linux
- Getting Started with Noduino SDK on Mac OS X
- Getting Started with Noduino SDK on Windows
- ESP8266 的各种问题参考: