NodeMCU 固件编译常见问题答疑

NodeMCU 固件编译常见问题答疑

发表于 2020/06/05 更新于 2020/06/05 149 字 1 分钟
AI 摘要 由 AI 自动生成

|

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。

作者: 小谈谈
声明: 本文采用 CC BY-NC-SA 4.0 许可协议,转载请注明出处。