Add BSM support for Hyundai Ioniq 6 #2950
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
Blind Spot Monitoring was not working on 2023-24 Hyundai Ioniq 6 despite the car having BSM hardware and comma detecting "Blind Spot Support: Yes" in Vehicle Info.
Root Cause
Wrong fingerprint message - BSM detection checked for message 0x1e5 (BLINDSPOTS_FRONT_CORNER_1) which doesn't contain the blind spot indicator signals
The original code had a logic mismatch:
Fingerprinting checked for 0x1e5:
ret.enableBsm = 0x1e5 in fingerprint[CAN.ECAN]
#But reading tried to get signals from 0x1ba:
ret.leftBlindspot = cp.vl["BLINDSPOTS_REAR_CORNERS"]["FL_INDICATOR"] != 0 # 0x1ba!
Wrong signal names - Ioniq 6 uses different signals (LEFT_MB/MORE_LEFT_PROB) than other CAN FD cars (FL_INDICATOR/FR_INDICATOR) for blind spot detection
Fix
interface.py: Changed BSM fingerprinting from 0x1e5 to 0x1ba (BLINDSPOTS_REAR_CORNERS)
carstate.py: Added car-specific signal handling for Ioniq 6
Changes
interface.py - Use correct BSM message for fingerprinting
ret.enableBsm = 0x1ba in fingerprint[CAN.ECAN]
carstate.py - Ioniq 6 uses different BSM signals
if self.CP.carFingerprint in (CAR.HYUNDAI_IONIQ_6,):
ret.leftBlindspot = cp.vl["BLINDSPOTS_REAR_CORNERS"]["LEFT_MB"] != 0
ret.rightBlindspot = cp.vl["BLINDSPOTS_REAR_CORNERS"]["MORE_LEFT_PROB"] != 0
else:
ret.leftBlindspot = cp.vl["BLINDSPOTS_REAR_CORNERS"]["FL_INDICATOR"] != 0
ret.rightBlindspot = cp.vl["BLINDSPOTS_REAR_CORNERS"]["FR_INDICATOR"] != 0
Tested
Verified on 2023 Hyundai Ioniq 6 with HDA II
BSM border metrics display correctly
Blind spot path overlay works
No CAN errors