absalom-muc/MHI-AC-Ctrl

No / partial data published

Closed this issue · 26 comments

Programmed the ESP with latest release from src, made sure to use PubSub 2.7 and to be secure in soldering etc.
Plugged it into my MHI-SRK50SW and the module boots up and connects to both WiFi and MQTT broker.

But I'm only seeing partial data and can't send commands... so something is wrong. Now what is the best approach to debug?

This is all I see:
image

Have you considered the Troubleshooting Guide, especially section 'Pins not properly connected'?

Yeah was doing that. Serial console displays "mhi_ac_ctrl_core.loop error: -3", so I'm off checking pins, thanks for the headsup :)

So, I checked with the following result:

`
Starting MHI-AC-Ctrl v2.5R21
CPU frequency[Hz]=80000000
current BSSID: FF:FF:FF:FF:FF:FF, strongest BSSID:
Connecting from bssid:FF:FF:FF:FF:FF:FF to bssid:, channel:0
.......... connected to LaDy_Domotica, IP address: x.x.x.x, BSSID: 6E:3B:00:00:00
OTA Ready
Attempting MQTT connection... connected
status=67 topic=connected payload=1
status=64 topic=RSSI payload=-56
status=66 topic=WIFI_LOST payload=0
status=65 topic=MQTT_LOST payload=0
status=65 topic=WIFI_BSSID payload=6E:3B:6B:00:00:00
Measure frequency for SCK, MOSI and MISO pin
status=70 topic=fSCK payload=0
status=71 topic=fMOSI payload=564
status=72 topic=fMISO payload=57
SCK frequency=0Hz (expected: >3000Hz) out of range!
MOSI frequency=564Hz (expected: <SCK frequency) out of range!
MISO frequency=57Hz (expected: ~0Hz) out of range!

--------------- CUT HERE FOR EXCEPTION DECODER ---------------

Soft WDT reset

stack>>>

ctx: cont
sp: 3ffffdb0 end: 3fffffc0 offset: 01a0
3fffff50: 3ffee860 3ffee864 3ffeeae0 402011fd
3fffff60: 0000002b 00000000 3ffee9c4 3ffeec70
3fffff70: 3fffdad0 00000000 3ffee870 4020120e
3fffff80: 3fffdad0 00000000 3ffee8a8 4020255b
3fffff90: 40201b70 feefeffe 4020ff48 4020ff2c
3fffffa0: feefeffe feefeffe 3ffeec5c 4020d6cc
3fffffb0: feefeffe feefeffe 3ffe85f4 40101195
<<<stack<<<

--------------- CUT HERE FOR EXCEPTION DECODER ---------------

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

load 0x4010f000, len 3460, room 16
tail 4
chksum 0xcc
load 0x3fff20b8, len 40, room 4
tail 4
chksum 0xc9
csum 0xc9
v00051a70
~ld
`

I checked the board to see if there were any short between pins - not the case.

Attached the SPI log, should that help debug...
SRK50ZS-W.txt

Anything I could do to check this? Should I grab the multimeter to measure voltages or something?

This log

SCK frequency=0Hz (expected: >3000Hz) out of range!
MOSI frequency=564Hz (expected: <SCK frequency) out of range!
MISO frequency=57Hz (expected: ~0Hz) out of range!

clearly shows that there is something wrong with the electrical connections. Before we start with the debugging, two questions:

  1. Have you used the original schematic and PCB or have you changed something? In case of changes, please describe them in detail.
  2. Have you directly plugged-in the PCB into the AC or do you use a cable for the connection?

yeah it's the original schematic and PCB without changes, v2.2. The unit is plugged in directly into the AC without cable in between. See attached pics
20220324_151115
20220324_151200
.

o.k., looks good. Let's start with the measurement. MHI-AC-Ctrl PCB should be plugged in into AC but ESP8266 board should be deattached. Please ensure that you don't touch inside the AC - it is dangerous!

  1. Between 2 red marked pins GND and +5V should be 5V:
    grafik

  2. Between 2 red marked pins GND and 3V3 should be 3.3V:
    grafik

  3. Between 2 red marked pins GND and SCK (high) should be approx. 2.5V:
    grafik

  4. Between 2 red marked pins GND and SCK (low) should be approx. 1.7V:
    grafik

If you have deviations please tell me the values.
And please upload a foto brom the bottom of your MHI-AC-Ctrl PCB.

Thanks for taking the time to troubleshoot.
I;ve got some weird readings. Some fluctuate a bit and might be influenced a little by me having to hold the dupont cables with my finger to the test-unit, as the location of the airco isn't.....ideal :-)

GND - 5V = 5.03V DC
GND - 3.3V = 0.25 - 0.38v DC
GND - SCKhigh = 2.3v DC
GND - SCKlow = 0.09 - 0.11v DC

Attached the bottom of the unit. I've had the AC on 230V but not powered on, that okay?

20220412_233843

The values are reasonable. Of course we can't measure the 3.3V domain when the ESP8266 is not connected-my fault. It makes no difference if the AC is powered.
So please repeat the measurement for GND - 3.3V and GND - SCKlow with ESP8266 board attached.

Measured again with Wemos D1 Mini attached:

GND - 3.3 = 3,29v DC
GND - SCKlow = 1,06v DC
GND - SCKhigh = 1,26v DC

Looks not too bad.
You wrote already that you use the latest version from the repository, however can you confirm that the following lines in MHI-AC-Ctrl-core.h
grafik
are not changed?
To be honest I have currently no idea what the reason for the bug could be and how to continue, but I will continue to think about it ...

yes, those are correct.
image

Good to read that the voltages appear to be correct. Honestly I have too little electrotechnical background to understand where to look. Would some kind of debug program on the wemos help to troubleshoot?

Not sure at all if relevant, but I did change some parts of the config:
#define POWERON_WHEN_CHANGING_MODE true // because I want to integrate with HomeAssistant
#define ROOM_TEMP_MQTT //because I later want to add an external temp sensor

But honestly that seems totally irrelevant...

Yes, it is not relevant. With the standard program you use, you have already a good test of the MHI-AC-Ctrl input pins SCK and MOSI with the integrated frequency measurement. Since the inputs signals seem to be o.k., you could try replacing ESP8266. I suppose you don't have an oscilloscope on hand right now.

To be complete, I measured the voltages on the AC PCB, from left to right with pin 5 as Ground:
1 = 12.46v
2 = 2.01v
3 = 3.45v
4 = 1.10v

I don't have an oscilloscope. I'll try to reflash the Wemos with the stable branch for now, just to be sure...

edit: flashing v2.2 with just basic WiFi and MQTT settings didn't make any difference, still the same output to the mqtt broker :(

I rechecked the values and there is something wrong with the voltages. To have a clear common reference I use the pin numbering from the schematic for X1 (different to your numbering)
1 - GND : 0V
2 - MISO : toggling between 0V and 3V, but currently irrelevant because it is our ouput
3 - MOSI : 4.7V (you have 3.45V)
4 - SCK : 4.7V (you have 2.01V)
5 - +12V : 12.4V

We should check why you have significant lower voltages for SCK and MOSI. It could be related to different multimeters, but maybe not. Can you measure the X1 voltages without the MHI-AC-Ctrl PCB plugged in?

Got to thank https://github.com/DYLaKo for his tip to take a look at his manual. It's in Dutch, but it brought me at the right points to check the flashing procedure. I redid everything and I think that in my original flashes, I missed some libraries: Didn't install the "ESP8266 Microgear" from Chavee Issariyapat (didn't knew I needed that), didn't install the onewire and dallastemperature one (as I thought I didn't need them since no connected external temp. sensor is being used).

But once I installed all those modules and reflashed the Wemos, the unit throws a lot more data on mqtt, and I can controll the unit through HomeAssistant and everything!

image

So I'm happy, thankful to you and such great community.

I'm glad to hear that it works!

But I don't believe the context to the missing libraries.
"ESP8266 Microgear" is not used in MHI-AC-Ctrl software
onewire and dallastemperature are included only when TEMP_MEASURE_PERIOD >0. And if a library is missing then you get an error message during compile.

However, congratulation 👍

then I can't explain it :)

Okay, you were right I think.... it worked for a bit but now it doesn't anymore... and the values are way off again;

image

I'll remeasure the X1 voltages without PCB.

Without PCB connected:

1 - GND : 0V
2 - not measured because of risk of shorting with ground in this unhandy position ;-)
3 - MOSI : 4.66 V
4 - SCK : 4.7 V
5 - +12V : 12.46 V

Inspired by your latest addition to Troubleshooding.md, I measured the GND - LV and GND - HV on the level shifter, with the board stuck into the AC. Where HV measures a neat 5V, ground to LV only gives 0.85 - 0.9V.

Could that indicate that the level shifter is damaged somehow? Could it be that I soldered to hot for this component? (by default on 430 degrees C).

I also think that it is related to the voltage shifter. But since it had worked for a short time, it could be related to a bad solder conncetion. I suggest you resolder all voltage shifter related solder connections (especially the voltage supply / GND pins). But please reduce the temperature to <400°C. I usually use approx. 350°C. And use some solder, just heating it probably won't do the trick.

I checked every connection to the levelshifter and verified the working of it. My first conclusion was wrong, as the component seems to need the 3.3V also on LV to work correctly (delivered by the Wemos). I was wrongly assuming it would just transform the 5V input to 3.3V itself...

I also reflashed everything from a clean project to make sure no unwanted typos were present (with two small kids around, you never know if they hit the keyboard when you weren't looking for 0.2 seconds lol).

I now get a different output, it seems. I looks like there is some short between fMISO and fMOSI, but then the multimeter says there isn't...

image

Also when sending a command to the set topic, I don't get an updated cmd_receiver=ok. So is it not reading the MQTT topic correctly or is it unable to send the command to the AC?

I'm lost....fSCK is back to <3000 now, fluctuating like mad...
image

Since fMISO=fMOSI I assume a short, too. If a MISO frequency>10Hz is detected during boot, then the ESP8266 stops working (endless loop until device is reseted). Which SW do you use? I prefer to do the debugging based on my SW only, nothing else should interfere.

SW you mean version (your src folder), compiled and uploaded with Arduino IDE. Last time I used Termite to look at the console but would happily use something different.

Okay. so they are shorted only the resistance was not enough to let my mm beep (around 70 Ohms). It doesnt seem to be in the soldering connections though, as they are visibly separated ok. I'm gonna resolder everything though tomorrow...

My request is only related to the ESP8266 SW in the src folder.
If resolder doesn't help I have no other idea than replacing the level shifter and/or the ESP8266

Well, since the soldering connections were so visibly right and clean, I used a razor knife to clean any dust or residue between pins. And I reflashed the Wemos with higher bitrate (but don't see that having anything to do with it). And I used an extension cable to prevent wifi drop-out. It has been running stable now for two days so I assume I did something right.

Bit unsatisfying that I couldn't find any conclusive solution, but well... it doesn't seem to relate to your software so closing this issue.