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

UART Not Connected KO-> 65!=00 #175

Open
beckynet opened this issue Oct 23, 2024 · 13 comments
Open

UART Not Connected KO-> 65!=00 #175

beckynet opened this issue Oct 23, 2024 · 13 comments

Comments

@beckynet
Copy link

beckynet commented Oct 23, 2024

Testing the 07 Oct 2024 with success on a Heat Pump MSZ-SF35/50/VE2 with WEMOS D1 Mini.

We have bought new WEMOS to complete the installation with same model of Unit.
We have copy the self code, and just rename and replace API Key.

Tested with 3 different Model of Wemos without success.
Also tested 1200, 4800, 9600 bauds without success.

We receive the following log

[12:08:05][I][app:100]: ESPHome version 2024.10.1 compiled on Oct 23 2024, 12:00:54
[12:08:09][W][CN105:177]: Heatpump has not replied for 124 s
[12:08:09][I][CN105:178]: We think Heatpump is not connected anymore..
[12:08:09][I][CN105:008]: setupUART() with baudrate 2400
[12:08:09][W][chkSum:079]: KO-> 65!=00
[12:08:11][W][component:237]: Component api took a long time for an operation (287 ms).
[12:08:11][W][component:238]: Components should block for at most 30 ms.
[12:08:13][W][CN105:177]: Heatpump has not replied for 128 s
[12:08:13][I][CN105:178]: We think Heatpump is not connected anymore..
[12:08:13][I][CN105:008]: setupUART() with baudrate 2400
[12:08:13][W][chkSum:079]: KO-> 65!=00
[12:08:13][I][app:100]: ESPHome version 2024.10.1 compiled on Oct 23 2024, 12:00:54
[12:08:17][W][CN105:177]: Heatpump has not replied for 132 s
[12:08:17][I][CN105:178]: We think Heatpump is not connected anymore..
[12:08:17][I][CN105:008]: setupUART() with baudrate 2400
[12:08:17][W][chkSum:079]: KO-> 65!=00
[12:08:21][W][CN105:177]: Heatpump has not replied for 136 s
[12:08:21][I][CN105:178]: We think Heatpump is not connected anymore..
[12:08:21][I][CN105:008]: setupUART() with baudrate 2400
[12:08:21][W][chkSum:079]: KO-> 65!=00
[12:08:25][W][CN105:177]: Heatpump has not replied for 140 s
[12:08:25][I][CN105:178]: We think Heatpump is not connected anymore..
[12:08:25][I][CN105:008]: setupUART() with baudrate 2400
[12:08:25][W][chkSum:079]: KO-> 65!=00
[12:08:29][W][CN105:177]: Heatpump has not replied for 144 s
[12:08:29][I][CN105:178]: We think Heatpump is not connected anymore..
[12:08:29][I][CN105:008]: setupUART() with baudrate 2400
[12:08:29][W][chkSum:079]: KO-> 65!=00

Here is my code, it run on Heatpump-1 the difference between Heatpump-1 and Heatpump-2 is only 2 week between first compil.
Perhaps a change on the githup

To verify it's not a trouble with the Unit, I've also tested with the running ESP on the new Unit it run with it !

substitutions:
name: heatpump-2
friendly_name: My Heatpump 2
update_interval: 4s

esphome:
name: ${name}
friendly_name: ${friendly_name}

For ESP8266 Devices

esp8266:
board: d1_mini

uart:
id: HP_UART
baud_rate: 2400
tx_pin: 1
rx_pin: 3

external_components:

  • source: github://echavet/MitsubishiCN105ESPHome

wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password

Enable fallback hotspot (captive portal) in case wifi connection fails

ap:
ssid: "${friendly_name} ESP"
password: P@ssword1!

captive_portal:

Enable logging

logger:
hardware_uart: UART1
level: INFO
logs:
EVT_SETS : INFO
WIFI : INFO
MQTT : INFO
WRITE_SETTINGS : INFO
SETTINGS : INFO
STATUS : INFO
CN105Climate: WARN
CN105: INFO
climate: WARN
sensor: WARN
chkSum : INFO
WRITE : WARN
READ : WARN
Header: INFO
Decoder : INFO
CONTROL_WANTED_SETTINGS: INFO

level: DEBUG

logs:

EVT_SETS : DEBUG

WIFI : INFO

MQTT : INFO

WRITE_SETTINGS : DEBUG

SETTINGS : DEBUG

STATUS : INFO

CN105Climate: WARN

CN105: DEBUG

climate: WARN

sensor: WARN

chkSum : INFO

WRITE : WARN

READ : WARN

Header: INFO

Decoder : DEBUG

CONTROL_WANTED_SETTINGS: DEBUG

Enable Home Assistant API

api:
encryption:
key: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
services:
- service: set_remote_temperature
variables:
temperature: float
then:

Select between the C version and the F version

Uncomment just ONE of the below lines. The top receives the temperature value in C,

the bottom receives the value in F, converting to C here.

    - lambda: 'id(hp).set_remote_temperature(temperature);'

- lambda: 'id(hp).set_remote_temperature((temperature - 32.0) * (5.0 / 9.0));'

- service: use_internal_temperature
  then:
    - lambda: 'id(hp).set_remote_temperature(0);'

ota:
platform: esphome # Required for ESPhome 2024.6.0 and greater

Enable Web server.

web_server:
port: 80
auth:
username: !secret web_login
password: !secret web_password

Sync time with Home Assistant.

time:

  • platform: homeassistant
    id: homeassistant_time

Text sensors with general information.

text_sensor:

Expose ESPHome version as sensor.

  • platform: version
    name: ESPHome Version
    hide_timestamp: true

Expose WiFi information as sensors.

  • platform: wifi_info
    ip_address:
    name: Wifi IP
    ssid:
    name: Wifi SSID
    bssid:
    name: Wifi BSSID

Expose Utime

  • platform: template
    name: "Uptime"
    icon: mdi:clock-start
    update_interval: ${update_interval}
    lambda: |-
    int seconds = (id(uptime_seconds).state);
    int days = seconds / (24 * 3600);
    seconds = seconds % (24 * 3600);
    int hours = seconds / 3600;
    seconds = seconds % 3600;
    int minutes = seconds / 60;
    seconds = seconds % 60;
    if ( days ) {
    return { (String(days) +"d " + String(hours) +"h " + String(minutes) +"m "+ String(seconds) +"s").c_str() };
    } else if ( hours ) {
    return { (String(hours) +"h " + String(minutes) +"m "+ String(seconds) +"s").c_str() };
    } else if ( minutes ) {
    return { (String(minutes) +"m "+ String(seconds) +"s").c_str() };
    } else {
    return { (String(seconds) +"s").c_str() };
    }

sensor:

Reports the WiFi signal strength/RSSI in dB

  • platform: wifi_signal
    name: WiFi Signal
    id: wifi_signal_db
    update_interval: 60s
    entity_category: "diagnostic"

Reports the WiFi signal strength in %

  • platform: copy
    source_id: wifi_signal_db
    name: "WiFi Signal Percent"
    filters:
    • lambda: return min(max(2 * (x + 100.0), 0.0), 100.0);
      unit_of_measurement: "%"
      entity_category: "diagnostic"
      device_class: ""

Temps de fonctionnement

  • platform: uptime
    name: "Uptime (s)"
    id: uptime_seconds
    icon: "mdi:clock-start"
    internal: true

  • platform: template
    name: "dg_uart_connected"
    entity_category: DIAGNOSTIC
    lambda: |-
    return (bool) id(hp).isUARTConnected_;
    update_interval: 30s

  • platform: template
    name: "dg_complete_cycles"
    entity_category: DIAGNOSTIC
    accuracy_decimals: 0
    lambda: |-
    return (unsigned long) id(hp).nbCompleteCycles_;
    update_interval: 60s

  • platform: template
    name: "dg_total_cycles"
    accuracy_decimals: 0
    entity_category: DIAGNOSTIC
    lambda: |-
    return (unsigned long) id(hp).nbCycles_;
    update_interval: 60s

  • platform: template
    name: "dg_nb_hp_connections"
    accuracy_decimals: 0
    entity_category: DIAGNOSTIC
    lambda: |-
    return (unsigned int) id(hp).nbHeatpumpConnections_;
    update_interval: 60s

  • platform: template
    name: "dg_complete_cycles_percent"
    unit_of_measurement: "%"
    accuracy_decimals: 1
    entity_category: DIAGNOSTIC
    lambda: |-
    unsigned long nbCompleteCycles = id(hp).nbCompleteCycles_;
    unsigned long nbCycles = id(hp).nbCycles_;
    if (nbCycles == 0) {
    return 0.0;
    }
    return (float) nbCompleteCycles / nbCycles * 100.0;
    update_interval: 60s

binary_sensor:

statut

  • platform: status
    name: "Status"

Create a button to restart the unit from HomeAssistant. Rarely needed, but can be handy.

button:

  • platform: restart
    name: "Restart"

climate:

  • platform: cn105
    id: hp
    name: "${friendly_name}"
    icon: mdi:heat-pump
    visual:
    min_temperature: 15
    max_temperature: 31
    temperature_step:
    target_temperature: 1
    current_temperature: 0.1
    compressor_frequency_sensor:
    name: Compressor Frequency
    vertical_vane_select:
    name: Vane Vertical
    horizontal_vane_select:
    name: Vane Horizontal
    isee_sensor:
    name: ISEE Sensor
    remote_temperature_timeout: 30min
    debounce_delay : 500ms
    update_interval: ${update_interval}
@beckynet beckynet changed the title UART Not COntected KO-> 65!=00 UART Not Connected KO-> 65!=00 Oct 23, 2024
@echavet
Copy link
Owner

echavet commented Oct 23, 2024

Perhaps you should try the one which works well on the other units just to diagnose whether it comes from the new wemos, the unit or the cable?

@beckynet
Copy link
Author

I've already test :
To verify it's not a trouble with the Unit, I've also tested with the running ESP on the new Unit it run with it !

@echavet
Copy link
Owner

echavet commented Oct 23, 2024

I'm not sure I understand.
What is the conclusion of the tests?
Is the unit, the cable or the ESP at the source of the issue?

@beckynet
Copy link
Author

The first we have made is identified as a D1 Mini Pro 4mb.
Other model was sell as D1 Mini Pro also but not physically identified as D1 Mini Pro. And The last bought is a AZDelivery D1 Mini V3
The First made run on All PAC Units.

D1 Mini Pro R The only one that works
D1 Mini Pro V The only one that works

All others don't connect on any PAC Units.
All WEMOS use the same CN105 connector, the same cable quality and length, and the same pining.

AZ Delivery D1 Mini V3 R
AZ Delivery D1 Mini V3 V
D1 Mini Pseudo Pro R
D1 Mini Pseudo Pro V

CN105

[16:16:39][I][app:100]: ESPHome version 2024.10.2 compiled on Oct 24 2024, 16:15:45
[16:16:40][W][component:237]: Component api took a long time for an operation (571 ms).
[16:16:40][W][component:238]: Components should block for at most 30 ms.
[16:16:41][E][CN105:032]: --> Heatpump did not reply: NOT CONNECTED <--
[16:16:41][I][CN105:033]: Trying to connect again...
[16:16:51][E][CN105:032]: --> Heatpump did not reply: NOT CONNECTED <--
[16:16:51][I][CN105:033]: Trying to connect again...
[16:17:01][E][CN105:032]: --> Heatpump did not reply: NOT CONNECTED <--
[16:17:01][I][CN105:033]: Trying to connect again...
[16:17:11][W][CN105:177]: Heatpump has not replied for 40 s
[16:17:11][I][CN105:178]: We think Heatpump is not connected anymore..
[16:17:11][I][CN105:008]: setupUART() with baudrate 2400
[16:17:12][W][chkSum:079]: KO-> 64!=FC
[16:17:15][W][CN105:177]: Heatpump has not replied for 44 s
[16:17:15][I][CN105:178]: We think Heatpump is not connected anymore..
[16:17:15][I][CN105:008]: setupUART() with baudrate 2400
[16:17:16][W][chkSum:079]: KO-> 64!=40
[16:17:19][W][CN105:177]: Heatpump has not replied for 48 s

@echavet
Copy link
Owner

echavet commented Oct 24, 2024

All right
I think I got it
This one does not work
I had bought this model too
I've never been able to make the uart communicate with the unit

@beckynet
Copy link
Author

So the problem is with the Wemos models?

The problem is that it's hard to find real Wemos D1 Pro modules, so Lolin has replaced them with a V3 model.
https://www.wemos.cc/en/latest/d1/d1_mini_pro.html

Physically, the model identified as a D1 Mini Pro is identical to the next 3 I bought, yet only the first one works.

How can I be sure I have a compatible model?

@echavet
Copy link
Owner

echavet commented Oct 24, 2024

Exactly
The ones with metal box work

You should use esp32

@beckynet
Copy link
Author

beckynet commented Oct 24, 2024

Metal box ?

Wich ESP32 ?

Some Wemos have different Chip as CP2104, CH340, CH9102 is it a way to know wich is good or not ?

@echavet
Copy link
Owner

echavet commented Oct 24, 2024

Actually i meant a metal hood!
Sorry. But even some of the ones with metal hood can be difficult to use. I used to add a regulator.

I'm using a simple s3
Some users use esp s3 from m5stack

@rkboni
Copy link

rkboni commented Oct 24, 2024 via email

@rkboni
Copy link

rkboni commented Oct 24, 2024

If you're in the US, or can order from Amazon US, these all have worked for me -- but agree that the D1 mini clones are a crapshoot, so it might be best to spend a little extra money and go for an ESP32: https://www.amazon.com/gp/product/B07V84VWSM/ref=ppx_yo_dt_b_search_asin_title?ie=UTF8&th=1

@duhow
Copy link
Contributor

duhow commented Nov 10, 2024

If it helps, I am currently using ESP32-S2 Mini https://www.aliexpress.com/item/1005004344359250.html , works fine.
Don't need Bluetooth at the moment.

@echavet
Copy link
Owner

echavet commented Nov 12, 2024

Hey @beckynet
Have you finally managed to make it work?

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

No branches or pull requests

4 participants