eculocate

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

commit e37553d0d75509d2eb7bdc83ab0a8bfe938dc66f
parent 9be9d167c38fa699c203ce4a9cb0644547d23cdf
Author: Daniel Barlow <dan@telent.net>
Date:   Mon, 12 Jan 2026 17:58:35 +0000

remove dead notes

Diffstat:
Mnotes.md | 140++++---------------------------------------------------------------------------
1 file changed, 7 insertions(+), 133 deletions(-)

diff --git a/notes.md b/notes.md @@ -1,15 +1,3 @@ -# 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 - SSID=my-wifi PASSWORD="my-wifi-password" cargo run --release -``` - # Resources @@ -138,130 +126,16 @@ according to https://forum.pgmfi.org/viewtopic.php?p=140964#p140964 table 0 is "ecmid" -## exporting - -we're going to stream data using udp over wifi - -https://docs.espressif.com/projects/rust/no_std-training/03_6_http_client.html - -* scan for networks and then pick whichever of dandroid,telent -is available - -** eventually we will do a wifi provisioning over ble thing - -* use mdns to notify the peer of where to connect to - -https://lib.rs/crates/esp-hal-mdns - -** Probe and Announce at startup - -at startup it should do Probe and Announce for "all those resource -records that a Multicast DNS responder desires to be unique on the local link" -so that would be `Honda Motorbike._keihin._udp.local` TXT and SRV, -but not honda.local A because the fact we got it using dhcp means -we already know it's unique - -"Probe" means send packets as QU (unicast response) containing ANY requests for each name: 3 packets with 250ms between them - -"Announce" means send 2 <= n <= 8 packets one second apart, containing -all the records we know - -[ Status: We announce but only once and we don't bother probing ] - - -** send additional data in responses - -section 12 of https://www.ietf.org/rfc/rfc6763.txt describes the -expected additional records: - - * for SRV, all the A and AAAA it names - - * for PTR "Service Instance Enumeration or Selective - Instance Enumeration (subtype)": i.e. when the record data names - an instance of the service, the SRV and TXT records for the instance - and all the A/AAAA named by the SRV - -status: done except that (c) probably the code is sucky; -(d) haven't investigated what happens if the packet gets too large - -** don't answer queries if the answers in the query already include what we'd send - -mdns is so fricking noisy already I don't know if this is worth the extra effort - -** set the CACHE_FLUSH thing when needed - -should be set on unique records but not shared - -"all the records with that name, rrtype, and rrclass are conceptually -under the control or ownership of a single responder" - -so this would be the Bike SRV and TXT and everything they reference -but not the PTR records because other devices could also legitimately -have those - - -** do we need to do NSEC? - -** handle QU and legacy queries - -5.4 Questions Requesting Unicast Responses - -- top bit in the class field of a DNS question is the unicast-response bit -- send repsonse unicast, unless the record has not been sent recently - ("within one quarter of its TTL") -- also for queries received fom unicast - - but verify the source is local lan - - and the port is 5353 (otherwise see "legacy") - - -6.7. Legacy Unicast Responses - -if source port != 5353 - -- respond via unicast to source -- query id and question -- don't set cache-flush bit -- ttl <= 10s - -** compress responses - - -* write the udp server - -- on reception of a packet containing table numbers, start streaming those -tables to the peer - -- probably the request protocol should be a _bit_ cleverer - - tables - - refresh time - - interpreted numbers - -``` -u16 poll_interval (ms) -u8 subscription_type = T for table -u8 table_number -u16 poll_interval (ms) -u8 subscription_type = T for table -u8 table_number -... -u16 poll_interval = 0 -``` - -we can extend this later to other subscription_types for pre-interprteted data. - - +## TODO +* wifi provisioning over ble -- if the peer goes away, stop +* ecu needs to timestamp the table reads before sending -- if we subsequently get a packet from a different address, send there instead +* add the 12v->5v buck converter, make a cable to plug into diag port -* write the receiver +* reverse-engineer the mystery values -- android app -- does enough mdns to choose a keihin service instance (https://github.com/mnellemann/mdns-explorer may help) +* add an IMU to get lean angles -- writes a list of tables to the advertised ip address/port -- reads udp and writes to "disk" -- updates the display to show data is incoming -- provides a "stop" button to close the socket +* OTA updates might be handy once it's installed on the bike