normaldotcom / canable-fw

Firmware for the CANable USB to CAN adapter
http://canable.io/
Other
178 stars 70 forks source link

help to start to contribute to this application #21

Open gaucho1978 opened 5 months ago

gaucho1978 commented 5 months ago

before to start the developement, I would like to know how to decode data received on the serial line. I understood first char (the t) indicates the start, then 3 nibbles for identifier (3 ascii characters) , then one byte of length (usually ascii character "8"), then the data bytes (16 ascii characters). How should I identify the rpm motor speed?

Lanchon commented 5 months ago

to answer your question before you edited, regarding you having windows:

if you want suggestions for the 3rd option, ask.

gaucho1978 commented 5 months ago

to answer your question before you edited, regarding you having windows:

  • install WSL (windows subsystem for linux)
  • install a linux distro in a VM (i suggest linux mint cinnamon in virtualbox)
  • dual boot a linux distro (which is incredibly simple and safe these days)

if you want suggestions for the 3rd option, ask.

I solved by downloading a ready made VMware Ubuntu virtual machine from osboxes.org, then I installed required components. I saved commands sequence. If asked I can share details.

for the new actual question I didn’t found a dbc file to decode sniffed can messages but I was able to use savvycan (with sniff function) in order to identify accelerator pedal message and motor rpm speed and gear selection, by looking at which bytes were changing upon action on pedal and gears. Then I was able to include my first modification inside firmware in order to get required information from the bus and saving them in variables inside the firmware. Now I just need to use these data to control my strip led, ws2812, that I want to control directly from the canable (reuse of the usb tx pin)

gaucho1978 commented 5 months ago

I would like to debug my modifications inside cube IDE but there is no cube project file, even If system.c contains classic Hal calls created by cube MX. I see there is a folder named cube but it's not clear to me why it is inside a folder and not on the root.

gaucho1978 commented 4 months ago

I ported it to stm32cube IDE. May be I will upload it in another repo if of interest for anyone

gaucho1978 commented 4 months ago

I uploaded my project. Essentially I ported it in stm32cube and I added optional functionalities. Unfortunately I didn't forked it while uploading, so is is not linked to this project (apart my readme): https://github.com/gaucho1978/CANableAndLedsStripController