I Need Help Coding ESP32 for Brake Lights. Will Pay $$/hr.

Brake lights are now up and running. They came together quicker than I had thought after the uphill battle with the CAN parsing.

11 Likes

@rpasichnyk hey man do you recall if the last-pulse_len frames 0x00000511 DLC3 and 0x00000711 DLC6 have anything to do with signifying a non-input status on PPM? Meaning something like “hey don’t pay attention to the info on 0x00000511 DLC8 because the remote isn’t sending me anything”

Edit - You Metr Pro shows 0.00 PPM if the remote is off, where the status output from the 0x00000511 DL8 return frames holds at -0.26% braking (on a -1 to +1 scale) on my output until I turn the remote on at which point it jumps straight back to 0%. That kind of sparked the thought, that you had correctly interpreted that no PPM was there even if the system was kicking out a value.

Edit2 - Actually it looks like I can determine that by the last byte in the DLC8 0x00000511 frame. I’ll give that a try.

3 Likes

Can anyone tell me if the DieBieMS has a similar request structure to VESC through the PROCESS_RX_BUFFER? I’m triggering charge animations by checking for positive BMS current and low motor RPM. Unfortunately it’s still possible to trigger the state change at the very end of a quick braking stop.

I’m curious if I can request directly the state of charging/discharge from the thing, I can’t seem to find it in the firmware code.

Newb alert. I fried my Unity, or at least bricked it. I’ve been sending CAN requests this whole time from the ESP32 with a CAN ID of zero, which is idiotic because the Unity master CAN ID is set to zero. It kept presenting itself in what I thought was leaked memory down the CAN line causing the VESC to go into safe mode.

Turns out it was the imposter on the CAN line. The Unity had enough and tapped out. I’m trying to figure out if the NRST pin on the STM32 is present in that little black 2 x 7 header (the one the BLE module sits in) to attempt a reset before taking a crack at swapping the MCU… :frowning:

Edit: ST-Link can’t find target

My answer to the initial question is a definite “yes” as i fully do and am absolutely able to understand what this thread is about. Also i’m drunk like shit but even sober i’d definitely not have an idea what’s going on here … Go capable people … ! Also i’m bored : )

1 Like

If you are still struggling let me know, the best method is to connect serial port of vesc to external microcontroller tx and rx which can access any other vesc via can bus and correct packet. Lights don’t need an insane polling period, 10 hz is more than enough as the external microcontroller can filter the values smooth if you want to pwm your lights.