Distinguishing CDCInterface UART
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 35/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Da chiarire
- Stato di attività
- Ferma
- Stack tecnologico
- python
- Ambito
- embedded-iot
Direzione di ricerca
Inizia da micropython/usb/usb-device-cdc/usb/device/cdc.py, in particolare da CDCInterface.desc_cfg, e verifica come _Device.init passi configuration_str ai descrittori USB. Usa lsusb -v con uno o più dispositivi RP2040 per esaminare i descrittori delle interfacce generati; il lavoro è completato quando le interfacce REPL e metriche espongono informazioni distintive affidabili e l'utilizzo è documentato o dimostrato.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
The cdc.CDCInterface works great for my use case of having a single RP2040 host a REPL for active interaction as well as a metrics endpoint for me to be able to gather data from my device while interacting with it.
The issue I've run into is being able to programmatically distinguish between the two interfaces. Typically the REPL comes in as the lower /dev/ttyACM* number and the virtual serial port as the higher in the pair. With multiple RP2040's plugged into my PC though it becomes a lot of guess work to distinguish who is the metrics interface and who is the REPL per device.
I've tried a few things:
- Setting args like
configuration_strin_Device.initlike so:core.get().init(uart, configuration_str="Pico Query", builtin_driver=True) - Modifying
desc_cfgwithin CDCInterface to try and an entry to thestrsvariable and then set that as theiInterfacevalue:
def desc_cfg(self, desc, itf_num, ep_num, strs):
# ...
if "Pico Query" not in strs:
strs.append("Pico Query")
i_data = desc._get_str_index("Pico Query") # should now return nonzero
# Now add the data interface
desc.interface(
itf_num + 1,
_CDC_DATA_EP_NUM,
_CDC_ITF_DATA_CLASS,
_CDC_ITF_DATA_SUBCLASS,
_CDC_ITF_DATA_PROT,
iInterface=i_data
)
# ...
But I'm never able to see a distinguishing value in lsusb -v to tell the two interfaces apart.
I'm probably missing something -- I'd love to contribute an example if someone can point me in the right direction.
- Lingua principale
- Python
- Stelle
- 2.9k
- Fork
- 1.1k
- Merge medio
- 7g 6h
- PR unite (30g)
- 3
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di micropython/micropython-lib
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
micropython/micropython-lib#1074 ·
-
needs-info
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 72/100
micropython/micropython-lib#943 · 1 commento ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
micropython/micropython-lib#931 · 1 commento ·
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 62/100
micropython/micropython-lib#795 · 2 commenti ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
micropython/micropython-lib#762 ·
Tutte le issue di micropython/micropython-lib
Issue simili
-
货币战争手改优先级配置缺少列表元素类型校验(P3) Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
syfoud/Simulated_Scepter#172 ·
-
A cancelled tests run makes the coverage comment workflow fail and reports it as a red check on main Apertaarea: ci bug perceived difficulty: 3
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
Nitjsefnie-Harness-Commons/daedalus#921 · 1 commento ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
EleutherAI/lm-evaluation-harness#4207 ·
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 92/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
ClickHouse/clickhouse-connect#1057 ·