2026-02-04 19:49:21 +00:00
2026-01-18 17:39:29 +00:00
2026-02-04 18:59:46 +00:00
2026-02-04 18:59:46 +00:00
2026-01-28 17:43:49 +00:00
2026-01-20 19:36:30 +00:00
2026-02-02 13:07:26 +00:00
2026-02-04 19:30:06 +00:00
2026-02-04 19:49:21 +00:00
2026-01-23 23:57:45 +00:00
2026-01-20 18:56:22 +00:00
2026-01-18 17:39:29 +00:00
2026-02-04 19:35:33 +00:00
2026-01-11 20:20:00 +00:00

Eculocate

Read data from the K-line of a Honda motorbike ECU and publish it using UDP over Wifi.

Comprises:

  • some code for an ESP32-C3 wich can be connected (via level shifters and other electronics, don't plug it straight in) to the bike's ECU,

  • a very PoC implementation of an android client, using Termux

Building

The repo is split into two crates in a cargo workspace: code in ecu-portable can be built and run using the native compiler, hence is unit-testable, and code in ecu-esp32 depends on all the esp32 gubbins so you can test it only by running it.

    cargo test -p ecu-portable --target x86_64-unknown-linux-gnu
	make BUILD_ID=$(date +%y%m%d-%H%M%S) install

How it works

The ESP32 is connected to the diagnostic port of the ECU and can interrogate it to dump its "tables". This is based on "K-line", a 1 wire 10400 baud serial connection operating with 12V logic.

On first boot, or if it can't connect to a Wifi network, it will function as a Bluetooth LE peripheral: you can connect to it, choose a wifi network and provide the password.

In normal operation it will connect to the configured Wifi network and open TCP and UDP sockets, The client connects first to TCP and provides a digitally signed session key, then (provided the signature is valid) to the UDP socket to send a subscription requests. When the device receives a subscription request, it starts to periodically query the ECU for the requested tables and sends the value using UDP back to the subscriber.

To avoid using hardcoded IP addresses, it uses multicast DNS/DNS service discovery to advertise itself as providing the _keihin._udp.local service, so a client can use zeroconf/bonjour/avahi to find where it is.

There is a prototype/example client in client/. Consult the README in that directory for details.

Description
No description provided
Readme 3.3 MiB
Languages
Rust 78.1%
Python 17.4%
Nix 2.6%
Ruby 1%
Makefile 0.9%