Sonic-Amiga / ESP8266-Faikin

Opensource replacement for Daikin BRP module to control Daikin aircon units
GNU General Public License v3.0
13 stars 0 forks source link

Air condition remains offline. Any way to troubleshoot? #21

Closed yiannosi closed 2 weeks ago

yiannosi commented 1 month ago

I have built the ESP 8266 variant to be use on a Daikin FTXS42JV1B unit. I have easily located the S21 port and connected to it. See below. Faikin module connects to WiFi as expected but the air conditioner appears to be offline on the web interface page of the module.

IMG_20240727_113458_resized_20240803_062247429

And below connected with Faikin: IMG_20240803_130453_resized_20240803_071603063

Any ideas? Any way to debug / troubleshoot whats going on?

Sonic-Amiga commented 1 month ago

Hello! What is your hardware ? Off-she-shelf 8266 ? If so, welcome to https://github.com/Sonic-Amiga/ESP8266-Faikin/issues/20

yiannosi commented 1 month ago

Hello! What is your hardware ? Off-she-shelf 8266 ? If so, welcome to #20

Its a home brew PCB with esp8266 based on the pinout of this design and two BSS138 fets for level shifting on Rx, Tx lines. Will post full schematic when i get home later.

Sonic-Amiga commented 1 month ago

Well, actually two options here:

  1. Sent data does not reach the AC
  2. Reply from the AC does not reach the controller.

If you have a PL2303 or similar adapted, you can tap into lines and see what's going on. Use hex-capable terminal. Parameters are 2400 8E1

yiannosi commented 1 month ago

So this is the schematic:

image

Sonic-Amiga commented 1 month ago

Hello! I immediately see one mistake. Your level shifters are inverting (you copied them from RevK's ESP32 design, correct?) 8266 apparently does not support pin inversion, so i removed that feature. I can try bringing it back for you to test if you want to. I think 8266 doesn't support it at all because i am doing all the development with an A/C simulator, running on PC, connected via pl2303; and changing polarity didn't seem to affect anything. So either pl2303 is too smart, or 8266 has no inversion for real

On Aug 4, 2024, 17:39, at 17:39, yiannosi @.***> wrote:

So this is the schematic:

image

-- Reply to this email directly or view it on GitHub: https://github.com/Sonic-Amiga/ESP8266-Faikin/issues/21#issuecomment-2267566348 You are receiving this because you commented.

Message ID: @.***>

yiannosi commented 1 month ago

Hmm isn't it possible to do inversion in software? 

What if I install pull up resistors...somehow.. I made a nice pcb for this and my thinking how to make the most of it...

Sonic-Amiga commented 1 month ago

isn't it possible to do inversion in software?

It is possible to configure serial port to do the inversion; but as i said above, that's probably ignored. Okay, one test is worth 1000 of words. Please stand by, i'll make a beta with this feature, let's retest.

Sonic-Amiga commented 1 month ago

Done; and i understood why it didn't work before. Stupid bug. You can grab a beta release from "betarelease" folder in my repo and flash manually; or you can change OTA URL to http://faikin-ota.home-assistant.my/ , then enable "Beta software" switch on "Basic" settings page, then do the upgrade. On "Advanced" page you'll see two new settings: swaptx, swaprx. Enable them both; that should work,

Sonic-Amiga commented 1 month ago

Important note: if you want to flash manually, the binary is on branch called "pin_inversion". My bad.

On Aug 4, 2024, 20:34, at 20:34, yiannosi @.***> wrote:

Hello! I immediately see one mistake. Your level shifters are inverting (you copied them from RevK's ESP32 design, correct?) 8266 apparently does not support pin inversion, so i removed that feature. I can try bringing it back for you to test if you want to. I think 8266 doesn't support it at all because i am doing all the development with an A/C simulator, running on PC, connected via pl2303; and changing polarity didn't seem to affect anything. So either pl2303 is too smart, or 8266 has no inversion for real On Aug 4, 2024, 17:39, at 17:39, yiannosi @.> wrote: So this is the schematic: image -- Reply to this email directly or view it on GitHub: #21 (comment) You are receiving this because you commented. Message ID: @.>

Hmm isn't it possible to do inversion in software? 

What if I install pull up resistors on tx, rx 3v3 side? 

-- Reply to this email directly or view it on GitHub: https://github.com/Sonic-Amiga/ESP8266-Faikin/issues/21#issuecomment-2267614504 You are receiving this because you commented.

Message ID: @.***>

yiannosi commented 1 month ago

Great thanks! I will try it later today hopefully. It will have to be OTA since I cant do manual upgrade unless I disolder the ESP module because of the inverters.. One small note : the wording swaptx and swaprx suggests swapping rx with tx rather than inversion of the signal so it could be confusing..

yiannosi commented 1 month ago

What you think of this mod as remake of the design to get over the inversion:

image

yiannosi commented 1 month ago

Done; and i understood why it didn't work before. Stupid bug. You can grab a beta release from "betarelease" folder in my repo and flash manually; or you can change OTA URL to http://faikin-ota.home-assistant.my/ , then enable "Beta software" switch on "Basic" settings page, then do the upgrade. On "Advanced" page you'll see two new settings: swaptx, swaprx. Enable them both; that should work,

Sorry but cant find a "beta release" on basic settings page.

Sonic-Amiga commented 1 month ago

That was another bug i fixed recently. Update to the latest release first. Alternatively you can simply append "/beta" to update URL as a workaround; that's what the switch effectively does.

On Aug 5, 2024, 17:42, at 17:42, yiannosi @.***> wrote:

Done; and i understood why it didn't work before. Stupid bug. You can grab a beta release from "betarelease" folder in my repo and flash manually; or you can change OTA URL to http://faikin-ota.home-assistant.my/ , then enable "Beta software" switch on "Basic" settings page, then do the upgrade. On "Advanced" page you'll see two new settings: swaptx, swaprx. Enable them both; that should work,

Sorry but cant find a "beta re;ease" on basic settings page.

-- Reply to this email directly or view it on GitHub: https://github.com/Sonic-Amiga/ESP8266-Faikin/issues/21#issuecomment-2269245776 You are receiving this because you commented.

Message ID: @.***>

Sonic-Amiga commented 1 month ago

What you think of this mod as remake of the design

Frankly speaking i am no expert in transistor circuits. But i know that a commonly used cirquit is https://circuitdigest.com/tutorial/bi-directional-logic-level-controller-using-mosfet

If you look at original Daichi design; they also use it for RX side.

yiannosi commented 1 month ago

Managed to update to beta version OTA. Before opening up the air conditioner for installation (for the 10th time!) do you think there are any test I can do?

Connecting it to a serial terminal at 2400bps, I just receive a series of '??????' characters

Sonic-Amiga commented 1 month ago

There's a lot you can do.

  1. You can install just a cable with connectors on both sides into your AC, so that you don't have to disassemble it over and over again.
  2. You can do majority of testing with PC on your desk. Look at Tools/Simulators directory in my repo. You can build the simulator yourself; or i can give you a Windows .exe file. Then you may connect Faikin to a USB<>Serial adapter, configured to 5V I/O, and do all the debugging on that setup. Proceed to A/C once it works.

Connecting it to a serial terminal at 2400bps, I just receive a series of '??????' characters

  1. Connecting what and how exactly ?
  2. No that's not what is expected. S21 contains printable characters. The first command, sent by Faikin, would start with '?F0'; and the response should start with '?G0' . But hexadecimal display will tell you more.
  3. You can set nox50 and nocnwired in advanced option to disable protocol autodetect and stick to S21, so that you won't be confused by garbage (x50 uses 9600 and cn_wired is not standard uart at all).
yiannosi commented 1 month ago

Thanks so much for your help!

Connecting what and how exactly ?

I used a TTL to usb adapter at 5v connected to Rx, Tx terminal (where the AC connects) , and used arduino serial monitor.

Sonic-Amiga commented 1 month ago

To terminals of your Faikin, correct ? So, just question marks are corrupt data. Note that your design suggests external +5V reference for pull-up (R9), so you need to connect that to +5V, provided by the adapter. Without that connection your Tx line is just floating with random noise on it.

yiannosi commented 1 month ago

yes you are right!

Sonic-Amiga commented 1 month ago

This is what i receive in putty, with only S21 protocol enabled as described image F1 (not F0, sorry) is the command (query basic parameters) and 'w' is checksum byte. STX of 0x02 and ETX of 0x03 aren't rendered being control characters

yiannosi commented 1 month ago

i see...nothing like what I saw ! Anyway, am to familiar with the protocol . ie dont know what F1,F0 is... But i ll try again tomorrow

Sonic-Amiga commented 1 month ago

And this is in RealTerm with hex display image 02 46 31 77 03 is the full packet

Sonic-Amiga commented 1 month ago

dont know what F1,F0 is...

Protocol doc is here: https://github.com/Sonic-Amiga/ESP8266-Faikin/blob/main/Manuals/S21.md , kindly provided by @RevK . See the source code for more questions. Note that simulator doesn't implement all the commands; only the very basic ones.

But you actually don't really need to know that in order to solve your task. You only need to know what the proper data looks like and here it is.

You're welcome and sorry for only being of passive help. You see, original project's goal was to run Faikin on off-the-shelf solution, which i just happened to already own. I am surprised that there's such a big interest to replicating the HW.

I could eventually order a D1-mini myself and try replicating your design; i really see nothing bad in it. But frankly speaking i'm busy.

For the start, i'd suggest you to get to a known good state. Disconnect everything, connect your USB adapter directly to 8266 and set it to 3.3V. You REALLY SHOULD see data. If not, well, your 8266 is probably blown.

By the way, for quick check, Faikin supports loopback test as described here https://github.com/Sonic-Amiga/ESP8266-Faikin/issues/20#issuecomment-2267548973 Works in the latest release (and in beta too)

yiannosi commented 1 month ago

I could eventually order a D1-mini myself and try replicating your design; i really see nothing bad in it. But frankly speaking i'm busy.

If interested, we could do something better: I have spare PCBs of this design and if you are happy with SMD soldering, I could send you a some by mail. Just give me your mailing address. You then just need to find the components. :)

By the way, which compiler do I need for the simulator?

Sonic-Amiga commented 1 month ago

You're welcome if your country ships to Russia. Drop me an email at pavel_fedin mail.ru and i will reply with address

On Aug 7, 2024, 07:35, at 07:35, yiannosi @.***> wrote:

I could eventually order a D1-mini myself and try replicating your design; i really see nothing bad in it. But frankly speaking i'm busy.

If interested, we could do something better: I have spare PCBs of this design and if you are happy with SMD soldering I could send you a some by mail. Just give me your mailing address. :)

-- Reply to this email directly or view it on GitHub: https://github.com/Sonic-Amiga/ESP8266-Faikin/issues/21#issuecomment-2272600178 You are receiving this because you commented.

Message ID: @.***>

yiannosi commented 1 month ago

I ve sent you an email...

Sonic-Amiga commented 1 month ago

I ain't got no mail... 🤷 Try sonic.amiga gmail.com . There are some issues with .ru apparently...

yiannosi commented 1 month ago

New email sent to gmail acoount

yiannosi commented 2 weeks ago

Now tested and works on model FTXS42JV1B apart from powerful mode which doesnt work.. Model can be added to the list!

Sonic-Amiga commented 2 weeks ago

Great! Would you like to contribute your 8266-based design to Hardware/ ?

yiannosi commented 2 weeks ago

Sure. I think i ve already sent you the schematic.

Sonic-Amiga commented 2 weeks ago

apart from powerful mode which doesnt work..

Known issue: https://github.com/revk/ESP32-Faikin/issues/441

I am launching a new release right now, it has some fixes regarding that; but FTXS is known not to work. Just like my ATX20V. They belong to a different family from FTXF (where everything now works). Unfortunately i failed to find respective control commands on my units. Perhaps it has incomplete S21 support, because i have an original Daikin BRP online controller, i tried to reverse-engineer from that, but it does not give me those controls. Perhaps unsupported. :(

I am working on improvements to S21 simulator for better reverse engineering support, and better testing support. Over time i may ask you to run some scripts to collect profiles from your A/C to try simulating it. If you don't mind.

revk commented 2 weeks ago

I'll get that on ota when I am back from coffee.