Skip to content

Conversation

@Stary2001
Copy link
Contributor

@Stary2001 Stary2001 commented Nov 10, 2025

This should make it so you can add new hats (and USB devices!) without adding entries to the configProducts map, only by adding a new config file with the correct name based on the programmed vendor/product.

🤝 Attestations

  • I have tested that my proposed changes behave as described.
  • I have tested that my proposed changes do not cause any obvious regressions on the following devices:
    • native

@Stary2001 Stary2001 added enhancement New feature or request linux-native related to running meshtastic as daemon on native linux labels Nov 10, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR enhances the LoRa device auto-configuration functionality by adding support for dynamic config file generation for unknown devices and improving HAT vendor detection. The changes refactor error handling from exception-based to condition-based logic while adding the ability to generate configuration filenames based on device vendor and product information.

  • Added cleanupNameForAutoconf function to sanitize device names for config filenames
  • Enhanced HAT detection to capture and display vendor information alongside product names
  • Replaced exception-based config lookup with conditional logic and fallback config generation

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@mverch67
Copy link
Collaborator

On my RPi5 (trixie) I don't have a folder /proc/device-tree/hat, but one called hat_type2:

$ ls -la /proc/device-tree/hat_type2/
total 0
drwxr-xr-x  2 root root   0 Nov 11 14:15 .
drwxr-xr-x 39 root root   0 Nov 11 14:15 ..
-r--r--r--  1 root root   9 Nov 11 14:15 custom_0
-r--r--r--  1 root root 116 Nov 11 14:15 custom_1
-r--r--r--  1 root root  10 Nov 11 14:15 name
-r--r--r--  1 root root  27 Nov 11 14:15 product
-r--r--r--  1 root root   7 Nov 11 14:15 product_id
-r--r--r--  1 root root   7 Nov 11 14:15 product_ver
-r--r--r--  1 root root  37 Nov 11 14:15 uuid
-r--r--r--  1 root root   8 Nov 11 14:15 vendor

@jp-bennett
Copy link
Collaborator

I'll be getting a hat+ in the next couple days, and can compare notes then.

@Stary2001
Copy link
Contributor Author

Stary2001 commented Nov 11, 2025

On a Zero 2 with trixie, I have it:

stary@fixer:~ $ ls /proc/device-tree/hat
custom_0  name  product  product_id  product_ver  uuid  vendor
stary@fixer:~ $

Is that Pi 5 specific?

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

Labels

enhancement New feature or request linux-native related to running meshtastic as daemon on native linux

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants