Closed mk-pmb closed 4 years ago
Can you reproduce this with a master build from the cloud builder?
Nope, seems I'm too n00b for that web form.
… and it said "It's pointless to select that many modules, the build is going to fail."
I guess your idea is that the bug may be related to my modules selection, so I tried with the esp8266_nodemcu_firmware
from this daily vanilla build, which ran your cloud builder docker image without custom config on the master branch. With that, it doesn't reboot, but
NodeMCU 3.0.0.0 built with Docker provided by frightanic.com
branch: dev
commit: a92da3c33cdb4446031e0add9fb661df82acbb0f
release: 3.0-master_20200610 +17
release DTS: 202008221641
SSL: false
build type: float
LFS: 0x0 bytes total capacity
modules: adc,bit,dht,file,gpio,i2c,mqtt,net,node,ow,spi,tmr,uart,wifi
build 2020-08-23 11:17 powered by Lua 5.1.4 on SDK 3.0.1-dev(fce080e)
cannot open init.lua:
> = net.ifinfo()
> = net.ifinfo(0)
> = nil -- for comparison: the above seem to have returned not even nil
nil
> wifi.setmode(wifi.STATION)
> = net.ifinfo()
Lua error: attempt to index a function value
stack traceback:
[C]: in function 'ifinfo'
stdin:1: in main chunk
[C]: ?
[C]: ?
> = net.ifinfo(0)
Lua error: attempt to index a number value
stack traceback:
[C]: in function 'ifinfo'
stdin:1: in main chunk
[C]: ?
[C]: ?
> wifi.setmode(wifi.SOFTAP)
> = net.ifinfo()
> = net.ifinfo(0)
>
… and it said "It's pointless to select that many modules, the build is going to fail."
You only get to see this if you select 20 or modules.
I guess your idea is that the bug may be related to my modules selection
No, not exactly. Regardless of your level of expertise if you manually edit source code or configuration options all sorts of things may go wrong.
So, I built a default firmware myself (entered email address, didn't modify anything else and hit the build button) and flashed it.
NodeMCU 3.0.0.0 built on nodemcu-build.com provided by frightanic.com
branch: master
commit: 8d091c476edf6ae2977a5f2a74bf5824d07d6183
release: 3.0-master_20200610
release DTS: 202006092026
SSL: false
build type: integer
LFS: 0x0 bytes total capacity
modules: file,gpio,net,node,tmr,uart,wifi
build 2020-08-23 15:00 powered by Lua 5.1.4 on SDK 3.0.1-dev(fce080e)
cannot open init.lua:
Connected MCU to WiFi AP then:
> print(net.ifinfo())
table: 3ffef9b0
> print(net.ifinfo(0))
table: 3ffef9b0
> print(net.ifinfo(0).dhcp.server_ip)
192.168.0.1
=> can't reproduce your issues
You only get to see this if you select 20 or modules.
Indeed I first tried without disabling any modules (i.e. left the checkboxes as they were, except enable debug), and got the same error. That's why I had the idea to uncheck all. I'll try your form again with JS enabled, in case the checkboxes really do need the jQuery and stuff.
=> can't reproduce your issues
Have you tried it with wifi.setmode(wifi.STATION)
first? And maybe erase the flash first so it can't have a remembered IP. Also in your example, when you get a DHCP IP, it seem you've configured the wifi. In my scenario no wifi credentials have been set up yet. It was a fresh boot with flash erased and then firmware uploaded.
After a bit of debugging the web form I managed to make it work, and got this firmware image. I erased the flash, uploaded the firmware, and was able to reproduce the error: https://gist.github.com/mk-pmb/7803ab9d5ca228f106efb48eb791f8eb
The commands used, without the noise:
wifi.setmode(wifi.SOFTAP)
= net.ifinfo(0)
= net.ifinfo()
wifi.setmode(wifi.STATION)
= net.ifinfo(0)
= net.ifinfo()
Just tried with my current working dev build and found similar results as @mk-pmb
I also fount that net.ifinfo(2)
reboots immediately.
Can't see why any of this happens from the code though.
NodeMCU 3.0.0.0
branch: pr_3158
commit: fd8ef76b0ae71dde56f0fb853faa2763520ebdea
release: 3.0-master_20200610 +11
release DTS:
SSL: false
build type: float
LFS: 0x40000 bytes total capacity
modules: adc,bit,color_utils,crypto,dht,encoder,enduser_setup,file,gpio,http,i2c,l3g4200d,mdns,net,node,ow,pipe,pixbuf,pwm,rtcfifo,rtcmem,rtctime,sjson,sntp,spi,struct,tmr,uart,wifi,wifi_monitor,ws2812,ws2812_effects
build 2020-06-26 19:39 powered by Lua 5.1.4 on SDK 3.0.1-dev(fce080e)
net.ifinfo(2)
reboots immediately.
Instead it's supposed to return nil
- at least that's what we documented.
@vsky279 would you have time to take a look?
I'll try to have a look :-) sometimes next week.
There seems to be an easy fix: #3267
Expected behavior
net.ifinfo()
should return nil or a table.Actual behavior
Test code
Provide a Minimal, Complete, and Verifiable example which will reproduce the problem.
NodeMCU startup banner
see above
Hardware
ESP8266 LoLin v3, esptool says "Chip is ESP8266EX", using the firmware image from this build