Heat pump monitor ESP8266 problem

@glyn.hudson Can you help?

Trawling the community - possible thing to try Cannot access WiFi AP after uploading from VSCode/PIO - #3 by kobuki

I did read that as well. Mine doesn’t look like it’s crashing (not resetting anyway). But in any case I don’t know what [email protected] is or where it lives - it’s not in the library manager or referenced in any source file as far as I can see.

1 Like

Me neither :grinning:.

1 Like

Thinking about buying a pre-flashed ESP board, de-soldering the module and fitting it to the heat pump monitor board.

According to this thread: ESP continually resetting. Any ideas? - #15 by danbates - the “correct” esp8266 board package to use with Arduino is version 2.4.2. I was using the latest, which is 2.5.2, so I downgraded it. This now doesn’t build, lots of errors as below.

C:\Users\PLC\ArduinoData\packages\esp8266\hardware\esp8266\2.4.2/tools/sdk/lib\libstdc++.a(ios-inst.o): In function `std::basic_ios<char, std::char_traits >::clear(std::_Ios_Iostate)’:

/Users/igrokhotkov/e/ESPTools/crosstool-NG/.build/xtensa-lx106-elf/build/build-cc-gcc-final/xtensa-lx106-elf/libstdc+±v3/include/bits/basic_ios.tcc:122: undefined reference to `std::__throw_ios_failure(char const*)’

C:\Users\PLC\ArduinoData\packages\esp8266\hardware\esp8266\2.4.2/tools/sdk/lib\libstdc++.a(c++locale.o):(.literal.ZNSt6locale5facet18_S_create_c_localeERPiPKcS1+0x4): undefined reference to `std::__throw_runtime_error(char const*)’

C:\Users\PLC\ArduinoData\packages\esp8266\hardware\esp8266\2.4.2/tools/sdk/lib\libstdc++.a(c++locale.o): In function `std::locale::facet::_S_create_c_locale(int*&, char const*, int*)’:

/Users/igrokhotkov/e/ESPTools/crosstool-NG/.build/xtensa-lx106-elf/build/build-cc-gcc-final/xtensa-lx106-elf/libstdc+±v3/src/c++98/c++locale.cc:207: undefined reference to `std::__throw_runtime_error(char const*)’

collect2.exe: error: ld returned 1 exit status

Hi Evan,
This guide needs updating to make clear the pio method isn’t working at the moment with master branch.

If you’re compiling emonESP master branch use Arduino with ESP 2.4.2 installed from the board manager.
If it’s the timer branch you’re using with the hp monitor then compile with pio.

I’ve never seen those errors before! Looks like a windows thing. Which version of Arduino is it? Might be worth trying to uninstall and install again the IDE or the ESP board package.

If using Arduino there are a few libraries to download also. Have you tracked them down?

The 1.8.0 thing referenced above is just PIO’s version scheme for the esp core, it actually uses ESP core 2.4.2 within it. If you’re compiling master using pio and [email protected] is used, it should theoretically work the same as arduino compiling with esp8266 2.4.2 from the board manager.

Hi Dan thanks for the help.

This guide needs updating to make clear the pio method isn’t working at the moment with master branch.

OK, I’m not, but I volunteer to edit the instructions to say that, if (and it’s a big if) I ever get this working!

I’ve re-installed Arduino, bringing it up to the latest version, 1.8.9. I’ve also removed/reinstalled the ESP board package to 2.4.2. Same weird errors. If I change the board package to 2.5.2 it DOES compile but obviously still doesn’t work. Changing back to 2.4.2: errors.

I am using the emonESP main branch, from a couple of days ago.
I did search for and install various libraries, I can see ESP_Async_E1.31, ESPAsyncTCP-master, ESPAsyncWebServer-master and PubSubClient in the libraries directory. I think were some others found via the library manager.

Not sure what ESP_Async_E1.31 is doing there but eveything else looks fine.
How about flashing pre-compiled binaries?
Or do you want to change the code?

The guide does not mention pre-compiled binaries, and I can’t see any binaries in the github…

That’s definitely something that needs updating in that case.

Flashed to the device with esptool.py with command:

esptool.py --baud 460800 write_flash 0x0 ./bin1.bin 0x300000 ./bin2.bin

Archive.zip (358.9 KB)

1 Like

@glyn.hudson
flashing with pre-compiled binaries.
. How to upload pre-compiled binaries readme update by danbates2 · Pull Request #67 · openenergymonitor/EmonESP · GitHub

Dan

Are the binaries master or timer branch?
They may need explicitly identifying.

Ian`

I’ve put master in master. I haven’t checked timer as I thought the binaries were already there.

Dan, thank you VERY much, that worked (esptool.py write_flash 0x0 src.ino.bin 0x300000 src.spiffs.bin)

So, is it worth updating the guide to instruct loading these pre-built binaries?

If I understand right neither of the two options described to build the source are usable at this time - platformio per your comment above, and also this issue I just noticed on GitHub: “Compile error with Arduino IDE #66” - this is the same thing I am getting.

Noticed, thanks. I’ve updated the guide so am waiting for the PR to be accepted, just need to confirm with Glyn.
ArduinoIDE 1.8.9 I’m using on a Mac.
Added working libraries here:
. https://github.com/danbates2/EmonESP-db/tree/master/libraries

I am new to this and just this evening got my board built up.

Same problem as OP, IP address was off in some 169.xxx.xxx.xxx range

I downgraded to 2.4.2 in Board manager. Mine compiles ok.

Master downloaded from:

After uploading with 2.4.2 and connecting on 192.168.4.1. i get:

/home.html not found, have you uploaded the SPIFFS?

I have re-uploaded the SPIFFS successfully, but getting that message?

Thanks!

Message after SPIFFS upload, looks ok?

Sketch uses 427932 bytes (40%) of program storage space. Maximum is 1044464 bytes.
Global variables use 37216 bytes (45%) of dynamic memory, leaving 44704 bytes for local variables. Maximum is 81920 bytes.
[SPIFFS] data : E:\Dropbox\Eco Tech\OpenEnergyMonitor\EmonESP-db-master\src\data
[SPIFFS] size : 1004
[SPIFFS] page : 256
[SPIFFS] block : 8192
/config.js

/home.html

/lib.js

/style.css

[SPIFFS] upload : C:\Users\BAKER\AppData\Local\Temp\arduino_build_594669/src.spiffs.bin
[SPIFFS] address : 0x300000
[SPIFFS] reset : ck
[SPIFFS] port : COM8
[SPIFFS] speed : 115200

Uploading 1028096 bytes from C:\Users\BAKER\AppData\Local\Temp\arduino_build_594669/src.spiffs.bin to flash at 0x00300000

… [ 7% ]

… [ 15% ]

… [ 23% ]

… [ 31% ]

… [ 39% ]

… [ 47% ]

… [ 55% ]

… [ 63% ]

… [ 71% ]

… [ 79% ]

… [ 87% ]

… [ 95% ]

… [ 100% ]

If i had a clue how to use python i would try erasing with ESPTOOL… :thinking:

update…

Got python working and erased the chip!

Re-loaded Prog and Spiffs from Arduino and all working.

Thanks

1 Like

Great.

So to round up this thread:

  1. There are now pre-built binaries, linked in the thread above. Use those unless you really need to build it yourself.

  2. If you are building it, only the Arduino IDE method works (at time of writing)

  3. When you select the ESP8266 board in the board manager, make sure you choose version 2.4.2. Otherwise it will compile but the AP won’t work properly.

  4. When it fails to build because of missing libraries, only use the ones linked above by Dan, there must be a specific version of these needed too. Don’t install them directly from GitHub like I did!

  5. Before loading, do the (full) flash erase step at the end of the instructions.

Easy when you know how.

1 Like