chrishrb / hoval-gateway

Hoval Gateway
Apache License 2.0
13 stars 5 forks source link

Composition of abitration ID #11

Closed abichinger closed 11 months ago

abichinger commented 11 months ago

Hey,

I'm currently working on my own hoval gateway for TTE-WEZ. (https://github.com/abichinger/esp_canbus) and I'm trying to figure out how hoval puts the can ID together.

According to your code

def build_arbitration_id(message_id, priority, device_type, device_id):
    return (message_id << 24) | (priority << 16) | (device_type << 8) | device_id

the device_id should be: can_id & 0xFF and the device_type should be (can_id >> 8) & 0xFF.

I found three can IDs on my bus and after sending some SET_REQUESTS from the control modules, I was able to assign the devices.

I would expect both control modules to have the same device_type. Have I made a mistake or is the can ID composed differently?

More information

Devices listed on the GUI of my control module with device IDs:

Device types according to https://raw.githubusercontent.com/wladwnt/CAN-Gateway/master/Operating_manual.pdf (page 34)

abichinger commented 11 months ago

https://github.com/nliaudat/esp_canbus/issues/7