Skip to content

feat: DAQ Heartbeat#546

Open
nicholasching wants to merge 61 commits into
daqfrom
daq-nick-heartbeat
Open

feat: DAQ Heartbeat#546
nicholasching wants to merge 61 commits into
daqfrom
daq-nick-heartbeat

Conversation

@nicholasching

Copy link
Copy Markdown

Completed basic heartbeat functionality for DAQ with the following features and design considerations:

Decided to implement heartbeat on separate heartbeat.go file for modularization.

On an interval, currently 3s, send POST request to the server with the following info:

  • timestamp
  • vehicle_ID - currently retrieved from env variable; i was thinking this could be used as a tag to filter data in the future. For example, we can configure the vehicle with different identifiers to differentiate between development, testing, practice, competition, etc, and then filter runs by vehicle_ID
  • session_ID - unique hash generated on each startup of the heartbeat script, allows us to track different test runs and associate CAN frame data w/each run, maybe some sort of list view for runs in the future.
  • CAN connection state for basic debug if the CAN telemetry does not work, but heartbeat does.

If communication fails, nothing happens; we will continue sending on the same regular interval.

ManushPatell and others added 9 commits October 19, 2025 13:28
* added positionfromV function and implemented in LV Controller

* fixed unused variable and declaration

* format issues

* typo

* fix formatting

* maybe now its for-real

* apply clang-format fixes

* fixing suspension formatting

* restore platformio file

* changes on dbc file for suspension travel

* updated namespace

* updated test cases and edge case

* naming and added comment

* fix build issue
* Added configurations for tms to use FreeRTOS

* Converted main.cc to use FreeRTOS tasks

* Removed lib_deps from env in platformio file for tms

* generated files from cubemx
* Add static code analysis to dashboard project

* Add static code analysis to front_controller

* Add static code analysis to lvcontroller

* Add static code analysis to tms

* Revert check_severity to default value

* Add static code analysis to demo projects

* Add pio check to build-test-projects

* Add pio check to pre-commit
* added fc suspension on dbc

* change class to sustravel12

* called in main.cc and fixed include statement

* inserted in loop
* Check for changes only in certain directories

* Fix static code analysis workflow

* Fix build-test-projects.yml

* Add test files for PR analysis

* Remove test files from repo

* Reduce number of pre-commit checks

* Reduce number of PR analysis checks
* Added generate git hash script

* Added platformio configs to use generate_git_hash.py as a new pre script file

* Added sending of git hash in lvcontroller

* Added 1hz task and git hash send to front controller

* Added 1hz task and git hash send to tms

* Used env variable for finding include directory of project

@sokosam sokosam left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rest LGTM

Comment thread scripts/daq/heartbeat.go
can0Active := h.can0 != nil
can1Active := h.can1 != nil
return can0Active, can1Active
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't touched go in a while but can you confirm if this actually checks if the can channels are active? (assuming that this is the goal)

are we certain that if HeartbeatHandler -> can0 : net.Conn is simply initialized that it would mean its active/online?

Again I'm not really sure how this works so just lmk if its right or not.

Comment thread scripts/daq/main.go
logger.Error("Failed to send heartbeat", zap.Error(err))
}
}
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we name both to Interval? Feels weird to have one be uploadTimer and heartbeatInterval

Suggested change
}
uploadInterval := time.NewTimer(time.Second)
heartbeatInterval := time.NewTicker(3 * time.Second)
defer heartbeatInterval.Stop()
for {
select {
case <-uploadInterval.C:
err = telemetry.Upload()
if err != nil {
fmt.Printf("failed to upload telemetry data: %v\n", err)
}
case <-heartbeatInterval.C:
err = heartbeat.SendHeartbeat()
if err != nil {
logger.Error("Failed to send heartbeat", zap.Error(err))
}
}
}

BlakeFreer and others added 14 commits December 5, 2025 13:59
Takes way to long. We should not be checking static analysis in
precommit since it takes several minutes.

This should only be a github check
PRs can now be approved by anyone in the organization.
* Clear out mcal sil. start sockets

* Adding Cobs message framing.`

* Send data with COBS

* Fix flags in platformio

* Fix Nanopb bug with PlatformIO

See the comment in `platformio.ini`

The bug is described in nanopb/nanopb#818

* Add pwm to protobuf

---------

Co-authored-by: Blake Freer <bkfreer10@gmail.com>
* Add configurable pedal-to-torque mapping

* Fix clang-format issues in tuning.hpp

* Set default pedal map to linear
* Migrate dashboard to LVGL 9.3 and add StatusBar

- Update LVGL dependency from 8.3 to 9.3 for both Linux and STM32
- Migrate display drivers to LVGL 9.3 API (lv_display_t, flush callbacks)
- Regenerate FE_Logo with RGB565 format for LVGL 9.3 compatibility
- Fix STM32 build: disable ARM Helium/NEON SIMD in lv_conf.h
- Fix exception handling for embedded targets (STM32)
- Add development tooling and documentation

Tested: Both targets build successfully

* Address review feedback: memory safety, config updates, and code cleanup

* Removed logo splash page. Saved 100KB in Flash

* Remove unused submodules :)

* Fix LVGL config issues

Dashboard wasn't showing anything:
- enabled LTDC callback in cubemx
- told platformio not to override the hal_conf with a build config
  option
- enabled st ltdc in lvgl.h
- enabled dma in ltdc

Still to fix:

fonts don't show up correctly

* Fix the dashboard, cubemx overwrites stm32f4xx_it.c which is an issue and must be kept in mind

* fix overwriting stm32f44x_it.c in cubemx and reset pin config

* format

* Finalize push

* format & pin out config

* repeat

---------

Co-authored-by: Furqaan <furqaankhurram@gmail.com>
Co-authored-by: Blake Freer <bkfreer10@gmail.com>
Co-authored-by: ManushPatell <manush.patelll@gmail.com>
Writes them to a local SQLite DB for now
ManushPatell and others added 25 commits May 10, 2026 10:59
* clean branch, update lv pinout config

* new bindings

* fix hsd binding

* read channels periph

* hsd classes

* hsd class implementation

* add cli testing, and fix build issue

* add bindings for stm32

* fix clang format

* dashboard clang format

* sil bindings, will need to improve after comp

* update dcdc, and cli bindings

* sil bindings, still throw errors

* dcdc

* add new dcdc can message in veh bus

* add missing channel
* Update fc pinout

* pinouts fc new rev

* new hsd folder

* add to alerts, new signal name for overcurrent

* fixed include

* fix hsd error

* add veh can to hsd update

* fix return

* hsd

* fix bindings

* fix another build error

* adding mcal bindings

* adding mcal bindings

* add thresholds, and mappign

* .

---------

Co-authored-by: ManushPatell <manush.patelll@gmail.com>
* bypass logo screen

* fix logic
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants