Commit Graph

18 Commits

Author SHA1 Message Date
Jason Wen
d6474aa0a9 Merge branch 'upstream/openpilot/master' into sync-20250731
# Conflicts:
#	.github/workflows/selfdrive_tests.yaml
#	common/params.h
#	common/params_keys.h
#	common/params_pyx.pyx
#	docs/CARS.md
#	opendbc_repo
#	panda
#	selfdrive/car/tests/test_models.py
#	selfdrive/pandad/pandad.cc
#	selfdrive/pandad/pandad.h
#	selfdrive/selfdrived/selfdrived.py
#	selfdrive/ui/translations/main_ar.ts
#	selfdrive/ui/translations/main_de.ts
#	selfdrive/ui/translations/main_es.ts
#	selfdrive/ui/translations/main_fr.ts
#	selfdrive/ui/translations/main_ja.ts
#	selfdrive/ui/translations/main_ko.ts
#	selfdrive/ui/translations/main_pt-BR.ts
#	selfdrive/ui/translations/main_th.ts
#	selfdrive/ui/translations/main_tr.ts
#	selfdrive/ui/translations/main_zh-CHS.ts
#	selfdrive/ui/translations/main_zh-CHT.ts
#	system/athena/athenad.py
#	system/athena/manage_athenad.py
#	system/manager/manager.py
#	system/sentry.py
#	uv.lock
Sync: `commaai/opendbc:master` into `sunnypilot/opendbc:master`

Sync: `commaai/panda:master` into `sunnypilot/panda:master`
2025-08-02 00:21:14 -04:00
Maxime Desroches
bddeca6998 Reapply "params: unique default value (#35798)" (#35806)
* Reapply "params: unique default value (#35798)"

This reverts commit 267acfb73b.

* more

* more

* test for this

* better name;
2025-07-24 17:58:16 -07:00
Maxime Desroches
267acfb73b Revert "params: unique default value (#35798)"
This reverts commit abd657edfa.
2025-07-24 14:58:46 -07:00
Maxime Desroches
abd657edfa params: unique default value (#35798)
* default

* None vs ""

* athena

* more

* more

* this

* better

* better

* now

* name

* better
2025-07-23 21:17:21 -07:00
Maxime Desroches
bc5336d805 params: auto decode based on type (#35794)
* type

* test

* more

* might as well use this

* one more

* live

* athena

* b

* also

* more

* now

* ah

* pigeon
2025-07-22 21:58:06 -07:00
Maxime Desroches
58d3038241 auto type cast for Params (#35786)
* first

* fix

* fix

* this

* real

* time

* time

* more

* more

* fix

* subclass

* fix

* fix

* test

* fix

* ruff

* revert

* default

* json

* more

* test

* test

* d

* better

* better

* test

* one

* test

* space
2025-07-22 19:30:47 -07:00
Shane Smiskol
39673deb77 Add CLEAR_ON_IGNITION_ON (#35710)
* add CLEAR_ON_IGNITION_ON

* hardwared is the only place that currently checks all ignition sources. doing it in pandad wouldn't make sense. this okay?

* remember

* only two usages but meh

* manager should probably be the only daemon to manage params

* clean up

* oh this is craze

* Update selfdrive/monitoring/helpers.py

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* together

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-07-16 20:59:12 -07:00
Jason Wen
c70d3db1e6 Params: support filtering by ParamKeyType for allKeys (#696) 2025-03-22 10:29:24 -04:00
DevTekVE
0b1d97fc72 sunnylink support (#499)
* Add Sunnylink integration for improved device communication

This commit introduces Sunnylink support, including modules for API interactions, device registration, logging, and uploader processes. Key changes involve adding Sunnylink-related components, such as sunnylinkd, manage_sunnylinkd, and associated utilities, along with seamless integration into process management.

* Refactor Sunnylink modules and update import paths

Standardize parameter handling in Sunnylink functions by initializing Params within functions as needed. Update imports to use fully-qualified paths for better clarity and consistency. Also, refactor logging messages for improved readability and maintainability.

* Add Sunnylink support and improve log handling

Introduced Sunnylink-specific functionality, including compression for oversized logs and platform-specific socket handling for macOS. Improved logging mechanisms, refactored log queue management, and fixed exception handling in sunnylinkd.

* Refactor and fix minor coding style inconsistencies

Remove unnecessary string concatenation, adjust spacing for better readability, and ensure cleaner code in `athenad.py` and `sunnylink.py`. Added a macOS-specific comment for TCP_KEEPALIVE configuration to improve code clarity.

* Replace platform system check with sys platform in athenad.py

To check for macOS platform, the code in athenad.py has been altered. Originally, the platform.system() function was used. However, the function has been replaced with sys.platform for a more consistent and preferable syntax. Particularly, this has been modified in the context of setting socket options.

* Apply suggestions from code review

Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>

* Simplify imports and reformat API function.

Removed unused `platform` import for cleanup in `athenad.py`. Improved readability of `api_get` in `__init__.py` by reformatting the long return statement into multiple lines.

* Adjust backoff logic and refactor API call formatting.

Introduce randomness to backoff calculation in Sunnylink API to reduce synchronization issues. Minor code refactoring improves readability in the API call logic.

* Refactor Sunnylink network check logic.

Removed hardware-based network check due to performance concerns and replaced it with a real-time device state monitoring loop. This improves efficiency and ensures accurate online status before proceeding with Sunnylink registration.

* Apply suggestions from code review

* `Refactor saveParams error handling and simplify logic`

Removed redundant try-except block wrapping the entire method for clarity. Moved error logging directly inside the loop to handle individual parameter exceptions more effectively. Simplified dictionary construction and improved error logging format.

* Add BACKUP flag to select persistent parameters

This commit introduces a new BACKUP flag and applies it to specific persistent parameters in `params.cc` and `params.h`. The BACKUP flag enhances data retention by designating parameters for inclusion in backups, ensuring crucial information is preserved across sessions.

* Simplify Sunnypilot params formatting

Removed unnecessary blank lines and adjusted the Sunnypilot comment format for better readability and consistency. No functional changes were made.

* SP: Move Sunnypilot-related code to sunnypilot/sunnylink (#504)

* Refactor and relocate sunnylink-related modules

sunnylink components have been reorganized for better modularity and clarity, with files moved under `sunnypilot/sunnylink`. Unused code was removed, and reusable utilities were separated for easier maintenance. Adjusted references across the project to reflect these changes.

* Permissions

* adding init py

* more

---------

Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
Co-authored-by: Jason Wen <haibin.wen3@gmail.com>
2025-01-05 02:27:44 -05:00
Dean Lee
1d7d7b89b2 common/params: support nonblocking write (#29808)
* Safe and efficient asynchronous writing parameters

* call putNonBlocking in locationd

* remove space

* ->AsyncWriter

* remove semicolon

* use member function

* asyc write multiple times

* add test case for AsyncWriter

* merge master

* add missing include

* public

* cleanup

* create once

* cleanup

* update that

* explicit waiting

* improve test case

* pass prefix to asywriter

* move to params

* assert(queue.empty())

* add comment

* add todo

* test_power_monitoring: remove patch

* rm laikad.py

* fix import

---------

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
old-commit-hash: 3c4c4d1f7f
2023-12-13 20:36:01 -08:00
Adeeb Shihadeh
4394116e5b clear non-release params on startup (#30583)
old-commit-hash: 531e62fc03
2023-12-01 23:57:54 -08:00
Dean Lee
f48dc2b0ef common/params: not copyable (#29834)
old-commit-hash: 7816edda57
2023-09-07 21:44:58 -07:00
Adeeb Shihadeh
0010c9a986 Revert "params: safe and efficient async writing parameters (#25912)"
This reverts commit 780669c33fea1b2a14a0bd6e2eac82c9b8893aa5.

old-commit-hash: ec479322d3
2023-09-06 13:44:20 -07:00
Dean Lee
08e70aecb2 params: safe and efficient async writing parameters (#25912)
* Safe and efficient asynchronous writing parameters

* call putNonBlocking in locationd

* remove space

* ->AsyncWriter

* remove semicolon

* use member function

* asyc write multiple times

* add test case for AsyncWriter

* merge master

* add missing include

* public

* cleanup

* create once

* cleanup

* update that

* explicit waiting

* improve test case

---------

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
old-commit-hash: 0d797f4e8b
2023-09-06 08:50:28 -07:00
Shane Smiskol
a14463cbe3 onroad transition: clear params and start safety setter thread (#28151)
* rename from ignition to onroad/offroad

* forgot one

* clear in manager

* don't clear in boardd anymore

fix

* params isn't used here

* add comment

* Revert "add comment"

This reverts commit 54fb6660501679e5a989c3f06c0a438bdb04dc7e.

* write params in manager

* first part is self explanatory

* remove these from thermald now

* start safety setter thread with IsOnroad

* drivesss

* more

* less

* come back

* makes sense here
old-commit-hash: b8fa7f58ea
2023-05-09 21:25:23 -07:00
Adeeb Shihadeh
3e2f436d4c auto-detect pigeon or quectel (#25991)
* auto-detect pigeon or quectel

* persistent

* fix sim

* fix process replay

* fix locationd unit tests

* fix that

Co-authored-by: Comma Device <device@comma.ai>
old-commit-hash: 01d05f66fe
2022-10-06 16:46:15 -07:00
Dean Lee
dc0ad229cd Params: add new method to get all keys (#25779)
* allKeys

* cleanup and test

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
old-commit-hash: 85b433760a
2022-09-15 15:43:27 -07:00
Adeeb Shihadeh
f4675fc260 Merge common/ and selfdrive/common (#24556)
* Merge common/ and selfdrive/common

* fix that

* fix version

* fix unit tests
old-commit-hash: cb8885cffb
2022-05-18 14:11:57 -07:00