A wiring that never looks at the expander names the family
A profile that drives the Cap without its expander says nothing about which Cap it is. The node then found no expander because it never looked, and the model fell back to the name of the newer board. An owner of the older Cap who wrote such a profile read "Cap LoRa-1262". The parent now sends the name of the family in that case, which is what the device screen shows before anything is connected. It is the most that is true when nothing looked. The About page names both Caps, because MeshTerm drives both now. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
fca92541f6
commit
ae83c6177f
3 files changed
+9
-1
No files matched your search
@@ -38,7 +38,7 @@ The UX is a bit different on the PicoCalc's 16-colour 53-column screen layout, b
|
||||
|
||||
### M5Stack Cardputer Zero
|
||||
The **Cardputer Zero** is the easiest of the three: MeshTerm is in **M5Stack**'s app store, so installing it takes a few keypresses. Both models work, the standard **Cardputer Zero** and the **Cardputer Zero Lite**.
|
||||
- Add the **Cap LoRa-1262**, and MeshTerm runs the mesh node itself, straight over SPI, just like on the uConsole. The Cap's GPS works too.
|
||||
- Add a LoRa Cap, and MeshTerm runs the mesh node itself, straight over SPI, just like on the uConsole. Both of M5Stack's Caps work, the **Cap LoRa-1262** and the older **Cap LoRa868**, and MeshTerm works out which one you have. The Cap's GPS works too.
|
||||
- Power the Cardputer off before you plug in or remove a Cap — the LoRa one included. M5Stack doesn't support hot-swapping Caps, and says it may cause the device to malfunction.
|
||||
- Put the antenna on the Cap before you power it on. M5Stack warns that the radio can be permanently damaged without it.
|
||||
|
||||
|
||||
@@ -408,6 +408,12 @@ def board_models(wiring: SpiWiring) -> tuple[str, str]:
|
||||
"""
|
||||
for radio in BUILTIN_RADIOS:
|
||||
if radio.name and radio.wiring.spidev == wiring.spidev and radio.present():
|
||||
if radio.without_expander and wiring.pi4io_bus < 0:
|
||||
# This wiring never looks at the expander, which is what tells the two
|
||||
# revisions apart. A profile that drops it is the usual way here. The name
|
||||
# of the family is then the most that is true, as it is on the device
|
||||
# screen before anything is connected.
|
||||
return (radio.name, "")
|
||||
return (radio.with_expander or radio.name, radio.without_expander)
|
||||
return ("", "")
|
||||
|
||||
|
||||
@@ -295,6 +295,8 @@ def test_the_node_is_given_the_model_of_each_revision(cardputer: Path) -> None:
|
||||
tweaked = replace(spiradio.CARDPUTER_ZERO_CAP, use_dio3_tcxo=False)
|
||||
assert spiradio.board_models(tweaked) == ("Cap LoRa-1262", "Cap LoRa868"), "a profile of it"
|
||||
assert spiradio.board_models(SpiWiring()) == ("", "") # the AIO: no name to give
|
||||
blind = replace(spiradio.CARDPUTER_ZERO_CAP, pi4io_bus=-1)
|
||||
assert spiradio.board_models(blind) == ("Cap LoRa", ""), "a wiring that never looks cannot say"
|
||||
cardputer.rmdir()
|
||||
assert spiradio.board_models(spiradio.CARDPUTER_ZERO_CAP) == ("", "") # another Pi
|
||||
|
||||
|
||||
Reference in new issue
Block a user