vekexasia / comfoair-esp32

Interact with Zehnder Comfoair with esp32
Other
116 stars 38 forks source link

Idea of making a project on ESP32 + ETHERNET #31

Open kamil2466 opened 1 year ago

kamil2466 commented 1 year ago

Hello, I make various pcb boards and I have a proposal to make a professional board for this project. I wanted to add MQTT broker control over ETHERNET, is it possible to rewrite the software under ETHERNET ?

vekexasia commented 1 year ago

why not kamil :) everything is possible

On Sun, Oct 2, 2022 at 10:32 PM Kamil_B @.***> wrote:

Hello, I make various pcb boards and I have a proposal to make a professional board for this project. I wanted to add MQTT broker control over ETHERNET, is it possible to rewrite the software under ETHERNET ?

— Reply to this email directly, view it on GitHub https://github.com/vekexasia/comfoair-esp32/issues/31, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABQ6SYAAZSIFJJBE7DHCDDWBHWOLANCNFSM6AAAAAAQ3BTTLE . You are receiving this because you are subscribed to this thread.Message ID: @.***>

--

Andrea Baccega [image: @. [image: @. [image: Personal site] http://www.andreabaccega.com/ [image: Linkedin Profile] http://it.linkedin.com/in/andreabaccega [image: Facebook] https://www.facebook.com/andrea.baccega [image: Google+] https://plus.google.com/109217393200753135791 [image: Twitter] http://twitter.com/veke87 [image: StackOverflow] http://stackoverflow.com/users/314407/andrea-baccega [image: GitHub] https://github.com/vekexasia

kamil2466 commented 1 year ago

Thank you for your reply :) I will make the design of the board and make it available to everyone. The controller will run on 12v DC power and Ethernet , and the outputs will be CAN bus, RS485 and 1-wire (ds18b20)

Obelixje commented 1 year ago

Very interesting!

Vinzent82 commented 1 year ago

great @kamil2466!

kamil2466 commented 1 year ago

I made a PCB design and will order a prototype 30 31 29

Input power supply +12V or from USB_C (+5V). Available buses (CANBUS, MODBUS and 1-WIRE).

SkullboyNL commented 1 year ago

looks good. Keep us informed

kamil2466 commented 1 year ago

PCB documentation https://docs.google.com/document/d/1q0n5UrU_Wb4M9KEMclKQVpAS4q2IFIikL5ap5B0-XQ0/edit?usp=sharing

tezet commented 1 year ago

Looks great @kamil2466! I like the idea of making the board based on WT32 - ETH01. I was planning to design some boards for my SSR relays control in similar way. Are you going to publish the project files for the board design?

kamil2466 commented 1 year ago

Looks great @kamil2466! I like the idea of making the board based on WT32 - ETH01. I was planning to design some boards for my SSR relays control in similar way. Are you going to publish the project files for the board design?

Yes they will be made available :) For now it is a prototype after launching and testing I will make it available to everyone Go to boneio.eu we do home automation controller

Vinzent82 commented 1 year ago

anybody having an idea how the firmware needs to be adapted for Ethernet support?

tezet commented 1 year ago

I would personally go with porting it as a ESPHome component, it would make it more flexible to integrate with different things (including Ethernet). Unfortunately I currently don't have time to do it, also current solution works fine for me.

gahujipo commented 1 year ago

@tezet what is your current solution? Does that solution use Ethernet?

vekexasia commented 1 year ago

i'm designing a pcb as well. why would you want to use ethernet instead of wifi?

Vinzent82 commented 1 year ago

why would you want to use ethernet instead of wifi?

@vekexasia, my reasons:

vekexasia commented 1 year ago

interesting Vincent. thanks for sharing.

the board i designed (check main repo now) is modular. You can design a hat with Ethernet and disable wifi .... :)

On Sun, Apr 30, 2023 at 7:12 AM Vinzent82 @.***> wrote:

why would you want to use ethernet instead of wifi?

@vekexasia https://github.com/vekexasia, my reasons:

  • better stability as my WiFiy quality is bad in the cellar
  • we care for human radiation exposure. Thus we switch off our WiFi as frequently as possible and it runs on minimum radiation power
  • less energy consumption

— Reply to this email directly, view it on GitHub https://github.com/vekexasia/comfoair-esp32/issues/31#issuecomment-1528941088, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABQ6S4RNLI5MKDMM3YHJ23XDXYDXANCNFSM6AAAAAAQ3BTTLE . You are receiving this because you were mentioned.Message ID: @.***>

--

Andrea Baccega [image: @. [image: @. [image: Personal site] http://www.andreabaccega.com/ [image: Linkedin Profile] http://it.linkedin.com/in/andreabaccega [image: Facebook] https://www.facebook.com/andrea.baccega [image: Google+] https://plus.google.com/109217393200753135791 [image: Twitter] http://twitter.com/veke87 [image: StackOverflow] http://stackoverflow.com/users/314407/andrea-baccega [image: GitHub] https://github.com/vekexasia

hcouplet commented 1 year ago

you can also directly use the board from olimex. See https://github.com/vekexasia/comfoair-esp32/pull/51

nliaudat commented 10 months ago

That should works : https://github.com/nliaudat/esp_canbus 10$/board at jlcpcb

une18 commented 7 months ago

@kamil2466 What is the status of this project? Did you get it working?

gekkekoe commented 3 months ago

@vekexasia would one of these https://docs.m5stack.com/en/atom/atom_can work out of the box? I think that it should work? Might be an easy solution.

[edit] hmm seems that it cannot power the board from the can bus itself, that's inconvenient then

svde commented 3 months ago

This one https://docs.m5stack.com/en/unit/Unit-Mini%20CAN should be able to power the board from the can bus.

I have one. I'm trying to use it in combination with an atoms3 lite / atoms3u, but the ESP32S3 doesn't compile. Will get a atom lite (regular esp32) and try with that.

gekkekoe commented 3 months ago

This one https://docs.m5stack.com/en/unit/Unit-Mini%20CAN should be able to power the board from the can bus.

I have one. I'm trying to use it in combination with an atoms3 lite / atoms3u, but the ESP32S3 doesn't compile. Will get a atom lite (regular esp32) and try with that.

yeah saw that one, but can't order it (yet) in the Netherlands. if you stack that one, you still need to use a grove cable to connect it to the S3 right? Also the (TJA1051T/3) chip does not have isolation compared to CA-IS3050G chip. Don't know if its really needed btw, but sounds a bit safer.

Did you change the board definition to build esphome? the s3 should be supported (s3 is also faster). have a look at an example esphome: https://github.com/fonske/Mitsubishi_procon/blob/main/esphome/boards/board-esp32S3.yaml or https://github.com/esphome/feature-requests/issues/2332

svde commented 3 months ago

This is the config I'm using:

substitutions:
  board: esp32-s3-devkitc-1
  device_description: "wtw new"
  mac: ***redacted***
  platform: "ESP32"
  rx_pin: "1" # RX = GPIO_NUM_1
  tx_pin: "2" # TX = GPIO_NUM_2

api:

captive_portal:

comfoair:
- rx_pin: ${rx_pin}
  tx_pin: ${tx_pin}

esphome:
  comment: "${device_description}"
  name: esphome-${mac}
  platformio_options:
    board_build.flash_mode: dio

esp32:
  board: ${board}
  framework:
    type: arduino

external_components:
  - source: github://vekexasia/comfoair-esp32
    components: [ comfoair ]

logger:
  level: INFO

mqtt:
  broker: ***redacted***

ota:

switch:
  - platform: restart
    name: restart

text_sensor:
  - platform: version
    name: version
  - platform: wifi_info
    ip_address:
      name: ip
    ssid:
      name: ssid
    bssid:
      name: bssid

web_server:
  port: 80

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password
  ap:
    ssid: esphome-${mac}
    password: !secret ap_password

and this is the (first) error:

Compiling .pioenvs/esphome-802aa8c75ec3/FrameworkArduino/esp32-hal-gpio.c.o
In file included from /config/.esphome/platformio/packages/framework-arduinoespressif32/tools/sdk/esp32s3/include/soc/esp32s3/include/soc/dport_reg.h:21,
                 from .piolibdeps/esphome-802aa8c75ec3/esp32_can/src/esp32_can_builtin_lowlevel.cpp:33:
.piolibdeps/esphome-802aa8c75ec3/esp32_can/src/esp32_can_builtin_lowlevel.cpp: In function 'int CAN_init()':
.piolibdeps/esphome-802aa8c75ec3/esp32_can/src/esp32_can_builtin_lowlevel.cpp:217:29: error: 'DPORT_PERIP_CLK_EN_REG' was not declared in this scope
     DPORT_SET_PERI_REG_MASK(DPORT_PERIP_CLK_EN_REG, DPORT_CAN_CLK_EN);
                             ^~~~~~~~~~~~~~~~~~~~~~
gekkekoe commented 3 months ago

Something like this should work: esp32: board: m5stack-atoms3 variant: esp32s3 framework: type: esp-idf version: 5.1.2 platform_version: 6.5.0

Seems to be ESPHome, it does not support platformIO 6 yet.

In file included from src/esphome/components/comfoair/comfoair.cpp:1: src/esphome/components/comfoair/comfoair.h:2:10: fatal error: esp32_can.h: No such file or directory It's probably moved or is re-named differently in new version.

[edit] https://github.com/espressif/arduino-esp32/issues/6937 Ah the ESP32 Can lib is old, and does not support new S3 board. Should not be that hard to switch to a newer lib

gekkekoe commented 3 months ago

seems that we need to use an updated lib dep of the esp32_can. I tried to replace it : https://github.com/gekkekoe/comfoair-esp32/commit/c79ed143059842534bc83159b5d50534fab15e61 but it does not seem to work, I'm pretty new with esphome so probably doing something wrong

svde commented 3 months ago

Got the M5stack atom lite. It works, powered via the 12V of the zehnder unit.

gekkekoe commented 3 months ago

use (my repo has the adjusted esp32 lib for S3):

external_components:
  - source: github://gekkekoe/comfoair-esp32
    components: [ comfoair ]

and configure as

esp32:
  board: m5stack-atoms3
  variant: esp32s3
  framework:
    type: arduino
    version: 2.0.14
    platform_version: 6.5.0

this builds :) no need to buy a regular. the S3 is faster

vekexasia commented 3 months ago

Can you guys post a pic of Al these different builds?

svde commented 3 months ago

This is my second "build". IMG_7098

Components:

It's small enough to be tucked away under the wiring cover on the top of the unit.

My first build (the original 3D printed box) isn't able to send commands to the ventilation unit. That's why I built the 2nd one, which (turns out) also isn't able to send commands to the ventilation unit. Perhaps it's due to the ComfoConnect LAN C and option box that are also connected to the unit.

gekkekoe commented 3 months ago

@vekexasia I still have a soldered version, but want to replace it. Would like a CAN module that can also power an atom3. Preferably no cable between the atom and CAN module. this https://docs.m5stack.com/en/atom/atom_can would have been ideal.

SkullboyNL commented 3 months ago

i made a Wifi and ethernet version

WhatsApp Image 2024-03-24 at 13 59 25 (2) WhatsApp Image 2024-03-24 at 13 59 26 WhatsApp Image 2024-03-24 at 13 59 25 (1) WhatsApp Image 2024-03-24 at 13 59 25