Wemos D1 Mini Pro not booting when referencing ArduinoOTA

Folks,

I got the weirdest issue.

I have a Wemos D1 Mini working just fine with a sketch. Sketch includes ArduinoOTA and that too worked well.

Today I changed the board to a new Wemos D1 Mini Pro, changed the ini, compiled and uploaded. No drama. Odd, board won’t boot.

I eventualy track it down to my file called OTA.cpp. In there I use the boilerplate OTA code.
When I comment it all out, the board runs fine.
When I put it back in but don’t refrence it, the board just crashes (see below).
Comment out the single line ArduinoOTA.setPassword(“FFF”), it compiles ok but the sketch refuses to run.
Remember, it’s in a funciton but not called!

This is the output

ets Jan 8 2013,rst cause:2, boot mode:(3,6)

load 0x4010f000, len 3460, room 16
tail 4
chksum 0xcc
load 0x3fff20b8, len 40, room 4
tail 4
chksum 0xc9
csum 0xc9
v00045830
~ld
e:3
ets Jan 8 2013,rst cause:3, boot mode:(3,6)

ets_main.c

To recap

  • This worked on another board.
  • This does not work, even if code is there but not refrenced.

Ever seen anything like this?

Does the number of bytes in the Flash or RAM usage change in the final lines of the compilation log when you comment or uncomment the line? If yes, it’s not effectless after all.

Good shout - it is different.

With code:

RAM: [==== ] 41.2% (used 33748 bytes from 81920 bytes)
Flash: [=== ] 26.9% (used 280564 bytes from 1044464 bytes)

Without code:

RAM: [==== ] 40.8% (used 33428 bytes from 81920 bytes)
Flash: [=== ] 26.7% (used 278397 bytes from 1044464 bytes)

I also made a small test sketch which had only wifi and OTA and that worked perfectly.

So, on this board, OTA works but does not work with my sketch.

So confused…

Just tried it on a number of other boards. It fails on the pros, works fine on te d1-minis…

A D1 mini pro has 16MByte of flash, which causes some problems in PlatformIO even during filesystem uploads.

Now while that exact bug may be unrelated, you can give it a try and make PlatformIO you have a more supported flash chip size, by adding

board_build.ldscript = eagle.flash.8m7m.ld

to the platformio.ini.