nodemcu uart 未定义常量?

nodemcu uart undefined constants?

使用 nodemcu_integer_0.9.6-dev_20150704.bin 我得到了这些奇怪的东西:

> uart=require("uart")
> =uart
romtable: 40240a00
>=uart.PARITY_NONE
nil
> =uart.STOPBITS_1
nil
> 

因此,我无法执行此操作:

uart.setup(0, 2400, 7, uart.PARITY_NONE, uart.STOPBITS_2, 0)

只是因为uart.PARITY_NONE没有定义,而且:

stdin:1: bad argument #4 to 'setup' (number expected, got nil) 

也许我应该使用更新的固件,但云构建服务确实适合我。我刚刚申请了一个新固件并尝试刷入设备 - 但它不起作用。当我重新启动设备时(闪烁后),WiFi 指示灯疯狂闪烁,并通过串口发送垃圾信息。

是的,您需要最新的固件才能使用这些常量(根据 docs)。

至于你失败的闪光尝试,我建议你坚持documentation the cloud build service sent you a reference for. However, I suggest you build from the current dev branch as to avoid having to flash the new esp init data manually. See 了解详情。