Aircoookie / WLED

Control WS2812B and many more types of digital RGB LEDs with an ESP8266 or ESP32 over WiFi!
https://kno.wled.ge
MIT License
15k stars 3.24k forks source link

So difficult/impossible to flash #1273

Closed wunderbaum closed 3 years ago

wunderbaum commented 4 years ago

What am I doing wrong? I tried to flash it on a wemos mini and a common wemos D1 R2. It failed many times, I even tried to compile it in Vscode/platformio. Flashing was ok, and I even saw the accesspoint WLED. I was able to connect but I never got an IP. Erased everything and tried again. Same dissapointment. I was not able to flash and use both of the boards.

I tried then well known tasmota on the same boards and it worked like a charm.

Steph71 commented 4 years ago

Same issue here.

Have a Node MCU with 32 Mb Flash. I want to give this FW a try ... but something seems shaky.

Flashing works fine, Device shows the orange greeting glow.

AP WLED-AP cannot be seen by my PC (which is a company thing ... sometimes I am not sure what it does and what not) ... however it can be seen by Android tablet and my Iphone, but trying to connect fails.

I tried to flash with ESPTool and with Espressif tool. Erased before ...

Tried older release .. tried 512k Version .. all no success

I also tried to read serial terminal output, but could not figure right baudrate .. any hints ?

also tried tasmota -> works like charm .... also AP mode.

same issue reported here:

https://wled.discourse.group/t/wled-no-ap/904

wunderbaum commented 4 years ago

I also tried to read serial terminal output, but could not figure right baudrate .. any hints ?

According to the platformio.ini, it has monitor_speed = 115200

But the precompiled version only says Ada I think. On vscode/platformio, I see a the connection attempts from the mobile on the serial console. No connection configured. Opening access point WLED-AP Init AP interfaces ---DEBUG INFO--- Runtime: 70070 Unix time: 70 Free heap: 24160 Wifi state: 0 State time: 10014 NTP last sync: 999000000 Client IP: (IP unset) Loops/sec: 38

NeariX67 commented 4 years ago

First of all, the title is misleading. You are able to flash it correctly, but don't seem to be able to connect to it. Since WLED is known for is stability problems in the AP mode. What do you mean with

I was able to connect but I never got an IP

Were you able to connect to the AP and set up your WiFi or did nothing pop up?

Regarding @wunderbaum Having problems inside a business wifi is nothing wled can do about. An ESP32 or ESP8266 is not build to run in a business environment with enhanced security.

wunderbaum commented 4 years ago

I am not in a business-environment, Steph71 is :-) I can see the WLED:AP, but I cannot connect. I tried with a Samsung S4, freshly installed for such config-purpose and with a pixel 4. Unfortunately no success. The phone does not get an IP-address. And the serial log says: Client IP: (IP unset)

Steph71 commented 4 years ago

Regarding @wunderbaum Having problems inside a business wifi is nothing wled can do about. An ESP32 or ESP8266 is not build to run in a business environment with enhanced security.

I am not in a business wifi ... I just cannot see the AP at all on my business laptop ... on my private Samsung Tablet and on my Iphone I can see the AP but connection fails.

wunderbaum commented 4 years ago

I made a small effort, I flashed a wemos mini with version 0.8.6, was easy able to connect via wlan and configure it to join my network. Then I did an OTA-update, worked fine. Same procedure with a nodemcu/wemos D1 was unfortunately not sucessful, Same board with other images like tasmota and easyesp is flashable and configurable. Strange. SO far, I tried out 3 nodemcu without any success, then I tried an old esp12 (see pic) esp12 and flashed it via platformio. That went easy and now its running since an hour without problems.

What the heck is wrong with those wemos boards...

cschuhknecht commented 4 years ago

I successfully flashed a Wemos D1 mini yesterday. I used WLED 0.10.2 and ESPHome Flasher 1.3.0.

https://github.com/esphome/esphome-flasher

Steph71 commented 4 years ago

I can confirm WMOS D1 mini just works ... Node MCU just doesn't ...

I just looked into the esptool logs and see one difference:

NodeMcu: Auto-detected Flash size: 4MB

D2 mini: Auto-detected Flash size: 16MB

Could it be, that 4 Mbyte flash is jut not enough to run the image WLED_0.10.2_ESP8266.bin

Legsmaniac commented 4 years ago

Could it be, that 4 Mbyte flash is jut not enough to run the image

All my lights, all 7 of them, are running on NodeMCU boards with no problems whatsoever. Never had any problems with the 8266 boards but the Wemos D1's I have had problems with. Although I rather suspect it might have been because they were fake D1s but they put me off bothering with them. Since I have no problems with NodeMCUs - yet - I see no reason to change.

pfeerick commented 4 years ago

@Steph71: If your D1 Mini has 16MB of flash, it's probably a D1 Mini Pro, not a D1 Mini. Regardless, WLED has support for 4MB flash, and has no issue running on my D1 Mini (i.e. with 4MB of flash). I can't comment from experience on the NodeMCUs as I haven't tried it on one yet. However, I would have expected it to work with the WLED_0.10.2_ESP8266.bin - with potentially just the pinout wrong. Which you can avoid by using the nodemcuv2 if that is the case.

Size is not your problem, as WLED is only about 575k in size, or 0.57MB (not taking into account the second OTA program slot, or file system partition, etc) out of 4MB. Even taking those other bits into account, there is still plenty of space left.

Tasmotizer (https://github.com/tasmota/tasmotizer) is another option for flashing the firmware... as you can use the 'bin file' option to specify any valid firmware ;) Plus it has the erase and self-resetting device options right there. I would strongly suggest you do erase the device if having issues with it, just in case there are lingering configuration values causing problems.

PS: btw, if you can see the AP, and have connected to it, what IP did you use to try and configure it? WLED uses 4.3.2.1 by default (you should be able to use http://wled.me also if in AP mode), but if that fails, I would try 192.168.4.1. But make sure whatever device you are using is using http, not https as some web browsers are defaulting to nowadays just to throw a spanner in the works :-/ I have just tried WLED_0.10.2_ESP8266.bin with a NodeMCU (marked LoLin NodeMCU v3) and it is working fine - was able to connect to the AP, configure it, and it's on my network now.

Steph71 commented 4 years ago

@pfeerick I am using NodeMCU V3, might be a clone ... Tried Tasmotizer ... shows same behavior. Cannot connect to AP (authentication failure). So no point in even trying to access the webui ... I think I can exclude the flashing process itself, because it works for the D1 Mini ... and it works for tasmota fw

The only think I could think of now is that there is a problem in this particular device, that just creates problems with this piece of firmware ... As soon I get another device of the type in my hands, I will try with that ...

pfeerick commented 4 years ago

Yeah, if you can't connect to the AP you're not going to have much luck accessing the web UI! :laughing: If it works with Tasmota or ESPHome, but not with WLED, then all I can suggest is some strange incomparability. I strongly doubt my NodeMCU v3 is a genuine one... but it seems to be working fine. Hopefully you can lay the blame on some weird hardware gremlin when you get a chance to try another one.

Steph71 commented 4 years ago

Just found another NodeMCU device from the same batch ordered in China some time back ...

Same behavior ... AP shows up but no way to connect.

Both devices work perfect with tasmota, easydsp and other FW. Just WLED won't work.

As a reference I attach pictures of the device:

grafik grafik

pfeerick commented 4 years ago

Oh, they do look cheap and nasty! :open_mouth: Poor little ESP8266 chip all there exposed, instead of under it's nice RF shield (i.e. like the ESP12 wunderbaum pictured earlier)... but, it looks like they have the option of 32MB instead of the usual 4MB, which is a nice option to have. Looks like it has a Winbond SPI flash memory chip too, so the possible PUYA flash issues I was going to mention issues won't be it... maybe someone else will have an idea? :wink:

Steph71 commented 4 years ago

this one is not giving me peace:

I installed platformIO in order to build the firmware from Source.

Using current master

https://github.com/Aircoookie/WLED/tree/b8fcab29ac180ca12e6a1d81870133274051275b

I was not completely sure which build target to choose .. so I tried env:d1_mini as I assume it compatible with my nodeMCU V3

After built I clicked "Upload and Monitor" from the PlatformIO Menu -> Download Starts -> Terminal starts.

Result: connect to the AP -> success

So now I am again supecting the upload procedure. Going back to my esptool prompt:

esptool erase_flash esptool write_flash 0x0 .pio\build\d1_mini\firmware.bin

Result: connect to the AP -> success

So its not the upload process, so I went back to the release Binary:

esptool erase_flash esptool write_flash 0x0 WLED_0.10.2_ESP8266.bin

Result: connect to the AP -> success

Now I am confused ... can my previously built binary can do something to my Device, that is persistant over

esptool erase_flash

So I tried to flash my previously used device, that has never seen the newly built binary:

esptool erase_flash esptool write_flash 0x0 .pio\build\d1_mini\firmware.bin

Result: connect to the AP -> Doesn't Work

So last thing I could try, is to flash my second Device also with platformIO to proove, that the process is doing somenting to to the esp device, that is persistant over flash delete and which decides whether WLED works or not ...

But then my testcase is gone .... I would really like to understand what platformIO upload can do what no other flasher (I tried Tasmotizer, EspHomeFlasher, and esptool) can do.

Edit: Just found that platformIO is actually using esptool to flash and its using the same version I use on teh commandline ...

kendersec commented 3 years ago

I'm having similar issues with the same black "wemos" board, a few more details on what I've tried and the symptoms https://wled.discourse.group/t/wled-no-ap/904

mrloggyst commented 3 years ago

I have the same problem.

Steph71 commented 3 years ago

@mrloggyst, @kendersec

Did you try to build and flash through platformio as described here In this way I was turning my non working node mcu V3 in a working one ... even thogh not understood ...

mrloggyst commented 3 years ago

@Steph71, I've tried, but I can`t reproduce your case. In my option, I could not convince the device to show WLED-AP. WLED-AP exist only maximum @ 8.6 release binary. But its not worked well too. Because if i change setting for connect to my wifi, it disappears

kendersec commented 3 years ago

I've tried with PlatformIO, the steps you suggest and also a bunch of other flavours (not exactly from the commit you suggest but fairly up to date master).

@mrloggyst WLED-AP is meant to disappear once it manages to establish a connection with the configured wifi. You then have to find the IP address of the device to be able to connect.

mrloggyst commented 3 years ago

@Steph71, I tried some test case with disable part of code in main loop WLED::loop() and i think i found that a problem is in handleWs(); with all commented "handle" function except handleWs() and handleConnection(). Problem still exists. But if we add before handleWs(); delay(100) that situation cardinaly change. WLED-AP will appear and we may connect to our home wifi network. And app interface is work. I think that something is wrong with the async method or something similar to this in web part. I also tried reflash device don`t erase wifi config setting and return back without delay function in code. Button (on/off) work. (monitoring com3 port). Brightness work too. But main form app for led if click on device in app hangup and display (after some time) device disconnect.

mrloggyst commented 3 years ago

@wunderbaum, can you label issue as a bug?

wunderbaum commented 3 years ago

@wunderbaum, can you label issue as a bug?

Unfortunately, I cannot change the label :-(

moesfeld commented 3 years ago

I'm also having these issues . I use the same Board as @Steph71 and can pretty much confirm his observations on persistence over several flashes with erase_flash prior to flashing. I will try flashing trough platform I/O when I get back home

moesfeld commented 3 years ago

Okay this is weird. Compiled and flashed current Master -> No AP showing up. Flashed 0.91 via home esp -> AP is showing up. Flashed 0.11 via home esp -> No AP Compiled and flashed current Master with wifi credentials in my_confing_sample.h -> AP is showing up

JohannesStroebel commented 3 years ago

I've got the same board as @Steph71 and got similiar issues. Flashing through either NodeMCU PyFlasher, Tasmotizer and ESPhome-flasher did show successful flashing, but AP doesn't even show up. Tasmota works like a charme, AP shows up. I will try VSCode PlatformIO next

JohannesStroebel commented 3 years ago

Okay sorry guys, I'd consider myself as someone fairly competent with tech, however I don't understand a single thing about building the .bin . I've been trying, but I'm running into various problems all the time. Could anybody explain exactly how to do this or at least link some useful information ("build from github.com/xyz" is not enough, someone not familiar with any of this, can't understand a single thing). This sure is not they way it's intended to be done, because it's by far not straightforward

Edit: For all other dummies like me: Install VSCode Install git Install PlatformIO extension in VSCode Open PlatformIO from the left sidebar Click "Clone Git Project" in the Lower left hand corner Paste URL from GitHub (https://github.com/Aircoookie/WLED.git) + Enter Choose location and save Open Explorer from the left sidebar Navigate to wled00/my_config.h Uncomment line 19-23 by removing the /* in line 17 and 23 Replace CLIENT_SSID and CLIENT_PASS by your own Save Open PlatformIO from the left sidebar Navigate to env:d1_mini Click Erase Flash Click Upload

that's it for now, I will continue once I find out, how to get everything working, because now it's not.

moesfeld commented 3 years ago

Could't stop working on this ;-) I can confirm @mrloggyst observations. But I don't think it's inside handleWs(); I can move the delay pretty much up and down the loop and the effect is the same -> AP shows up correctly. Testing showed that reducing to delay(10); works also so I moved it to the end of the loop. Reducing further to around 5-6 I get spotty results. I have a hunch that it has to do with arduino core but can't really point my finger at it. Since this seems to be limited to specific boards I wont commit a pull request but maybe it helps someone compiling theyr own version

stale[bot] commented 3 years ago

Hey! This issue has been open for quite some time without any new comments now. It will be closed automatically in a week if no further activity occurs. Thank you for using WLED!