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

Add the WeiKai SPI/I2C UART/IO Expander components to esphome #5218

Merged
merged 324 commits into from
Apr 24, 2024

Conversation

DrCoolzic
Copy link
Contributor

@DrCoolzic DrCoolzic commented Aug 8, 2023

What does this implement/fix?

Add 8 new components from the WeiKai family of components:
WK2168-IQPG WK2132-ISSG WK2124-ISSG WK2204-IQNG WK2212-IQNG

These components allow to connect up to 4 UART devices and IO pins from an SPI or I²C bus

There are 11 components added to the ESPHome library:

  • The weikai: component that contains all the code for the base functionality
  • the weikai_i2c: provides the interface using the i2c bus
  • the weikai_spi: provides the interface using the spi bus
  • The wk2132_spi: that contains the spi related classes for the wk2132
  • The wk2132_i2c: that contains the i2c related classes for the wk2132
  • The wk2168_spi: that contains the spi related classes for the wk2168
  • The wk2168_i2c: that contains the i2c related classes for the wk2132
  • The wk2204_spi: that contains the spi related classes for the wk2204
  • The wk2204_i2c: that contains the i2c related classes for the wk2204
  • The wk2212_spi: that contains the spi related classes for the wk2212
  • The wk2212_i2c: that contains the i2c related classes for the wk2212

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Other

Related issue or feature (if applicable): fixes

Pull request in esphome-docs with documentation (if applicable): esphome/esphome-docs#3113

Test Environment

  • ESP32
  • ESP32 IDF
  • ESP8266
  • RP2040

Example entry for config.yaml:

# Example config.yaml for the wk2132_i2c: component
wk2132_i2c:
  - id: wk2132_0
    address: 0x70
    i2c_id: i2c_bus
    uart:
      - uart_id: uart_id_0
        channel: 0
        baud_rate: 115200
        stop_bits: 1
        parity: none
      - uart_id: uart_id_1
        channel: 1
        baud_rate: 19200
# Example config.yaml for the wk2168_spi component
wk2168_spi:
  - id: bridge_0
    cs_pin: 5
    data_rate: 4MHz
    crystal: 11059200
    test_mode: 1
    uart:
      - uart_id: uart_id0
        channel: 0
        baud_rate: 115200
        stop_bits: 1
        parity: none
      - uart_id: uart_id1
        channel: 1
        baud_rate: 115200
      - uart_id: uart_id2
        channel: 2
        baud_rate: 115200
# individual binary_sensor inputs
binary_sensor:
  - platform: gpio
    name: "b0 p3"
    pin:
      wk2168_spi: bridge_0
      number: 0
  - platform: gpio
    name: "b0 p1"
    pin:
      wk2168_spi: bridge_0
      number: 1
      mode:
        input: true
      inverted: true
# Individual binary outputs
switch:
  - platform: gpio
    name: "b0 p2"
    pin:
      wk2168_spi: bridge_0
      number: 2
      mode:
        output: true
  - platform: gpio
    name: "b0 p3"
    pin:
      wk2168_spi: bridge_0
      number: 3
      mode:
        output: true
      inverted: true

Checklist:

  • The code change is tested and works locally.
  • Tests have been added to verify that the new code works (under tests/ folder).

If user exposed functionality or configuration variables are added/changed:

@SeByDocKy
Copy link
Contributor

That's a major addition to ESPhome!!!!!!! Bravo....

Copy link
Contributor

@kahrendt kahrendt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work on the component! I have it tested and working with a DFRobot module.

I have added a few recommendations mainly based off changes that I have been requested to make for my own PRs. For a couple of them, I wrote if I was unsure about them in terms of the project's bigger picture, so I may be off base on those.

It would be great to get this working without needing a dummy UART device, but I'm not sure how to go about that!

esphome/components/wk2132/__init__.py Outdated Show resolved Hide resolved
esphome/components/wk2132/__init__.py Outdated Show resolved Hide resolved
esphome/components/wk2132/wk2132.cpp Outdated Show resolved Hide resolved
esphome/components/wk2132/wk2132.h Outdated Show resolved Hide resolved
esphome/components/wk2132/wk2132.cpp Outdated Show resolved Hide resolved
esphome/components/wk2132/wk2132.h Outdated Show resolved Hide resolved
esphome/components/wk2132/wk2132.cpp Outdated Show resolved Hide resolved
esphome/components/wk2132/wk2132.h Outdated Show resolved Hide resolved
@DrCoolzic
Copy link
Contributor Author

DrCoolzic commented Aug 24, 2023

Nice work on the component! I have it tested and working with a DFRobot module.

Thanks :) Good to know its working for you

It would be great to get this working without needing a dummy UART device, but I'm not sure how to go about that!

From what I understand it has to be solved in UART component. Jessie is aware of the problem, but I do not think anybody
is working on the problem?

I have made the changes you suggested - Thanks for your help

@SeByDocKy
Copy link
Contributor

Nice work on the component! I have it tested and working with a DFRobot module.

I have added a few recommendations mainly based off changes that I have been requested to make for my own PRs. For a couple of them, I wrote if I was unsure about them in terms of the project's bigger picture, so I may be off base on those.

It would be great to get this working without needing a dummy UART device, but I'm not sure how to go about that!

Which components you tested with ?

@kahrendt
Copy link
Contributor

I've retested the updated code, and everything is still working. I hope those changes help get this PR accepted a bit faster! This will be a useful component for some of my future projects.

SeByDocKy, I am testing it with the dfrobot mmwave component. I haven't explored that PR too deeply, but the WK2132 is reading the motion sensor state just fine out of the box. Here is the basic config for it:


external_components:
  - source: github://pr#5218
    components: [ wk2132 ]    
  - source: github://pr#4203
    components: [ dfrobot_mmwave_radar ]

wk2132:
  - id: wk2132_0
    address: 0x70
    uart:
      - uart_id: uart_id_wk2132_0_0
        channel: 0 
        baud_rate: 115200
        stop_bits: 1
        parity: none

uart:
  id: dummy
  tx_pin: 3
  baud_rate: 9600

binary_sensor:
  - platform: dfrobot_mmwave_radar
    name: "MMWave Motion"

@DrCoolzic
Copy link
Contributor Author

I've retested the updated code, and everything is still working. I hope those changes help get this PR accepted a bit faster! This will be a useful component for some of my future projects.

Thank you for your time and help. This is my first submission so I'm not too familiar with the process.
It's a shame that component design for ESPHome isn't better documented. You have to guess at a lot of things to get the result, but the more comfortable you get the more you appreciate the architecture...
Thanks again for your help, and let's hope the PR validation goes smoothly.

@SeByDocKy
Copy link
Contributor

SeByDocKy commented Aug 25, 2023

Ok I did the first testing with a sds011 sensor. Got a good and a bad news...

i) The good one.... With the Wk2132, i can collect both sensor informations (pm2.5 & pm10)
ii) The bad one... If I am not pluging the wk2132 into the I2C bus, got a bunch of I2C error msgs

[15:44:18][E][wk2132:083]: read_wk2132_register_(@70 FSR, ch=0 b=00 [00000000], len=1): I2C code 2
[15:44:18][E][wk2132:083]: read_wk2132_register_(@70 FSR, ch=0 b=00 [00000000], len=1): I2C code 2
[15:44:18][E][wk2132:083]: read_wk2132_register_(@70 FSR, ch=0 b=00 [00000000], len=1): I2C code 2
[15:44:18][E][wk2132:083]: read_wk2132_register_(@70 FSR, ch=0 b=00 [00000000], len=1): I2C code 2
[15:44:18][E][wk2132:083]: read_wk2132_register_(@70 FSR, ch=0 b=00 [00000000], len=1): I2C code 2
[15:44:18][E][wk2132:083]: read_wk2132_register_(@70 FSR, ch=0 b=00 [00000000], len=1): I2C code 2
[15:44:18][E][wk2132:083]: read_wk2132_register_(@70 FSR, ch=0 b=00 [00000000], len=1): I2C code 2
[15:44:18][E][wk2132:083]: read_wk2132_register_(@70 FSR, ch=0 b=00 [00000000], len=1): I2C code 2

I guess during the setup of the conponent, no check is performed if it's plugged .... must be added...

Now I will check with a more complex serial component like a BMS

@DrCoolzic
Copy link
Contributor Author

The bad new... If I am not pluging the wk2132 into the I2C bus, got a bunch of I2C error msgs

[15:44:18][E][wk2132:083]: read_wk2132_register_(@70 FSR, ch=0 b=00 [00000000], len=1): I2C code 2

I am not sure to understand what you are asking for? If you declare a component and if the component is not connected it is normal that the I²C bus returns error code 2. This is the expected behaviour to indicate your hardware is faulty and telling you where is the error.
The only thing I can do is to report the same error and then invalidate all calls to the wk2132. In which case you will need to restart the ESP if you connect the component latter.

@SeByDocKy
Copy link
Contributor

SeByDocKy commented Aug 25, 2023

The bad new... If I am not pluging the wk2132 into the I2C bus, got a bunch of I2C error msgs

[15:44:18][E][wk2132:083]: read_wk2132_register_(@70 FSR, ch=0 b=00 [00000000], len=1): I2C code 2

I am not sure to understand what you are asking for? If you declare a component and if the component is not connected it is normal that the I²C bus returns error code 2. This is the expected behaviour to indicate your hardware is faulty and telling you where is the error. The only thing I can do is to report the same error and then invalidate all calls to the wk2132. In which case you will need to restart the ESP if you connect the component latter.

the "absence" detection must be done during the setup in order to not have multiple error msg during the main update().... Maybe a working around would be to change the ESPLOG verbosity level ....

@DrCoolzic
Copy link
Contributor Author

The bad new... If I am not pluging the wk2132 into the I2C bus, got a bunch of I2C error msgs

[15:44:18][E][wk2132:083]: read_wk2132_register_(@70 FSR, ch=0 b=00 [00000000], len=1): I2C code 2

I am not sure to understand what you are asking for? If you declare a component and if the component is not connected it is normal that the I²C bus returns error code 2. This is the expected behaviour to indicate your hardware is faulty and telling you where is the error. The only thing I can do is to report the same error and then invalidate all calls to the wk2132. In which case you will need to restart the ESP if you connect the component latter.

the "absence" detection must be done during the setup in order to have multiple error msg during the main update().... Maybe a working around would be to change the ESPLOG verbosity level ....

Once again, I don't understand why it's a problem to indicate that the module is not correctly connected? The debug messages were created to help users locate a fault.

I don't suppose you're going to make a board where you can add or remove components during operation?
As far as I know, ESPHome's architecture was not designed for dynamic component configuration.

@SeByDocKy
Copy link
Contributor

SeByDocKy commented Aug 26, 2023

Ok just tested with a JKBMS and unfortunaly no data are received :( (like bandid17)
Here is my yaml

  updates: 5s
  name: air_control

esphome:
  name: ${name}
  
esp32:
  board: esp32dev
  framework:
    type: arduino
    version: 2.0.11 #2.0.5 2.0.9
    platform_version: 6.3.2 #4.4.0 6.2.0
 
external_components:
  - source: github://pr#5218
    components: [wk2132]
  - source: github://syssi/esphome-jk-bms@main
    refresh: 0s  

wifi:
  ssid: !secret esphome_ssid
  password: !secret esphome_password

# Enable logging
logger:
  #baud_rate: 0
  level: very_verbose
# Enable Home Assistant API
api:

ota:

switch:
  - platform: restart
    name: restart_${name}

# font:
# - file: 'dejavusans.ttf'
#   id: font1
#   size: 8

uart:
  tx_pin: GPIO17
#  rx_pin: GPIO16
  baud_rate: 115200 #9600
  id: ubus1

i2c:
- sda: GPIO25
  scl: GPIO26
  id: i2c_bus1
  
wk2132:
  - address: 0x10
    id: uart_bridge0
    i2c_id: i2c_bus1
    uart:
      - uart_id: uart_00
        channel: 0
        baud_rate: 9600
        #parity: even
      - uart_id: uart_01
        channel: 1
        baud_rate: 115200

jk_modbus:
  - id: jkbms_0
    uart_id: uart_01
jk_bms:
  - id: bms_0
    jk_modbus_id: jkbms_0
       
sensor:

- platform: jk_bms
  jk_bms_id: bms_0
  min_cell_voltage:
    name: ${name}_min_cell_voltage
  max_cell_voltage:
    name: ${name}_max_cell_voltage
  min_voltage_cell:
    name: ${name}_min_voltage_cell
  max_voltage_cell:
    name: ${name}_max_voltage_cell  
  delta_cell_voltage:
    name: ${name}_delta_cell_voltage
  average_cell_voltage:
    name: ${name}_average_cell_voltage 
  cell_voltage_1:
    name: ${name}_cell_voltage_1
  cell_voltage_2:
    name: ${name}_cell_voltage_2
  cell_voltage_3:
    name: ${name}_cell_voltage_3
  cell_voltage_4:
    name: ${name}_cell_voltage_4

Here is the log in very_verbose level: https://pastebin.com/qr2wuggk

@SeByDocKy
Copy link
Contributor

Concerning the sds011, even if I can collect the two sensor data, I noticed I got this warning msg

[16:23:35][D][sensor:094]: 'air_control_2_5µm_concentration': Sending state 11.20000 µg/m³ with 1 decimals of accuracy
[16:23:35][D][sensor:094]: 'air_control_10_0µm_concentration': Sending state 16.50000 µg/m³ with 1 decimals of accuracy
[16:23:35][W][component:204]: Component sds011.sensor took a long time for an operation (0.07 s).
[16:23:35][W][component:205]: Components should block for at most 20-30ms.```

@DrCoolzic
Copy link
Contributor Author

DrCoolzic commented Aug 26, 2023

@SeByDocKy
I looked at the log file and I see that the wk2132 is asked to send 21 characters starting with 0x4E and after that is listening but not receiving anything ?
Could that be an hardware problem? Can you connect a logic analyzer? Typically you should see activity on the I²C bus prior to reading or writing character ...
Can you put the loger at debug level and add the undocummented line in your yaml

...
wk2132:
  - address: 0x10
    test_mode: 1
    id: uart_bridge0
    i2c_id: i2c_bus1
...

This should print ...sniif writing .... when writing to the wk2132 and ...sniff reading ... when reading character from the line
Nothing else I can think about

@DrCoolzic
Copy link
Contributor Author

Concerning the sds011, even if I can collect the two sensor data, I noticed I got this warning msg

[16:23:35][D][sensor:094]: 'air_control_2_5µm_concentration': Sending state 11.20000 µg/m³ with 1 decimals of accuracy
[16:23:35][D][sensor:094]: 'air_control_10_0µm_concentration': Sending state 16.50000 µg/m³ with 1 decimals of accuracy
[16:23:35][W][component:204]: Component sds011.sensor took a long time for an operation (0.07 s).
[16:23:35][W][component:205]: Components should block for at most 20-30ms.```

sorry I know nothing about the sds011.
Actually a lot of components block the loop more than 30 ms!

@DrCoolzic
Copy link
Contributor Author

FYI here is how to interpret the wk2132 address

+----+----+----+----+----+----+----+----+
|  0 | A1 | A0 |  1 |  0 | C1 | C0 |  F |
+----+----+----+----+----+----+----+----+
where :
A1 A0 are the two switches
C1 C0 is the channel number (0-4)
F normal(0) or FIFO(1)

for example with a0 a1 = 0 0
register ch 0 = 0x10
register ch 1 = 0x12
fifo ch0 = 0x11
fifo ch1 = 0x13

note that acessing directly the fifo is very unusual with i²c component

But if you look on the bus remember that the R/W bit is added at the end. So it becomes:

+----+----+----+----+----+----+----+----+
| A1 | A0 |  1 |  0 | C1 | C0 |  F | WR |
+----+----+----+----+----+----+----+----+

image

@kahrendt
Copy link
Contributor

I've been testing this a bit more, and I am running into issues using the LD2410 component that was updated in the last release. It is trying to call some validation functions that check the UART interface is configured correctly, and this PR doesn't have them. This setup will throw errors:

wk2132:
  - id: wk2132_0
    address: 0x70
    uart:
      - uart_id: uart_mmwave
        channel: 0 
        baud_rate: 256000
        stop_bits: 1
        parity: none

uart:
  id: dummy
  tx_pin: 3
  rx_pin: 32
  baud_rate: 9600

ld2410:
  uart_id: uart_mmwave

In the base UART component __init__.py, there are some validate functions starting around line 243. I think those will need to be added to this PR to avoid the compilation errors. There may be a better way than duplicating them in your own __init__.py, but I am unaware of it.

@DrCoolzic
Copy link
Contributor Author

I've been testing this a bit more, and I am running into issues using the LD2410 component that was updated in the last release. It is trying to call some validation functions that check the UART interface is configured correctly, and this PR doesn't have them. This setup will throw errors:

I already had the exact same problem using the PMSX003. It is also complaining about a RX pin that does not exist during some sensor validation.
This seems to be some problem in the UART validation again. I already started to look in the UART validation functions to understand why we need to declare a “dummy” UART when using the AUTO_LOAD = ["uart"] but my knowledge of Python is not sufficient to follow this code … and it is the same to fix it for the problem you describe.
Therefore, as I am not the cause of the problem, I will probably leave the resolution of the problem to the UART team. I intend to create a bug report for the problem of the need to add a dummy UART.

DrCoolzic and others added 7 commits August 31, 2023 16:14
This is a first prototype using a ring buffer. This is done to
be ready to transfer quickly bytes one by one without need to
make transactions on the i2c bus.
This is a very preliminary version just to test the concept

On branch wk2132-ring-b1
Changes to be committed:
	modified:   esphome/components/wk2132/wk2132.cpp
	modified:   esphome/components/wk2132/wk2132.h
Note that currently the ring buffer is only used for received char
we might want to do that for sending

On branch wk2132-ring-b1
Your branch is up to date with 'origin/wk2132-ring-b1'.

Changes to be committed:
	modified:   esphome/components/wk2132/wk2132.cpp
	modified:   esphome/components/wk2132/wk2132.h
The branch has been reviewed, tested, and cleaned.
Found more this-> missing

On branch wk2132-ring-b1
Your branch is up to date with 'origin/wk2132-ring-b1'.

Changes to be committed:
	modified:   esphome/components/wk2132/wk2132.cpp
	modified:   esphome/components/wk2132/wk2132.h
@DrCoolzic
Copy link
Contributor Author

DrCoolzic commented Apr 9, 2024

I had to push some commits to this PR to change from uart_id to just id which is what the final validate expects. This change will break any existing configs using this PR as an external_component.

I am cannot compile anymore any of my components ???
I have tried to add

external_components:
  - source: github://pr#6504
    components: [uart]
    refresh: 0s

but it does not help ?

PS U:\__DEV__\VSCode\ESPHome\esphome> esphome run .\config\wk2132_i2c-arduino.yaml
INFO ESPHome 2024.4.0-dev
INFO Reading configuration .\config\wk2132_i2c-arduino.yaml...
INFO Updating https://github.com/esphome/esphome.git@pull/6504/head
Failed config

wk2132_i2c: [source .\config\wk2132_i2c-arduino.yaml:52]
  - id: bridge_0
    address: 112
    test_mode: 1
    uart: 

      'id' is a required option for [0].
      - 
        [uart_id] is an invalid option for [0]. Please check the indentation.
        uart_id: uart_id0
        channel: 0
        baud_rate: 115200
        stop_bits: 1
        parity: none
      - uart_id: uart_id1
        channel: 1
        baud_rate: 115200
uart: None

  'baud_rate' is a required option for [0].
  []
...

and it fails even if I had a dummy uart?

what should I do to make them working again ??? please help i am stuck 💩

@DrCoolzic
Copy link
Contributor Author

the test did not pass with same error: https://github.com/esphome/esphome/actions/runs/8618224123/job/23620133312?pr=5218

@jesserockz
Copy link
Member

  • create a directory in test/components
  • in this directory add one yaml file per platform. Assumption esp32 for esp32 arduino, esp32-idf for esp32 esp-idf, esp8286 for esp8286 etc.
  • in this file put what used to be in testX.yaml
  • if several platform use common.yaml to avoid duplication

Is the above correct?

Correct yes

I am cannot compile anymore any of my components ???

Did you read my message where I said this?

change from uart_id to just id

It needs to change to be like this:

wk2132_i2c:
  - id: bridge_0
    address: 112
    test_mode: 1
    uart: 
      - id: uart_id0 # Change this from `uart_id` to just `id`
        channel: 0
        baud_rate: 115200
        stop_bits: 1
        parity: none
      - id: uart_id1 # Change this from `uart_id` to just `id`
        channel: 1
        baud_rate: 115200

@DrCoolzic
Copy link
Contributor Author

@DrCoolzic I have fixed that issue now in #6504

Cool it woks on my test

@DrCoolzic
Copy link
Contributor Author

DrCoolzic commented Apr 10, 2024

I am cannot compile anymore any of my components ???

Did you read my message where I said this?

change from uart_id to just id

It needs to change to be like this:

wk2132_i2c:
  - id: bridge_0
    address: 112
    test_mode: 1
    uart: 
      - id: uart_id0 # Change this from `uart_id` to just `id`
        channel: 0
        baud_rate: 115200
        stop_bits: 1
        parity: none
      - id: uart_id1 # Change this from `uart_id` to just `id`
        channel: 1
        baud_rate: 115200

Sorry I did not understand what I had to change. My mistake. ;) I have modified my yamls and now it works.

I have completed the tests for the wk2132_i2c and I am waiting for the results.
If it works correctly I will add the tests for the seven other components. I will also modified my documentation.
Keep you posted. Thanks

Is there a way to test tests/components/wk2132_i2c/* locally before submitting ? cause validation process is now taking forever :(

Hopefully all tests should be good

On branch wk2132
Your branch is up to date with 'origin/wk2132'.

Changes to be committed:
	modified:   tests/components/wk2132_i2c/common.yaml
	modified:   tests/components/wk2132_i2c/test.esp32-idf.yaml
	modified:   tests/components/wk2132_i2c/test.esp32-s3-idf.yaml
	modified:   tests/components/wk2132_i2c/test.esp32-s3.yaml
	modified:   tests/components/wk2132_i2c/test.esp32.yaml
	new file:   tests/components/wk2132_spi/common.yaml
	new file:   tests/components/wk2132_spi/test.esp32-idf.yaml
	new file:   tests/components/wk2132_spi/test.esp32-s3-idf.yaml
	new file:   tests/components/wk2132_spi/test.esp32-s3.yaml
	new file:   tests/components/wk2132_spi/test.esp32.yaml
	new file:   tests/components/wk2168_i2c/common.yaml
	new file:   tests/components/wk2168_i2c/test.esp32-idf.yaml
	new file:   tests/components/wk2168_i2c/test.esp32-s3-idf.yaml
	new file:   tests/components/wk2168_i2c/test.esp32-s3.yaml
	new file:   tests/components/wk2168_i2c/test.esp32.yaml
	new file:   tests/components/wk2168_spi/common.yaml
	new file:   tests/components/wk2168_spi/test.esp32-idf.yaml
	new file:   tests/components/wk2168_spi/test.esp32-s3-idf.yaml
	new file:   tests/components/wk2168_spi/test.esp32-s3.yaml
	new file:   tests/components/wk2168_spi/test.esp32.yaml
	new file:   tests/components/wk2204_i2c/common.yaml
	new file:   tests/components/wk2204_i2c/test.esp32-idf.yaml
	new file:   tests/components/wk2204_i2c/test.esp32-s3-idf.yaml
	new file:   tests/components/wk2204_i2c/test.esp32-s3.yaml
	new file:   tests/components/wk2204_i2c/test.esp32.yaml
	new file:   tests/components/wk2204_spi/common.yaml
	new file:   tests/components/wk2204_spi/test.esp32-idf.yaml
	new file:   tests/components/wk2204_spi/test.esp32-s3-idf.yaml
	new file:   tests/components/wk2204_spi/test.esp32-s3.yaml
	new file:   tests/components/wk2204_spi/test.esp32.yaml
	new file:   tests/components/wk2212_i2c/common.yaml
	new file:   tests/components/wk2212_i2c/test.esp32-idf.yaml
	new file:   tests/components/wk2212_i2c/test.esp32-s3-idf.yaml
	new file:   tests/components/wk2212_i2c/test.esp32-s3.yaml
	new file:   tests/components/wk2212_i2c/test.esp32.yaml
	new file:   tests/components/wk2212_spi/common.yaml
	new file:   tests/components/wk2212_spi/test.esp32-idf.yaml
	new file:   tests/components/wk2212_spi/test.esp32-s3-idf.yaml
	new file:   tests/components/wk2212_spi/test.esp32-s3.yaml
	new file:   tests/components/wk2212_spi/test.esp32.yaml
@DrCoolzic
Copy link
Contributor Author

@jesserockz all modifications requested have been done.

Shoul be ready for final review as soon as tests finished ?

@DrCoolzic DrCoolzic marked this pull request as ready for review April 10, 2024 16:31
@esphome esphome bot requested a review from jesserockz April 10, 2024 16:31
@probot-esphome
Copy link

Hey there @esphome/core, mind taking a look at this pull request as it has been labeled with an integration (uart) you are listed as a code owner for? Thanks!
(message by CodeOwnersMention)

@jesserockz jesserockz added this to the 2024.5.0b1 milestone Apr 16, 2024
@DrCoolzic
Copy link
Contributor Author

@jesserockz
FYI since latest modification uart_component_esp_idf.cpp does not compile anymorer in idf 5.2.1

src/esphome/components/uart/uart_component_esp_idf.cpp: In member function 'virtual void esphome::uart::IDFUARTComponent::setup()':
src/esphome/components/uart/uart_component_esp_idf.cpp:72:34: error: invalid conversion from 'uint8_t' {aka 'unsigned char'} to 'uart_port_t' [-fpermissive]
   72 |   this->uart_num_ = next_uart_num++;
      |                     ~~~~~~~~~~~~~^~
      |                                  |
      |                                  uint8_t {aka unsigned char}
*** [.pioenvs\weikai-i2c-spi\src\esphome\components\uart\uart_component_esp_idf.o] Error 1

I think it would be nice to fix it.

By the way tests/test6.yaml is broken but I did not touch it ???

@jesserockz
Copy link
Member

FYI since latest modification uart_component_esp_idf.cpp does not compile anymorer in idf 5.2.1

This has been fixed in #6487

@@ -0,0 +1,4 @@
/* compiling with esp-idf framework requires a .cpp file for some reason ? */
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Weird, I will look into this after this PR is merged

@jesserockz jesserockz mentioned this pull request Apr 23, 2024
13 tasks
@jesserockz jesserockz merged commit f8cdb08 into esphome:dev Apr 24, 2024
68 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Apr 26, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.