After using the Home Assistant MELcloud integration I would like to know more about what my heat pump is doing. So I bought a Procon A1M melcobems to have a modbus connection to the heat pump. A RS485 converter than gives the signal to a ESP8266 (Wemos D1 mini) with ESPhome to make all available in Home Assistant. The idea is not new and code is already available. I got it from tweakers.net directly from one of the users and that code works.
Another user there expanded the code with a lot of useful things (but he uses a ESP32). So I tried to put that on the D1 mini. The installation appears to run without problems but after that the device doesn’t come online.
If I use a usb connection to read out the logs I get this:
User exception (panic/abort/assert)
--------------- CUT HERE F
User exception (panic/abort/assert)
--------------- CUT HERE FOR EXCEPTION DECODER ---------------
Unhandled C++ exception: OOM
>>>stack>>>
ctx: cont
sp: 3ffffc50 end: 3fffffc0 offset: 0000
3ffffc50: 00000000 0082008f 00000000 4010024c
3ffffc60: 000000fe 00000000 00000000 00000000
3ffffc70: 00000000 00000000 00000000 00000001
3ffffc80: 00007fff 00000000 00000002 3fff860c
3ffffc90: 3fffb4b4 4020ad2a 00000020 4022988e
3ffffca0: 3fffb4b4 4020ad2a 00000020 402298ad
3ffffcb0: 00000002 00000000 00000020 40228ef8
3ffffcc0: 3fffb49c 00000000 00000002 4020ad2a
3ffffcd0: 3fffb4b4 00000010 3ffffd20 3fffb4a4
3ffffce0: 3fff3fdc 00000045 3fff3fdc 00000000
3ffffcf0: 3fff408c 3fff799c 3fff860c 4020c090
3ffffd00: 00000002 4020c6dd 3fff1498 4020c0a8
3ffffd10: 3ffffd40 3ffffd30 00000010 40214633
3ffffd20: 3fff408c 3fff85a4 4022d55c 4022d540
3ffffd30: 3fff79ac 3fff85a4 3fffbc54 40261824
3ffffd40: 00000004 000000bf 3fffbc54 00000102
3ffffd50: 3fff407c 00000046 3fff407c 402057a8
3ffffd60: 6c656d6f 00000045 3fff3fdc 4020bce2
3ffffd70: 4a200200 00000000 00000000 00000000
3ffffd80: 00000000 3fffaa44 3fff1498 00000001
3ffffd90: 3fff3f7c 00000044 3fff1498 4022d448
3ffffda0: 3fff96ec 3ffffdc0 3fff1498 4022d500
3ffffdb0: 3fff3fdc 00000045 3fff1498 40213eb1
3ffffdc0: 00000043 00000043 3fffa954 40242428
3ffffdd0: 0000011c 00000108 00000042 40212e72
3ffffde0: 3fffa3b8 3fff1498 3fffa314 3fff1560
3ffffdf0: 3fffa314 3fff1498 3fffa314 4021acec
3ffffe00: 00000001 00000000 00000000 00000000
3ffffe10: 00000000 feefef00 feefeffe feefeffe
3ffffe20: 3ffffe28 0000000e 2d505345 7374694d
3ffffe30: 73696275 00006968 00000000 00000000
3ffffe40: 3ffffe48 00000009 666e6f63 73656769
3ffffe50: 00000070 00000000 00000000 00000000
3ffffe60: 140a0a01 140a0a29 ffffff01 00000000
3ffffe70: 00000000 00000000 3fff3ef4 00000013
3ffffe80: 0000001e 00000000 00000000 00000000
3ffffe90: 00000000 00000000 3ffffea0 00000009 <
3ffffea0: 64696341 706f7020 00000073 00000000
3ffffeb0: 00000000 00000000 140a0a01 140a0a29
3ffffec0: ffffff01 00000000 00000000 00000000
3ffffed0: 3ffffed8 0000000b 3a69646d 2d77656e
3ffffee0: 00786f62 006e6f69 3fffff60 00000001
3ffffef0: 3ffffee8 00000001 3ffffee8 00000001
3fffff00: 3ffffee8 00000001 3ffffee8 00000001
3fffff10: 3ffffee8 00000001 3ffffee8 00000001
3fffff20: 3ffffee8 00000001 3ffffee8 00000001
3fffff30: 3ffffee8 00000001 3ffffee8 00000001
3fffff40: 3ffffee8 00000001 3ffffee8 00000001
3fffff50: 3ffffee8 00000001 3ffffee8 00000001
3fffff60: 3fff8b5c feefeffe feefeffe feefeffe
3fffff70: 3fffa218 000000b8 3fffa314 00000000
3fffff80: 3ffe9b72 feefeffe feefeffe feefeffe
3fffff90: feefeffe feefeffe feefeffe 3fff19d4
3fffffa0: 3fffdad0 00000000 3fff19c0 402293c8
3fffffb0: feefeffe feefeffe 3ffe86c4 40100701
<<<stack<<<
last failed alloc call: 4020AD2A(32)
--------------- CUT HERE FOR EXCEPTION DECODER ---------------
last failed alloc caller: 0x4020ad2a
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
v0009d290
~ld
User exception (panic/abort/assert)
--------------- CUT HERE FOR EXCEPTION DECODER ---------------
Unhandled C++ exception: OOM
>>>stack>>>
ctx: cont
sp: 3ffffc50 end: 3fffffc0 offset: 0000
3ffffc50: 00000000 0082008f 00000000 4010024c
3ffffc60: 000000fe 00000000 00000000 00000000
3ffffc70: 00000000 00000000 00000000 00000001
3ffffc80: 00007fff 00000000 00000002 3fff860c
3ffffc90: 3fffb4b4 4020ad2a 00000020 4022988e
3ffffca0: 3fffb4b4 4020ad2a 00000020 402298ad
3ffffcb0: 00000002 00000000 00000020 40228ef8
3ffffcc0: 3fffb49c 00000000 00000002 4020ad2a
3ffffcd0: 3fffb4b4 00000010 3ffffd20 3fffb4a4
3ffffce0: 3fff3fdc 00000045 3fff3fdc 00000000
3ffffcf0: 3fff408c 3fff799c 3fff860c 4020c090
3ffffd00: 00000002 4020c6dd 3fff1498 4020c0a8
3ffffd10: 3ffffd40 3ffffd30 00000010 40214633
3ffffd20: 3fff408c 3fff85a4 4022d55c 4022d540
3ffffd30: 3fff79ac 3fff85a4 3fffbc54 40261824
3ffffd40: 00000003 000000bf 3fffbc54 00000102
3ffffd50: 3fff407c 00000046 3fff407c 402057a8
3ffffd60: 6c656d6f 00000045 3fff3fdc 4020bce2
3ffffd70: 4a200200 00000000 00000000 00000000
3ffffd80: 00000000 3fffaa44 3fff1498 00000001
3ffffd90: 3fff3f7c 00000044 3fff1498 4022d448
3ffffda0: 3fff96ec 3ffffdc0 3fff1498 4022d500
3ffffdb0: 3fff3fdc 00000045 3fff1498 40213eb1
3ffffdc0: 00000043 00000043 3fffa954 40242428
3ffffdd0: 0000011c 00000108 00000042 40212e72
3ffffde0: 3fffa3b8 3fff1498 3fffa314 3fff1560
3ffffdf0: 3fffa314 3fff1498 3fffa314 4021acec
3ffffe00: 00000001 00000000 00000000 00000000
3ffffe10: 00000000 feefef00 feefeffe feefeffe
3ffffe20: 3ffffe28 0000000e 2d505345 7374694d
3ffffe30: 73696275 00006968 00000000 00000000
3ffffe40: 3ffffe48 00000009 666e6f63 73656769
3ffffe50: 00000070 00000000 00000000 00000000
3ffffe60: 140a0a01 140a0a29 ffffff01 00000000
3ffffe70: 00000000 00000000 3fff3ef4 00000013
3ffffe80: 0000001e 00000000 00000000 00000000
3ffffe90: 00000000 00000000 3ffffea0 00000009 <
3ffffea0: 64696341 706f7020 00000073 00000000
3ffffeb0: 00000000 00000000 140a0a01 140a0a29
3ffffec0: ffffff01 00000000 00000000 00000000
3ffffed0: 3ffffed8 0000000b 3a69646d 2d77656e
3ffffee0: 00786f62 006e6f69 3fffff60 00000001
3ffffef0: 3ffffee8 00000001 3ffffee8 00000001
3fffff00: 3ffffee8 00000001 3ffffee8 00000001
3fffff10: 3ffffee8 00000001 3ffffee8 00000001
3fffff20: 3ffffee8 00000001 3ffffee8 00000001
3fffff30: 3ffffee8 00000001 3ffffee8 00000001
3fffff40: 3ffffee8 00000001 3ffffee8 00000001
3fffff50: 3ffffee8 00000001 3ffffee8 00000001
3fffff60: 3fff8b5c feefeffe feefeffe feefeffe
3fffff70: 3fffa218 000000b8 3fffa314 00000000
3fffff80: 3ffe9b72 feefeffe feefeffe feefeffe
3fffff90: feefeffe feefeffe feefeffe 3fff19d4
3fffffa0: 3fffdad0 00000000 3fff19c0 402293c8
3fffffb0: feefeffe feefeffe 3ffe86c4 40100701
<<<stack<<<
last failed alloc call: 4020AD2A(32)
--------------- CUT HERE FOR EXCEPTION DECODER ---------------
last failed alloc caller: 0x4020ad2a
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
v0009d290
~ld
Because of the OOM message I also tried a D1 mini pro which should have more memory but the problem remains. I have no clue where to start troubleshooting. I hope you have
Edit:
Tried to remove all logger activity (level: none). Didn’t make a difference.
If I look at the installation log maybe memory isn’t the problem:
INFO Reading configuration /config/esphome/pro-mitsubishi.yaml...
INFO Generating C++ source...
INFO Compiling app...
Processing esp-warmtepomp (board: d1_mini_pro; framework: arduino; platform: platformio/espressif8266 @ 3.2.0)
--------------------------------------------------------------------------------
HARDWARE: ESP8266 80MHz, 80KB RAM, 16MB Flash
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
Dependency Graph
|-- <ESPAsyncTCP-esphome> 1.2.3
|-- <ESPAsyncWebServer-esphome> 2.1.0
| |-- <ESPAsyncTCP-esphome> 1.2.3
| |-- <Hash> 1.0
| |-- <ESP8266WiFi> 1.0
|-- <DNSServer> 1.1.1
|-- <ESP8266WiFi> 1.0
|-- <ESP8266mDNS> 1.2
|-- <ArduinoJson> 6.18.5
Compiling /data/esp-warmtepomp/.pioenvs/esp-warmtepomp/src/main.cpp.o
Linking /data/esp-warmtepomp/.pioenvs/esp-warmtepomp/firmware.elf
RAM: [====== ] 55.9% (used 45800 bytes from 81920 bytes)
Flash: [====== ] 61.2% (used 639569 bytes from 1044464 bytes)
Building /data/esp-warmtepomp/.pioenvs/esp-warmtepomp/firmware.bin
esp8266_copy_factory_bin(["/data/esp-warmtepomp/.pioenvs/esp-warmtepomp/firmware.bin"], ["/data/esp-warmtepomp/.pioenvs/esp-warmtepomp/firmware.elf"])
========================= [SUCCESS] Took 7.42 seconds =========================
INFO Successfully compiled program.
Edit 2:
If I remove the last part of the yaml code with all the text_sensors the esp comes online immediately and displays all remaining sensors. If I add one then it won’t work. The strange thing is the first code I mentioned also has some of the same text_sensors and is working.
If remove most of the code, leaving only the text_sensors, then it works as well. So it goes wrong somewhere in the combination?