Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[nonNASA] No communication established if AC and ESP powered on together. #191

Open
tristone-cz opened this issue Oct 15, 2024 · 3 comments · May be fixed by #218
Open

[nonNASA] No communication established if AC and ESP powered on together. #191

tristone-cz opened this issue Oct 15, 2024 · 3 comments · May be fixed by #218

Comments

@tristone-cz
Copy link

Hi.

I am playing with the AC about last week. Handled several issues, including missing 12V, never mind.

Today I connected power supply 230V -> 12V and the ESP works.
But in overall the setup behaves weird.

If I turn on power for AC (not start eg. cooling, really connect power) the ESP cannot start communication with the AC.
There are endless attempts to register as controller:

INFO Successfully connected to ac-rooms @ 192.168.11.211 in 0.007s
INFO Successful handshake with ac-rooms @ 192.168.11.211 in 0.105s
[10:58:12][W][samsung_ac:091]: write 32d0c8d1d2000000000000001b34
[10:58:12][W][samsung_ac:091]: write 32d0c8d1d2000000000000001b34
[10:58:12][W][samsung_ac:091]: write 32d0c8d1d2000000000000001b34
[10:58:12][W][samsung_ac:091]: write 32d0c8d1d2000000000000001b34
[10:58:13][W][samsung_ac:091]: write 32d0c8d1d2000000000000001b34
[10:58:13][W][samsung_ac:091]: write 32d0c8d1d2000000000000001b34
[10:58:13][W][samsung_ac:091]: write 32d0c8d1d2000000000000001b34
[10:58:13][W][samsung_ac:091]: write 32d0c8d1d2000000000000001b34
[10:58:13][W][samsung_ac:091]: write 32d0c8d1d2000000000000001b34
[10:58:13][W][samsung_ac:091]: write 32d0c8d1d2000000000000001b34
[10:58:13][W][samsung_ac:091]: write 32d0c8d1d2000000000000001b34
...
[10:58:25][W][samsung_ac:091]: write 32d0c8d1d2000000000000001b34
[10:58:25][W][samsung_ac:175]: NonNASA: invalid crc - got 112 but should be 118: 3200c8fc3f0b343201c8fc457034
[10:58:25][W][samsung_ac:091]: write 32d0c8d1d2000000000000001b34

It does not stop even in 10 minutes. Just from time to time with a message of invalid CRC.

If I just disconnect power from ESP and connect back, no difference.

BUT. If I power on the AC without ESP powered and then in a minute or two power on the ESP - all works.
Communication works, controls work.

I tried many times, some combinations what to put on and off etc.
The conclusion is that only sequence which works is Power AC -> delay -> Power ESP
Once everything runs fine it also works to power off the AC while keeping ESP up and power it back. But this is quite useless scenario.

Now when the AC is opened it is manageable but once covered there will be no way how to recover from power loss.

Have you seen anything like that? Any idea how this can be caused?
Maybe to add some delay to startup after power on ....

@tristone-cz tristone-cz changed the title [nonNASA] No communication established is AC and ESP started together. [nonNASA] No communication established if AC and ESP powered on together. Oct 15, 2024
@lanwin
Copy link
Collaborator

lanwin commented Oct 16, 2024

Hi @tristone-cz that looks wired. The CRC errors are normal. I also have this in my NASA system. I just leave them to have a better understanding how often it happens.

Did you tried to turn on message logging as described in readme?

@tristone-cz
Copy link
Author

Hi @lanwin I tried now the logging.

Log number 3 is just basic logging, directives debug_log_ to true.
It is even just upload new FW and ESP restart, no power off of the AC.

Log number 4 is a bit interesting. Slightly different behavior, I saw once already. But not regular.
I turned on the UART debug, deploy FW, restart ESP. No power off.
At 14:50:35 there is an understood message with status of the AC. Since that time the error Unsupported alt_mode 0 is present which is a sign of somehow working communication. But still many of the those registration messages.
At this point it is possible to control the AC and once first command is successfully sent the registration messages stop. At time 14:51:05.
But this behavior is random. I saw it only twice. In other cases no communication.

Log number 5 is with the same debug ar log 4. Just AC was powered off and then on which turns on also the ESP.
And no communication established.

logs_ac-rooms_run_3.txt
logs_ac-rooms_run_4.txt
logs_ac-rooms_logs_5.txt

@tristone-cz
Copy link
Author

I managed to handle the delay.
I forked the repo and added delay for first registration. And with the delay it works. Even somehow the registration is not needed, the communication starts sooner then the delay expires.

What I failed is to add a config parameter so I did not create pull request yet. So far no idea what I missed 😢

Code comparison:
main...tristone-cz:esphome_samsung_ac:tristone-cz-patch-1

That code does not take the parameter into account in protocol_non_nasa.cpp

The commented out line work with fixed delay of 1 minute.

	//const long delay_interval = (1 *60 * 1000UL);
	const long delay_interval = (non_nasa_registration_delay_interval * 1000UL);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants