LibreSolar / esp32-edge-firmware

Firmware for CAN/UART to WiFi/BLE gateway using ESP32
Apache License 2.0
26 stars 12 forks source link

Add ThingSet via CAN ISO-TP #12

Closed martinjaeger closed 3 years ago

martinjaeger commented 3 years ago

This PR adds initial support for ThingSet requests via CAN using lishen2/isotp-c library (forked to Libre Solar github account.

Firmware has been tested with Linux can-utils and MPPT 2420 HC charge controller using Zephyr implementation. The Zephyr implementation needs these additional features to support messages with padding.

As ISO-TP standard suggests fixed bytes (0xDA) for the bits 16..23, the ThingSet message format had to be changed such that the function code (first byte of a request) is included in the data and not in the ID. The ThingSet spec has to be updated accordingly.

Open points for proper implementation:

martinjaeger commented 3 years ago

Thanks for the review @Gretel5X. Fixed the issues and will merge after CI has passed.