弹霄博科

小谈谈一亩三分地



NodeMCU 固件编译常见问题答疑


发布日期: 2020/06/05
更新日期: 2020/06/05
作者: 小谈谈
分类: 物联网
标签: nodemcu, esp8266
阅读时间: 1 分钟
字数: 149 字


smartconfig.h: No such file or directory

wifi.c:20:31: fatal error: smart/smartconfig.h: No such file or directory ```
wifi.c:20:31: fatal error: smart/smartconfig.h: No such file or directory
#include "smart/smartconfig.h"
^
compilation terminated.
../../Makefile:422: recipe for target '.output/eagle/debug/obj/wifi.o' failed
make[2]: *** [.output/eagle/debug/obj/wifi.o] Error 1
make[2]: Leaving directory '/root/workspace/app/modules'
../Makefile:380: recipe for target '.subdirs' failed
make[1]: *** [.subdirs] Error 2
make[1]: Leaving directory '/root/workspace/app'
Makefile:380: recipe for target '.subdirs' failed
make: *** [.subdirs] Error 2
script returned exit code 2
```
目前看来,这是 nodemcu-firmware 的一个 bug,官方已经在 dev 分支修复了这个问题,如果你不想使用 dev 分支,可以手动修改 app/modules/wifi.c 文件,将 #include "smart/smartconfig.h" 修改为 #include "smartconfig.h"。更多信息请参考这个 issues 2928

recipe for target '.subdirs' failed

Makefile:380: recipe for target '.subdirs' failed ```
Traceback (most recent call last):
File "/root/workspace/tools/toolchains/esptool.py", line 37, in <module>
import serial
ImportError: No module named serial
../Makefile:264: recipe for target '.output/eagle/debug/bin/eagle.app.v6.bin' failed
make[1]: *** [.output/eagle/debug/bin/eagle.app.v6.bin] Error 1
make[1]: Leaving directory '/root/workspace/app'
Makefile:380: recipe for target '.subdirs' failed
make: *** [.subdirs] Error 2
```
很可能是编译链工具不完整,请重新克隆 nodemcu-firmware 仓库,一定要使用 git clone 而不是 zip download。