Muzi Base SuperIO: GPS mode switch ignored at boot
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 70/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- cpp
- Lĩnh vực
- embedded-iot
Hướng nghiên cứu
Bắt đầu từ MuziBaseSensorManager::begin() và loop() trong variants/muzi_base/target.cpp, sau đó xem thứ tự khởi động của companion quanh applyGpsPrefs() trong examples/companion_radio/main.cpp. Thay đổi được đề xuất giữ _last_gps_sw ở -1, để loop() đầu tiên áp dụng vị trí công tắc sau khi các tùy chọn đã được đặt. Hoàn thành khi trang GPS hiển thị gps on sau khi khởi động lại với công tắc ở vị trí giữa, và bạn đã kiểm tra xem variants/thinknode_m1/target.cpp có cùng vấn đề thứ tự hay không. Cần có phần cứng để xác nhận bản sửa lỗi.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Description
On the Muzi Base (Uno/Duo) with the SuperIO, the companion firmware ignores the 3-position mode switch when the device boots. If the switch is already in the GPS position (Mode 2, middle) at power-on, GPS stays off. It only turns on after the switch is moved away and back.
Meshtastic uses the same switch for GPS on/off: SWITCH_MODE2 (P0.12, middle position) is defined as PIN_GPS_SWITCH[^1]. The SuperIO docs list the GPS module as part of the board[^2].
Cause
MuziBaseSensorManager::begin() reads the switch and calls start_gps()/stop_gps()[^3]. But in the companion, sensors.begin() is followed right away by the_mesh.applyGpsPrefs()[^4], which sets GPS from the saved gps_enabled pref (off by default). That overrides the switch state.
After that, loop() only reacts when the switch changes[^5], so the initial position is never applied again.
Steps to reproduce
- Flash
muzi_base_uno_superIO_companion_radio_ble(or the Duo equivalent). - Set the mode switch to the middle position (GPS on).
- Power cycle the device.
- Open the GPS page on the display: it shows
gps off(sw)instead ofgps on. - Move the switch away and back: GPS turns on.
Proposed fix
Let the first loop() apply the switch position, so it runs after applyGpsPrefs():
--- a/variants/muzi_base/target.cpp
+++ b/variants/muzi_base/target.cpp
@@ bool MuziBaseSensorManager::begin() {
pinMode(PIN_GPS_SWITCH, INPUT);
- _last_gps_sw = digitalRead(PIN_GPS_SWITCH); // initial gps state from the switch
- if (_last_gps_sw == HIGH) start_gps(); else stop_gps();
+ // leave _last_gps_sw at -1 so the first loop() applies the switch position.
+ // applying it here would be overridden by applyGpsPrefs(), which the
+ // companion runs right after sensors.begin().
+ _last_gps_sw = -1;
The ThinkNode M1 uses the same pattern (variants/thinknode_m1/target.cpp) and may have the same problem.
Environment
- Board: Muzi Base Uno + SuperIO
- Firmware:
main@ 81dbae5 (v1.18.0), envmuzi_base_uno_superIO_companion_radio_ble
[^1]: Meshtastic muzi_base variant, mode switch pins: https://github.com/meshtastic/firmwa6fdd4cd659498d28d8bd153/variants/nrf52840/muzi_base/variant.h#L64-L66
[^2]: Meshtastic docs, muzi ᴡᴏʀᴋꜱ Super IO: https://meshtastic.org/docs/hardware/devices/muziworks/muzi-base/super-io/
[^3]: https://github.com/meshcore-dev/MeshCore/blob/81dbae592ffad40b4212bc0b37e82b38da08f4bct.cpp#L44-L45
[^4]: https://github.com/meshcore-dev/MeshCore/blob/81dbae592ffad40b4212bc0b37e82b38da08f4bc/examples/companion_radio/main.cpp#L278-L281
[^5]: https://github.com/meshcore-dev/MeshCore/blob/81dbae592ffad40b4212bc0b37e82b38da08f4bc/variants/muzi_base/target.cpp#L63-L65
- Ngôn ngữ chính
- C
- Star
- 3.9k
- Fork
- 1.5k
- Merge trung bình
- 2 ngày 20 giờ
- Pull request đã merge (30 ngày)
- 36
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của meshcore-dev/MeshCore
-
Discover Filters Half WorkingĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 67/100
meshcore-dev/MeshCore#3698 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 63/100
meshcore-dev/MeshCore#3622 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Feature Request] Set Australia (Mid) Preset to automatically enable 2 byte default path hash sizeĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
meshcore-dev/MeshCore#3571 · 5 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
meshcore-dev/MeshCore#3567 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
RTC_RX8130CE writes and reads the one-hot WEEK register as a numberCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
meshcore-dev/MeshCore#3549 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của meshcore-dev/MeshCore
Issue tương tự
-
Bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
ly05010419/MacNativeGames#1697 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
colbymchenry/codegraph#3228 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
FujiNetWIFI/fujinet-config#372 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
aminya/project_options#303 ·