Pierre-33 / SenseoWifi

Wifi'ify the Senseo coffee maker. Circuit and firmware for an internal Senseo hack to monitor and control the daily coffee brew (via MQTT) ☕️📶
GNU General Public License v3.0
0 stars 0 forks source link

Senseo Wifi wont get past Sending Init Information... #2

Open bjornmorsman opened 4 months ago

bjornmorsman commented 4 months ago

Hi Pierre,

we talked about this problem at ThomDietrich's repo so what dit i try.

i add a bunch of "Serial.println("some unique string to identify this log");" in SenseoWifi.cpp:

At the very beginning of loopHandler() At the very end of setup(), one before Homie.setup() and the other one after still in setup(), one before and after senseoNode.advertise("pendingCommands") and one after senseoNode.advertise("processedCommands") One for each case of the switch() in onHomieEvent() At the beginning of setupHandler(), before and after mySenseo.setup()

This gives me no usefull extra information, not before it hangs at Sending Initial Information.... i also commented out the reset button, that doesn help, after that i flashed ThomDietrich's original firmware and than the senseo-wifi works fine so i doubt it is hardware related. deleted al the topics in mqtt explorer en tried again, its get populated until pendingCommands, i also tryed a differen mqtt broker, problem persists. i checked you fork and i downloaded the ''master'' version that is the correct one right? you told me that you never tried your fork without your add-on so i put a 1K resistor at A0 so the pcb would think your add-on is installed, that doesnt help either

i indeed changed the order of the advertisements so i can narrow down where the problem is.

    senseoNode.advertise("pendingCommands").setName("Current Commands").setDatatype("string").setRetained(false);
    senseoNode.advertise("processedCommands").setName("Current Commands").setDatatype("string").setRetained(false);

when i comment in the above 2 rules of 1 of them my senseo hangs at boot when Sending Initial Informatie.. and doesnt get past that ever.

senseoNode.advertise("programContext").setName("Program Context").setDatatype("string");

when i comment in the above rule and comment out the pending/proccesedCommnds rules, i get an bootloop with the next information.

Exception (3):
epc1=0x40284638 epc2=0x00000000 epc3=0x00000000 excvaddr=0x400343e1 depc=0x00000000

LoadStoreError: Processor internal physical address or data error during load or store
  epc1=0x40284638 in umm_info at ??:?

>>>stack>>>

ctx: cont
sp: 3ffffd80 end: 3fffffd0 offset: 0150
3ffffed0:  00014b33 001300b0 3fffff38 40219a0e
3ffffee0:  00000020 00000038 3fff752c 4020b935
3ffffef0:  3fff23b0 3ffe9704 00000000 3ffead72
3fffff00:  3fff22b0 3fff4e4c 3fff62bc 402847dc
3fffff10:  00003108 00000621 3ffe8958 4020a6a5
3fffff20:  00000001 00000001 00000000 4021066d
3fffff30:  3fff6564 00000020 00000022 3fff1d0c
3fffff40:  3fff22b0 3fff4e4c 3fff1d68 40211a5c
3fffff50:  00000000 00000000 3ffe8954 00000004
3fffff60:  3fff6564 00a400af 00000000 00003232
3fffff70:  00000000 3fff74f4 7a0ba8c0 4021d2d8
3fffff80:  00000007 fffffffc 4023986c 40239864
3fffff90:  402183ec 3ffea3c0 3fff2758 3fff28d4
3fffffa0:  3fffdad0 00000000 3fff1f58 4020d4ef
3fffffb0:  00000000 00000000 3fff28a8 4021b020
3fffffc0:  feefeffe feefeffe 3fffdab0 401018c1
<<<stack<<<

0x40219a0e in String::changeBuffer(unsigned int) at ??:?
0x4020b935 in __gnu_cxx::__normal_iterator<unsigned char*, std::vector<unsigned char, std::allocator<unsigned char> > > std::vector<unsigned char, std::allocator<unsigned char> >::insert<char const*, void>(__gnu_cxx::__normal_iterator<unsigned char const*, std::vector<unsigned char, std::allocator<unsigned char> > >, char const*, char const*) at ??:?
0x402847dc in umm_max_block_size at ??:?
0x4020a6a5 in AsyncMqttClient::publish(char const*, unsigned char, bool, char const*, unsigned int, bool, unsigned short) at ??:?
0x4021066d in HomieInternals::BootNormal::_prefixMqttTopic(char const*) at ??:?
0x40211a5c in HomieInternals::BootNormal::_advertise() at ??:?
0x4021d2d8 in uart_write at ??:?
0x4023986c in std::_Function_handler<void (HomieEvent const&), void (*)(HomieEvent const&)>::_M_manager(std::_Any_data&, std::_Any_data const&, std::_Manager_operation) at ??:?
0x40239864 in std::_Function_handler<void (HomieEvent const&), void (*)(HomieEvent const&)>::_M_invoke(std::_Any_data const&, HomieEvent const&) at ??:?
0x402183ec in HardwareSerial::write(unsigned char const*, unsigned int) at ??:?
0x4020d4ef in HomieInternals::HomieClass::loop() at ??:?
0x4021b020 in loop_wrapper() at core_esp8266_main.cpp:?
0x401018c1 in cont_wrapper at ??:?

i tryed downgrading PlatformIO, that doesnt solve the problem. it looks like there is a problem with AsyncMqttClient. i checked my platformio.ini and its using version 0.9.0 so that has te be correct.

what version of platform = espressif8266 did you use when building could that be a problem maybe? i did also try different builds of homie that doesnt help.

if you need some more informatie please ask me

bjornmorsman commented 4 months ago

Hi Pierre,

Today i tested again, i commented out the next rule and build the firmware.

marvinroger/AsyncMqttClient @ ^0.9.0

The senseo booted in the correct state, the only problem is that mqtt discovery doesnt work with the AsyncMqttClient packed with homie 3.0.1 can we say that the problem must be in the AsyncMqttClient ? or can it be in the espressif8266 version somehow?

Pierre-33 commented 4 months ago

Ok, so "good news" I flashed a blank esp8266 D1 mini with no pcb attached and I can repro your crash. I'll add some logs and try to find out what I miss.

Pierre-33 commented 4 months ago

Ok, so as you already find out, for some reason the advertising of pendingCommands and processedCommands caused AsyncMQTTClient to crash. I shorten the name of both topic (I replacement xxCommands by xxCmds) and it seems to have fix the issue. It's a mystery to me why my senseo flashed a years ago seems to not have the issue at all and the fix is not really satisfying but that all I can offer for now.

The fix is pushed on master, let me know how it works for you.

bjornmorsman commented 4 months ago

Hi Pierre,

Thanx for all the work, it looks like its function now! i also have another question, your pcb arrived last saturday so i tested it out right away. you have add some extra pin headers for the connection to the senseo, how do i connect them to my senseo? in parallel with the existing wires or do i need to solder new wires to the pcb of the senseo?

Thanx in advance

Pierre-33 commented 4 months ago

Indeed, I didn't document anything, sorry about that :-/ So you are using the pcb found on my git hub right? I'll try to remember but it's been a year, I should have it wrote down for my self :) The biggest change with my pcb is that it came between the physical button and the actual senseo pcb. So if I remember correctly, you need to unplug the button from the senseo pcb and plug them on the esp pcb, and then you should have some other connectors on esp pcb that go where the button were going in the first place.

Pierre-33 commented 4 months ago

If I remember correctly (again), the row of 5 pins the right (with "used only by the add-on") is where you connect the button and you unplug from the senseo PCB, if your senseo is like mine it should fit perfectly if you solder a connector. The top connector should go directly toward the senseo pcb (Dupont wire should do the trick)