diff --git a/meshterm/assets/pages/about.md b/meshterm/assets/pages/about.md index 2f51b35..a80c005 100644 --- a/meshterm/assets/pages/about.md +++ b/meshterm/assets/pages/about.md @@ -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. diff --git a/meshterm/core/spiradio.py b/meshterm/core/spiradio.py index 4620af6..dff7f91 100644 --- a/meshterm/core/spiradio.py +++ b/meshterm/core/spiradio.py @@ -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 ("", "") diff --git a/tests/test_spiradio.py b/tests/test_spiradio.py index e84adad..1bd6e2e 100644 --- a/tests/test_spiradio.py +++ b/tests/test_spiradio.py @@ -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