Skip to content

Conversation

@tache
Copy link
Contributor

@tache tache commented Feb 9, 2025

  • Added a detailed error message for FileNotFoundError when the serial device is not found.
  • Included troubleshooting steps for common issues.

- Added a detailed error message for FileNotFoundError when the serial device is not found.
- Included troubleshooting steps for common issues.
@CLAassistant
Copy link

CLAassistant commented Feb 9, 2025

CLA assistant check
All committers have signed the CLA.

@tache
Copy link
Contributor Author

tache commented Feb 9, 2025

Existing:

Traceback (most recent call last):
  File "~/.pyenv/versions/3.12.2/bin/meshtastic", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "~/.pyenv/versions/3.12.2/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/meshtastic/__main__.py", line 1988, in main
    common()
  File "~/.pyenv/versions/3.12.2/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/meshtastic/__main__.py", line 1242, in common
    client = meshtastic.serial_interface.SerialInterface(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "~/.pyenv/versions/3.12.2/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/meshtastic/serial_interface.py", line 52, in __init__
    with open(self.devPath, encoding="utf8") as f:
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: '/dev/cu.SLAB_USBtoUART'

With update:

File Not Found Error:
  The serial device at '/dev/cu.SLAB_USBtoUART' was not found.
  Please check the following:
    1. Is the device connected properly?
    2. Is the correct serial port specified?
    3. Are the necessary drivers installed?
    4. Are you using a **power-only USB cable**? A power-only cable cannot transmit data.
       Ensure you are using a **data-capable USB cable**.

@ianmcorvidae
Copy link
Contributor

Looks pretty good to me! Thanks for this.

@ianmcorvidae ianmcorvidae merged commit 5487f7a into meshtastic:master Feb 18, 2025
9 checks passed
@codecov
Copy link

codecov bot commented Feb 18, 2025

Codecov Report

Attention: Patch coverage is 10.00000% with 9 lines in your changes missing coverage. Please review.

Project coverage is 60.22%. Comparing base (fc3b81d) to head (8c115dc).
Report is 8 commits behind head on master.

Files with missing lines Patch % Lines
meshtastic/__main__.py 10.00% 9 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #735      +/-   ##
==========================================
- Coverage   60.35%   60.22%   -0.13%     
==========================================
  Files          24       24              
  Lines        3970     3980      +10     
==========================================
+ Hits         2396     2397       +1     
- Misses       1574     1583       +9     
Flag Coverage Δ
unittests 60.22% <10.00%> (-0.13%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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.

3 participants