jagheterfredrik / esphome-rego1000

ESPHome custom component for IVT Rego1000 heat pump controller
12 stars 5 forks source link

Dump values using CAN module MCP2515 #10

Closed stomko11 closed 1 year ago

stomko11 commented 1 year ago

My rego1000 is v.3.9.0 I am using MCP2515 which is working, I can read values, but most of them make no sense. I was hoping to be able to dump the values and map it accordingly. Any way I can achieve it using regodump? This is my config for rego1000 and CAN:

spi:
  clk_pin: GPIO18
  mosi_pin: GPIO23
  miso_pin: GPIO19

canbus:
  - platform: mcp2515
    can_id: 0
    id: can0
    cs_pin: GPIO5
    bit_rate: 125kbps

Thanks

stomko11 commented 1 year ago

@jagheterfredrik wondering if you could advise?

jagheterfredrik commented 1 year ago

The regodump utility doesn’t support spi at the moment. The change is probably quite small but I have very limited time right now. I’ll see if I can find some time otherwise your best bet is to hook up a can transceiver (rx/tx on gpio 22/23)and use the internal esp32 can controller.

stomko11 commented 1 year ago

Thanks. Which transciever would I use then?

jagheterfredrik commented 1 year ago

I’m using the SN65HVD231 but I assume TJA1050 also would work just fine.

jagheterfredrik commented 1 year ago

If you do get around to dumping please submit back 🙏

stomko11 commented 1 year ago

I will!

stomko11 commented 1 year ago

@jagheterfredrik Question though - how exactly is dump supposed to work. I see the output on the console, such as:

[23:34:19][D][canbus:067]: received can message (#1) extended can_id=0x80060 size=1
[23:34:19][D][canbus:067]: received can message (#1) extended can_id=0x801c270 size=2
[23:34:19][D][canbus:067]: received can message (#1) extended can_id=0x54270 size=1
[23:34:20][D][canbus:067]: received can message (#1) extended can_id=0x8020270 size=2
[23:34:21][D][canbus:067]: received can message (#1) extended can_id=0x80060 size=1
[23:34:21][D][canbus:067]: received can message (#2) extended can_id=0x4c270 size=1
[23:34:21][D][canbus:067]: received can message (#1) extended can_id=0x8058270 size=1

Is there any detailed description how to proceed next?

jagheterfredrik commented 1 year ago

Use info level on the logger. Upload and wait 25 seconds, it should spit out all variables

stomko11 commented 1 year ago

Thanks. I have tried both info and debug level, but the output I am getting is pretty much the same as above...actually to be more precise, with info, I do not get any output. With debug, I get what's above. I am modifying this in yaml:

# Enable logging
logger:
  level: info
jagheterfredrik commented 1 year ago

If you have debug level you should at least see the message “STARTING”? (After 25s)

stomko11 commented 1 year ago

no, not really. Here is the full output including install:

INFO ESPHome 2023.5.5
INFO Reading configuration /config/esphome/ivt.yaml...
INFO Generating C++ source...
INFO Compiling app...
Processing ivt (board: esp32dev; framework: arduino; platform: platformio/espressif32@5.3.0)
--------------------------------------------------------------------------------
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
 - toolchain-xtensa-esp32 @ 8.4.0+2021r2-patch5
Dependency Graph
|-- AsyncTCP-esphome @ 1.2.2
|-- WiFi @ 2.0.0
|-- FS @ 2.0.0
|-- Update @ 2.0.0
|-- ESPAsyncWebServer-esphome @ 2.1.0
|   |-- AsyncTCP-esphome @ 1.2.2
|-- DNSServer @ 2.0.0
|-- ESPmDNS @ 2.0.0
|-- noise-c @ 0.1.4
|   |-- libsodium @ 1.10018.1
Compiling /data/ivt/.pioenvs/ivt/src/main.cpp.o
In file included from src/regovardump.h:4,
                 from src/main.cpp:23:
/data/cache/platformio/packages/framework-arduinoespressif32/tools/sdk/esp32/include/driver/include/driver/can.h:13:2: warning: #warning driver/can.h is deprecated, please use driver/twai.h instead [-Wcpp]
 #warning driver/can.h is deprecated, please use driver/twai.h instead
  ^~~~~~~
In file included from /data/cache/platformio/packages/framework-arduinoespressif32/tools/sdk/esp32/include/driver/include/driver/can.h:15,
                 from src/regovardump.h:4,
                 from src/main.cpp:23:
/data/cache/platformio/packages/framework-arduinoespressif32/tools/sdk/esp32/include/hal/esp32/include/hal/can_types.h:21:2: warning: #warning hal/can_types.h is deprecated, please use hal/twai_types.h instead [-Wcpp]
 #warning hal/can_types.h is deprecated, please use hal/twai_types.h instead
  ^~~~~~~
Linking /data/ivt/.pioenvs/ivt/firmware.elf
RAM:   [=         ]  12.4% (used 40600 bytes from 327680 bytes)
Flash: [=====     ]  49.3% (used 905273 bytes from 1835008 bytes)
Building /data/ivt/.pioenvs/ivt/firmware.bin
Creating esp32 image...
Successfully created esp32 image.
esp32_create_combined_bin(["/data/ivt/.pioenvs/ivt/firmware.bin"], ["/data/ivt/.pioenvs/ivt/firmware.elf"])
Wrote 0xee6c0 bytes to file /data/ivt/.pioenvs/ivt/firmware-factory.bin, ready to flash to offset 0x0
========================= [SUCCESS] Took 7.59 seconds =========================
INFO Successfully compiled program.
INFO Resolving IP address of ivt.local
INFO  -> x.x.x.x
INFO Uploading /data/ivt/.pioenvs/ivt/firmware.bin (911040 bytes)
Uploading: [============================================================] 100% Done...

INFO Waiting for result...
INFO OTA successful
INFO Successfully uploaded program.
INFO Starting log output from ivt.local using esphome API
INFO Successfully connected to ivt.local
[00:08:34][I][app:102]: ESPHome version 2023.5.5 compiled on Jun 17 2023, 00:08:07
[00:08:34][C][wifi:368]:   Hostname: 'ivt'
[00:08:34][C][wifi:370]:   Signal strength: -57 dB ▂▄▆█
[00:08:34][C][wifi:374]:   Channel: 4
[00:08:34][C][logger:301]: Logger:
[00:08:34][C][logger:302]:   Level: DEBUG
[00:08:34][C][logger:303]:   Log Baud Rate: 115200
[00:08:34][C][logger:305]:   Hardware UART: UART0
[00:08:34][C][canbus:021]: config standard id=0x000
[00:08:34][C][captive_portal:088]: Captive Portal:
[00:08:34][C][mdns:108]: mDNS:
[00:08:34][C][mdns:109]:   Hostname: ivt
[00:08:34][C][ota:093]: Over-The-Air Updates:
[00:08:34][C][ota:094]:   Address: ivt.local:3232
[00:08:34][C][ota:097]:   Using Password.
[00:08:34][C][api:138]: API Server:
[00:08:34][C][api:139]:   Address: ivt.local:6053
[00:08:34][C][api:141]:   Using noise encryption: YES
[00:08:34][D][canbus:067]: received can message (#1) extended can_id=0x54270 size=1
[00:08:35][D][canbus:067]: received can message (#1) extended can_id=0x80060 size=1
[00:08:35][D][canbus:067]: received can message (#1) extended can_id=0x8010270 size=2
[00:08:36][D][canbus:067]: received can message (#1) extended can_id=0x4c270 size=1
[00:08:36][D][canbus:067]: received can message (#1) extended can_id=0x8014270 size=2
[00:08:36][D][canbus:067]: received can message (#1) extended can_id=0x1d8431 size=1
[00:08:37][D][canbus:067]: received can message (#1) extended can_id=0x80060 size=1
[00:08:37][D][canbus:067]: received can message (#1) extended can_id=0x48270 size=1
[00:08:37][D][canbus:067]: received can message (#1) extended can_id=0x8018270 size=2
[00:08:38][D][canbus:067]: received can message (#1) extended can_id=0x801c270 size=2
[00:08:38][D][canbus:067]: received can message (#1) extended can_id=0x44270 size=1
[00:08:39][D][canbus:067]: received can message (#1) extended can_id=0x80060 size=1
[00:08:39][D][canbus:067]: received can message (#1) extended can_id=0x8020270 size=2
[00:08:39][D][canbus:067]: received can message (#1) extended can_id=0x40270 size=1
[00:08:40][D][canbus:067]: received can message (#1) extended can_id=0x8058270 size=1
[00:08:41][D][canbus:067]: received can message (#1) extended can_id=0x3c270 size=1
[00:08:41][D][canbus:067]: received can message (#1) extended can_id=0x80060 size=1
[00:08:41][D][canbus:067]: received can message (#1) extended can_id=0x805c270 size=1
[00:08:42][D][canbus:067]: received can message (#1) extended can_id=0x38270 size=1
[00:08:42][D][canbus:067]: received can message (#1) extended can_id=0x8060270 size=1

and the output goes on and on repeating these (reading these)

jagheterfredrik commented 1 year ago

What’s in ivt.yaml? Is it a copy of rego1000dump.yaml?

you might need to hook up and flash over usb, when using ota early log lines are usually lost.

stomko11 commented 1 year ago

It is. But I have must been doing something wrong. Retried again from scratch, and got back the desired dump. I will go through it at some point and merge here later.

stomko11 commented 1 year ago

I have opened pull req to include dump and variables for v3.9.0. I will open another issue/request for Holiday mode

jagheterfredrik commented 1 year ago

Thanks! 🙏