elupus / esphome-nibe

Esphome components for nibe heat pumps
MIT License
69 stars 20 forks source link

Olimex esp32-poe #24

Closed Berjastein closed 1 year ago

Berjastein commented 1 year ago

Hi, im trying to configure Olimex esp32-poe, everything seems to be running, but i dont think its sending out udp packets, tried to point target after laptop and listen on wireshark, but there is nothing comming.

The pump is never going in alarm state, and modbus is activated on the pump, i i turn off the nibegw the pump goes in error, so i guess rs485 is working?

Im just using the wifi not the ethernet port.

Board: https://www.olimex.com/Products/IoT/ESP32/ESP32-POE-ISO/open-source-hardware

RS485 addon for board: https://www.olimex.com/Products/Modules/Interface/MOD-RS485/open-source-hardware

esphome:
  name: nibegw
  comment: Nibegw
  platform: ESP32
  board: esp32-poe

# General ESPHome setup
api:

ota:
  password: !secret OTA_PASSWORD

logger:

wifi:
  ssid: !secret WIFI_SSID
  password: !secret WIFI_PASSWORD
  fast_connect: true # Fast connect to connect to my hidden network

external_components:
  - source: 
      type: git
      url: https://github.com/elupus/esphome-nibe.git
    components: [ nibegw ]

uart:
  id: my_uart
  rx_pin: GPIO36
  tx_pin: GPIO4
  baud_rate: 9600

nibegw:
  udp:
    # The target address(s) to send data to. May also be multicast addresses.
    target:
      - ip: 192.168.86.171
        port: 10091

    # List of source address to accept read/write from, may be empty for no filter, but
    # this is not recommended.
    source:
      - 192.168.86.171

    # Optional port this device will listen to to receive read requests. Defaults to 9999
    read_port: 10091

    # Optional port this device will listen to to receive write request. Defaults to 10000
    write_port: 10092

  acknowledge:
    - MODBUS40

    # Enable a dummy RMU40 accessory to receive updates
    # to certain registers faster. This should not be
    # enabled if you have an actual RMU40.
    - RMU40_S4

  # Constant replies to certain requests can be made
  constants:
    - address: MODBUS40
      token: ACCESSORY
      data: [
            0x0A, # MODBUS version low
            0x00, # MODBUS version high
            0x02, # MODBUS address?
      ]

    # Accessory version response
    - address: RMU40_S4
      token: ACCESSORY
      data: [
            0xEE, # RMU ?
            0x03, # RMU version low
            0x01, # RMU version high
      ]

    # Unknown response that nibepi uses
    - address: RMU40_S4
      token: RMU_DATA
      command: RMU_WRITE
      data: [
            0x63,
            0x00,
      ]

    # Constant fixed temperature to avoid pump going into alarm.
    - address: RMU40_S4
      token: RMU_WRITE
      data: [
            0x06, # Temperature
            0x14, # degrees low
            0x00, # degrees hight
      ]
elupus commented 1 year ago

Your config does look correct. Is it connecting to your wifi network? Can you ping it?

Have you look at the logs from the esp?

Berjastein commented 1 year ago

Hi thanks for quick reply!

The esp is connected to wifi and i can see the logs from HA esphome addon, and ping works.

When i try to connect the nibe integration from HA it says udp packet recived, but i only see that when i try to add the Integration, otherways the esp starts up messages come like ip and ports and after nothing more is in console.

Can i get more log data?

elupus commented 1 year ago

You should be getting a log entry every time the pump speaks. You can add debug: true to the nibe section to get some more output.

You dont seem to have set up a dir_pin? Are you sure that rs485 board support auto rx/tx switching?

Berjastein commented 1 year ago

I am not sure, i cant find anything about it, do you know by looking at the diagram if it is or not?

Here is a link to schematic: https://www.olimex.com/Products/Modules/Interface/MOD-RS485/resources/MOD-RS485-schematic.pdf

elupus commented 1 year ago

That chip is not automatic. It needs to have its nRE and DE controlled. In your case they need to be tied together and controlled by the dir_pin setting.

At the moment the code cant drive both pins itself. Maybe some lambda could be used on the dir_pin setting but ive not looked at that.

Berjastein commented 1 year ago

Thanks! now I know where to look!

Berjastein commented 1 year ago

I made some changes on the print, and used GPIO 10 for dir_pin, now it is working, thanks for pointing me in the right direction :)

elupus commented 1 year ago

Nice to hear!