{"record":{"id":"78d87ab21b9d541b","repo":"commaai/openpilot","slug":"no-euicc-detected","errorCode":null,"errorMessage":"no eUICC detected","messagePattern":"no eUICC detected","errorType":"exception","errorClass":"SystemExit","httpStatus":null,"severity":"error","filePath":"openpilot/common/esim/esim.py","lineNumber":67,"sourceCode":"  p_switch = sub.add_parser('switch', help='switch to profile')\n  p_switch.add_argument('profile', help='iccid or 1-based index from `list`')\n\n  p_delete = sub.add_parser('delete', help='delete profile (warning: this cannot be undone)')\n  p_delete.add_argument('profile', help='iccid or 1-based index from `list`')\n\n  p_download = sub.add_parser('download', help='download a profile using QR code (format: LPA:1$rsp.truphone.com$QRF-SPEEDTEST)')\n  p_download.add_argument('qr')\n  p_download.add_argument('name')\n\n  p_nickname = sub.add_parser('nickname', help='update the nickname for a profile')\n  p_nickname.add_argument('profile', help='iccid or 1-based index from `list`')\n  p_nickname.add_argument('name')\n\n  args = parser.parse_args()\n\n  lpa = HARDWARE.get_sim_lpa()\n  if not lpa.is_euicc():\n    raise SystemExit(\"no eUICC detected\")\n  if args.cmd == 'switch':\n    iccid = resolve_iccid(lpa, args.profile)\n    execute_and_process_notifications(lpa, lambda: lpa.switch_profile(iccid))\n  elif args.cmd == 'delete':\n    iccid = resolve_iccid(lpa, args.profile)\n    confirm = input(f'are you sure you want to delete profile {iccid}? (y/N) ')\n    if confirm == 'y':\n      execute_and_process_notifications(lpa, lambda: lpa.delete_profile(iccid))\n    else:\n      print('cancelled')\n      exit(0)\n  elif args.cmd == 'download':\n    execute_and_process_notifications(lpa, lambda: lpa.download_profile(args.qr, args.name))\n  elif args.cmd == 'nickname':\n    lpa.nickname_profile(resolve_iccid(lpa, args.profile), args.name)\n  else:\n    if args.cmd is None:\n      parser.print_help()","sourceCodeStart":49,"sourceCodeEnd":85,"githubUrl":"https://github.com/commaai/openpilot/blob/516ec1e68203439a73f340f1d0b3b91eabc626ee/openpilot/common/esim/esim.py#L49-L85","documentation":"Before dispatching any subcommand, the esim CLI obtains the LPA backend from HARDWARE.get_sim_lpa() and checks lpa.is_euicc(). If the modem/SIM stack reports no eUICC (no eSIM-capable chip on the active interface), the tool aborts with SystemExit('no eUICC detected') because every subsequent operation requires the eUICC's ISD-R.","triggerScenarios":"Running any esim.py subcommand on hardware whose modem does not expose an eUICC: a physical plastic SIM in the slot, a modem without eSIM support, a missing/unresponsive modem (e.g. /dev/modem_at0 absent), or a device whose HARDWARE abstraction returns a non-eUICC LPA.","commonSituations":"Testing on a dev board or PC without a cellular modem; a device shipped with plastic SIM only; the modem is in a bad state so the eUICC inquiry fails; a typo/failure in udev so the AT serial device isn't present.","solutions":["Verify a physical eSIM-capable modem is present and enumerated (ls /dev/modem_at0, check dmesg for the modem)","If using a plastic SIM, this tool cannot manage it — eSIM operations require an eUICC; use a carrier eSIM QR download instead","Reboot/power-cycle the modem (or run the lte start script /dev/comma/lte/lte.sh start) and retry, since a hung modem can fail is_euicc()","Confirm HARDWARE.get_sim_lpa() returns the LPA matching your actual modem type on this device"],"exampleFix":"# before\npython -m openpilot.common.esim.esim list   # SystemExit: no eUICC detected\n\n# after — check the modem is up first\nimport subprocess\nsubprocess.run(['/usr/comma/lte/lte.sh', 'start'], capture_output=True)\n# verify the AT port exists, then retry\nimport os\nassert os.path.exists('/dev/modem_at0'), 'modem AT port missing'\npython -m openpilot.common.esim.esim list","handlingStrategy":"validation","validationCode":"lpa = HARDWARE.get_sim_lpa()\nif not lpa.is_euicc():\n  raise SystemExit('this device/SIM has no eUICC; eSIM tools unavailable')","typeGuard":"def euicc_available() -> bool:\n  try:\n    return HARDWARE.get_sim_lpa().is_euicc()\n  except Exception:\n    return False","tryCatchPattern":null,"preventionTips":["Gate all eSIM UI/automation behind an is_euicc() check at startup","Confirm the modem AT device exists before launching esim tooling","Power-cycle the modem and re-check before concluding hardware lacks eUICC"],"tags":["esim","hardware","modem","environment","python"],"backgroundTag":null,"analyzedSha":"516ec1e68203439a73f340f1d0b3b91eabc626ee","analyzedAt":"2026-08-15T00:17:37.461Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}