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

Help debugging interface for Panasonic CZ-CAPWFC1 #63

Open
Aidan-Chey opened this issue Jul 9, 2022 · 14 comments
Open

Help debugging interface for Panasonic CZ-CAPWFC1 #63

Aidan-Chey opened this issue Jul 9, 2022 · 14 comments
Labels
discussion DNSK-P11 Issues with the DNSK-P11 wifi adapter enhancement New feature or request help wanted Extra attention is needed

Comments

@Aidan-Chey
Copy link

Aidan-Chey commented Jul 9, 2022

Hello there Dominik,

I was pointed here by Michel as a possibility to help figure out if we can get the Panasonic Climate Interface to work with the CZ-CAPWFC1 WLAN adaptor supplied by Panasonic for my Ducted Heat Pump.

Michel was nice enough to allow me to order 1 of the Panasonic Climate Interface with the hope it may work with the above adaptor. So I have one now and it's installed in the adaptor, replacing it's original Panasonic Climate Interface. It seems to work well enough, it powers on, has the web server and connects to home assistant through ESPHome.

Only issue is the Panasonic Climate Interface doesn't seem to understand the packets from the adaptor and I was
hoping you could cast your eye over the readings/logs and figure out if anything can be done to get it working.

Here is the config I have installed on the Panasonic Climate Interface at the moment. I've slightly adjusted the recommended to exclude the fin adjustment (ducted heat pumps don't have these) and add a restart button and verbose logging.
bedroom-theatre-aircon-config.yaml.txt

Here is a log file from the Panasonic Climate Interface, taken from the ESPHome web interface in HA.
logs_bedrooms-theatre-aircon_logs.txt

Here is a picture of the install in the adaptor (I'm aware the cable connection is backwards in image, I have corrected that)
install

Any help or suggestions you could give regarding this would be appreciated.

@DomiStyle
Copy link
Owner

DomiStyle commented Jul 9, 2022

Looking at your log the AC responds with a valid packet but one that is not known to me: 5A.00.00.06.00.00.A0.5A.01.00.09.00.00.9C.

After that the data is not parseable anymore (starting with 00). It's hard to tell what's going on exactly without the expected output by a logic analyzer with the original unit in place. It might be that just the handshake is different in these units or they use a different protocol entirely.

However, the first packet is in the correct format for the usual DNSK-P11 so it might just be an error message you get back.

I never bothered actually decoding the handshake. I just replay it on the ESP as it is sent by the DNSK-P11 module, so for all I know there might be a version or device type encoded somewhere.

Is it possible for you to connect a logic analyzer to the original unit and sniff the handshake during power on?

@DomiStyle DomiStyle added enhancement New feature or request help wanted Extra attention is needed DNSK-P11 Issues with the DNSK-P11 wifi adapter discussion labels Jul 9, 2022
@Aidan-Chey
Copy link
Author

Thanks a bunch for looking into this.

I don't have a logic analyzer, or heard of it before but the concept makes sense. I could probably buy one depending on how expensive it's gonna get. Looking online in NZ (where I live) stores there are options that range from $30 to $1500, with the cheaper variants being usb sticks and the more expensive being full fledged oscilloscopes.

I'm looking at this one here: https://www.phoenix-tech.co.nz/products/saleae-logic-analyser?variant=12429818036272
Says it uses a software package from https://www.saleae.com/downloads/ to read the results.

So my understanding is that when I hook this up to the adaptor instead of the Panasonic Climate Interface the analyzer will record the handshake traffic sent by the adaptor. I can then use the logic recording on my PC with the Saleae software, then I'd post the results here for analysis. Does that sound about right?

@DomiStyle
Copy link
Owner

I'm looking at this one here: https://www.phoenix-tech.co.nz/products/saleae-logic-analyser?variant=12429818036272

Ideally it supports PulseView so I can open it easily. There's a list of supported devices here: https://sigrok.org/wiki/Supported_hardware

Any with 2 channels will do fine. The one you linked seems to be this one: https://sigrok.org/wiki/MCU123_Saleae_Logic_clone

So my understanding is that when I hook this up to the adaptor instead of the Panasonic Climate Interface

You hook up the original Panasonic wifi adapter and in parallel you hook into the RX and TX pins with the logic analyzer and perform a cold start of the wifi module.

That way you will capture the entire handshake between the two boards.

@Aidan-Chey
Copy link
Author

Okie, I'm ordering one of these logic analyzers that look like they are open source and work with Sigrok / PulseView. Those test probe things look pretty neat.

Looks like it needs to be plugged into a device for power and to do the reading (maybe no internal memory?), which should be alright; I have an android phone and it looks like SigRok has an APK for android devices of PulseView so hopefully that works out, otherwise I can borrow a laptop.

Once that has arrives, I'll let you know how it went.

@DomiStyle
Copy link
Owner

Looks like it needs to be plugged into a device for power and to do the reading

Yes, you will have to have a laptop connected with PulseView running to take the readings. Android might work too, never used the app before.

So laptop to logic analyzer and logic analyzer to TX, RX and GND on the DNSK-P11 module. That should do it. In case you have difficulties attaching the probes directly to the board a soldering iron might come in handy as well, there are pads you can connect to on the back.

@Aidan-Chey
Copy link
Author

Aidan-Chey commented Nov 20, 2022

Well, that was a hassel and a half.

For some reason suppliers weren't sending me the probes I ordered or they kept getting lost in shipping... When i finally got some, there was insufficient grabing surface for the probes to attach... I ended up soldering wires to the T2-T8 (T1 is 5v, looking at diagram) pads on the back of the board.

PulseView on Android is unusable, I can capture the sessions but I can't save the data anywhere cause it's seemed blackboxed by the OS (permissions issue maybe?). Anyway installed it on a windows tablet thing and captured the startup session. Of note the 1 minute cutoff for recording in pulseview stoped the recording as the card completed connection with the cloud (I can tell by the LED output of the wireless module) so not sure if you needed that bit.

In this attechement you will find the .sr & .pvs files
immediateStart.zip

Please let me know if this is what you needed. If you need to know which channel is which, im goning to need to spend more time doing another recording becaue I didn't take note of that. I know on the analyzer pin (channel?) 7 & 8 were marked as ground, and I attached T8 to pin 8.

Here is an image I found from a PDF for the DNSK-p11 board about it's layout.
DNSK-P11 Diagram

@tefod-zz
Copy link

tefod-zz commented May 9, 2023

Any further developments regarding the reverse engineering/connection/integration of the CZ-CAPWFC1 into cloudless home assistant world?

@Aidan-Chey
Copy link
Author

No, no further developments so far. I'm not sure what's happening. As far as I am aware I've gotten the information @DomiStyle needed to attempt some sort of integration. Maybe they just weren't aware because I did finally get the readout around year end (holidays), and just needs a "poke" 😁

@mchacher
Copy link

@DomiStyle @Aidan-Chey any progress on this one ? I am very interested as well.

@DomiStyle
Copy link
Owner

I didn't have time to take a detailed look into the captures.

There's an ongoing PR for newer devices that might work on this one as well: #95

@mchacher
Copy link

Thanks a lot. If you need help to test I can help

@DomiStyle
Copy link
Owner

@mchacher You can try running the branch from the PR and see if it works.

@mchacher
Copy link

@DomiStyle I am very familiar with ESP32 and hardware / software dev but not to esphome or homesssistant. Any simple way to do testing with C / C++ code and basic mqtt integration ?

@DomiStyle
Copy link
Owner

Yes, setup the normal repo like described in the readme and then replace https://github.com/DomiStyle/esphome-panasonic-ac/blob/master/ac.yaml.example#L26 with source: github://jonasf21/esphome-panasonic-ac.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion DNSK-P11 Issues with the DNSK-P11 wifi adapter enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants