From 816d4e2fa3fdd5d8fbb5f8c35dba15a6bbf9f6e5 Mon Sep 17 00:00:00 2001 From: silverphish-io <50057415+silverphish-io@users.noreply.github.com> Date: Thu, 25 Sep 2025 14:59:25 +0100 Subject: [PATCH 01/29] Update faq.md --- docs/faq.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/faq.md b/docs/faq.md index 5ed1d2a5f..0976c098c 100644 --- a/docs/faq.md +++ b/docs/faq.md @@ -185,7 +185,7 @@ The T-Deck firmware is free to download and most features are available without - Canada and USA are on **910.525MHz** - For other regions and countries, please check your local LoRa frequency -In UK and EU, 867.5MHz is not allowed to use 250kHz bandwidth and it only allows 2.5% duty cycle for clients. 869.525Mhz allows an airtime of 10%, 250KHz bandwidth, and a higher EIRP, therefore MeshCore nodes can send more often and with more power. That is why this frequency is chosen for UK and EU. This is also why Meshtastic also uses this frequency. +In UK and EU, 867.5MHz is not allowed to use 250kHz bandwidth and it only allows 2.5% duty cycle for clients. 869.525Mhz allows an airtime of 10%, 250KHz bandwidth, and a higher Effective Isotropic Radiated Power (EIRP), therefore MeshCore nodes can send more often and with more power. That is why this frequency is chosen for UK and EU. This is also why Meshtastic also uses this frequency. [Source](https://discord.com/channels/826570251612323860/1330643963501351004/1356540643853209641) @@ -557,7 +557,7 @@ From here, reference repeater and room server command line commands on MeshCore **A:** Yes. See the following: #### 5.14.1. meshcoremqtt -A Python script to send meshore debug and packet capture data to MQTT for analysis +A Python script to send meshcore debug and packet capture data to MQTT for analysis https://github.com/Andrew-a-g/meshcoretomqtt #### 5.14.2. MeshCore for Home Assistant From 4e886bfa90d9f179b859c21bec212609b4ac8a79 Mon Sep 17 00:00:00 2001 From: silverphish-io <50057415+silverphish-io@users.noreply.github.com> Date: Thu, 25 Sep 2025 15:01:39 +0100 Subject: [PATCH 02/29] Typo fix in faq and payloads --- docs/payloads.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/payloads.md b/docs/payloads.md index 4d00f9300..e23cbb830 100644 --- a/docs/payloads.md +++ b/docs/payloads.md @@ -57,7 +57,7 @@ Appdata Flags # Acknowledgement -An acknowledgement that a message was received. Note that for returned path messages, an acknowledgement will be sent in the "extra" payload (see [Returned Path](#returned-path)) and not as a discrete ackowledgement. CLI commands do not require an acknowledgement, neither discrete nor extra. +An acknowledgement that a message was received. Note that for returned path messages, an acknowledgement will be sent in the "extra" payload (see [Returned Path](#returned-path)) and not as a discrete acknowledgement. CLI commands do not require an acknowledgement, neither discrete nor extra. | Field | Size (bytes) | Description | |----------|--------------|------------------------------------------------------------| @@ -186,4 +186,4 @@ TODO: describe what datagram looks like # Custom packet -Custom packets have no defined format. \ No newline at end of file +Custom packets have no defined format. From c8a6bcf57f4a1fb58795a1e7373fa69323bf6328 Mon Sep 17 00:00:00 2001 From: ripplebiz Date: Sun, 28 Sep 2025 21:43:30 +1000 Subject: [PATCH 03/29] Update README.md --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 73fa960c1..eba4d1533 100644 --- a/README.md +++ b/README.md @@ -97,10 +97,10 @@ Here are some general principals you should try to adhere to: There are a number of fairly major features in the pipeline, with no particular time-frames attached yet. In very rough chronological order: - [X] Companion radio: UI redesign -- [ ] Repeater + Room Server: add ACL's (like Sensor Node has) -- [ ] Standardise Bridge mode for repeaters +- [X] Repeater + Room Server: add ACL's (like Sensor Node has) +- [X] Standardise Bridge mode for repeaters - [ ] Repeater/Bridge: Standardise the Transport Codes for zoning/filtering -- [ ] Core + Repeater: enhanced zero-hop neighbour discovery +- [X] Core + Repeater: enhanced zero-hop neighbour discovery - [ ] Core: round-trip manual path support - [ ] Companion + Apps: support for multiple sub-meshes (and 'off-grid' client repeat mode) - [ ] Core + Apps: support for LZW message compression From f594f2c7e60996a0d2d483983abc1a72cce1cfd0 Mon Sep 17 00:00:00 2001 From: uncle lit <43320854+LitBomb@users.noreply.github.com> Date: Tue, 30 Sep 2025 16:01:11 -0700 Subject: [PATCH 04/29] Update faq.md added pyMC_core to meshcore projects mentioned Cisien's meshcoretomqtt fork from Andrew-a-g updated Coding Rate explanation and recommendation updated radio presets and added how to update presets listed in the app --- docs/faq.md | 55 +++++++++++++++++++++++++++++++++++------------------ 1 file changed, 36 insertions(+), 19 deletions(-) diff --git a/docs/faq.md b/docs/faq.md index 38a552c23..d330d50e4 100644 --- a/docs/faq.md +++ b/docs/faq.md @@ -61,22 +61,23 @@ author: https://github.com/LitBomb - [5.14.3. Python MeshCore](#5143-python-meshcore) - [5.14.4. meshcore-cli](#5144-meshcore-cli) - [5.14.5. meshcore.js](#5145-meshcorejs) + - [5.14.6. pyMC\_core](#5146-pymc_core) - [6. Troubleshooting](#6-troubleshooting) - [6.1. Q: My client says another client or a repeater or a room server was last seen many, many days ago.](#61-q-my-client-says-another-client-or-a-repeater-or-a-room-server-was-last-seen-many-many-days-ago) - [6.2. Q: A repeater or a client or a room server I expect to see on my discover list (on T-Deck) or contact list (on a smart device client) are not listed.](#62-q-a-repeater-or-a-client-or-a-room-server-i-expect-to-see-on-my-discover-list-on-t-deck-or-contact-list-on-a-smart-device-client-are-not-listed) - [6.3. Q: How to connect to a repeater via BLE (Bluetooth)?](#63-q-how-to-connect-to-a-repeater-via-ble-bluetooth) - [6.4. Q: My companion isn't showing up over Bluetooth?](#64-q-my-companion-isnt-showing-up-over-bluetooth) - - [6.5. Q: I can't connect via Bluetooth, what is the Bluetooth pairing code?](#64-q-i-cant-connect-via-bluetooth-what-is-the-bluetooth-pairing-code) - - [6.6. Q: My Heltec V3 keeps disconnecting from my smartphone. It can't hold a solid Bluetooth connection.](#65-q-my-heltec-v3-keeps-disconnecting-from-my-smartphone--it-cant-hold-a-solid-bluetooth-connection) - - [6.7. Q: My RAK/T1000-E/xiao\_nRF52 device seems to be corrupted, how do I wipe it clean to start fresh?](#66-q-my-rakt1000-exiao_nrf52-device-seems-to-be-corrupted-how-do-i-wipe-it-clean-to-start-fresh) - - [6.8. Q: WebFlasher fails on Linux with failed to open](#67-q-webflasher-fails-on-linux-with-failed-to-open) + - [6.5. Q: I can't connect via Bluetooth, what is the Bluetooth pairing code?](#65-q-i-cant-connect-via-bluetooth-what-is-the-bluetooth-pairing-code) + - [6.6. Q: My Heltec V3 keeps disconnecting from my smartphone. It can't hold a solid Bluetooth connection.](#66-q-my-heltec-v3-keeps-disconnecting-from-my-smartphone--it-cant-hold-a-solid-bluetooth-connection) + - [6.7. Q: My RAK/T1000-E/xiao\_nRF52 device seems to be corrupted, how do I wipe it clean to start fresh?](#67-q-my-rakt1000-exiao_nrf52-device-seems-to-be-corrupted-how-do-i-wipe-it-clean-to-start-fresh) + - [6.8. Q: WebFlasher fails on Linux with failed to open](#68-q-webflasher-fails-on-linux-with-failed-to-open) - [7. Other Questions:](#7-other-questions) - [7.1. Q: How to update nRF (RAK, T114, Seed XIAO) repeater and room server firmware over the air using the new simpler DFU app?](#71-q-how-to-update-nrf-rak-t114-seed-xiao-repeater-and-room-server-firmware-over-the-air-using-the-new-simpler-dfu-app) - [7.2. Q: How to update ESP32-based devices over the air?](#72-q-how-to-update-esp32-based-devices-over-the-air) - [7.3. Q: Is there a way to lower the chance of a failed OTA device firmware update (DFU)?](#73-q-is-there-a-way-to-lower-the-chance-of-a-failed-ota-device-firmware-update-dfu) - [7.4. Q: are the MeshCore logo and font available?](#74-q-are-the-meshcore-logo-and-font-available) - [7.5. Q: What is the format of a contact or channel QR code?](#75-q-what-is-the-format-of-a-contact-or-channel-qr-code) - - [7.6. Q: How do I connect to the companion via WIFI, e.g. using a heltec v3?](#76-q-how-do-i-connect-to-the-comnpanion-via-wifi-eg-using-a-heltec-v3) + - [7.6. Q: How do I connect to the companion via WIFI, e.g. using a heltec v3?](#76-q-how-do-i-connect-to-the-companion-via-wifi-eg-using-a-heltec-v3) ## 1. Introduction @@ -180,22 +181,17 @@ The T-Deck firmware is free to download and most features are available without ### 2.3. Q: What frequencies are supported by MeshCore? -**A:** It supports the 868MHz range in the UK/EU and the 915MHz range in New Zealand, Australia, and the USA. Countries and regions in these two frequency ranges are also supported. The firmware and client allow users to set their preferred frequency. -- Australia and New Zealand are on **915.8MHz** -- UK and EU are on **869.525MHz** -- Canada and USA are on **910.525MHz** -- For other regions and countries, please check your local LoRa frequency +**A:** It supports the 868MHz range in the UK/EU and the 915MHz range in New Zealand, Australia, and the USA. Countries and regions in these two frequency ranges are also supported. -In UK and EU, 867.5MHz is not allowed to use 250kHz bandwidth and it only allows 2.5% duty cycle for clients. 869.525Mhz allows an airtime of 10%, 250KHz bandwidth, and a higher Effective Isotropic Radiated Power (EIRP), therefore MeshCore nodes can send more often and with more power. That is why this frequency is chosen for UK and EU. This is also why Meshtastic also uses this frequency. +Use the smartphone client or the repeater setup feature on there web flasher to set your radios' RF settings by choosing the preset for your regions. -[Source](https://discord.com/channels/826570251612323860/1330643963501351004/1356540643853209641) +Recently, as of October 2025, many regions have moved to the "narrow" setting, aka using BW62.5 and a lower SF number (instead of the original SF11). For example, USA/Canada (Recommended) preset is 910.525MHz, SF7, BW62.5, CR5. + +After extensive testing, many regions have switched or about to switch over to BW62.5 and SF7, 8, or 9. Narrower bandwidth setting and lower SF setting allow MeshCore's radio signals to fit between interference in the ISM band, provide for a lower noise floor, better SNR, and faster transmissions. + +If you have consensus from your community in your region to update your region's preset recommendation, please post your update request on the [#meshcore-app](https://discord.com/channels/1343693475589263471/1391681655911088241) channel on the [MeshCore Discord server ](https://discord.gg/cYtQNYCCRK) to let Liam Cottle know. -the rest of the radio settings are the same for all frequencies: -- Spread Factor (SF): 11 -- Coding Rate (CR): 5 -- Bandwidth (BW): 250.00 -(Originally MeshCore started with SF 10. recently (as of late April 2025) the community has advocated SF 11 also a viable option for longer range but a little slower transmission. Currently there are MeshCore meshes with SF 10 and SF 11. Liam Cottle's smartphone app's presets now recommend SF 10 for Australia and SF 11 for all other regions and countries. EU and UK has SF 10 and SF 11 presets. Work with your local meshers on deciding with SF number is best for your use cases. In the future, there may be bridge nodes that can bridge SF 10 and SF 11 (or even different frequencies) traffic.) ### 2.4. Q: What is an "advert" in MeshCore? **A:** @@ -376,7 +372,23 @@ https://github.com/meshcore-dev/MeshCore/blob/main/src/Packet.h#L19 **SF is spreading factor** - how much should the communication spread in time -**CR is coding rate** - https://www.thethingsnetwork.org/docs/lorawan/fec-and-code-rate/ +**CR is coding rate** - from: https://www.thethingsnetwork.org/docs/lorawan/fec-and-code-rate/ + +TL;DR: default CR to 5 for good stable links. If it is not a solid link and is intermittent, change to CR to 7 or 8. + +Forward Error Correction is a process of adding redundant bits to the data to be transmitted. During the transmission, data may get corrupted by interference (changes from 0 to 1 / 1 to 0). These error correction bits are used at the receivers for restoring corrupted bits. + +The Code Rate of a forward error correction expresses the proportion of bits in a data stream that actually carry useful information. + +There are 4 code rates used in LoRaWAN: + +4/5 +4/6 +5/7 +4/8 + +For example, if the code rate is 5/7, for every 5 bits of useful information, the coder generates a total of 7 bits of data, of which 2 bits are redundant. + Making the bandwidth 2x wider (from BW125 to BW250) allows you to send 2x more bytes in the same time. Making the spreading factor 1 step lower (from SF10 to SF9) allows you to send 2x more bytes in the same time. Lowering the spreading factor makes it more difficult for the gateway to receive a transmission, as it will be more sensitive to noise. You could compare this to two people taking in a noisy place (a bar for example). If you’re far from each other, you have to talk slow (SF10), but if you’re close, you can talk faster (SF7) @@ -558,7 +570,8 @@ From here, reference repeater and room server command line commands on MeshCore **A:** Yes. See the following: #### 5.14.1. meshcoremqtt -A Python script to send meshcore debug and packet capture data to MQTT for analysis +A Python script to send meshcore debug and packet capture data to MQTT for analysis. Cisien's version is a fork of Andrew-a-g's and is being used to to collect data for https://map.w0z.is/messages and https://analyzer.letsme.sh/ +https://github.com/Cisien/meshcoretomqtt https://github.com/Andrew-a-g/meshcoretomqtt #### 5.14.2. MeshCore for Home Assistant @@ -577,6 +590,10 @@ CLI interface to MeshCore companion radio over BLE, TCP, or serial. Uses Python A JavaScript library for interacting with a MeshCore device running the companion radio firmware https://github.com/liamcottle/meshcore.js +#### 5.14.6. pyMC_core +pyMC_Core is a Python port of MeshCore, designed for Raspberry Pi and similar hardware, it talks to LoRa modules over SPI. +https://github.com/rightup/pyMC_core + --- ## 6. Troubleshooting From 6ee0b851951387d1f48943df3b261b3715f5ac83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonathan=20Sto=CC=88cklmayer?= <> Date: Wed, 1 Oct 2025 09:50:41 +0200 Subject: [PATCH 05/29] Fix debug log: use c->extra.room.push_failures instead of non-existent c->push_failures --- examples/simple_room_server/MyMesh.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/simple_room_server/MyMesh.cpp b/examples/simple_room_server/MyMesh.cpp index 89f2afb3d..a8a1c8744 100644 --- a/examples/simple_room_server/MyMesh.cpp +++ b/examples/simple_room_server/MyMesh.cpp @@ -784,7 +784,7 @@ void MyMesh::loop() { if (c->extra.room.pending_ack && millisHasNowPassed(c->extra.room.ack_timeout)) { c->extra.room.push_failures++; c->extra.room.pending_ack = 0; // reset (TODO: keep prev expected_ack's in a list, incase they arrive LATER, after we retry) - MESH_DEBUG_PRINTLN("pending ACK timed out: push_failures: %d", (uint32_t)c->push_failures); + MESH_DEBUG_PRINTLN("pending ACK timed out: push_failures: %d", (uint32_t)c->extra.room.push_failures); } } // check next Round-Robin client, and sync next new post From 3e3fa5b443ca59b9633057f797b595712dd15856 Mon Sep 17 00:00:00 2001 From: tekstrand Date: Sat, 4 Oct 2025 10:54:24 -0500 Subject: [PATCH 06/29] trim trailing whitespace, clarify repeater gps, remove outdated instructions --- docs/faq.md | 182 +++++++++++++++++++++++++--------------------------- 1 file changed, 89 insertions(+), 93 deletions(-) diff --git a/docs/faq.md b/docs/faq.md index d330d50e4..c69077d1d 100644 --- a/docs/faq.md +++ b/docs/faq.md @@ -1,10 +1,6 @@ **MeshCore-FAQ** A list of frequently-asked questions and answers for MeshCore -The current version of this MeshCore FAQ is at https://github.com/meshcore-dev/MeshCore/blob/main/docs/faq.md. -This MeshCore FAQ is also mirrored at https://github.com/LitBomb/MeshCore-FAQ and might have newer updates if pull requests on Scott's MeshCore repo are not approved yet. - -author: https://github.com/LitBomb --- - [1. Introduction](#1-introduction) @@ -92,7 +88,7 @@ MeshCore is free and open source: * The T-Deck firmware is developed by Scott at Ripple Radios, the creator of MeshCore, is also free to flash on your devices and use -Some more advanced, but optional features are available on T-Deck if you register your device for a key to unlock. On the MeshCore smartphone clients for Android and iOS/iPadOS, you can unlock the wait timer for repeater and room server remote management over RF feature. +Some more advanced, but optional features are available on T-Deck if you register your device for a key to unlock. On the MeshCore smartphone clients for Android and iOS/iPadOS, you can unlock the wait timer for repeater and room server remote management over RF feature. These features are completely optional and aren't needed for the core messaging experience. They're like super bonus features and to help the developers continue to work on these amazing features, they may charge a small fee for an unlock code to utilise the advanced features. @@ -106,7 +102,7 @@ Anyone is able to build anything they like on top of MeshCore without paying any MeshCore Firmware GitHub: https://github.com/ripplebiz/MeshCore NOTE: Andy Kirby has a very useful [intro video](https://www.youtube.com/watch?v=t1qne8uJBAc) for beginners. - + You need LoRa hardware devices to run MeshCore firmware as clients or server (repeater and room server). @@ -115,7 +111,7 @@ MeshCore is available on a variety of 433MHz, 868MHz and 915MHz LoRa devices. Fo For an up-to-date list of supported devices, please go to https://flasher.meshcore.co.uk/ -To use MeshCore without using a phone as the client interface, you can run MeshCore on a LiLygo's T-Deck, T-Deck Plus, T-Pager, T-Watch, or T-Display Pro. MeshCore Ultra firmware running on these devices are a complete off-grid secure communication solution. +To use MeshCore without using a phone as the client interface, you can run MeshCore on a LiLygo's T-Deck, T-Deck Plus, T-Pager, T-Watch, or T-Display Pro. MeshCore Ultra firmware running on these devices are a complete off-grid secure communication solution. #### 1.2.2. Firmware MeshCore has four firmware types that are not available on other LoRa systems. MeshCore has the following: @@ -123,30 +119,30 @@ MeshCore has four firmware types that are not available on other LoRa systems. M #### 1.2.3. Companion Radio Firmware Companion radios are for connecting to the Android app or web app as a messenger client. There are two different companion radio firmware versions: -1. **BLE Companion** - BLE Companion firmware runs on a supported LoRa device and connects to a smart device running the Android or iOS MeshCore client over BLE +1. **BLE Companion** + BLE Companion firmware runs on a supported LoRa device and connects to a smart device running the Android or iOS MeshCore client over BLE -2. **USB Serial Companion** - USB Serial Companion firmware runs on a supported LoRa device and connects to a smart device or a computer over USB Serial running the MeshCore web client - +2. **USB Serial Companion** + USB Serial Companion firmware runs on a supported LoRa device and connects to a smart device or a computer over USB Serial running the MeshCore web client + #### 1.2.4. Repeater -Repeaters are used to extend the range of a MeshCore network. Repeater firmware runs on the same devices that run client firmware. A repeater's job is to forward MeshCore packets to the destination device. It does **not** forward or retransmit every packet it receives, unlike other LoRa mesh systems. +Repeaters are used to extend the range of a MeshCore network. Repeater firmware runs on the same devices that run client firmware. A repeater's job is to forward MeshCore packets to the destination device. It does **not** forward or retransmit every packet it receives, unlike other LoRa mesh systems. A repeater can be remotely administered using a T-Deck running the MeshCore firmware with remote administration features unlocked, or from a BLE Companion client connected to a smartphone running the MeshCore app. #### 1.2.5. Room Server -A room server is a simple BBS server for sharing posts. T-Deck devices running MeshCore firmware or a BLE Companion client connected to a smartphone running the MeshCore app can connect to a room server. +A room server is a simple BBS server for sharing posts. T-Deck devices running MeshCore firmware or a BLE Companion client connected to a smartphone running the MeshCore app can connect to a room server. Room servers store message history on them and push the stored messages to users. Room servers allow roaming users to come back later and retrieve message history. With channels, messages are either received when it's sent, or not received and missed if the channel user is out of range. Room servers are different and more like email servers where you can come back later and get your emails from your mail server. -A room server can be remotely administered using a T-Deck running the MeshCore firmware with remote administration features unlocked, or from a BLE Companion client connected to a smartphone running the MeshCore app. +A room server can be remotely administered using a T-Deck running the MeshCore firmware with remote administration features unlocked, or from a BLE Companion client connected to a smartphone running the MeshCore app. When a client logs into a room server, the client will receive the previously 32 unseen messages. -Although room server can also repeat with the command line command `set repeat on`, it is not recommended nor encouraged. A room server with repeat set to `on` lacks the full set of repeater and remote administration features that are only available in the repeater firmware. +Although room server can also repeat with the command line command `set repeat on`, it is not recommended nor encouraged. A room server with repeat set to `on` lacks the full set of repeater and remote administration features that are only available in the repeater firmware. The recommendation is to run repeater and room server on separate devices for the best experience. @@ -169,23 +165,23 @@ After you flashed the latest firmware onto your repeater device, keep the device The repeater and room server CLI reference is here: https://github.com/meshcore-dev/MeshCore/wiki/Repeater-&-Room-Server-CLI-Reference -If you have more supported devices, you can use your additional devices with the room server firmware. +If you have more supported devices, you can use your additional devices with the room server firmware. ### 2.2. Q: Does MeshCore cost any money? -**A:** All radio firmware versions (e.g. for Heltec V3, RAK, T-1000E, etc) are free and open source developed by Scott at Ripple Radios. +**A:** All radio firmware versions (e.g. for Heltec V3, RAK, T-1000E, etc) are free and open source developed by Scott at Ripple Radios. -The native Android and iOS client uses the freemium model and is developed by Liam Cottle, developer of meshtastic map at [meshtastic.liamcottle.net](https://meshtastic.liamcottle.net) on [GitHub](https://github.com/liamcottle/meshtastic-map) and [reticulum-meshchat on github](https://github.com/liamcottle/reticulum-meshchat). +The native Android and iOS client uses the freemium model and is developed by Liam Cottle, developer of meshtastic map at [meshtastic.liamcottle.net](https://meshtastic.liamcottle.net) on [GitHub](https://github.com/liamcottle/meshtastic-map) and [reticulum-meshchat on github](https://github.com/liamcottle/reticulum-meshchat). -The T-Deck firmware is free to download and most features are available without cost. To support the firmware developer, you can pay for a registration key to unlock your T-Deck for deeper map zoom and remote server administration over RF using the T-Deck. You do not need to pay for the registration to use your T-Deck for direct messaging and connecting to repeaters and room servers. +The T-Deck firmware is free to download and most features are available without cost. To support the firmware developer, you can pay for a registration key to unlock your T-Deck for deeper map zoom and remote server administration over RF using the T-Deck. You do not need to pay for the registration to use your T-Deck for direct messaging and connecting to repeaters and room servers. ### 2.3. Q: What frequencies are supported by MeshCore? -**A:** It supports the 868MHz range in the UK/EU and the 915MHz range in New Zealand, Australia, and the USA. Countries and regions in these two frequency ranges are also supported. +**A:** It supports the 868MHz range in the UK/EU and the 915MHz range in New Zealand, Australia, and the USA. Countries and regions in these two frequency ranges are also supported. -Use the smartphone client or the repeater setup feature on there web flasher to set your radios' RF settings by choosing the preset for your regions. +Use the smartphone client or the repeater setup feature on there web flasher to set your radios' RF settings by choosing the preset for your regions. -Recently, as of October 2025, many regions have moved to the "narrow" setting, aka using BW62.5 and a lower SF number (instead of the original SF11). For example, USA/Canada (Recommended) preset is 910.525MHz, SF7, BW62.5, CR5. +Recently, as of October 2025, many regions have moved to the "narrow" setting, aka using BW62.5 and a lower SF number (instead of the original SF11). For example, USA/Canada (Recommended) preset is 910.525MHz, SF7, BW62.5, CR5. After extensive testing, many regions have switched or about to switch over to BW62.5 and SF7, 8, or 9. Narrower bandwidth setting and lower SF setting allow MeshCore's radio signals to fit between interference in the ISM band, provide for a lower noise floor, better SNR, and faster transmissions. @@ -194,7 +190,7 @@ If you have consensus from your community in your region to update your region's ### 2.4. Q: What is an "advert" in MeshCore? -**A:** +**A:** Advert means to advertise yourself on the network. In Reticulum terms it would be to announce. In Meshtastic terms it would be the node sending its node info. MeshCore allows you to manually broadcast your name, position and public encryption key, which is also signed to prevent spoofing. When you click the advert button, it broadcasts that data over LoRa. MeshCore calls that an Advert. There's two ways to advert, "zero hop" and "flood". @@ -210,7 +206,7 @@ As of Aug 20 2025, a pending PR on github will change the flood advert to 12 hou ### 2.5. Q: Is there a hop limit? -**A:** Internally the firmware has maximum limit of 64 hops. In real world settings it will be difficult to get close to the limit due to the environments and timing as packets travel further and further. We want to hear how far your MeshCore conversations go. +**A:** Internally the firmware has maximum limit of 64 hops. In real world settings it will be difficult to get close to the limit due to the environments and timing as packets travel further and further. We want to hear how far your MeshCore conversations go. --- @@ -220,14 +216,14 @@ As of Aug 20 2025, a pending PR on github will change the flood advert to 12 hou ### 3.1. Q: How do you configure a repeater or a room server? -**A:** - When MeshCore is flashed onto a LoRa device is for the first time, it is necessary to set the server device's frequency to make it utilize the frequency that is legal in your country or region. +**A:** - When MeshCore is flashed onto a LoRa device is for the first time, it is necessary to set the server device's frequency to make it utilize the frequency that is legal in your country or region. Repeater or room server can be administered with one of the options below: - + - After a repeater or room server firmware is flashed on to a LoRa device, go to and use the web user interface to connect to the LoRa device via USB serial. From there you can set the name of the server, its frequency and other related settings, location, passwords etc. ![image](https://github.com/user-attachments/assets/2a9d9894-e34d-4dbe-b57c-fc3c250a2d34) - + - Connect the server device using a USB cable to a computer running Chrome on https://flasher.meshcore.co.uk/, then use the `console` feature to connect to the device - Use a MeshCore smartphone clients to remotely administer servers via LoRa. @@ -236,10 +232,10 @@ Repeater or room server can be administered with one of the options below: - + ### 3.2. Q: Do I need to set the location for a repeater? -**A:** With location set for a repeater, it can show up on a MeshCore map in the future. Set location with the following commands: +**A:** While not required, with location set for a repeater it will show up on the MeshCore map in the future. Set location with the following command: `set lat set long ` @@ -266,14 +262,14 @@ You can get the latitude and longitude from Google Maps by right-clicking the lo **A:** Yes, it is available on https://buymeacoffee.com/ripplebiz/ultra-v7-7-guide-meshcore-users ### 4.2. Q: What are the steps to get a T-Deck into DFU (Device Firmware Update) mode? -**A:** -1. Device off -2. Connect USB cable to device -3. Hold down trackball (keep holding) -4. Turn on device -5. Hear USB connection sound -6. Release trackball -7. T-Deck in DFU mode now +**A:** +1. Device off +2. Connect USB cable to device +3. Hold down trackball (keep holding) +4. Turn on device +5. Hear USB connection sound +6. Release trackball +7. T-Deck in DFU mode now 8. At this point you can begin flashing using ### 4.3. Q: Why is my T-Deck Plus not getting any satellite lock? @@ -290,8 +286,8 @@ GPS on T-Deck is always enabled. You can skip the "GPS clock sync" and the T-De **A:** Users have had no issues using 16GB or 32GB SD cards. Format the SD card to **FAT32**. ### 4.6. Q: what is the public key for the default public channel? -**A:** -T-Deck uses the same key the smartphone apps use but in base64 +**A:** +T-Deck uses the same key the smartphone apps use but in base64 `izOH6cXN6mrJ5e26oRXNcg==` The third character is the capital letter 'O', not zero `0` @@ -301,24 +297,24 @@ The smartphone app key is in hex: [Source](https://discord.com/channels/826570251612323860/1330643963501351004/1354194409213792388) ### 4.7. Q: How do I get maps on T-Deck? -**A:** You need map tiles. You can get pre-downloaded map tiles here (a good way to support development): -- (Europe) +**A:** You need map tiles. You can get pre-downloaded map tiles here (a good way to support development): +- (Europe) - (US) -Another way to download map tiles is to use this Python script to get the tiles in the areas you want: - +Another way to download map tiles is to use this Python script to get the tiles in the areas you want: + -There is also a modified script that adds additional error handling and parallel downloads: - +There is also a modified script that adds additional error handling and parallel downloads: + -UK map tiles are available separately from Andy Kirby on his discord server: +UK map tiles are available separately from Andy Kirby on his discord server: ### 4.8. Q: Where do the map tiles go? Once you have the tiles downloaded, copy the `\tiles` folder to the root of your T-Deck's SD card. ### 4.9. Q: How to unlock deeper map zoom and server management features on T-Deck? -**A:** You can download, install, and use the T-Deck firmware for free, but it has some features (map zoom, server administration) that are enabled if you purchase an unlock code for \$10 per T-Deck device. +**A:** You can download, install, and use the T-Deck firmware for free, but it has some features (map zoom, server administration) that are enabled if you purchase an unlock code for \$10 per T-Deck device. Unlock page: ### 4.10. Q: How to decipher the diagnostics screen on T-Deck? @@ -326,17 +322,17 @@ Unlock page: **A: ** Space is tight on T-Deck's screen, so the information is a bit cryptic. The format is : `{hops} l:{packet-length}({payload-len}) t:{packet-type} snr:{n} rssi:{n}` -See here for packet-type: +See here for packet-type: https://github.com/meshcore-dev/MeshCore/blob/main/src/Packet.h#L19 - - - #define PAYLOAD_TYPE_REQ 0x00 // request (prefixed with dest/src hashes, MAC) (enc data: timestamp, blob) - #define PAYLOAD_TYPE_RESPONSE 0x01 // response to REQ or ANON_REQ (prefixed with dest/src hashes, MAC) (enc data: timestamp, blob) - #define PAYLOAD_TYPE_TXT_MSG 0x02 // a plain text message (prefixed with dest/src hashes, MAC) (enc data: timestamp, text) - #define PAYLOAD_TYPE_ACK 0x03 // a simple ack #define PAYLOAD_TYPE_ADVERT 0x04 // a node advertising its Identity - #define PAYLOAD_TYPE_GRP_TXT 0x05 // an (unverified) group text message (prefixed with channel hash, MAC) (enc data: timestamp, "name: msg") - #define PAYLOAD_TYPE_GRP_DATA 0x06 // an (unverified) group datagram (prefixed with channel hash, MAC) (enc data: timestamp, blob) - #define PAYLOAD_TYPE_ANON_REQ 0x07 // generic request (prefixed with dest_hash, ephemeral pub_key, MAC) (enc data: ...) + + + #define PAYLOAD_TYPE_REQ 0x00 // request (prefixed with dest/src hashes, MAC) (enc data: timestamp, blob) + #define PAYLOAD_TYPE_RESPONSE 0x01 // response to REQ or ANON_REQ (prefixed with dest/src hashes, MAC) (enc data: timestamp, blob) + #define PAYLOAD_TYPE_TXT_MSG 0x02 // a plain text message (prefixed with dest/src hashes, MAC) (enc data: timestamp, text) + #define PAYLOAD_TYPE_ACK 0x03 // a simple ack #define PAYLOAD_TYPE_ADVERT 0x04 // a node advertising its Identity + #define PAYLOAD_TYPE_GRP_TXT 0x05 // an (unverified) group text message (prefixed with channel hash, MAC) (enc data: timestamp, "name: msg") + #define PAYLOAD_TYPE_GRP_DATA 0x06 // an (unverified) group datagram (prefixed with channel hash, MAC) (enc data: timestamp, blob) + #define PAYLOAD_TYPE_ANON_REQ 0x07 // generic request (prefixed with dest_hash, ephemeral pub_key, MAC) (enc data: ...) #define PAYLOAD_TYPE_PATH 0x08 // returned path (prefixed with dest/src hashes, MAC) (enc data: path, extra) [Source](https://discord.com/channels/1343693475589263471/1343693475589263474/1350611321040932966) @@ -366,7 +362,7 @@ https://github.com/meshcore-dev/MeshCore/blob/main/src/Packet.h#L19 ### 5.1. Q: What are BW, SF, and CR? -**A:** +**A:** **BW is bandwidth** - width of frequency spectrum that is used for transmission @@ -374,7 +370,7 @@ https://github.com/meshcore-dev/MeshCore/blob/main/src/Packet.h#L19 **CR is coding rate** - from: https://www.thethingsnetwork.org/docs/lorawan/fec-and-code-rate/ -TL;DR: default CR to 5 for good stable links. If it is not a solid link and is intermittent, change to CR to 7 or 8. +TL;DR: default CR to 5 for good stable links. If it is not a solid link and is intermittent, change to CR to 7 or 8. Forward Error Correction is a process of adding redundant bits to the data to be transmitted. During the transmission, data may get corrupted by interference (changes from 0 to 1 / 1 to 0). These error correction bits are used at the receivers for restoring corrupted bits. @@ -389,7 +385,7 @@ There are 4 code rates used in LoRaWAN: For example, if the code rate is 5/7, for every 5 bits of useful information, the coder generates a total of 7 bits of data, of which 2 bits are redundant. -Making the bandwidth 2x wider (from BW125 to BW250) allows you to send 2x more bytes in the same time. Making the spreading factor 1 step lower (from SF10 to SF9) allows you to send 2x more bytes in the same time. +Making the bandwidth 2x wider (from BW125 to BW250) allows you to send 2x more bytes in the same time. Making the spreading factor 1 step lower (from SF10 to SF9) allows you to send 2x more bytes in the same time. Lowering the spreading factor makes it more difficult for the gateway to receive a transmission, as it will be more sensitive to noise. You could compare this to two people taking in a noisy place (a bar for example). If you’re far from each other, you have to talk slow (SF10), but if you’re close, you can talk faster (SF7) @@ -397,14 +393,14 @@ So, it's balancing act between speed of the transmission and resistance to noise things network is mainly focused on LoRaWAN, but the LoRa low-level stuff still checks out for any LoRa project ### 5.2. Q: Do MeshCore clients repeat? -**A:** No, MeshCore clients do not repeat. This is the core of MeshCore's messaging-first design. This is to avoid devices flooding the air ware and create endless collisions, so messages sent aren't received. -In MeshCore, only repeaters and room server with `set repeat on` repeat. +**A:** No, MeshCore clients do not repeat. This is the core of MeshCore's messaging-first design. This is to avoid devices flooding the air ware and create endless collisions, so messages sent aren't received. +In MeshCore, only repeaters and room server with `set repeat on` repeat. ### 5.3. Q: What happens when a node learns a route via a mobile repeater, and that repeater is gone? **A:** If you used to reach a node through a repeater and the repeater is no longer reachable, the client will send the message using the existing (but now broken) known path, the message will fail after 3 retries, and the app will reset the path and send the message as flood on the last retry by default. This can be turned off in settings. If the destination is reachable directly or through another repeater, the new path will be used going forward. Or you can set the path manually if you know a specific repeater to use to reach that destination. -In the case if users are moving around frequently, and the paths are breaking, they just see the phone client retries and revert to flood to attempt to re-establish a path. +In the case if users are moving around frequently, and the paths are breaking, they just see the phone client retries and revert to flood to attempt to re-establish a path. ### 5.4. Q: How does a node discovery a path to its destination and then use it to send messages in the future, instead of flooding every message it sends like Meshtastic? @@ -423,14 +419,14 @@ Routes are stored in sender's contact list. When you send a message the first t **A:** The smartphone app key is in hex: ` 8b3387e9c5cdea6ac9e5edbaa115cd72` -T-Deck uses the same key but in base64 +T-Deck uses the same key but in base64 `izOH6cXN6mrJ5e26oRXNcg==` The third character is the capital letter 'O', not zero `0` [Source](https://discord.com/channels/826570251612323860/1330643963501351004/1354194409213792388) ### 5.7. Q: Is MeshCore open source? -**A:** Most of the firmware is freely available. Everything is open source except the T-Deck firmware and Liam's native mobile apps. -- Firmware repo: https://github.com/meshcore-dev/MeshCore +**A:** Most of the firmware is freely available. Everything is open source except the T-Deck firmware and Liam's native mobile apps. +- Firmware repo: https://github.com/meshcore-dev/MeshCore ### 5.8. Q: How can I support MeshCore? **A:** Provide your honest feedback on GitHub and on [MeshCore Discord server](https://discord.gg/BMwCtwHj5V). Spread the word of MeshCore to your friends and communities; help them get started with MeshCore. Support Scott's MeshCore development at . @@ -440,7 +436,7 @@ Support Liam Cottle's smartphone client development by unlocking the server admi Support Rastislav Vysoky (recrof)'s flasher web site and the map web site development through [PayPal](https://www.paypal.com/donate/?business=DREHF5HM265ES&no_recurring=0&item_name=If+you+enjoy+my+work%2C+you+can+support+me+here%3A¤cy_code=EUR) or [Revolut](https://revolut.me/recrof) ### 5.9. Q: How do I build MeshCore firmware from source? -**A:** See instructions here: +**A:** See instructions here: https://discord.com/channels/826570251612323860/1330643963501351004/1341826372120608769 Build instructions for MeshCore: @@ -460,7 +456,7 @@ Then it should be the same for all platforms: python3 -m venv meshcore cd meshcore && source bin/activate pip install -U platformio -git clone https://github.com/ripplebiz/MeshCore.git +git clone https://github.com/ripplebiz/MeshCore.git cd MeshCore ``` open platformio.ini and in `[arduino_base]` edit the `LORA_FREQ=867.5` @@ -470,8 +466,8 @@ pio run -e RAK_4631_Repeater ``` then you'll find `firmware.zip` in `.pio/build/RAK_4631_Repeater` -Andy also has a video on how to build using VS Code: -*How to build and flash Meshcore repeater firmware | Heltec V3* +Andy also has a video on how to build using VS Code: +*How to build and flash Meshcore repeater firmware | Heltec V3* *(Link referenced in the Discord post)* ### 5.10. Q: Are there other MeshCore related open source projects? @@ -488,13 +484,13 @@ Meshcore would not be best suited to ATAK because MeshCore: clients do not repeat and therefore you would need a network of repeaters in place will not have a stable path where all clients are constantly moving between repeaters -MeshCore clients would need to reset path constantly and flood traffic across the network which could lead to lots of collisions with something as chatty as ATAK. +MeshCore clients would need to reset path constantly and flood traffic across the network which could lead to lots of collisions with something as chatty as ATAK. This could change in the future if MeshCore develops a client firmware that repeats. [Source](https://discord.com/channels/826570251612323860/1330643963501351004/1354780032140054659) ### 5.12. Q: How do I add a node to the [MeshCore Map]([url](https://meshcore.co.uk/map.html)) -**A:** +**A:** To add a BLE Companion radio, connect to the BLE Companion radio from the MeshCore smartphone app. In the app, tap the `3 dot` menu icon at the top right corner, then tap `Internet Map`. Tap the `3 dot` menu icon again and choose `Add me to the Map` @@ -513,7 +509,7 @@ For ESP-based devices (e.g. Heltec V3) you need: - Download firmware file from flasher.meshcore.co.uk - Go to the web site on a browser, find the section that has the firmware up need - Click the Download button, right click on the file you need, for example, - - `Heltec_V3_companion_radio_ble-v1.7.1-165fb33.bin` + - `Heltec_V3_companion_radio_ble-v1.7.1-165fb33.bin` - Non-merged bin keeps the existing Bluetooth pairing database - `Heltec_v3_companion_radio_usb-v1.7.1-165fb33-merged.bin` - Merged bin overwrites everything including the bootloader, existing Bluetooth pairing database, but keeps configurations. @@ -532,7 +528,7 @@ For ESP-based devices (e.g. Heltec V3) you need: - `esptool.py -p /dev/ttyUSB0 --chip esp32-s3 write_flash 0x10000 .bin` - For merged bin: - `esptool.py -p /dev/ttyUSB0 --chip esp32-s3 write_flash 0x00000 .bin` - + **Instructions for nRF devices:** @@ -553,18 +549,18 @@ For nRF devices (e.g. RAK, Heltec T114) you need the following: - `pip install adafruit-nrfutil --break-system-packages` - Use this command to flash the nRF device: - `adafruit-nrfutil --verbose dfu serial --package RAK_4631_companion_radio_usb-v1.7.1-165fb33.zip -p /dev/ttyACM0 -b 115200 --singlebank --touch 1200` - - + + To manage a repeater or room server connected to a Pi over USB serial using shell commands, you need to install `picocom`. To install `picocom`, run the following command: - `sudo apt install picocom` To start managing your USB serial-connected device using picocom, use the following command: - `picocom -b 115200 /dev/ttyUSB0 --imap lfcrlf` -From here, reference repeater and room server command line commands on MeshCore github wiki here: +From here, reference repeater and room server command line commands on MeshCore github wiki here: - https://github.com/meshcore-dev/MeshCore/wiki/Repeater-&-Room-Server-CLI-Reference - + ### 5.14. Q: Are there are projects built around MeshCore? **A:** Yes. See the following: @@ -582,7 +578,7 @@ https://github.com/awolden/meshcore-ha Bindings to access your MeshCore companion radio nodes in python. https://github.com/fdlamotte/meshcore_py -#### 5.14.4. meshcore-cli +#### 5.14.4. meshcore-cli CLI interface to MeshCore companion radio over BLE, TCP, or serial. Uses Python MeshCore above. https://github.com/fdlamotte/meshcore-cli @@ -600,9 +596,9 @@ https://github.com/rightup/pyMC_core ### 6.1. Q: My client says another client or a repeater or a room server was last seen many, many days ago. ### 6.2. Q: A repeater or a client or a room server I expect to see on my discover list (on T-Deck) or contact list (on a smart device client) are not listed. -**A:** -- If your client is a T-Deck, it may not have its time set (no GPS installed, no GPS lock, or wrong GPS baud rate). -- If you are using the Android or iOS client, the other client, repeater, or room server may have the wrong time. +**A:** +- If your client is a T-Deck, it may not have its time set (no GPS installed, no GPS lock, or wrong GPS baud rate). +- If you are using the Android or iOS client, the other client, repeater, or room server may have the wrong time. You can get the epoch time on and use it to set your T-Deck clock. For a repeater and room server, the admin can use a T-Deck to remotely set their clock (clock sync), or use the `time` command in the USB serial console with the server device connected. @@ -623,23 +619,23 @@ You can get the epoch time on and use it to se ### 6.7. Q: My RAK/T1000-E/xiao_nRF52 device seems to be corrupted, how do I wipe it clean to start fresh? -**A:** +**A:** 1. Connect USB-C cable to your device, per your device's instruction, get it to flash mode: - For RAK, click the reset button **TWICE** - For T1000-e, quickly disconnect and reconnect the magnetic side of the cable from the device **TWICE** - For Heltec T114, click the reset button **TWICE** (the bottom button) - For Xiao nRF52, click the reset button once. If that doesn't work, quickly double click the reset button twice. If that doesn't work, disconnection the board from your PC and reconnect again ([seeed studio wiki](https://wiki.seeedstudio.com/XIAO_BLE/#access-the-swd-pins-for-debugging-and-reflashing-bootloader)) 5. A new folder will appear on your computer's desktop -6. Download the `flash_erase*.uf2` file for your device on flasher.meshcore.co.uk +6. Download the `flash_erase*.uf2` file for your device on flasher.meshcore.co.uk - RAK WisBlock and Heltec T114: `Flash_erase-nRF32_softdevice_v6.uf2` - Seeed Studio Xiao nRF52 WIO: `Flash_erase-nRF52_softdevice_v7.uf2` 8. drag and drop the uf2 file for your device to the root of the new folder 9. Wait for the copy to complete. You might get an error dialog, you can ignore it -10. Go to https://flasher.meshcore.co.uk/, click `Console` and select the serial port for your connected device +10. Go to https://flasher.meshcore.co.uk/, click `Console` and select the serial port for your connected device 11. In the console, press enter. Your flash should now be erased 12. You may now flash the latest MeshCore firmware onto your device -Separately, starting in firmware version 1.7.0, there is a CLI Rescue mode. If your device has a user button (e.g. some RAK, T114), you can activate the rescue mode by hold down the user button of the device within 8 seconds of boot. Then you can use the 'Console' on flasher.meshcore.co.uk +Separately, starting in firmware version 1.7.0, there is a CLI Rescue mode. If your device has a user button (e.g. some RAK, T114), you can activate the rescue mode by hold down the user button of the device within 8 seconds of boot. Then you can use the 'Console' on flasher.meshcore.co.uk ### 6.8. Q: WebFlasher fails on Linux with failed to open @@ -662,12 +658,12 @@ Allow the browser user on it: 4. Go to the Command Line tab, type `start ota` and hit enter. 5. you should see `OK` to confirm the repeater device is now in OTA mode 6. Run the DFU app,tab `Settings` on the top right corner -7. Enable `Packets receipt notifications`, and change `Number of Packets` to 10 for RAK, 8 for T114. 8 also works for RAK. +7. Enable `Packets receipt notifications`, and change `Number of Packets` to 10 for RAK, 8 for T114. 8 also works for RAK. 9. Select the firmware zip file you downloaded 10. Select the device you want to update. If the device you want to update is not on the list, try enabling`OTA` on the device again 11. If the device is not found, enable `Force Scanning` in the DFU app 12. Tab the `Upload` to begin OTA update -13. If it fails, try turning off and on Bluetooth on your phone. If that doesn't work, try rebooting your phone. +13. If it fails, try turning off and on Bluetooth on your phone. If that doesn't work, try rebooting your phone. 14. Wait for the update to complete. It can take a few minutes. @@ -679,13 +675,13 @@ Allow the browser user on it: 4. Go to the Command Line tab, type `start ota` and hit enter. 5. you should see `OK` to confirm the repeater device is now in OTA mode 6. The command `start ota` on an ESP32-based device starts a wifi hotspot named `MeshCore OTA` -7. From your phone or computer connect to the 'MeshCore OTA' hotspot +7. From your phone or computer connect to the 'MeshCore OTA' hotspot 8. From a browser, go to http://192.168.4.1/update and upload the non-merged bin from the flasher ### 7.3. Q: Is there a way to lower the chance of a failed OTA device firmware update (DFU)? -**A:** Yes, developer `che aporeps` has an enhanced OTA DFU bootloader for nRF52 based devices. With this bootloader, if it detects that the application firmware is invalid, it falls back to OTA DFU mode so you can attempt to flash again to recover. This bootloader has other changes to make the OTA DFU process more fault tolerant. +**A:** Yes, developer `che aporeps` has an enhanced OTA DFU bootloader for nRF52 based devices. With this bootloader, if it detects that the application firmware is invalid, it falls back to OTA DFU mode so you can attempt to flash again to recover. This bootloader has other changes to make the OTA DFU process more fault tolerant. Refer to https://github.com/oltaco/Adafruit_nRF52_Bootloader_OTAFIX for the latest information. @@ -697,7 +693,7 @@ Currently, the following boards are supported: ### 7.4. Q: are the MeshCore logo and font available? -**A:** Yes, it is on the MeshCore github repo here: +**A:** Yes, it is on the MeshCore github repo here: https://github.com/meshcore-dev/MeshCore/tree/main/logo ### 7.5. Q: What is the format of a contact or channel QR code? @@ -716,7 +712,7 @@ where `&type` is: `sensor = 4` ### 7.6. Q: How do I connect to the companion via WIFI, e.g. using a heltec v3? - **A:** + **A:** WiFi firmware requires you to compile it yourself, as you need to set the wifi ssid and password. Edit WIFI_SSID and WIFI_PWD in `./variants/heltec_v3/platformio.ini` and then flash it to your device. From 8b68b5a6898812019d77a413b3b429f0b9f04431 Mon Sep 17 00:00:00 2001 From: fdlamotte Date: Wed, 12 Nov 2025 16:14:57 +0100 Subject: [PATCH 07/29] Update README.md (RAK boards don't need pio patch) --- README.md | 9 --------- 1 file changed, 9 deletions(-) diff --git a/README.md b/README.md index eba4d1533..cb68c9609 100644 --- a/README.md +++ b/README.md @@ -113,12 +113,3 @@ There are a number of fairly major features in the pipeline, with no particular - Report bugs and request features on the [GitHub Issues](https://github.com/ripplebiz/MeshCore/issues) page. - Find additional guides and components on [my site](https://buymeacoffee.com/ripplebiz). - Join [MeshCore Discord](https://discord.gg/BMwCtwHj5V) to chat with the developers and get help from the community. - -## RAK Wireless Board Support in PlatformIO - -Before building/flashing the RAK4631 targets in this project, there is, unfortunately, some patching you have to do to your platformIO packages to make it work. There is a guide here on the process: - [RAK Wireless: How to Perform Installation of Board Support Package in PlatformIO](https://learn.rakwireless.com/hc/en-us/articles/26687276346775-How-To-Perform-Installation-of-Board-Support-Package-in-PlatformIO) - -After building, you will need to convert the output firmware.hex file into a .uf2 file you can copy over to your RAK4631 device (after doing a full erase) by using the command `uf2conv.py -f 0xADA52840 -c firmware.hex` with the python script available from: - [GitHub: Microsoft - uf2](https://github.com/Microsoft/uf2/blob/master/utils/uf2conv.py) - From cae37d889212ae3a049bedf83896eb561708c846 Mon Sep 17 00:00:00 2001 From: uncle lit <43320854+LitBomb@users.noreply.github.com> Date: Sun, 7 Dec 2025 22:31:54 -0800 Subject: [PATCH 08/29] Update faq.md add get and set prv.key add web site to generate new private key and specific its public key's first byte value add link to repeater observer instruction add links to The Comms Channel's meshcore video, MCarper's Meshcore Advantages, and Austin Mesh's MeshCore vs Meshtastic comparison add deafness instruction for agc reset interval add reference to Liam's Windows and Intel Mac client apps add reference to Tree's Meshcore packet decoder add OTA BLE update addendum for Seeed Wio Tracker L1 Pro add instruction to use T-deck's software keyboard to enter `=` at the end of the base64 public key --- docs/faq.md | 78 ++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 75 insertions(+), 3 deletions(-) diff --git a/docs/faq.md b/docs/faq.md index c69077d1d..4bfa68576 100644 --- a/docs/faq.md +++ b/docs/faq.md @@ -1,6 +1,10 @@ **MeshCore-FAQ** A list of frequently-asked questions and answers for MeshCore +The current version of this MeshCore FAQ is at https://github.com/meshcore-dev/MeshCore/blob/main/docs/faq.md. +This MeshCore FAQ is also mirrored at https://github.com/LitBomb/MeshCore-FAQ and might have newer updates if pull requests on Scott's MeshCore repo are not approved yet. + +author: https://github.com/LitBomb --- - [1. Introduction](#1-introduction) @@ -22,6 +26,10 @@ A list of frequently-asked questions and answers for MeshCore - [3.2. Q: Do I need to set the location for a repeater?](#32-q-do-i-need-to-set-the-location-for-a-repeater) - [3.3. Q: What is the password to administer a repeater or a room server?](#33-q-what-is-the-password-to-administer-a-repeater-or-a-room-server) - [3.4. Q: What is the password to join a room server?](#34-q-what-is-the-password-to-join-a-room-server) + - [3.5. Q: Can I retrieve a repeater's private key or set a repeater's private key?](#35-q-can-i-retrieve-a-repeaters-private-key-or-set-a-repeaters-private-key) + - [3.6. Q: The first byte of my repeater's public key collides with an exisitng repeater on the mesh. How do I get a new private key with a matching public key that has its first byte of my choosing?](#36-q-the-first-byte-of-my-repeaters-public-key-collides-with-an-exisitng-repeater-on-the-mesh--how-do-i-get-a-new-private-key-with-a-matching-public-key-that-has-its-first-byte-of-my-choosing) + - [3.7. Q: My repeater maybe suffering from deafness due to high power interference near my mesh's frequency, it is not hearing other in-range MeshCore radios. what can I do?](#37-q-my-repeater-maybe-suffering-from-deafness-due-to-high-power-interference-near-my-meshs-frequency-it-is-not-hearing-other-in-range-meshcore-radios--what-can-i-do) + - [3.8 Q: How do I make my repeater an observer on the mesh](#38-q-how-do-i-make-my-repeater-an-observer-on-the-mesh) - [4. T-Deck Related](#4-t-deck-related) - [4.1. Q: Is there a user guide for T-Deck, T-Pager, T-Watch, or T-Display Pro?](#41-q-is-there-a-user-guide-for-t-deck-t-pager-t-watch-or-t-display-pro) - [4.2. Q: What are the steps to get a T-Deck into DFU (Device Firmware Update) mode?](#42-q-what-are-the-steps-to-get-a-t-deck-into-dfu-device-firmware-update-mode) @@ -58,6 +66,9 @@ A list of frequently-asked questions and answers for MeshCore - [5.14.4. meshcore-cli](#5144-meshcore-cli) - [5.14.5. meshcore.js](#5145-meshcorejs) - [5.14.6. pyMC\_core](#5146-pymc_core) + - [5.14.7. MeshCore Packet Decoder](#5147-meshcore-packet-decoder) + - [5.15. Q: Are there clientt applications for Windows or Mac?](#515-q-are-there-clientt-applications-for-windows-or-mac) + - [5.16. Q: Are there any document that compares MeshCore with other LoRa systems?](#516-q-are-there-any-document-that-compares-meshcore-with-other-lora-systems) - [6. Troubleshooting](#6-troubleshooting) - [6.1. Q: My client says another client or a repeater or a room server was last seen many, many days ago.](#61-q-my-client-says-another-client-or-a-repeater-or-a-room-server-was-last-seen-many-many-days-ago) - [6.2. Q: A repeater or a client or a room server I expect to see on my discover list (on T-Deck) or contact list (on a smart device client) are not listed.](#62-q-a-repeater-or-a-client-or-a-room-server-i-expect-to-see-on-my-discover-list-on-t-deck-or-contact-list-on-a-smart-device-client-are-not-listed) @@ -69,6 +80,7 @@ A list of frequently-asked questions and answers for MeshCore - [6.8. Q: WebFlasher fails on Linux with failed to open](#68-q-webflasher-fails-on-linux-with-failed-to-open) - [7. Other Questions:](#7-other-questions) - [7.1. Q: How to update nRF (RAK, T114, Seed XIAO) repeater and room server firmware over the air using the new simpler DFU app?](#71-q-how-to-update-nrf-rak-t114-seed-xiao-repeater-and-room-server-firmware-over-the-air-using-the-new-simpler-dfu-app) + - [7.1.1 Q: Can I update Seeed Studio Wio Tracker L1 Pro using OTA?](#711-q-can-i-update-seeed-studio-wio-tracker-l1-pro-using-ota) - [7.2. Q: How to update ESP32-based devices over the air?](#72-q-how-to-update-esp32-based-devices-over-the-air) - [7.3. Q: Is there a way to lower the chance of a failed OTA device firmware update (DFU)?](#73-q-is-there-a-way-to-lower-the-chance-of-a-failed-ota-device-firmware-update-dfu) - [7.4. Q: are the MeshCore logo and font available?](#74-q-are-the-meshcore-logo-and-font-available) @@ -252,6 +264,32 @@ You can get the latitude and longitude from Google Maps by right-clicking the lo `set guest.password {guest-password}` +### 3.5. Q: Can I retrieve a repeater's private key or set a repeater's private key? + +**A:** You can issue these commands to get or set a repeater's private key using a USB serial connection. + +`get prv.key` to print a repeater's private key on the serial console +`set prv.key ` to set a repeater's private key on the serila console + +Reboot the repeater after `set prv.key ` command for the new private key to take effect. + +### 3.6. Q: The first byte of my repeater's public key collides with an exisitng repeater on the mesh. How do I get a new private key with a matching public key that has its first byte of my choosing? + +**A:** You can generate a new private key and specific the first byte of its public key here: https://gessaman.com/mc-keygen/ + + +### 3.7. Q: My repeater maybe suffering from deafness due to high power interference near my mesh's frequency, it is not hearing other in-range MeshCore radios. what can I do? + +**A:** This may be due to the SX1262 radio's auto gain control feature. You can use this command to preiodically reset its AGC. + +`set agc.reset.interval ` + +This is a very low cost operation, just setting the readio's state to idle. The value is incremented by 4. `set agc.reset.interval 4` works well to cure deafness. + + +### 3.8 Q: How do I make my repeater an observer on the mesh + +**A:** The observer instruction is available here: https://analyzer.letsme.sh/observer/onboard --- @@ -289,7 +327,9 @@ GPS on T-Deck is always enabled. You can skip the "GPS clock sync" and the T-De **A:** T-Deck uses the same key the smartphone apps use but in base64 `izOH6cXN6mrJ5e26oRXNcg==` -The third character is the capital letter 'O', not zero `0` + +There are no `=` on the T-Deck's hardware keyboard. You can use the on-screen software keyboard to enter `=`. Tap the text box to enable the on-screen software keyboard. +The third character is the capital letter `O` (Oh), not zero `0` The smartphone app key is in hex: ` 8b3387e9c5cdea6ac9e5edbaa115cd72` @@ -590,6 +630,28 @@ https://github.com/liamcottle/meshcore.js pyMC_Core is a Python port of MeshCore, designed for Raspberry Pi and similar hardware, it talks to LoRa modules over SPI. https://github.com/rightup/pyMC_core +#### 5.14.7. MeshCore Packet Decoder +A TypeScript library for decoding MeshCore mesh networking packets with full cryptographic support. Uses WebAssembly (WASM) for Ed25519 key derivation through the orlp/ed25519 library. It powers the [MeshCore Packet Analyzer](https://analyzer.letsme.sh/packets). +https://github.com/michaelhart/meshcore-decoder + + +### 5.15. Q: Are there clientt applications for Windows or Mac? +**A:** Yes, the same iOS and Android client is also available for Windows and Intel Mac (sorry, not available for ARM-based Mac yet). You can find them together with the Android APK here: +https://files.liamcottle.net/MeshCore + +Both the Windows and Intel Mac versions of the client app are fully unlocked and are free to use. + +### 5.16. Q: Are there any document that compares MeshCore with other LoRa systems? + +**A:** Here is a list of MeshCore comparison resources: +The Comms Channel on YouTube: +https://www.youtube.com/watch?v=guDoKGs02Us +MeshCore Advantages by MCarper: +https://github.com/mikecarper/meshfirmware/blob/main/MeshCoreAdvantages.md +Meshcore vs Meshtastic by austinmesh.org +https://www.austinmesh.org/learn/meshcore-vs-meshtastic/ + + --- ## 6. Troubleshooting @@ -666,6 +728,12 @@ Allow the browser user on it: 13. If it fails, try turning off and on Bluetooth on your phone. If that doesn't work, try rebooting your phone. 14. Wait for the update to complete. It can take a few minutes. +#### 7.1.1 Q: Can I update Seeed Studio Wio Tracker L1 Pro using OTA? +**A:** You can flash this safer bootloader to the Wio Tracker L1 Pro +https://github.com/oltaco/Adafruit_nRF52_Bootloader_OTAFIX + +After this bootloader is flashed onto the device, you can trigger over the air update using bluetooth by holding the button next to the D-Pad and then click the reset button. The follow the same OTA update instructions above. You can skip pass the `start ota` instruction and start the update using the DFU app. + ### 7.2. Q: How to update ESP32-based devices over the air? @@ -686,10 +754,14 @@ Allow the browser user on it: Refer to https://github.com/oltaco/Adafruit_nRF52_Bootloader_OTAFIX for the latest information. Currently, the following boards are supported: -- Nologo ProMicro +- Heltec Automation Mesh Node T114 / HT-nRF5262 +- Nologo ProMicro NRF52840 (aka SuperMini NRF52840) +- Seeed Studio SenseCAP Card Tracker T1000-E +- Seeed Studio Wio Tracker L1 - Seeed Studio XIAO nRF52840 BLE - Seeed Studio XIAO nRF52840 BLE SENSE -- RAK 4631 +- RAK 4631 (See note) +- RAK WisMesh Tag (new 28/11/2025) ### 7.4. Q: are the MeshCore logo and font available? From 1f5659dd26bf171399006dfc4476160096753072 Mon Sep 17 00:00:00 2001 From: uncle lit <43320854+LitBomb@users.noreply.github.com> Date: Mon, 8 Dec 2025 09:33:10 -0800 Subject: [PATCH 09/29] Update faq.md fix typo bugs found by @4np --- docs/faq.md | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/docs/faq.md b/docs/faq.md index 4bfa68576..e74fbcad2 100644 --- a/docs/faq.md +++ b/docs/faq.md @@ -67,8 +67,8 @@ author: https://github.com/LitBomb - [5.14.5. meshcore.js](#5145-meshcorejs) - [5.14.6. pyMC\_core](#5146-pymc_core) - [5.14.7. MeshCore Packet Decoder](#5147-meshcore-packet-decoder) - - [5.15. Q: Are there clientt applications for Windows or Mac?](#515-q-are-there-clientt-applications-for-windows-or-mac) - - [5.16. Q: Are there any document that compares MeshCore with other LoRa systems?](#516-q-are-there-any-document-that-compares-meshcore-with-other-lora-systems) + - [5.15. Q: Are there client applications for Windows or Mac?](#515-q-are-there-clientt-applications-for-windows-or-mac) + - [5.16. Q: Are there any resources that compare MeshCore to other LoRa systems?](#516-q-are-there-any-document-that-compares-meshcore-with-other-lora-systems) - [6. Troubleshooting](#6-troubleshooting) - [6.1. Q: My client says another client or a repeater or a room server was last seen many, many days ago.](#61-q-my-client-says-another-client-or-a-repeater-or-a-room-server-was-last-seen-many-many-days-ago) - [6.2. Q: A repeater or a client or a room server I expect to see on my discover list (on T-Deck) or contact list (on a smart device client) are not listed.](#62-q-a-repeater-or-a-client-or-a-room-server-i-expect-to-see-on-my-discover-list-on-t-deck-or-contact-list-on-a-smart-device-client-are-not-listed) @@ -284,7 +284,9 @@ Reboot the repeater after `set prv.key ` command for the new private key to `set agc.reset.interval ` -This is a very low cost operation, just setting the readio's state to idle. The value is incremented by 4. `set agc.reset.interval 4` works well to cure deafness. +The `` unit is in seconds and is incremented by 4. `set agc.reset.interval 4` works well to cure deafness. + +This is a very low cost operation. AGC reset is done by simply setting `state = STATE_IDLE;` in function `RadioLibWrapper::resetAGC()` in `RadioLibWrappers.cpp` ### 3.8 Q: How do I make my repeater an observer on the mesh @@ -328,7 +330,7 @@ GPS on T-Deck is always enabled. You can skip the "GPS clock sync" and the T-De T-Deck uses the same key the smartphone apps use but in base64 `izOH6cXN6mrJ5e26oRXNcg==` -There are no `=` on the T-Deck's hardware keyboard. You can use the on-screen software keyboard to enter `=`. Tap the text box to enable the on-screen software keyboard. +There is no `=` key on the T-Deck's hardware keyboard. You can use the on-screen software keyboard to enter `=`. Tap the text box to enable the on-screen software keyboard. The third character is the capital letter `O` (Oh), not zero `0` The smartphone app key is in hex: @@ -635,13 +637,13 @@ A TypeScript library for decoding MeshCore mesh networking packets with full cry https://github.com/michaelhart/meshcore-decoder -### 5.15. Q: Are there clientt applications for Windows or Mac? +### 5.15. Q: Are there client applications for Windows or Mac? **A:** Yes, the same iOS and Android client is also available for Windows and Intel Mac (sorry, not available for ARM-based Mac yet). You can find them together with the Android APK here: https://files.liamcottle.net/MeshCore Both the Windows and Intel Mac versions of the client app are fully unlocked and are free to use. -### 5.16. Q: Are there any document that compares MeshCore with other LoRa systems? +### 5.16. Q: Are there any resources that compare MeshCore to other LoRa systems? **A:** Here is a list of MeshCore comparison resources: The Comms Channel on YouTube: From 2bcc9c10d24de07770c3e353de5782fab099df64 Mon Sep 17 00:00:00 2001 From: mattzzw Date: Sun, 14 Dec 2025 18:29:49 +0100 Subject: [PATCH 10/29] Update faq.md Fix typo --- docs/faq.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/faq.md b/docs/faq.md index e74fbcad2..3b5535d0c 100644 --- a/docs/faq.md +++ b/docs/faq.md @@ -269,7 +269,7 @@ You can get the latitude and longitude from Google Maps by right-clicking the lo **A:** You can issue these commands to get or set a repeater's private key using a USB serial connection. `get prv.key` to print a repeater's private key on the serial console -`set prv.key ` to set a repeater's private key on the serila console +`set prv.key ` to set a repeater's private key on the serial console Reboot the repeater after `set prv.key ` command for the new private key to take effect. From 27c92d2fe9a1ee0d28e31688d24df10de6133930 Mon Sep 17 00:00:00 2001 From: uncle lit <43320854+LitBomb@users.noreply.github.com> Date: Sun, 21 Dec 2025 21:48:56 -0800 Subject: [PATCH 11/29] Update FAQ with new MeshCore applications and tx power settings for amped radios Added entries for meshcore-pi and pyMC_Repeater to the FAQ Added tx power settings for amped radios --- docs/faq.md | 34 ++++++++++++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/docs/faq.md b/docs/faq.md index 3b5535d0c..7f1be3373 100644 --- a/docs/faq.md +++ b/docs/faq.md @@ -67,8 +67,10 @@ author: https://github.com/LitBomb - [5.14.5. meshcore.js](#5145-meshcorejs) - [5.14.6. pyMC\_core](#5146-pymc_core) - [5.14.7. MeshCore Packet Decoder](#5147-meshcore-packet-decoder) - - [5.15. Q: Are there client applications for Windows or Mac?](#515-q-are-there-clientt-applications-for-windows-or-mac) - - [5.16. Q: Are there any resources that compare MeshCore to other LoRa systems?](#516-q-are-there-any-document-that-compares-meshcore-with-other-lora-systems) + - [5.14.8. meshcore-pi](#5148-meshcore-pi) + - [5.14.9. pyMC\_Repeater](#5149-pymc_repeater) + - [5.15. Q: Are there client applications for Windows or Mac?](#515-q-are-there-client-applications-for-windows-or-mac) + - [5.16. Q: Are there any resources that compare MeshCore to other LoRa systems?](#516-q-are-there-any-resources-that-compare-meshcore-to-other-lora-systems) - [6. Troubleshooting](#6-troubleshooting) - [6.1. Q: My client says another client or a repeater or a room server was last seen many, many days ago.](#61-q-my-client-says-another-client-or-a-repeater-or-a-room-server-was-last-seen-many-many-days-ago) - [6.2. Q: A repeater or a client or a room server I expect to see on my discover list (on T-Deck) or contact list (on a smart device client) are not listed.](#62-q-a-repeater-or-a-client-or-a-room-server-i-expect-to-see-on-my-discover-list-on-t-deck-or-contact-list-on-a-smart-device-client-are-not-listed) @@ -86,6 +88,8 @@ author: https://github.com/LitBomb - [7.4. Q: are the MeshCore logo and font available?](#74-q-are-the-meshcore-logo-and-font-available) - [7.5. Q: What is the format of a contact or channel QR code?](#75-q-what-is-the-format-of-a-contact-or-channel-qr-code) - [7.6. Q: How do I connect to the companion via WIFI, e.g. using a heltec v3?](#76-q-how-do-i-connect-to-the-companion-via-wifi-eg-using-a-heltec-v3) + - [7.7. Q: I have a Station G2, or a Heltec V4, or an Ikoka Stick, or a radio with a EByte E22-900M30S or a E22-900M33S module, what should their transmit power be set to?](#77-q-i-have-a-station-g2-or-a-heltec-v4-or-an-ikoka-stick-or-a-radio-with-a-ebyte-e22-900m30s-or-a-e22-900m33s-module-what-should-their-transmit-power-be-set-to) +- [| | High Output | 22 dBm | 28 dBm | |](#--high-output--22-dbm--28-dbm--) ## 1. Introduction @@ -636,6 +640,14 @@ https://github.com/rightup/pyMC_core A TypeScript library for decoding MeshCore mesh networking packets with full cryptographic support. Uses WebAssembly (WASM) for Ed25519 key derivation through the orlp/ed25519 library. It powers the [MeshCore Packet Analyzer](https://analyzer.letsme.sh/packets). https://github.com/michaelhart/meshcore-decoder +#### 5.14.8. meshcore-pi +meshcore-pi is another Python port of MeshCore, designed for Raspberry Pi and similar hardware, it talks to LoRa modules over SPI or GPIO. +https://github.com/brianwiddas/meshcore-pi + +#### 5.14.9. pyMC_Repeater +pyMC_Repeater is a repeater daemon in Python built on top of the [`pymc_core`](#5146-pymc_core) library. +https://github.com/rightup/pyMC_Repeater + ### 5.15. Q: Are there client applications for Windows or Mac? **A:** Yes, the same iOS and Android client is also available for Windows and Intel Mac (sorry, not available for ARM-based Mac yet). You can find them together with the Android APK here: @@ -790,4 +802,22 @@ where `&type` is: WiFi firmware requires you to compile it yourself, as you need to set the wifi ssid and password. Edit WIFI_SSID and WIFI_PWD in `./variants/heltec_v3/platformio.ini` and then flash it to your device. +### 7.7. Q: I have a Station G2, or a Heltec V4, or an Ikoka Stick, or a radio with a EByte E22-900M30S or a E22-900M33S module, what should their transmit power be set to? + **A:** +For companion radios, you can set these radios' transmit power in the smartphone app. For repeater and room server radios, you can set their transmit power using the command line command `set tx`. You can get their current value using command line comand `get tx` + + +> ### ⚠️ **WARNING: Set these values at your own risk. Incorrect power settings can permanently damage your radio hardware.** + +| Device / Model | Region / Description | In-App Setting (dBm) | Target Radio Output | Notes | +| :--- | :--- | :--- | :--- | :--- | +| **Station G2**
[Reference](https://wiki.uniteng.com/en/meshtastic/station-g2) | US915 Max Output | 19 dBm | 26.5 dBm (4.46W) | | +| | US915 Recommended Max | 16 dBm | 35 dBm (3.16W) | 1dB compression point | +| | EU868 Recommended Max | 15 dBm | 34.5 dBm (2.82W) | 1dB compression point | +| | US915 1W Output | 10 dBm | 1W | | +| | EU868 1W Output | 9 dBm | 1W | | +| **Ikoka Stick E22-900M30S** | 1W Model | 19 dBm | 1W | **DO NOT EXCEED** (Risk of burn out) | +| **Ikoka Stick E22-900M33S** | 2W Model | 9 dBm | 2W | **DO NOT EXCEED** (Risk of burn out) | +| **Heltec V4** | Standard Output | 10 dBm | 22 dBm | | +| | High Output | 22 dBm | 28 dBm | | --- From a93527a47400308577b565f772974eba6e0343df Mon Sep 17 00:00:00 2001 From: uncle lit <43320854+LitBomb@users.noreply.github.com> Date: Fri, 2 Jan 2026 22:34:10 -0800 Subject: [PATCH 12/29] fix Station G2 output dBm typo fix Station G2 output dBm typo reported on https://github.com/meshcore-dev/MeshCore/issues/1304 changed 26.5 dBm to 36.5 dBm --- docs/faq.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/faq.md b/docs/faq.md index 7f1be3373..66a942a4a 100644 --- a/docs/faq.md +++ b/docs/faq.md @@ -811,7 +811,7 @@ For companion radios, you can set these radios' transmit power in the smartphone | Device / Model | Region / Description | In-App Setting (dBm) | Target Radio Output | Notes | | :--- | :--- | :--- | :--- | :--- | -| **Station G2**
[Reference](https://wiki.uniteng.com/en/meshtastic/station-g2) | US915 Max Output | 19 dBm | 26.5 dBm (4.46W) | | +| **Station G2**
[Reference](https://wiki.uniteng.com/en/meshtastic/station-g2) | US915 Max Output | 19 dBm | 36.5 dBm (4.46W) | | | | US915 Recommended Max | 16 dBm | 35 dBm (3.16W) | 1dB compression point | | | EU868 Recommended Max | 15 dBm | 34.5 dBm (2.82W) | 1dB compression point | | | US915 1W Output | 10 dBm | 1W | | From 599e15fd0ce2776456893e213fa556745047d9d4 Mon Sep 17 00:00:00 2001 From: Michael Boelen Date: Thu, 8 Jan 2026 15:20:05 +0000 Subject: [PATCH 13/29] Update faq.md Fix of a typo, change second sentence to start with a capital (like Q 3.6), adding missing dot in 3.8, and turn 3.8 into a question. The file on dev branch is outdated, so submitting this on main. --- docs/faq.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/faq.md b/docs/faq.md index 66a942a4a..9fc1d4416 100644 --- a/docs/faq.md +++ b/docs/faq.md @@ -28,8 +28,8 @@ author: https://github.com/LitBomb - [3.4. Q: What is the password to join a room server?](#34-q-what-is-the-password-to-join-a-room-server) - [3.5. Q: Can I retrieve a repeater's private key or set a repeater's private key?](#35-q-can-i-retrieve-a-repeaters-private-key-or-set-a-repeaters-private-key) - [3.6. Q: The first byte of my repeater's public key collides with an exisitng repeater on the mesh. How do I get a new private key with a matching public key that has its first byte of my choosing?](#36-q-the-first-byte-of-my-repeaters-public-key-collides-with-an-exisitng-repeater-on-the-mesh--how-do-i-get-a-new-private-key-with-a-matching-public-key-that-has-its-first-byte-of-my-choosing) - - [3.7. Q: My repeater maybe suffering from deafness due to high power interference near my mesh's frequency, it is not hearing other in-range MeshCore radios. what can I do?](#37-q-my-repeater-maybe-suffering-from-deafness-due-to-high-power-interference-near-my-meshs-frequency-it-is-not-hearing-other-in-range-meshcore-radios--what-can-i-do) - - [3.8 Q: How do I make my repeater an observer on the mesh](#38-q-how-do-i-make-my-repeater-an-observer-on-the-mesh) + - [3.7. Q: My repeater maybe suffering from deafness due to high power interference near my mesh's frequency, it is not hearing other in-range MeshCore radios. What can I do?](#37-q-my-repeater-maybe-suffering-from-deafness-due-to-high-power-interference-near-my-meshs-frequency-it-is-not-hearing-other-in-range-meshcore-radios--what-can-i-do) + - [3.8. Q: How do I make my repeater an observer on the mesh?](#38-q-how-do-i-make-my-repeater-an-observer-on-the-mesh) - [4. T-Deck Related](#4-t-deck-related) - [4.1. Q: Is there a user guide for T-Deck, T-Pager, T-Watch, or T-Display Pro?](#41-q-is-there-a-user-guide-for-t-deck-t-pager-t-watch-or-t-display-pro) - [4.2. Q: What are the steps to get a T-Deck into DFU (Device Firmware Update) mode?](#42-q-what-are-the-steps-to-get-a-t-deck-into-dfu-device-firmware-update-mode) @@ -282,9 +282,9 @@ Reboot the repeater after `set prv.key ` command for the new private key to **A:** You can generate a new private key and specific the first byte of its public key here: https://gessaman.com/mc-keygen/ -### 3.7. Q: My repeater maybe suffering from deafness due to high power interference near my mesh's frequency, it is not hearing other in-range MeshCore radios. what can I do? +### 3.7. Q: My repeater maybe suffering from deafness due to high power interference near my mesh's frequency, it is not hearing other in-range MeshCore radios. What can I do? -**A:** This may be due to the SX1262 radio's auto gain control feature. You can use this command to preiodically reset its AGC. +**A:** This may be due to the SX1262 radio's auto gain control feature. You can use this command to periodically reset its AGC. `set agc.reset.interval ` @@ -293,7 +293,7 @@ The `` unit is in seconds and is incremented by 4. `set agc.reset.inter This is a very low cost operation. AGC reset is done by simply setting `state = STATE_IDLE;` in function `RadioLibWrapper::resetAGC()` in `RadioLibWrappers.cpp` -### 3.8 Q: How do I make my repeater an observer on the mesh +### 3.8. Q: How do I make my repeater an observer on the mesh? **A:** The observer instruction is available here: https://analyzer.letsme.sh/observer/onboard From 0c2da8ce1e064879b7525d1dd92ba2eca98fe170 Mon Sep 17 00:00:00 2001 From: liamcottle Date: Wed, 28 Jan 2026 21:20:36 +1300 Subject: [PATCH 14/29] add support for mkdocs --- docs/_assets/meshcore_tm.svg | 14 ++++++++++++++ docs/_stylesheets/extra.css | 11 +++++++++++ docs/index.md | 13 +++++++++++++ mkdocs.yml | 20 ++++++++++++++++++++ 4 files changed, 58 insertions(+) create mode 100644 docs/_assets/meshcore_tm.svg create mode 100644 docs/_stylesheets/extra.css create mode 100644 docs/index.md create mode 100644 mkdocs.yml diff --git a/docs/_assets/meshcore_tm.svg b/docs/_assets/meshcore_tm.svg new file mode 100644 index 000000000..b7e252d96 --- /dev/null +++ b/docs/_assets/meshcore_tm.svg @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/docs/_stylesheets/extra.css b/docs/_stylesheets/extra.css new file mode 100644 index 000000000..55d1b1479 --- /dev/null +++ b/docs/_stylesheets/extra.css @@ -0,0 +1,11 @@ +:root { + --md-primary-fg-color: #1F2937; + --md-primary-fg-color--light: #1F2937; + --md-primary-fg-color--dark: #1F2937; + --md-accent-fg-color: #1F2937; +} + +/* hide git repo version */ +.md-source__fact--version { + display: none; +} diff --git a/docs/index.md b/docs/index.md new file mode 100644 index 000000000..b4fb262b1 --- /dev/null +++ b/docs/index.md @@ -0,0 +1,13 @@ +# Welcome + +Welcome to the MeshCore documentation. + +## Building and viewing Docs + +``` +pip install mkdocs +pip install mkdocs-material +``` + +* `mkdocs serve` - Start the live-reloading docs server. +* `mkdocs build` - Build the documentation site. diff --git a/mkdocs.yml b/mkdocs.yml new file mode 100644 index 000000000..9cc7b3ad9 --- /dev/null +++ b/mkdocs.yml @@ -0,0 +1,20 @@ +site_name: MeshCore Docs +site_url: https://meshcore-dev.github.io/meshcore/ +site_description: Documentation for the open source MeshCore firmware + +repo_name: meshcore-dev/meshcore +repo_url: https://github.com/meshcore-dev/meshcore/ +edit_uri: edit/main/docs/ + +theme: + name: material + logo: _assets/meshcore_tm.svg + features: + - content.action.edit + - content.code.copy + - search.highlight + - search.suggest + - toc.integrate + +extra_css: + - _stylesheets/extra.css From a87c0fe2d6d7b11014d874c16f9b3f41c0df2484 Mon Sep 17 00:00:00 2001 From: liamcottle Date: Wed, 28 Jan 2026 21:25:44 +1300 Subject: [PATCH 15/29] separate table of contents --- mkdocs.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/mkdocs.yml b/mkdocs.yml index 9cc7b3ad9..3a76842f5 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -14,7 +14,6 @@ theme: - content.code.copy - search.highlight - search.suggest - - toc.integrate extra_css: - _stylesheets/extra.css From 132c8961e87cb8b165db8d43769acaacd81eca01 Mon Sep 17 00:00:00 2001 From: liamcottle Date: Wed, 28 Jan 2026 21:37:21 +1300 Subject: [PATCH 16/29] add workflow to build and deploy docs to github pages --- .github/workflows/github-pages.yml | 32 ++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 .github/workflows/github-pages.yml diff --git a/.github/workflows/github-pages.yml b/.github/workflows/github-pages.yml new file mode 100644 index 000000000..b5b742f50 --- /dev/null +++ b/.github/workflows/github-pages.yml @@ -0,0 +1,32 @@ +name: Build and deploy Docs site to GitHub Pages + +on: + push: + branches: + - main + +permissions: + contents: write + +jobs: + github-pages: + runs-on: ubuntu-latest + steps: + + - name: Checkout Repo + uses: actions/checkout@v4 + + - name: Setup Python + uses: actions/setup-python@v5 + with: + ruby-version: 3.x + + - name: Configure Git Credentials + run: | + git config user.name github-actions[bot] + git config user.email 41898282+github-actions[bot]@users.noreply.github.com + + - name: Build and Deploy + run: | + pip install mkdocs-material + mkdocs gh-deploy --force From c35c1961de3bb86c90e81e833519d35fbb238651 Mon Sep 17 00:00:00 2001 From: liamcottle Date: Wed, 28 Jan 2026 21:39:04 +1300 Subject: [PATCH 17/29] add docs branch for testing --- .github/workflows/github-pages.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/github-pages.yml b/.github/workflows/github-pages.yml index b5b742f50..a80c20987 100644 --- a/.github/workflows/github-pages.yml +++ b/.github/workflows/github-pages.yml @@ -4,6 +4,7 @@ on: push: branches: - main + - docs permissions: contents: write From 706b5a39c69db2b3a9313147c2d1fa951b577a81 Mon Sep 17 00:00:00 2001 From: liamcottle Date: Wed, 28 Jan 2026 21:44:19 +1300 Subject: [PATCH 18/29] allow manual deploy --- .github/workflows/github-pages.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/github-pages.yml b/.github/workflows/github-pages.yml index a80c20987..e1ef22385 100644 --- a/.github/workflows/github-pages.yml +++ b/.github/workflows/github-pages.yml @@ -1,6 +1,7 @@ name: Build and deploy Docs site to GitHub Pages on: + workflow_dispatch: push: branches: - main From 384e4820528c296b3ccadbb21bd341e98e9d7d30 Mon Sep 17 00:00:00 2001 From: Liam Cottle Date: Tue, 3 Feb 2026 13:47:43 +1300 Subject: [PATCH 19/29] Create CNAME --- CNAME | 1 + 1 file changed, 1 insertion(+) create mode 100644 CNAME diff --git a/CNAME b/CNAME new file mode 100644 index 000000000..1b7d16714 --- /dev/null +++ b/CNAME @@ -0,0 +1 @@ +docs.meshcore.nz \ No newline at end of file From 4af31e552ed836e8cbb3fab2cb4d9a3ff056d99b Mon Sep 17 00:00:00 2001 From: liamcottle Date: Tue, 3 Feb 2026 17:51:22 +1300 Subject: [PATCH 20/29] refactor documentation --- docs/_stylesheets/extra.css | 5 + docs/cli_commands.md | 4 +- ...rotocol_guide.md => companion_protocol.md} | 550 +++++------------- docs/docs.md | 13 + docs/faq.md | 25 +- docs/index.md | 18 +- docs/qr_codes.md | 34 ++ docs/terminal_chat_cli.md | 96 +++ 8 files changed, 315 insertions(+), 430 deletions(-) rename docs/{protocol_guide.md => companion_protocol.md} (57%) create mode 100644 docs/docs.md create mode 100644 docs/qr_codes.md create mode 100644 docs/terminal_chat_cli.md diff --git a/docs/_stylesheets/extra.css b/docs/_stylesheets/extra.css index 55d1b1479..f9f75b120 100644 --- a/docs/_stylesheets/extra.css +++ b/docs/_stylesheets/extra.css @@ -9,3 +9,8 @@ .md-source__fact--version { display: none; } + +/* underline links */ +.md-typeset a { + text-decoration: underline; +} diff --git a/docs/cli_commands.md b/docs/cli_commands.md index 6b4f61578..f89d400ad 100644 --- a/docs/cli_commands.md +++ b/docs/cli_commands.md @@ -1,4 +1,6 @@ -# MeshCore Repeater & Room Server CLI Commands +# CLI Commands + +This document provides an overview of CLI commands that can be sent to MeshCore Repeaters, Room Servers and Sensors. ## Navigation diff --git a/docs/protocol_guide.md b/docs/companion_protocol.md similarity index 57% rename from docs/protocol_guide.md rename to docs/companion_protocol.md index ceedbbf05..9d45b59ef 100644 --- a/docs/protocol_guide.md +++ b/docs/companion_protocol.md @@ -1,26 +1,42 @@ -# MeshCore Device Communication Protocol Guide +# Companion Protocol -This document provides a comprehensive guide for communicating with MeshCore devices over Bluetooth Low Energy (BLE). It is platform-agnostic and can be used for Android, iOS, Python, JavaScript, or any other platform that supports BLE. +- **Last Updated**: 2026-01-03 +- **Protocol Version**: Companion Firmware v1.12.0+ -## ⚠️ Important Security Note +> NOTE: This document is still in development. Some information may be inaccurate. -**All secrets, hashes, and cryptographic values shown in this guide are EXAMPLE VALUES ONLY and are NOT real secrets.** +This document provides a comprehensive guide for communicating with MeshCore devices over Bluetooth Low Energy (BLE). -- The secret `9b647d242d6e1c5883fde0c5cf5c4c5e` used in examples is a made-up example value -- All hex values, public keys, and hashes in examples are for demonstration purposes only -- **Never use example secrets in production** - always generate new cryptographically secure random secrets -- This guide is for protocol documentation only - implement proper security practices in your actual implementation +It is platform-agnostic and can be used for Android, iOS, Python, JavaScript, or any other platform that supports BLE. + +## Official Libraries + +Please see the following repos for existing MeshCore Companion Protocol libraries. + +- JavaScript: [https://github.com/meshcore-dev/meshcore.js](https://github.com/meshcore-dev/meshcore.js) +- Python: [https://github.com/meshcore-dev/meshcore_py](https://github.com/meshcore-dev/meshcore_py) + +## Important Security Note + +All secrets, hashes, and cryptographic values shown in this guide are example values only. + +- All hex values, public keys and hashes are for demonstration purposes only +- Never use example secrets in production +- Always generate new cryptographically secure random secrets +- Please implement proper security practices in your implementation +- This guide is for protocol documentation only ## Table of Contents 1. [BLE Connection](#ble-connection) -2. [Protocol Overview](#protocol-overview) +2. [Packet Structure](#packet-structure) 3. [Commands](#commands) 4. [Channel Management](#channel-management) -5. [Secret Generation and QR Codes](#secret-generation-and-qr-codes) -6. [Message Handling](#message-handling) -7. [Response Parsing](#response-parsing) -8. [Example Implementation Flow](#example-implementation-flow) +5. [Message Handling](#message-handling) +6. [Response Parsing](#response-parsing) +7. [Example Implementation Flow](#example-implementation-flow) +8. [Best Practices](#best-practices) +9. [Troubleshooting](#troubleshooting) --- @@ -28,181 +44,111 @@ This document provides a comprehensive guide for communicating with MeshCore dev ### Service and Characteristics -MeshCore devices expose a BLE service with the following UUIDs: +MeshCore Companion devices expose a BLE service with the following UUIDs: -- **Service UUID**: `0000ff00-0000-1000-8000-00805f9b34fb` -- **RX Characteristic** (Device → Client): `0000ff01-0000-1000-8000-00805f9b34fb` -- **TX Characteristic** (Client → Device): `0000ff02-0000-1000-8000-00805f9b34fb` +- **Service UUID**: `6E400001-B5A3-F393-E0A9-E50E24DCCA9E` +- **RX Characteristic** (App → Firmware): `6E400002-B5A3-F393-E0A9-E50E24DCCA9E` +- **TX Characteristic** (Firmware → App): `6E400003-B5A3-F393-E0A9-E50E24DCCA9E` ### Connection Steps 1. **Scan for Devices** - - Scan for BLE devices advertising the MeshCore service UUID - - Filter by device name (typically contains "MeshCore" or similar) - - Note the device MAC address for reconnection + - Scan for BLE devices advertising the MeshCore Service UUID + - Optionally filter by device name (typically contains "MeshCore" prefix) + - Note the device MAC address for reconnection 2. **Connect to GATT** - - Connect to the device using the discovered MAC address - - Wait for connection to be established + - Connect to the device using the discovered MAC address + - Wait for connection to be established 3. **Discover Services and Characteristics** - - Discover the service with UUID `0000ff00-0000-1000-8000-00805f9b34fb` - - Discover RX characteristic (`0000ff01-...`) for receiving data - - Discover TX characteristic (`0000ff02-...`) for sending commands + - Discover the service with UUID `6E400001-B5A3-F393-E0A9-E50E24DCCA9E` + - Discover the RX characteristic `6E400002-B5A3-F393-E0A9-E50E24DCCA9E` + - Your app writes to this, the firmware reads from this + - Discover the TX characteristic `6E400003-B5A3-F393-E0A9-E50E24DCCA9E` + - The firmware writes to this, your app reads from this 4. **Enable Notifications** - - Subscribe to notifications on the RX characteristic - - Enable notifications/indications to receive data from the device - - On some platforms, you may need to write to a descriptor (e.g., `0x2902`) with value `0x01` or `0x02` - -5. **Send AppStart Command** - - Send the app start command (see [Commands](#commands)) to initialize communication - - Wait for OK response before sending other commands - -### Connection State Management - -- **Disconnected**: No connection established -- **Connecting**: Connection attempt in progress -- **Connected**: GATT connection established, ready for commands -- **Error**: Connection failed or lost + - Subscribe to notifications on the TX characteristic to receive data from the firmware + +5. **Send Initial Commands** + - Send `CMD_APP_START` to identify your app to firmware and get radio settings + - Send `CMD_DEVICE_QEURY` to fetch device info and negotiate supported protocol versions + - Send `CMD_SET_DEVICE_TIME` to set the firmware clock + - Send `CMD_GET_CONTACTS` to fetch all contacts + - Send `CMD_GET_CHANNEL` multiple times to fetch all channel slots + - Send `CMD_SYNC_NEXT_MESSAGE` to fetch the next message stored in firmware + - Setup listeners for push codes, such as `PUSH_CODE_MSG_WAITING` or `PUSH_CODE_ADVERT` + - See [Commands](#commands) section for information on other commands **Note**: MeshCore devices may disconnect after periods of inactivity. Implement auto-reconnect logic with exponential backoff. ### BLE Write Type -When writing commands to the TX characteristic, specify the write type: +When writing commands to the RX characteristic, specify the write type: - **Write with Response** (default): Waits for acknowledgment from device - **Write without Response**: Faster but no acknowledgment **Platform-specific**: + - **Android**: Use `BluetoothGattCharacteristic.WRITE_TYPE_DEFAULT` or `WRITE_TYPE_NO_RESPONSE` - **iOS**: Use `CBCharacteristicWriteType.withResponse` or `.withoutResponse` - **Python (bleak)**: Use `write_gatt_char()` with `response=True` or `False` -**Recommendation**: Use write with response for reliability, especially for critical commands like `SET_CHANNEL`. +**Recommendation**: Use write with response for reliability. ### MTU (Maximum Transmission Unit) The default BLE MTU is 23 bytes (20 bytes payload). For larger commands like `SET_CHANNEL` (66 bytes), you may need to: 1. **Request Larger MTU**: Request MTU of 512 bytes if supported - - Android: `gatt.requestMtu(512)` - - iOS: `peripheral.maximumWriteValueLength(for:)` - - Python (bleak): MTU is negotiated automatically + - Android: `gatt.requestMtu(512)` + - iOS: `peripheral.maximumWriteValueLength(for:)` + - Python (bleak): MTU is negotiated automatically -2. **Handle Chunking**: If MTU is small, commands may be split automatically by the BLE stack - - Ensure all chunks are sent before waiting for response - - Responses may also arrive in chunks - buffer until complete - -### Command Sequencing and Timing +### Command Sequencing **Critical**: Commands must be sent in the correct sequence: 1. **After Connection**: - - Wait for GATT connection established - - Wait for services/characteristics discovered - - Wait for notifications enabled (descriptor write complete) - - **Wait 200-1000ms** for device to be ready (some devices need initialization time) - - Send `APP_START` command - - **Wait for `PACKET_OK` response** before sending any other commands + - Wait for BLE connection to be established + - Wait for services/characteristics to be discovered + - Wait for notifications to be enabled + - Now you can safely send commands to the firmware 2. **Command-Response Matching**: - - Send one command at a time - - Wait for response before sending next command - - Use timeout (typically 5 seconds) - - Match response to command by: - - Command type (e.g., `GET_CHANNEL` → `PACKET_CHANNEL_INFO`) - - Sequence number (if implemented) - - First-in-first-out queue - -3. **Timing Considerations**: - - Minimum delay between commands: 50-100ms - - After `APP_START`: Wait 200-500ms before next command - - After `SET_CHANNEL`: Wait 500-1000ms for channel to be created - - After enabling notifications: Wait 200ms before sending commands - -**Example Flow**: -```python -# 1. Connect and discover -await connect_to_device(device) -await discover_services() -await enable_notifications() -await asyncio.sleep(0.2) # Wait for device ready - -# 2. Send AppStart -send_command(build_app_start()) -response = await wait_for_response(PACKET_OK, timeout=5.0) -if response.type != PACKET_OK: - raise Exception("AppStart failed") - -# 3. Now safe to send other commands -await asyncio.sleep(0.1) # Small delay between commands -send_command(build_device_query()) -response = await wait_for_response(PACKET_DEVICE_INFO, timeout=5.0) -``` + - Send one command at a time + - Wait for a response before sending another command + - Use a timeout (typically 5 seconds) + - Match response to command by type (e.g: `CMD_GET_CHANNEL` → `RESP_CODE_CHANNEL_INFO`) ### Command Queue Management -For reliable operation, implement a command queue: +For reliable operation, implement a command queue. -1. **Queue Structure**: - - Maintain a queue of pending commands - - Track which command is currently waiting for response - - Only send next command after receiving response or timeout +**Queue Structure**: -2. **Implementation**: -```python -class CommandQueue: - def __init__(self): - self.queue = [] - self.waiting_for_response = False - self.current_command = None - - async def send_command(self, command, expected_response_type, timeout=5.0): - if self.waiting_for_response: - # Queue the command - self.queue.append((command, expected_response_type, timeout)) - return - - self.waiting_for_response = True - self.current_command = (command, expected_response_type, timeout) - - # Send command - await write_to_tx_characteristic(command) - - # Wait for response - response = await wait_for_response(expected_response_type, timeout) - - self.waiting_for_response = False - self.current_command = None - - # Process next queued command - if self.queue: - next_cmd, next_type, next_timeout = self.queue.pop(0) - await self.send_command(next_cmd, next_type, next_timeout) - - return response -``` +- Maintain a queue of pending commands +- Track which command is currently waiting for a response +- Only send next command after receiving response or timeout + +**Error Handling**: -3. **Error Handling**: - - On timeout: Clear current command, process next in queue - - On error: Log error, clear current command, process next - - Don't block queue on single command failure +- On timeout, clear current command, process next in queue +- On error, log error, clear current command, process next --- -## Protocol Overview +## Packet Structure The MeshCore protocol uses a binary format with the following structure: -- **Commands**: Sent from client to device via TX characteristic -- **Responses**: Received from device via RX characteristic (notifications) -- **All multi-byte integers**: Little-endian byte order +- **Commands**: Sent from app to firmware via RX characteristic +- **Responses**: Received from firmware via TX characteristic notifications +- **All multi-byte integers**: Little-endian byte order (except CayenneLPP which is Big-endian) - **All strings**: UTF-8 encoding -### Packet Structure - Most packets follow this format: ``` [Packet Type (1 byte)] [Data (variable length)] @@ -283,7 +229,7 @@ Byte 1: Channel Index (0-7) Byte 0: 0x20 Byte 1: Channel Index (0-7) Bytes 2-33: Channel Name (32 bytes, UTF-8, null-padded) -Bytes 34-65: Secret (32 bytes, see [Secret Generation](#secret-generation)) +Bytes 34-65: Secret (32 bytes) ``` **Total Length**: 66 bytes @@ -298,7 +244,7 @@ Bytes 34-65: Secret (32 bytes, see [Secret Generation](#secret-generation)) - Padded with null bytes (0x00) if shorter **Secret Field** (32 bytes): -- For **private channels**: 32-byte secret (see [Secret Generation](#secret-generation)) +- For **private channels**: 32-byte secret - For **public channels**: All zeros (0x00) **Example** (create channel "YourChannelName" at index 1 with secret): @@ -380,170 +326,33 @@ Byte 0: 0x14 ### Channel Types -1. **Public Channels** (Index 0) - - No secret required - - Anyone with the channel name can join - - Use for open communication - -2. **Private Channels** (Indices 1-7) - - Require a 16-byte secret - - Secret is expanded to 32 bytes using SHA-512 (see [Secret Generation](#secret-generation)) - - Only devices with the secret can access the channel +1. **Public Channel** + - Uses a publicly known 16-byte key: `8b3387e9c5cdea6ac9e5edbaa115cd72` + - Anyone can join this channel, messages should be considered public + - Used as the default public group chat +2. **Hashtag Channels** + - Uses a secret key derived from the channel name + - It is the first 16 bytes of `sha256("#test")` + - For example hashtag channel `#test` has the key: `9cd8fcf22a47333b591d96a2b848b73f` + - Used as a topic based public group chat, separate from the default public channel +3. **Private Channels** + - Uses a randomly generated 16-byte secret key + - Messages should be considered private between those that know the secret + - Users should keep the key secret, and only share with those you want to communicate with + - Used as a secure private group chat ### Channel Lifecycle -1. **Create Channel**: - - Choose an available index (1-7 for private channels) - - Generate or provide a 16-byte secret - - Send `SET_CHANNEL` command with name and secret - - **Store the secret locally** (device does not return it) - -2. **Query Channel**: - - Send `GET_CHANNEL` command with channel index - - Parse `PACKET_CHANNEL_INFO` response - - Note: Secret will be null in response (security feature) - +1. **Set Channel**: + - Fetch all channel slots, and find one with empty name and all-zero secret + - Generate or provide a 16-byte secret + - Send `CMD_SET_CHANNEL` with name and secret +2. **Get Channel**: + - Send `CMD_GET_CHANNEL` with channel index + - Parse `RESP_CODE_CHANNEL_INFO` response 3. **Delete Channel**: - - Send `SET_CHANNEL` command with empty name and all-zero secret - - Or overwrite with a new channel - -### Channel Index Management - -- **Index 0**: Reserved for public channels -- **Indices 1-7**: Available for private channels -- If a channel exists at index 0 but should be private, migrate it to index 1-7 - ---- - -## Secret Generation and QR Codes - -### Secret Generation - -For private channels, generate a cryptographically secure 16-byte secret: - -**Pseudocode**: -```python -import secrets - -# Generate 16 random bytes -secret_bytes = secrets.token_bytes(16) - -# Convert to hex string for storage/sharing -secret_hex = secret_bytes.hex() # 32 hex characters -``` - -**Important**: Use a cryptographically secure random number generator (CSPRNG). Do not use predictable values. - -### Secret Expansion - -When sending the secret to the device via `SET_CHANNEL`, the 16-byte secret must be expanded to 32 bytes: - -**Process**: -1. Take the 16-byte secret -2. Compute SHA-512 hash: `hash = SHA-512(secret)` -3. Use the first 32 bytes of the hash as the secret field in the command - -**Pseudocode**: -```python -import hashlib - -secret_16_bytes = ... # Your 16-byte secret -sha512_hash = hashlib.sha512(secret_16_bytes).digest() # 64 bytes -secret_32_bytes = sha512_hash[:32] # First 32 bytes -``` - -This matches MeshCore's ED25519 key expansion method. - -### QR Code Format - -QR codes for sharing channel secrets use the following format: - -**URL Scheme**: -``` -meshcore://channel/add?name=&secret=<32HexChars> -``` - -**Parameters**: -- `name`: Channel name (URL-encoded if needed) -- `secret`: 32-character hexadecimal representation of the 16-byte secret - -**Example** (using example secret - NOT a real secret): -``` -meshcore://channel/add?name=YourChannelName&secret=9b647d242d6e1c5883fde0c5cf5c4c5e -``` - -**Alternative Formats** (for backward compatibility): - -1. **JSON Format**: -```json -{ - "name": "YourChannelName", - "secret": "9b647d242d6e1c5883fde0c5cf5c4c5e" -} -``` -*Note: The secret value above is an example only - generate your own secure random secret.* - -2. **Plain Hex** (32 hex characters): -``` -9b647d242d6e1c5883fde0c5cf5c4c5e -``` -*Note: This is an example hex value - always generate your own cryptographically secure random secret.* - -### QR Code Generation - -**Steps**: -1. Generate or use existing 16-byte secret -2. Convert to 32-character hex string (lowercase) -3. URL-encode the channel name -4. Construct the `meshcore://` URL -5. Generate QR code from the URL string - -**Example** (Python with `qrcode` library): -```python -import qrcode -from urllib.parse import quote -import secrets - -channel_name = "YourChannelName" -# Generate a real cryptographically secure secret (NOT the example value) -secret_bytes = secrets.token_bytes(16) -secret_hex = secret_bytes.hex() # This will be a different value each time - -# Example value shown in documentation: "9b647d242d6e1c5883fde0c5cf5c4c5e" -# DO NOT use the example value - always generate your own! - -url = f"meshcore://channel/add?name={quote(channel_name)}&secret={secret_hex}" -qr = qrcode.QRCode(version=1, box_size=10, border=5) -qr.add_data(url) -qr.make(fit=True) -img = qr.make_image(fill_color="black", back_color="white") -img.save("channel_qr.png") -``` - -### QR Code Scanning - -When scanning a QR code: - -1. **Parse URL Format**: - - Extract `name` and `secret` query parameters - - Validate secret is 32 hex characters - -2. **Parse JSON Format**: - - Parse JSON object - - Extract `name` and `secret` fields - -3. **Parse Plain Hex**: - - Extract only hex characters (0-9, a-f, A-F) - - Validate length is 32 characters - - Convert to lowercase - -4. **Validate Secret**: - - Must be exactly 32 hex characters (16 bytes) - - Convert hex string to bytes - -5. **Create Channel**: - - Use extracted name and secret - - Send `SET_CHANNEL` command + - Send `CMD_SET_CHANNEL` with empty name and all-zero secret + - Or overwrite with a new channel --- @@ -693,28 +502,28 @@ Use the `SEND_CHANNEL_MESSAGE` command (see [Commands](#commands)). ### Packet Types -| Value | Name | Description | -|-------|------|-------------| -| 0x00 | PACKET_OK | Command succeeded | -| 0x01 | PACKET_ERROR | Command failed | -| 0x02 | PACKET_CONTACT_START | Start of contact list | -| 0x03 | PACKET_CONTACT | Contact information | -| 0x04 | PACKET_CONTACT_END | End of contact list | -| 0x05 | PACKET_SELF_INFO | Device self-information | -| 0x06 | PACKET_MSG_SENT | Message sent confirmation | -| 0x07 | PACKET_CONTACT_MSG_RECV | Contact message (standard) | -| 0x08 | PACKET_CHANNEL_MSG_RECV | Channel message (standard) | -| 0x09 | PACKET_CURRENT_TIME | Current time response | -| 0x0A | PACKET_NO_MORE_MSGS | No more messages available | -| 0x0C | PACKET_BATTERY | Battery level | -| 0x0D | PACKET_DEVICE_INFO | Device information | -| 0x10 | PACKET_CONTACT_MSG_RECV_V3 | Contact message (V3 with SNR) | -| 0x11 | PACKET_CHANNEL_MSG_RECV_V3 | Channel message (V3 with SNR) | -| 0x12 | PACKET_CHANNEL_INFO | Channel information | -| 0x80 | PACKET_ADVERTISEMENT | Advertisement packet | -| 0x82 | PACKET_ACK | Acknowledgment | -| 0x83 | PACKET_MESSAGES_WAITING | Messages waiting notification | -| 0x88 | PACKET_LOG_DATA | RF log data (can be ignored) | +| Value | Name | Description | +|-------|----------------------------|-------------------------------| +| 0x00 | PACKET_OK | Command succeeded | +| 0x01 | PACKET_ERROR | Command failed | +| 0x02 | PACKET_CONTACT_START | Start of contact list | +| 0x03 | PACKET_CONTACT | Contact information | +| 0x04 | PACKET_CONTACT_END | End of contact list | +| 0x05 | PACKET_SELF_INFO | Device self-information | +| 0x06 | PACKET_MSG_SENT | Message sent confirmation | +| 0x07 | PACKET_CONTACT_MSG_RECV | Contact message (standard) | +| 0x08 | PACKET_CHANNEL_MSG_RECV | Channel message (standard) | +| 0x09 | PACKET_CURRENT_TIME | Current time response | +| 0x0A | PACKET_NO_MORE_MSGS | No more messages available | +| 0x0C | PACKET_BATTERY | Battery level | +| 0x0D | PACKET_DEVICE_INFO | Device information | +| 0x10 | PACKET_CONTACT_MSG_RECV_V3 | Contact message (V3 with SNR) | +| 0x11 | PACKET_CHANNEL_MSG_RECV_V3 | Channel message (V3 with SNR) | +| 0x12 | PACKET_CHANNEL_INFO | Channel information | +| 0x80 | PACKET_ADVERTISEMENT | Advertisement packet | +| 0x82 | PACKET_ACK | Acknowledgment | +| 0x83 | PACKET_MESSAGES_WAITING | Messages waiting notification | +| 0x88 | PACKET_LOG_DATA | RF log data (can be ignored) | ### Parsing Responses @@ -1081,33 +890,6 @@ def on_notification_received(data): send_command(tx_char, build_get_message()) ``` -### QR Code Sharing - -```python -import secrets -from urllib.parse import quote - -# 1. Generate QR code data -channel_name = "YourChannelName" -# Generate a real secret (NOT the example value from documentation) -secret_bytes = secrets.token_bytes(16) -secret_hex = secret_bytes.hex() - -# Example value in documentation: "9b647d242d6e1c5883fde0c5cf5c4c5e" -# DO NOT use example values - always generate your own secure random secrets! - -url = f"meshcore://channel/add?name={quote(channel_name)}&secret={secret_hex}" - -# 2. Generate QR code image -qr = qrcode.QRCode(version=1, box_size=10, border=5) -qr.add_data(url) -qr.make(fit=True) -img = qr.make_image(fill_color="black", back_color="white") - -# 3. Display or save QR code -img.save("channel_qr.png") -``` - --- ## Best Practices @@ -1121,81 +903,37 @@ img.save("channel_qr.png") - Always use cryptographically secure random number generators - Store secrets securely (encrypted storage) - Never log or transmit secrets in plain text - - Device does not return secrets - you must store them locally 3. **Message Handling**: - - Poll `GET_MESSAGE` periodically or when `PACKET_MESSAGES_WAITING` is received - - Handle message chunking for long messages (>133 characters) - - Implement message deduplication to avoid processing the same message twice - -4. **Error Handling**: - - Implement timeouts for all commands (typically 5 seconds) - - Handle `PACKET_ERROR` responses appropriately - - Log errors for debugging but don't expose sensitive information - -5. **Channel Management**: - - Avoid using channel index 0 for private channels - - Migrate channels from index 0 to 1-7 if needed - - Query channels after connection to discover existing channels - ---- - -## Platform-Specific Notes - -### Android -- Use `BluetoothGatt` API -- Request `BLUETOOTH_CONNECT` and `BLUETOOTH_SCAN` permissions (Android 12+) -- Enable notifications by writing to descriptor `0x2902` with value `0x01` or `0x02` + - Send `CMD_SYNC_NEXT_MESSAGE` when `PUSH_CODE_MSG_WAITING` is received + - Implement message deduplication to avoid display the same message twice -### iOS -- Use `CoreBluetooth` framework -- Implement `CBPeripheralDelegate` for notifications -- Request Bluetooth permissions in Info.plist +4. **Channel Management**: + - Fetch all channel slots even if you encounter an empty slot + - Ideally save new channels into the first empty slot -### Python -- Use `bleak` library for cross-platform BLE support -- Handle async/await for BLE operations -- Use `asyncio` for command-response patterns - -### JavaScript/Node.js -- Use `noble` or `@abandonware/noble` for BLE -- Handle callbacks or promises for async operations -- Use `Buffer` for binary data manipulation +5. **Error Handling**: + - Implement timeouts for all commands (typically 5 seconds) + - Handle `RESP_CODE_ERR` responses appropriately --- ## Troubleshooting ### Connection Issues + - **Device not found**: Ensure device is powered on and advertising - **Connection timeout**: Check Bluetooth permissions and device proximity - **GATT errors**: Ensure proper service/characteristic discovery ### Command Issues + - **No response**: Verify notifications are enabled, check connection state -- **Error responses**: Verify command format, check channel index validity -- **Timeout**: Increase timeout value or check device responsiveness +- **Error responses**: Verify command format and check error code +- **Timeout**: Increase timeout value or try again ### Message Issues -- **Messages not received**: Poll `GET_MESSAGE` command periodically -- **Duplicate messages**: Implement message deduplication using timestamps/hashes -- **Message truncation**: Split long messages into chunks - -### Secret/Channel Issues -- **Secret not working**: Verify secret expansion (SHA-512) is correct -- **Channel not found**: Query channels after connection to discover existing channels -- **Channel index 0**: Migrate to index 1-7 for private channels - ---- - -## References - -- MeshCore Python implementation: `meshcore_py-main/src/meshcore/` -- BLE GATT Specification: Bluetooth SIG Core Specification -- ED25519 Key Expansion: RFC 8032 - ---- - -**Last Updated**: 2025-01-01 -**Protocol Version**: Based on MeshCore v1.36.0+ +- **Messages not received**: Poll `GET_MESSAGE` command periodically +- **Duplicate messages**: Implement message deduplication using timestamp/content as a unique id +- **Message truncation**: Send long messages as separate shorter messages diff --git a/docs/docs.md b/docs/docs.md new file mode 100644 index 000000000..7fab4bb7d --- /dev/null +++ b/docs/docs.md @@ -0,0 +1,13 @@ +# Local Documentation + +This document explains how to build and view the MeshCore documentation locally. + +## Building and viewing Docs + +``` +pip install mkdocs +pip install mkdocs-material +``` + +- `mkdocs serve` - Start the live-reloading docs server. +- `mkdocs build` - Build the documentation site. diff --git a/docs/faq.md b/docs/faq.md index 66a942a4a..94d46d367 100644 --- a/docs/faq.md +++ b/docs/faq.md @@ -1,11 +1,6 @@ -**MeshCore-FAQ** -A list of frequently-asked questions and answers for MeshCore - -The current version of this MeshCore FAQ is at https://github.com/meshcore-dev/MeshCore/blob/main/docs/faq.md. -This MeshCore FAQ is also mirrored at https://github.com/LitBomb/MeshCore-FAQ and might have newer updates if pull requests on Scott's MeshCore repo are not approved yet. +# Frequently Asked Questions -author: https://github.com/LitBomb ---- +A list of frequently-asked questions and answers for MeshCore - [1. Introduction](#1-introduction) - [1.1. Q: What is MeshCore?](#11-q-what-is-meshcore) @@ -112,15 +107,15 @@ Anyone is able to build anything they like on top of MeshCore without paying any ### 1.2. Q: What do you need to start using MeshCore? **A:** Everything you need for MeshCore is available at: - Main web site: [https://meshcore.co.uk/](https://meshcore.co.uk/) - Firmware Flasher: https://flasher.meshcore.co.uk/ - Phone Client Applications: https://meshcore.co.uk/apps.html - MeshCore Firmware GitHub: https://github.com/ripplebiz/MeshCore - - NOTE: Andy Kirby has a very useful [intro video](https://www.youtube.com/watch?v=t1qne8uJBAc) for beginners. +- Main web site: [https://meshcore.co.uk](https://meshcore.co.uk) +- Firmware Flasher: [https://flasher.meshcore.co.uk](https://flasher.meshcore.co.uk) +- MeshCore Firmware on GitHub: [https://github.com/meshcore-dev/MeshCore](https://github.com/meshcore-dev/MeshCore) +- MeshCore Companion App: [https://meshcore.nz](https://meshcore.nz) +- MeshCore Map: [https://meshcore.co.uk/map.html](https://meshcore.co.uk/map.html) +- Andy Kirby has a very useful [intro video](https://www.youtube.com/watch?v=t1qne8uJBAc) for beginners. - You need LoRa hardware devices to run MeshCore firmware as clients or server (repeater and room server). +You need LoRa hardware devices to run MeshCore firmware as clients or server (repeater and room server). #### 1.2.1. Hardware MeshCore is available on a variety of 433MHz, 868MHz and 915MHz LoRa devices. For example, Lilygo T-Deck, T-Pager, RAK Wireless WisBlock RAK4631 devices (e.g. 19003, 19007, 19026), Heltec V3, Xiao S3 WIO, Xiao C3, Heltec T114, Station G2, Nano G2 Ultra, Seeed Studio T1000-E. More devices are being added regularly. @@ -535,7 +530,7 @@ MeshCore clients would need to reset path constantly and flood traffic across th This could change in the future if MeshCore develops a client firmware that repeats. [Source](https://discord.com/channels/826570251612323860/1330643963501351004/1354780032140054659) -### 5.12. Q: How do I add a node to the [MeshCore Map]([url](https://meshcore.co.uk/map.html)) +### 5.12. Q: How do I add a node to the [MeshCore Map](https://meshcore.co.uk/map.html) **A:** To add a BLE Companion radio, connect to the BLE Companion radio from the MeshCore smartphone app. In the app, tap the `3 dot` menu icon at the top right corner, then tap `Internet Map`. Tap the `3 dot` menu icon again and choose `Add me to the Map` diff --git a/docs/index.md b/docs/index.md index b4fb262b1..f4394f756 100644 --- a/docs/index.md +++ b/docs/index.md @@ -1,13 +1,15 @@ -# Welcome +# Introduction Welcome to the MeshCore documentation. -## Building and viewing Docs +Below are a few quick start guides. -``` -pip install mkdocs -pip install mkdocs-material -``` +- [Frequently Asked Questions](./faq.md) +- [CLI Commands](./cli_commands.md) +- [Companion Protocol](./companion_protocol.md) +- [Packet Structure](./packet_structure.md) +- [QR Codes](./qr_codes.md) -* `mkdocs serve` - Start the live-reloading docs server. -* `mkdocs build` - Build the documentation site. +If you find a mistake in any of our documentation, or find something is missing, please feel free to open a pull request for us to review. + +- [Documentation Source](https://github.com/meshcore-dev/MeshCore/tree/main/docs) diff --git a/docs/qr_codes.md b/docs/qr_codes.md new file mode 100644 index 000000000..364efa8ac --- /dev/null +++ b/docs/qr_codes.md @@ -0,0 +1,34 @@ +# QR Codes + +This document provides an overview of QR Code formats that can be used for sharing MeshCore channels and contacts. The formats described below are supported by the MeshCore mobile app. + +## Add Channel + +**Example URL**: + +``` +meshcore://channel/add?name=Public&secret=8b3387e9c5cdea6ac9e5edbaa115cd72 +``` + +**Parameters**: + +- `name`: Channel name (URL-encoded if needed) +- `secret`: 16-byte secret represented as 32 hex characters + +## Add Contact + +**Example URL**: + +``` +meshcore://contact/add?name=Example+Contact&public_key=9cd8fcf22a47333b591d96a2b848b73f457b1bb1a3ea2453a885f9e5787765b1&type=1 +``` + +**Parameters**: + +- `name`: Contact name (URL-encoded if needed) +- `public_key`: 32-byte public key represented as 64 hex characters +- `type`: numeric contact type + - `1`: Companion + - `2`: Repeater + - `3`: Room Server + - `4`: Sensor diff --git a/docs/terminal_chat_cli.md b/docs/terminal_chat_cli.md new file mode 100644 index 000000000..f053e64d8 --- /dev/null +++ b/docs/terminal_chat_cli.md @@ -0,0 +1,96 @@ +# Terminal Chat CLI + +Below are the commands you can enter into the Terminal Chat clients: + +``` +set freq {frequency} +``` +Set the LoRa frequency. Example: set freq 915.8 + +``` +set tx {tx-power-dbm} +``` +Sets LoRa transmit power in dBm. + +``` +set name {name} +``` +Sets your advertisement name. + +``` +set lat {latitude} +``` +Sets your advertisement map latitude. (decimal degrees) + +``` +set lon {longitude} +``` +Sets your advertisement map longitude. (decimal degrees) + +``` +set af {air-time-factor} +``` +Sets the transmit air-time-factor. + + +``` +time {epoch-secs} +``` +Set the device clock using UNIX epoch seconds. Example: time 1738242833 + + +``` +advert +``` +Sends an advertisement packet + +``` +clock +``` +Displays current time per device's clock. + + +``` +ver +``` +Shows the device version and firmware build date. + +``` +card +``` +Displays *your* 'business card', for other to manually _import_ + +``` +import {card} +``` +Imports the given card to your contacts. + +``` +list {n} +``` +List all contacts by most recent. (optional {n}, is the last n by advertisement date) + +``` +to +``` +Shows the name of current recipient contact. (for subsequent 'send' commands) + +``` +to {name-prefix} +``` +Sets the recipient to the _first_ matching contact (in 'list') by the name prefix. (ie. you don't have to type whole name) + +``` +send {text} +``` +Sends the text message (as DM) to current recipient. + +``` +reset path +``` +Resets the path to current recipient, for new path discovery. + +``` +public {text} +``` +Sends the text message to the built-in 'public' group channel From dccdc4d958be339ab15f2e85b1fb49c24764fb5a Mon Sep 17 00:00:00 2001 From: Don Patterson Date: Tue, 3 Feb 2026 18:06:23 -0800 Subject: [PATCH 21/29] Fix URLs --- docs/faq.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/faq.md b/docs/faq.md index 94d46d367..79c4e9a8a 100644 --- a/docs/faq.md +++ b/docs/faq.md @@ -290,7 +290,7 @@ This is a very low cost operation. AGC reset is done by simply setting `state = ### 3.8 Q: How do I make my repeater an observer on the mesh -**A:** The observer instruction is available here: https://analyzer.letsme.sh/observer/onboard +**A:** The observer instruction is available here: https://analyzer.letsmesh.net/observer/onboard --- @@ -607,7 +607,7 @@ From here, reference repeater and room server command line commands on MeshCore **A:** Yes. See the following: #### 5.14.1. meshcoremqtt -A Python script to send meshcore debug and packet capture data to MQTT for analysis. Cisien's version is a fork of Andrew-a-g's and is being used to to collect data for https://map.w0z.is/messages and https://analyzer.letsme.sh/ +A Python script to send meshcore debug and packet capture data to MQTT for analysis. Cisien's version is a fork of Andrew-a-g's and is being used to to collect data for https://map.w0z.is/messages and https://analyzer.letsmesh.net/ https://github.com/Cisien/meshcoretomqtt https://github.com/Andrew-a-g/meshcoretomqtt @@ -632,7 +632,7 @@ pyMC_Core is a Python port of MeshCore, designed for Raspberry Pi and similar ha https://github.com/rightup/pyMC_core #### 5.14.7. MeshCore Packet Decoder -A TypeScript library for decoding MeshCore mesh networking packets with full cryptographic support. Uses WebAssembly (WASM) for Ed25519 key derivation through the orlp/ed25519 library. It powers the [MeshCore Packet Analyzer](https://analyzer.letsme.sh/packets). +A TypeScript library for decoding MeshCore mesh networking packets with full cryptographic support. Uses WebAssembly (WASM) for Ed25519 key derivation through the orlp/ed25519 library. It powers the [MeshCore Packet Analyzer](https://analyzer.letsmesh.net/packets). https://github.com/michaelhart/meshcore-decoder #### 5.14.8. meshcore-pi From 6564bbd58e7b7e6d8f6cb2adc167c5c8c5ace551 Mon Sep 17 00:00:00 2001 From: liamcottle Date: Sun, 8 Feb 2026 13:00:59 +1300 Subject: [PATCH 22/29] migrate docs build script so cname survives --- .github/workflows/github-pages.yml | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/.github/workflows/github-pages.yml b/.github/workflows/github-pages.yml index e1ef22385..a3f53e3f3 100644 --- a/.github/workflows/github-pages.yml +++ b/.github/workflows/github-pages.yml @@ -23,12 +23,15 @@ jobs: with: ruby-version: 3.x - - name: Configure Git Credentials - run: | - git config user.name github-actions[bot] - git config user.email 41898282+github-actions[bot]@users.noreply.github.com - - - name: Build and Deploy + - name: Build run: | pip install mkdocs-material - mkdocs gh-deploy --force + mkdocs build + + - name: Deploy to GitHub Pages + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + cname: docs.meshcore.nz + publish_dir: ./site + publish_branch: 'gh-pages' From 85aa052e1f35ca582b7cf9094e10ce6997a3e506 Mon Sep 17 00:00:00 2001 From: liamcottle Date: Sun, 8 Feb 2026 13:01:13 +1300 Subject: [PATCH 23/29] only deploy docs from main branch --- .github/workflows/github-pages.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/github-pages.yml b/.github/workflows/github-pages.yml index a3f53e3f3..d50a044c5 100644 --- a/.github/workflows/github-pages.yml +++ b/.github/workflows/github-pages.yml @@ -5,7 +5,6 @@ on: push: branches: - main - - docs permissions: contents: write From 4224ddff0bd96453941a8afccb7ca381d9df680d Mon Sep 17 00:00:00 2001 From: liamcottle Date: Sun, 8 Feb 2026 14:05:37 +1300 Subject: [PATCH 24/29] refactor packet format docs --- docs/index.md | 2 +- docs/packet_format.md | 120 +++++++++++++++++++++++++++++++++++++++ docs/packet_structure.md | 60 -------------------- docs/payloads.md | 17 +++--- 4 files changed, 130 insertions(+), 69 deletions(-) create mode 100644 docs/packet_format.md delete mode 100644 docs/packet_structure.md diff --git a/docs/index.md b/docs/index.md index f4394f756..9460a00c5 100644 --- a/docs/index.md +++ b/docs/index.md @@ -7,7 +7,7 @@ Below are a few quick start guides. - [Frequently Asked Questions](./faq.md) - [CLI Commands](./cli_commands.md) - [Companion Protocol](./companion_protocol.md) -- [Packet Structure](./packet_structure.md) +- [Packet Format](./packet_format.md) - [QR Codes](./qr_codes.md) If you find a mistake in any of our documentation, or find something is missing, please feel free to open a pull request for us to review. diff --git a/docs/packet_format.md b/docs/packet_format.md new file mode 100644 index 000000000..50f9c01a7 --- /dev/null +++ b/docs/packet_format.md @@ -0,0 +1,120 @@ +# Packet Format + +This document describes the MeshCore packet format. + +- `0xYY` indicates `YY` in hex notation. +- `0bYY` indicates `YY` in binary notation. +- Bit 0 indicates the bit furthest to the right: `0000000X` +- Bit 7 indicates the bit furthest to the left: `X0000000` + +## Version 1 Packet Format + +This is the protocol level packet structure used in MeshCore firmware v1.12.0 + +``` +[header][transport_codes(optional)][path_length][path][payload] +``` + +- [header](#header-format) - 1 byte + - 8-bit Format: `0bVVPPPPRR` - `V=Version` - `P=PayloadType` - `R=RouteType` + - Bits 0-1 - 2-bits - [Route Type](#route-types) + - `0x00`/`0b00` - `ROUTE_TYPE_TRANSPORT_FLOOD` - Flood Routing + Transport Codes + - `0x01`/`0b01` - `ROUTE_TYPE_FLOOD` - Flood Routing + - `0x02`/`0b10` - `ROUTE_TYPE_DIRECT` - Direct Routing + - `0x03`/`0b11` - `ROUTE_TYPE_TRANSPORT_DIRECT` - Direct Routing + Transport Codes + - Bits 2-5 - 4-bits - [Payload Type](#payload-types) + - `0x00`/`0b0000` - `PAYLOAD_TYPE_REQ` - Request (destination/source hashes + MAC) + - `0x01`/`0b0001` - `PAYLOAD_TYPE_RESPONSE` - Response to `REQ` or `ANON_REQ` + - `0x02`/`0b0010` - `PAYLOAD_TYPE_TXT_MSG` - Plain text message + - `0x03`/`0b0011` - `PAYLOAD_TYPE_ACK` - Acknowledgment + - `0x04`/`0b0100` - `PAYLOAD_TYPE_ADVERT` - Node advertisement + - `0x05`/`0b0101` - `PAYLOAD_TYPE_GRP_TXT` - Group text message (unverified) + - `0x06`/`0b0110` - `PAYLOAD_TYPE_GRP_DATA` - Group datagram (unverified) + - `0x07`/`0b0111` - `PAYLOAD_TYPE_ANON_REQ` - Anonymous request + - `0x08`/`0b1000` - `PAYLOAD_TYPE_PATH` - Returned path + - `0x09`/`0b1001` - `PAYLOAD_TYPE_TRACE` - Trace a path, collecting SNR for each hop + - `0x0A`/`0b1010` - `PAYLOAD_TYPE_MULTIPART` - Packet is part of a sequence of packets + - `0x0B`/`0b1011` - `PAYLOAD_TYPE_CONTROL` - Control packet data (unencrypted) + - `0x0C`/`0b1100` - reserved + - `0x0D`/`0b1101` - reserved + - `0x0E`/`0b1110` - reserved + - `0x0F`/`0b1111` - `PAYLOAD_TYPE_RAW_CUSTOM` - Custom packet (raw bytes, custom encryption) + - Bits 6-7 - 2-bits - [Payload Version](#payload-versions) + - `0x00`/`0b00` - v1 - 1-byte src/dest hashes, 2-byte MAC + - `0x01`/`0b01` - v2 - Future version (e.g., 2-byte hashes, 4-byte MAC) + - `0x02`/`0b10` - v3 - Future version + - `0x03`/`0b11` - v4 - Future version +- `transport_codes` - 4 bytes (optional) + - Only present for `ROUTE_TYPE_TRANSPORT_FLOOD` and `ROUTE_TYPE_TRANSPORT_DIRECT` + - `transport_code_1` - 2 bytes - `uint16_t` - calculated from region scope + - `transport_code_2` - 2 bytes - `uint16_t` - reserved +- `path_length` - 1 byte - Length of the path field in bytes +- `path` - size provided by `path_length` - Path to use for Direct Routing + - Up to a maximum of 64 bytes, defined by `MAX_PATH_SIZE` + - v1.12.0 firmware and older drops packets with `path_length` [larger than 64](https://github.com/meshcore-dev/MeshCore/blob/e812632235274ffd2382adf5354168aec765d416/src/Dispatcher.cpp#L144) +- `payload` - variable length - Payload Data + - Up to a maximum 184 bytes, defined by `MAX_PACKET_PAYLOAD` + - Generally this is the remainder of the raw packet data + - The firmware parses this data based on the provided Payload Type + - v1.12.0 firmware and older drops packets with `payload` sizes [larger than 184](https://github.com/meshcore-dev/MeshCore/blob/e812632235274ffd2382adf5354168aec765d416/src/Dispatcher.cpp#L152) + +### Packet Format + +| Field | Size (bytes) | Description | +|-----------------|----------------------------------|----------------------------------------------------------| +| header | 1 | Contains routing type, payload type, and payload version | +| transport_codes | 4 (optional) | 2x 16-bit transport codes (if ROUTE_TYPE_TRANSPORT_*) | +| path_length | 1 | Length of the path field in bytes | +| path | up to 64 (`MAX_PATH_SIZE`) | Stores the routing path if applicable | +| payload | up to 184 (`MAX_PACKET_PAYLOAD`) | Data for the provided Payload Type | + +> NOTE: see the [Payloads](./payloads.md) documentation for more information about the content of specific payload types. + +### Header Format + +Bit 0 means the lowest bit (1s place) + +| Bits | Mask | Field | Description | +|------|--------|-----------------|----------------------------------| +| 0-1 | `0x03` | Route Type | Flood, Direct, etc | +| 2-5 | `0x3C` | Payload Type | Request, Response, ACK, etc | +| 6-7 | `0xC0` | Payload Version | Versioning of the payload format | + +### Route Types + +| Value | Name | Description | +|--------|-------------------------------|----------------------------------| +| `0x00` | `ROUTE_TYPE_TRANSPORT_FLOOD` | Flood Routing + Transport Codes | +| `0x01` | `ROUTE_TYPE_FLOOD` | Flood Routing | +| `0x02` | `ROUTE_TYPE_DIRECT` | Direct Routing | +| `0x03` | `ROUTE_TYPE_TRANSPORT_DIRECT` | Direct Routing + Transport Codes | + +### Payload Types + +| Value | Name | Description | +|--------|---------------------------|----------------------------------------------| +| `0x00` | `PAYLOAD_TYPE_REQ` | Request (destination/source hashes + MAC) | +| `0x01` | `PAYLOAD_TYPE_RESPONSE` | Response to `REQ` or `ANON_REQ` | +| `0x02` | `PAYLOAD_TYPE_TXT_MSG` | Plain text message | +| `0x03` | `PAYLOAD_TYPE_ACK` | Acknowledgment | +| `0x04` | `PAYLOAD_TYPE_ADVERT` | Node advertisement | +| `0x05` | `PAYLOAD_TYPE_GRP_TXT` | Group text message (unverified) | +| `0x06` | `PAYLOAD_TYPE_GRP_DATA` | Group datagram (unverified) | +| `0x07` | `PAYLOAD_TYPE_ANON_REQ` | Anonymous request | +| `0x08` | `PAYLOAD_TYPE_PATH` | Returned path | +| `0x09` | `PAYLOAD_TYPE_TRACE` | Trace a path, collecting SNR for each hop | +| `0x0A` | `PAYLOAD_TYPE_MULTIPART` | Packet is part of a sequence of packets | +| `0x0B` | `PAYLOAD_TYPE_CONTROL` | Control packet data (unencrypted) | +| `0x0C` | reserved | reserved | +| `0x0D` | reserved | reserved | +| `0x0E` | reserved | reserved | +| `0x0F` | `PAYLOAD_TYPE_RAW_CUSTOM` | Custom packet (raw bytes, custom encryption) | + +### Payload Versions + +| Value | Version | Description | +|--------|---------|--------------------------------------------------| +| `0x00` | 1 | 1-byte src/dest hashes, 2-byte MAC | +| `0x01` | 2 | Future version (e.g., 2-byte hashes, 4-byte MAC) | +| `0x02` | 3 | Future version | +| `0x03` | 4 | Future version | diff --git a/docs/packet_structure.md b/docs/packet_structure.md deleted file mode 100644 index 92c410be5..000000000 --- a/docs/packet_structure.md +++ /dev/null @@ -1,60 +0,0 @@ -# Packet Structure - -| Field | Size (bytes) | Description | -|-----------------|----------------------------------|-----------------------------------------------------------| -| header | 1 | Contains routing type, payload type, and payload version. | -| transport_codes | 4 (optional) | 2x 16-bit transport codes (if ROUTE_TYPE_TRANSPORT_*) | -| path_len | 1 | Length of the path field in bytes. | -| path | up to 64 (`MAX_PATH_SIZE`) | Stores the routing path if applicable. | -| payload | up to 184 (`MAX_PACKET_PAYLOAD`) | The actual data being transmitted. | - -Note: see the [payloads doc](./payloads.md) for more information about the content of payload. - -## Header Breakdown - -bit 0 means the lowest bit (1s place) - -| Bits | Mask | Field | Description | -|-------|--------|-----------------|-----------------------------------------------| -| 0-1 | `0x03` | Route Type | Flood, Direct, Reserved - see below. | -| 2-5 | `0x3C` | Payload Type | Request, Response, ACK, etc. - see below. | -| 6-7 | `0xC0` | Payload Version | Versioning of the payload format - see below. | - -## Route Type Values - -| Value | Name | Description | -|--------|-------------------------------|--------------------------------------| -| `0x00` | `ROUTE_TYPE_TRANSPORT_FLOOD` | Flood routing mode + transport codes | -| `0x01` | `ROUTE_TYPE_FLOOD` | Flood routing mode (builds up path). | -| `0x02` | `ROUTE_TYPE_DIRECT` | Direct route (path is supplied). | -| `0x03` | `ROUTE_TYPE_TRANSPORT_DIRECT` | direct route + transport codes | - -## Payload Type Values - -| Value | Name | Description | -|--------|---------------------------|-----------------------------------------------| -| `0x00` | `PAYLOAD_TYPE_REQ` | Request (destination/source hashes + MAC). | -| `0x01` | `PAYLOAD_TYPE_RESPONSE` | Response to REQ or ANON_REQ. | -| `0x02` | `PAYLOAD_TYPE_TXT_MSG` | Plain text message. | -| `0x03` | `PAYLOAD_TYPE_ACK` | Acknowledgment. | -| `0x04` | `PAYLOAD_TYPE_ADVERT` | Node advertisement. | -| `0x05` | `PAYLOAD_TYPE_GRP_TXT` | Group text message (unverified). | -| `0x06` | `PAYLOAD_TYPE_GRP_DATA` | Group datagram (unverified). | -| `0x07` | `PAYLOAD_TYPE_ANON_REQ` | Anonymous request. | -| `0x08` | `PAYLOAD_TYPE_PATH` | Returned path. | -| `0x09` | `PAYLOAD_TYPE_TRACE` | trace a path, collecting SNI for each hop. | -| `0x0A` | `PAYLOAD_TYPE_MULTIPART` | packet is part of a sequence of packets. | -| `0x0B` | `PAYLOAD_TYPE_CONTROL` | control packet data (unencrypted) | -| `0x0C` | . | reserved | -| `0x0D` | . | reserved | -| `0x0E` | . | reserved | -| `0x0F` | `PAYLOAD_TYPE_RAW_CUSTOM` | Custom packet (raw bytes, custom encryption). | - -## Payload Version Values - -| Value | Version | Description | -|--------|---------|---------------------------------------------------| -| `0x00` | 1 | 1-byte src/dest hashes, 2-byte MAC. | -| `0x01` | 2 | Future version (e.g., 2-byte hashes, 4-byte MAC). | -| `0x02` | 3 | Future version. | -| `0x03` | 4 | Future version. | diff --git a/docs/payloads.md b/docs/payloads.md index aaa84166e..3648b6557 100644 --- a/docs/payloads.md +++ b/docs/payloads.md @@ -1,5 +1,6 @@ -# Meshcore payloads -Inside of each [meshcore packet](./packet_structure.md) is a payload, identified by the payload type in the packet header. The types of payloads are: +# Payload Format + +Inside each [MeshCore Packet](./packet_format.md) is a payload, identified by the payload type in the packet header. The types of payloads are: * Node advertisement. * Acknowledgment. @@ -80,12 +81,12 @@ Returned path, request, response, and plain text messages are all formatted in t Returned path messages provide a description of the route a packet took from the original author. Receivers will send returned path messages to the author of the original message. -| Field | Size (bytes) | Description | -|-------------|--------------|----------------------------------------------------------------------------------------------| -| path length | 1 | length of next field | -| path | see above | a list of node hashes (one byte each) | -| extra type | 1 | extra, bundled payload type, eg., acknowledgement or response. Same values as in [packet structure](./packet_structure.md) | -| extra | rest of data | extra, bundled payload content, follows same format as main content defined by this document | +| Field | Size (bytes) | Description | +|-------------|--------------|----------------------------------------------------------------------------------------------------------------------| +| path length | 1 | length of next field | +| path | see above | a list of node hashes (one byte each) | +| extra type | 1 | extra, bundled payload type, eg., acknowledgement or response. Same values as in [Packet Format](./packet_format.md) | +| extra | rest of data | extra, bundled payload content, follows same format as main content defined by this document | ## Request From 246f5352d6c6f2327079b103e32112124401e09b Mon Sep 17 00:00:00 2001 From: Jeroen Vermeulen Date: Fri, 20 Feb 2026 20:48:48 +0100 Subject: [PATCH 25/29] Update admin password command description Tested in v1.13. These commands don't work anymore: ``` get password -> ??: password set password secret -> unknown config: password secret ``` This does work: ``` password secret -> password now: secret ``` --- docs/cli_commands.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/docs/cli_commands.md b/docs/cli_commands.md index d2460c46d..7ade97066 100644 --- a/docs/cli_commands.md +++ b/docs/cli_commands.md @@ -293,10 +293,9 @@ This document provides an overview of CLI commands that can be sent to MeshCore --- -#### View or change this node's admin password +#### Change this node's admin password **Usage:** -- `get password` -- `set password ` +- `password ` **Parameters:** - `password`: Admin password From 5e24d03a9148b246e5f6d8e2a6c427cc9204ebfa Mon Sep 17 00:00:00 2001 From: dreirund <1590519+dreirund@users.noreply.github.com> Date: Tue, 24 Feb 2026 13:26:30 +0100 Subject: [PATCH 26/29] faq.md: Section 5.14: Added more external projects. Added to section 5.14 "Are there are projects built around MeshCore?": * awesome-meshcore * meshcore-open * MeshCore-Cardputer-ADV * LunarCore * MC-Term * Meck * Meshcore for Wio Tracker L1 Pro * MeshCore map auto uploader --- docs/faq.md | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/docs/faq.md b/docs/faq.md index 5e9113a7c..3ef0d63ea 100644 --- a/docs/faq.md +++ b/docs/faq.md @@ -55,6 +55,7 @@ A list of frequently-asked questions and answers for MeshCore - [5.12. Q: How do I add a node to the MeshCore Map](#512-q-how-do-i-add-a-node-to-the-meshcore-map) - [5.13. Q: Can I use a Raspberry Pi to update a MeshCore radio?](#513-q-can-i-use-a-raspberry-pi-to-update-a-meshcore-radio) - [5.14. Q: Are there are projects built around MeshCore?](#514-q-are-there-are-projects-built-around-meshcore) + - [5.14.0. awesome-meshcore](#5140-awesome-meshcore) - [5.14.1. meshcoremqtt](#5141-meshcoremqtt) - [5.14.2. MeshCore for Home Assistant](#5142-meshcore-for-home-assistant) - [5.14.3. Python MeshCore](#5143-python-meshcore) @@ -64,6 +65,13 @@ A list of frequently-asked questions and answers for MeshCore - [5.14.7. MeshCore Packet Decoder](#5147-meshcore-packet-decoder) - [5.14.8. meshcore-pi](#5148-meshcore-pi) - [5.14.9. pyMC\_Repeater](#5149-pymc_repeater) + - [5.14.10. meshcore-open](#51410-meshcore-open) + - [5.14.11. MeshCore-Cardputer-ADV](#51411-MeshCore-Cardputer-ADV) + - [5.14.12. LunarCore](#51412-LunarCore) + - [5.14.13. MC-Term](#51413-MC-Term) + - [5.14.14. Meck](#51414-Meck) + - [5.14.15. Meshcore for Wio Tracker L1 Pro](#51415-Meshcore-for-Wio-Tracker-L1-Pro) + - [5.14.16. MeshCore map auto uploader](#51416-MeshCore-map-auto-uploader) - [5.15. Q: Are there client applications for Windows or Mac?](#515-q-are-there-client-applications-for-windows-or-mac) - [5.16. Q: Are there any resources that compare MeshCore to other LoRa systems?](#516-q-are-there-any-resources-that-compare-meshcore-to-other-lora-systems) - [6. Troubleshooting](#6-troubleshooting) @@ -606,6 +614,12 @@ From here, reference repeater and room server command line commands on MeshCore **A:** Yes. See the following: +#### 5.14.0. awesome-meshcore +A meta website/ git-repository collecting many projects related to MeshCore, grouped by type. See +https://github.com/samuk/awesome-meshcore. + +A few projects are also listed here in the following paragraphs: + #### 5.14.1. meshcoremqtt A Python script to send meshcore debug and packet capture data to MQTT for analysis. Cisien's version is a fork of Andrew-a-g's and is being used to to collect data for https://map.w0z.is/messages and https://analyzer.letsmesh.net/ https://github.com/Cisien/meshcoretomqtt @@ -643,6 +657,38 @@ https://github.com/brianwiddas/meshcore-pi pyMC_Repeater is a repeater daemon in Python built on top of the [`pymc_core`](#5146-pymc_core) library. https://github.com/rightup/pyMC_Repeater +#### 5.14.10. meshcore-open +Open Source companion app for Android, iOS, GNU/Linux (and maybe other Unixes), Windows, macOS, chromium-based browsers. +https://github.com/zjs81/meshcore-open + +#### 5.14.11. MeshCore-Cardputer-ADV +Standalone client firmware for the "[M5Stack Cardputer ADV](https://docs.m5stack.com/en/core/Cardputer-Adv)" with the "[M5Stack Cap LoRa-1262](https://docs.m5stack.com/en/cap/Cap_LoRa-1262)" module. + +There are two variants: + +* https://github.com/Stachugit/MeshCore-Cardputer-ADV, +* https://github.com/sosprz/meshcore-cardputer-adv. + +#### 5.14.12. LunarCore +Multi-protocol mesh firmware for ESP32-S3 LoRa devices (MeshCore, Meshtastic, RNode/KISS (Reticulum)). Protocol is auto-detected from the first bytes over serial or BLE. +https://github.com/STCisGOOD/lunarcore + +#### 5.14.13. MC-Term +(Soon to be) Open Source companion firmware for [LilyGO T-Deck (Plus)](https://lilygo.cc/en-us/products/t-deck-plus-1) and [Seeed Studio SenseCap Indicator (TFT / D1Pro)](https://www.seeedstudio.com/SenseCAP-Indicator-D1Pro-p-5644.html), that can be used both standalone and together with a companion app. +https://github.com/dabeani/meshcore + +#### 5.14.14. Meck +Companion firmware for [LilyGo T-Deck Pro](https://lilygo.cc/products/t-deck-pro) that allows standalone operation and connection to a companion app via Bluetooth Low Energy (BLE). +https://github.com/pelgraine/Meck + +#### 5.14.15. Meshcore for Wio Tracker L1 Pro +Companion firmware for [Seeed Studio Wio Tracker L1 Pro](https://www.seeedstudio.com/Wio-Tracker-L1-Pro-p-6454.html) with specific UI adjustments that can be used standalone. +https://github.com/sosprz/Meshcore-Wio-Tracker-L1-Pro + +#### 5.14.16. MeshCore map auto uploader +A Node.js software that will upload every repeater or room server to [map.meshcore.dev](https://map.meshcore.dev/) when a connected companion hears new advert. +https://github.com/recrof/map.meshcore.dev-uploader + ### 5.15. Q: Are there client applications for Windows or Mac? **A:** Yes, the same iOS and Android client is also available for Windows and Intel Mac (sorry, not available for ARM-based Mac yet). You can find them together with the Android APK here: From b16adee4bb412796f934db07845f9736ce353bbc Mon Sep 17 00:00:00 2001 From: dreirund <1590519+dreirund@users.noreply.github.com> Date: Tue, 24 Feb 2026 17:48:30 +0100 Subject: [PATCH 27/29] docs/faq.md: Table of Contents: Remove bogous `[| | High Output | 22 dBm | 28 dBm | |](#--high-output--22-dbm--28-dbm--)`. The table of contents of `docs/faq.md` had at the end a bogous entry ```markdown - [| | High Output | 22 dBm | 28 dBm | |](#--high-output--22-dbm--28-dbm--) ``` This patch removes that bogous entry. --- docs/faq.md | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/faq.md b/docs/faq.md index 5e9113a7c..f8316f84a 100644 --- a/docs/faq.md +++ b/docs/faq.md @@ -84,7 +84,6 @@ A list of frequently-asked questions and answers for MeshCore - [7.5. Q: What is the format of a contact or channel QR code?](#75-q-what-is-the-format-of-a-contact-or-channel-qr-code) - [7.6. Q: How do I connect to the companion via WIFI, e.g. using a heltec v3?](#76-q-how-do-i-connect-to-the-companion-via-wifi-eg-using-a-heltec-v3) - [7.7. Q: I have a Station G2, or a Heltec V4, or an Ikoka Stick, or a radio with a EByte E22-900M30S or a E22-900M33S module, what should their transmit power be set to?](#77-q-i-have-a-station-g2-or-a-heltec-v4-or-an-ikoka-stick-or-a-radio-with-a-ebyte-e22-900m30s-or-a-e22-900m33s-module-what-should-their-transmit-power-be-set-to) -- [| | High Output | 22 dBm | 28 dBm | |](#--high-output--22-dbm--28-dbm--) ## 1. Introduction From ff72564bcafe4e74d0dfb779912714f2c8587660 Mon Sep 17 00:00:00 2001 From: dreirund <1590519+dreirund@users.noreply.github.com> Date: Tue, 24 Feb 2026 18:19:50 +0100 Subject: [PATCH 28/29] docs/faq.md: Categorising section 5.14. "Q: Are there are projects built around MeshCore?". In `[docs/faq.md](https://github.com/meshcore-dev/MeshCore/blob/main/docs/faq.md)`, the entries are now grouped by category. This patch applies on top of https://github.com/meshcore-dev/MeshCore/pull/1822. --- docs/faq.md | 93 +++++++++++++++++++++++++++++++---------------------- 1 file changed, 55 insertions(+), 38 deletions(-) diff --git a/docs/faq.md b/docs/faq.md index 3ef0d63ea..489df8eae 100644 --- a/docs/faq.md +++ b/docs/faq.md @@ -55,23 +55,28 @@ A list of frequently-asked questions and answers for MeshCore - [5.12. Q: How do I add a node to the MeshCore Map](#512-q-how-do-i-add-a-node-to-the-meshcore-map) - [5.13. Q: Can I use a Raspberry Pi to update a MeshCore radio?](#513-q-can-i-use-a-raspberry-pi-to-update-a-meshcore-radio) - [5.14. Q: Are there are projects built around MeshCore?](#514-q-are-there-are-projects-built-around-meshcore) - - [5.14.0. awesome-meshcore](#5140-awesome-meshcore) - - [5.14.1. meshcoremqtt](#5141-meshcoremqtt) - - [5.14.2. MeshCore for Home Assistant](#5142-meshcore-for-home-assistant) - - [5.14.3. Python MeshCore](#5143-python-meshcore) - - [5.14.4. meshcore-cli](#5144-meshcore-cli) - - [5.14.5. meshcore.js](#5145-meshcorejs) - - [5.14.6. pyMC\_core](#5146-pymc_core) - - [5.14.7. MeshCore Packet Decoder](#5147-meshcore-packet-decoder) - - [5.14.8. meshcore-pi](#5148-meshcore-pi) - - [5.14.9. pyMC\_Repeater](#5149-pymc_repeater) - - [5.14.10. meshcore-open](#51410-meshcore-open) - - [5.14.11. MeshCore-Cardputer-ADV](#51411-MeshCore-Cardputer-ADV) - - [5.14.12. LunarCore](#51412-LunarCore) - - [5.14.13. MC-Term](#51413-MC-Term) - - [5.14.14. Meck](#51414-Meck) - - [5.14.15. Meshcore for Wio Tracker L1 Pro](#51415-Meshcore-for-Wio-Tracker-L1-Pro) - - [5.14.16. MeshCore map auto uploader](#51416-MeshCore-map-auto-uploader) + - [5.14.1. overview](#5141-overview) + - [5.14.1.1. awesome-meshcore](#51411-awesome-meshcore) + - [5.14.2. programming libraries, command line software](#5142-programming-libraries-command-line-software) + - [5.14.2.1. meshcoremqtt](#51421-meshcoremqtt) + - [5.14.2.2. MeshCore for Home Assistant](#51422-meshcore-for-home-assistant) + - [5.14.2.3. Python MeshCore](#51423-python-meshcore) + - [5.14.2.4. meshcore-cli](#51424-meshcore-cli) + - [5.14.2.5. meshcore.js](#51425-meshcorejs) + - [5.14.2.6. pyMC\_core](#51426-pymc_core) + - [5.14.2.7. MeshCore Packet Decoder](#51427-meshcore-packet-decoder) + - [5.14.2.8. meshcore-pi](#51428-meshcore-pi) + - [5.14.2.9. pyMC\_Repeater](#51429-pymc_repeater) + - [5.14.2.10. MeshCore map auto uploader](#514210-MeshCore-map-auto-uploader) + - [5.14.3. apps, graphical software](#5143-apps-graphical-software) + - [5.14.3.1. meshcore-open](#51431-meshcore-open) + - [5.14.4. firmwares](#5144-firmwares) + - [5.14.4.1. MeshCore-Cardputer-ADV](#51441-MeshCore-Cardputer-ADV) + - [5.14.4.2. LunarCore](#51442-LunarCore) + - [5.14.4.3. MC-Term](#51443-MC-Term) + - [5.14.4.4. Meck](#51444-Meck) + - [5.14.4.5. Meshcore for Wio Tracker L1 Pro](#51445-Meshcore-for-Wio-Tracker-L1-Pro) + - [5.14.5. online services](#5145-online-services) - [5.15. Q: Are there client applications for Windows or Mac?](#515-q-are-there-client-applications-for-windows-or-mac) - [5.16. Q: Are there any resources that compare MeshCore to other LoRa systems?](#516-q-are-there-any-resources-that-compare-meshcore-to-other-lora-systems) - [6. Troubleshooting](#6-troubleshooting) @@ -612,56 +617,68 @@ From here, reference repeater and room server command line commands on MeshCore ### 5.14. Q: Are there are projects built around MeshCore? -**A:** Yes. See the following: +**A:** Yes. Some of them are listed below. -#### 5.14.0. awesome-meshcore +#### 5.14.1. overview + +Some resources that by themselves give overviews about MeshCore related projects: + +##### 5.14.1.1. awesome-meshcore A meta website/ git-repository collecting many projects related to MeshCore, grouped by type. See https://github.com/samuk/awesome-meshcore. -A few projects are also listed here in the following paragraphs: +#### 5.14.2. programming libraries, command line software -#### 5.14.1. meshcoremqtt +##### 5.14.2.1. meshcoremqtt A Python script to send meshcore debug and packet capture data to MQTT for analysis. Cisien's version is a fork of Andrew-a-g's and is being used to to collect data for https://map.w0z.is/messages and https://analyzer.letsmesh.net/ https://github.com/Cisien/meshcoretomqtt https://github.com/Andrew-a-g/meshcoretomqtt -#### 5.14.2. MeshCore for Home Assistant +##### 5.14.2.2. MeshCore for Home Assistant A custom Home Assistant integration for MeshCore mesh radio nodes. It allows you to monitor and control MeshCore nodes via USB, BLE, or TCP connections. https://github.com/awolden/meshcore-ha -#### 5.14.3. Python MeshCore +##### 5.14.2.3. Python MeshCore Bindings to access your MeshCore companion radio nodes in python. https://github.com/fdlamotte/meshcore_py -#### 5.14.4. meshcore-cli +##### 5.14.2.4. meshcore-cli CLI interface to MeshCore companion radio over BLE, TCP, or serial. Uses Python MeshCore above. https://github.com/fdlamotte/meshcore-cli -#### 5.14.5. meshcore.js +##### 5.14.2.5. meshcore.js A JavaScript library for interacting with a MeshCore device running the companion radio firmware https://github.com/liamcottle/meshcore.js -#### 5.14.6. pyMC_core +##### 5.14.2.6. pyMC_core pyMC_Core is a Python port of MeshCore, designed for Raspberry Pi and similar hardware, it talks to LoRa modules over SPI. https://github.com/rightup/pyMC_core -#### 5.14.7. MeshCore Packet Decoder +##### 5.14.2.7. MeshCore Packet Decoder A TypeScript library for decoding MeshCore mesh networking packets with full cryptographic support. Uses WebAssembly (WASM) for Ed25519 key derivation through the orlp/ed25519 library. It powers the [MeshCore Packet Analyzer](https://analyzer.letsmesh.net/packets). https://github.com/michaelhart/meshcore-decoder -#### 5.14.8. meshcore-pi +##### 5.14.2.8. meshcore-pi meshcore-pi is another Python port of MeshCore, designed for Raspberry Pi and similar hardware, it talks to LoRa modules over SPI or GPIO. https://github.com/brianwiddas/meshcore-pi -#### 5.14.9. pyMC_Repeater +##### 5.14.2.9. pyMC_Repeater pyMC_Repeater is a repeater daemon in Python built on top of the [`pymc_core`](#5146-pymc_core) library. https://github.com/rightup/pyMC_Repeater -#### 5.14.10. meshcore-open +##### 5.14.2.10. MeshCore map auto uploader +A Node.js software that will upload every repeater or room server to [map.meshcore.dev](https://map.meshcore.dev/) when a connected companion hears new advert. +https://github.com/recrof/map.meshcore.dev-uploader + +#### 5.14.3. apps, graphical software + +##### 5.14.3.1. meshcore-open Open Source companion app for Android, iOS, GNU/Linux (and maybe other Unixes), Windows, macOS, chromium-based browsers. https://github.com/zjs81/meshcore-open -#### 5.14.11. MeshCore-Cardputer-ADV +#### 5.14.4. firmwares + +##### 5.14.4.1. MeshCore-Cardputer-ADV Standalone client firmware for the "[M5Stack Cardputer ADV](https://docs.m5stack.com/en/core/Cardputer-Adv)" with the "[M5Stack Cap LoRa-1262](https://docs.m5stack.com/en/cap/Cap_LoRa-1262)" module. There are two variants: @@ -669,25 +686,25 @@ There are two variants: * https://github.com/Stachugit/MeshCore-Cardputer-ADV, * https://github.com/sosprz/meshcore-cardputer-adv. -#### 5.14.12. LunarCore +##### 5.14.4.2. LunarCore Multi-protocol mesh firmware for ESP32-S3 LoRa devices (MeshCore, Meshtastic, RNode/KISS (Reticulum)). Protocol is auto-detected from the first bytes over serial or BLE. https://github.com/STCisGOOD/lunarcore -#### 5.14.13. MC-Term +##### 5.14.4.3. MC-Term (Soon to be) Open Source companion firmware for [LilyGO T-Deck (Plus)](https://lilygo.cc/en-us/products/t-deck-plus-1) and [Seeed Studio SenseCap Indicator (TFT / D1Pro)](https://www.seeedstudio.com/SenseCAP-Indicator-D1Pro-p-5644.html), that can be used both standalone and together with a companion app. https://github.com/dabeani/meshcore -#### 5.14.14. Meck +##### 5.14.4.4. Meck Companion firmware for [LilyGo T-Deck Pro](https://lilygo.cc/products/t-deck-pro) that allows standalone operation and connection to a companion app via Bluetooth Low Energy (BLE). https://github.com/pelgraine/Meck -#### 5.14.15. Meshcore for Wio Tracker L1 Pro +##### 5.14.4.5. Meshcore for Wio Tracker L1 Pro Companion firmware for [Seeed Studio Wio Tracker L1 Pro](https://www.seeedstudio.com/Wio-Tracker-L1-Pro-p-6454.html) with specific UI adjustments that can be used standalone. https://github.com/sosprz/Meshcore-Wio-Tracker-L1-Pro -#### 5.14.16. MeshCore map auto uploader -A Node.js software that will upload every repeater or room server to [map.meshcore.dev](https://map.meshcore.dev/) when a connected companion hears new advert. -https://github.com/recrof/map.meshcore.dev-uploader +#### 5.14.5. online services + +*(None yet listed here. See [overview ressources](#5141-overview).)* ### 5.15. Q: Are there client applications for Windows or Mac? From c37161dc60bb7f528b6543db05dda7395e52a6b7 Mon Sep 17 00:00:00 2001 From: Frank Zosso Date: Wed, 25 Feb 2026 17:17:42 +0100 Subject: [PATCH 29/29] Initial RAK One-Wire implementation for WisMesh Solar Repeater boundle (RAK9154 Solar Battery + RAK2560_HZB + RAK4630 Module) to report battery pack telemetry in channel 2 --- .../sensors/EnvironmentSensorManager.cpp | 40 ++- .../sensors/EnvironmentSensorManager.h | 11 +- src/helpers/sensors/OneWireSensorHub.cpp | 267 ++++++++++++++++++ src/helpers/sensors/OneWireSensorHub.h | 77 +++++ variants/rak4631/platformio.ini | 25 ++ 5 files changed, 418 insertions(+), 2 deletions(-) create mode 100644 src/helpers/sensors/OneWireSensorHub.cpp create mode 100644 src/helpers/sensors/OneWireSensorHub.h diff --git a/src/helpers/sensors/EnvironmentSensorManager.cpp b/src/helpers/sensors/EnvironmentSensorManager.cpp index a75d378c8..6a7031049 100644 --- a/src/helpers/sensors/EnvironmentSensorManager.cpp +++ b/src/helpers/sensors/EnvironmentSensorManager.cpp @@ -331,6 +331,15 @@ bool EnvironmentSensorManager::begin() { } #endif + #ifdef ENV_INCLUDE_ONEWIRE + OneWire_initialized = _oneWireHub.begin(); + if (OneWire_initialized) { + MESH_DEBUG_PRINTLN("OneWire SensorHub initialized with %d probe(s)", _oneWireHub.getNumPids()); + } else { + MESH_DEBUG_PRINTLN("OneWire SensorHub: No probes found"); + } + #endif + return true; } @@ -483,6 +492,27 @@ bool EnvironmentSensorManager::querySensors(uint8_t requester_permissions, Cayen } #endif + #ifdef ENV_INCLUDE_ONEWIRE + if (OneWire_initialized) { + bool has_onewire_data = _oneWireHub.hasVoltage() || _oneWireHub.hasCurrent() || _oneWireHub.hasBatteryPercent() || _oneWireHub.hasTemperature(); + if (has_onewire_data) { + MESH_DEBUG_PRINTLN("OneWire Telemetry ch=%d: V=%d C=%d SOC=%d T=%d", + next_available_channel, + _oneWireHub.hasVoltage(), _oneWireHub.hasCurrent(), + _oneWireHub.hasBatteryPercent(), _oneWireHub.hasTemperature()); + if (_oneWireHub.hasVoltage()) + telemetry.addVoltage(next_available_channel, _oneWireHub.getVoltage()); + if (_oneWireHub.hasCurrent()) + telemetry.addCurrent(next_available_channel, _oneWireHub.getCurrent()); + if (_oneWireHub.hasBatteryPercent()) + telemetry.addPercentage(next_available_channel, _oneWireHub.getBatteryPercent()); + if (_oneWireHub.hasTemperature()) + telemetry.addTemperature(next_available_channel, _oneWireHub.getTemperature()); + next_available_channel++; + } + } + #endif + } return true; @@ -702,11 +732,13 @@ void EnvironmentSensorManager::stop_gps() { MESH_DEBUG_PRINTLN("Stop GPS is N/A on this board. Actual GPS state unchanged"); #endif } +#endif // ENV_INCLUDE_GPS +#if ENV_INCLUDE_GPS || ENV_INCLUDE_ONEWIRE void EnvironmentSensorManager::loop() { + #if ENV_INCLUDE_GPS static long next_gps_update = 0; - #if ENV_INCLUDE_GPS _location->loop(); if (millis() > next_gps_update) { @@ -732,5 +764,11 @@ void EnvironmentSensorManager::loop() { next_gps_update = millis() + (gps_update_interval_sec * 1000); } #endif + + #ifdef ENV_INCLUDE_ONEWIRE + if (OneWire_initialized) { + _oneWireHub.loop(); + } + #endif } #endif diff --git a/src/helpers/sensors/EnvironmentSensorManager.h b/src/helpers/sensors/EnvironmentSensorManager.h index f176a33f5..de7518eb8 100644 --- a/src/helpers/sensors/EnvironmentSensorManager.h +++ b/src/helpers/sensors/EnvironmentSensorManager.h @@ -4,6 +4,10 @@ #include #include +#ifdef ENV_INCLUDE_ONEWIRE +#include +#endif + class EnvironmentSensorManager : public SensorManager { protected: int next_available_channel = TELEM_CHANNEL_SELF + 1; @@ -23,6 +27,11 @@ class EnvironmentSensorManager : public SensorManager { bool BME680_initialized = false; bool BMP085_initialized = false; + #ifdef ENV_INCLUDE_ONEWIRE + OneWireSensorHub _oneWireHub; + bool OneWire_initialized = false; + #endif + bool gps_detected = false; bool gps_active = false; uint32_t gps_update_interval_sec = 1; // Default 1 second @@ -48,7 +57,7 @@ class EnvironmentSensorManager : public SensorManager { #endif bool begin() override; bool querySensors(uint8_t requester_permissions, CayenneLPP& telemetry) override; - #if ENV_INCLUDE_GPS + #if ENV_INCLUDE_GPS || ENV_INCLUDE_ONEWIRE void loop() override; #endif int getNumSettings() const override; diff --git a/src/helpers/sensors/OneWireSensorHub.cpp b/src/helpers/sensors/OneWireSensorHub.cpp new file mode 100644 index 000000000..00412c02a --- /dev/null +++ b/src/helpers/sensors/OneWireSensorHub.cpp @@ -0,0 +1,267 @@ +#include "OneWireSensorHub.h" + +#ifdef ENV_INCLUDE_ONEWIRE + +#include + +static SoftwareHalfSerial oneWireSerial(ONEWIRE_PIN); + +OneWireSensorHub* OneWireSensorHub::_instance = nullptr; + +void OneWireSensorHub::_onewire_callback(const uint8_t pid, const uint8_t sid, + const SNHUBAPI_EVT_E eid, uint8_t* msg, uint16_t len) { + if (_instance) { + _instance->handleEvent(pid, sid, eid, msg, len); + } +} + +bool OneWireSensorHub::begin() { + _instance = this; + _found_pid_count = 0; + _has_voltage = false; + + for (int i = 0; i < ONEWIRE_MAX_PIDS; i++) { + _found_pids[i] = 0xFF; + } + + pinMode(WB_IO2, OUTPUT); + digitalWrite(WB_IO2, HIGH); + delay(100); + + oneWireSerial.begin(9600); + RakSNHub_Protocl_API.init(_onewire_callback); + + MESH_DEBUG_PRINTLN("OneWire: Scanning for sensor probes (%d ms)...", ONEWIRE_DISCOVERY_TIMEOUT_MS); + + unsigned long start = millis(); + while ((millis() - start) < ONEWIRE_DISCOVERY_TIMEOUT_MS) { + while (oneWireSerial.available()) { + if (_rxlen < sizeof(_rxbuf)) { + _rxbuf[_rxlen++] = oneWireSerial.read(); + } + delay(5); + } + + if (_rxlen > 0) { + RakSNHub_Protocl_API.process(_rxbuf, _rxlen); + _rxlen = 0; + } + + delay(100); + } + + MESH_DEBUG_PRINTLN("OneWire: Discovery complete. Found %d sensor probe(s)", _found_pid_count); + + if (_found_pid_count == 0) { + digitalWrite(WB_IO2, LOW); + return false; + } + + _next_poll_ms = millis() + 2000; + _current_poll_idx = 0; + + return true; +} + +void OneWireSensorHub::loop() { + if (_found_pid_count == 0) return; + + while (oneWireSerial.available()) { + if (_rxlen < sizeof(_rxbuf)) { + _rxbuf[_rxlen++] = oneWireSerial.read(); + } else { + break; + } + _last_rx_time = millis(); + } + + if (_rxlen > 0 && (millis() - _last_rx_time) >= 10) { + RakSNHub_Protocl_API.process(_rxbuf, _rxlen); + _rxlen = 0; + } + + if (millis() >= _next_poll_ms) { + if (_current_poll_idx < _found_pid_count) { + uint8_t pid = _found_pids[_current_poll_idx]; + if (pid != 0xFF) { + RakSNHub_Protocl_API.get.data(pid); + MESH_DEBUG_PRINTLN("OneWire: Requested data from PID %d", pid); + } + _current_poll_idx++; + } + + if (_current_poll_idx >= _found_pid_count) { + _current_poll_idx = 0; + _next_poll_ms = millis() + ONEWIRE_POLL_INTERVAL_MS; + } else { + // Stagger between PID requests + _next_poll_ms = millis() + 500; + } + } +} + +void OneWireSensorHub::handleEvent(uint8_t pid, uint8_t sid, SNHUBAPI_EVT_E eid, + uint8_t* msg, uint16_t len) { + switch (eid) { + case SNHUBAPI_EVT_QSEND: + oneWireSerial.write(msg, len); + break; + + case SNHUBAPI_EVT_ADD_PID: + registerPid(msg[0]); + break; + + case SNHUBAPI_EVT_ADD_SID: + MESH_DEBUG_PRINTLN("OneWire: Added SID 0x%02X for PID %d", msg[0], pid); + break; + + case SNHUBAPI_EVT_SDATA_REQ: { + uint8_t ipso_type = msg[0]; + uint16_t val_len = len - 1; + + uint8_t ordered[256]; + for (uint16_t i = 0; i < val_len; i += 2) { + if (i + 1 < val_len) { + ordered[i] = msg[1 + i + 1]; + ordered[i + 1] = msg[1 + i]; + } else { + ordered[i] = msg[1 + i]; + } + } + MESH_DEBUG_PRINTLN("OneWire: SDATA_REQ SID=0x%02X IPSO=%d len=%d", sid, ipso_type, val_len); + parseSensorData(sid, ipso_type, ordered, val_len); + break; + } + + case SNHUBAPI_EVT_REPORT: { + uint8_t ipso_type = msg[0]; + uint16_t val_len = len - 1; + MESH_DEBUG_PRINTLN("OneWire: REPORT SID=0x%02X IPSO=%d len=%d", sid, ipso_type, val_len); + parseSensorData(sid, ipso_type, &msg[1], val_len); + break; + } + + case SNHUBAPI_EVT_CHKSUM_ERR: + MESH_DEBUG_PRINTLN("OneWire: Checksum error"); + break; + + case SNHUBAPI_EVT_SEQ_ERR: + MESH_DEBUG_PRINTLN("OneWire: Sequence error"); + break; + + default: + break; + } +} + +void OneWireSensorHub::registerPid(uint8_t pid) { + for (int i = 0; i < ONEWIRE_MAX_PIDS; i++) { + if (_found_pids[i] == pid) { + MESH_DEBUG_PRINTLN("OneWire: PID %d already registered", pid); + return; + } + } + for (int i = 0; i < ONEWIRE_MAX_PIDS; i++) { + if (_found_pids[i] == 0xFF) { + _found_pids[i] = pid; + _found_pid_count++; + MESH_DEBUG_PRINTLN("OneWire: Registered PID %d (total: %d)", pid, _found_pid_count); + return; + } + } + MESH_DEBUG_PRINTLN("OneWire: No slots for PID %d", pid); +} + +void OneWireSensorHub::parseSensorData(uint8_t sid, uint8_t ipso_type, uint8_t* data, uint16_t data_len) { + switch (ipso_type) { + case RAK_IPSO_BATTERVALUE: // 116 (3316-3200): battery voltage, 2 bytes, /100 + case RAK_IPSO_DC_VOLTAGE: { // 186 (3386-3200): DC voltage, 2 bytes, /100 + if (data_len >= 2) { + int16_t raw = ((int16_t)data[0] << 8) | (int16_t)data[1]; + _cached_voltage = (float)raw / 100.0f; + _has_voltage = true; + MESH_DEBUG_PRINTLN("OneWire: Battery Voltage = %.2fV (IPSO %d, raw=%d)", _cached_voltage, ipso_type, raw); + } + break; + } + + case RAK_IPSO_DC_CURRENT: { // 185 (3385-3200): DC current, 2 bytes, mA + if (data_len >= 2) { + int16_t raw = ((int16_t)data[0] << 8) | (int16_t)data[1]; + _cached_current_ma = raw; + _has_current = true; + MESH_DEBUG_PRINTLN("OneWire: Battery Current = %dmA (IPSO %d, raw=%d)", _cached_current_ma, ipso_type, raw); + } + break; + } + + case RAK_IPSO_CAPACITY: { // 184 (3384-3200): battery percentage, 1 byte + if (data_len >= 1) { + _cached_battery_pct = data[0]; + if (_cached_battery_pct > 100) _cached_battery_pct = 100; + _has_battery_pct = true; + MESH_DEBUG_PRINTLN("OneWire: Battery SOC = %d%% (IPSO %d)", _cached_battery_pct, ipso_type); + } + break; + } + + case RAK_IPSO_TEMP_SENSOR: { // 103 (3303-3200): temperature, 2 bytes, /10 + if (data_len >= 2) { + int16_t raw = ((int16_t)data[0] << 8) | (int16_t)data[1]; + _cached_temperature = (float)raw / 10.0f; + _has_temperature = true; + MESH_DEBUG_PRINTLN("OneWire: Battery Temperature = %.1fC (IPSO %d, raw=%d)", _cached_temperature, ipso_type, raw); + } + break; + } + + case RAK_IPSO_SSN: { // 126 (3326-3200): serial number, 3 bytes + if (data_len >= 3) { + _cached_serial = ((uint32_t)data[0] << 16) | ((uint32_t)data[1] << 8) | data[2]; + _has_serial = true; + MESH_DEBUG_PRINTLN("OneWire: Serial Number = %06lX (IPSO %d)", (unsigned long)_cached_serial, ipso_type); + } + break; + } + + case RAK_IPSO_BINARY2BYTE: { // 243 (0xF3): 2-byte binary, SID distinguishes error vs FW version + if (data_len >= 2) { + uint16_t val = ((uint16_t)data[0] << 8) | data[1]; + if (sid == 0x19) { + _cached_error = val; + _has_error = true; + MESH_DEBUG_PRINTLN("OneWire: Battery Error = 0x%04X (IPSO %d, SID 0x%02X)", val, ipso_type, sid); + } else if (sid == 0x1A) { + _cached_fw_version = val; + _has_fw_version = true; + MESH_DEBUG_PRINTLN("OneWire: Battery FW Version = v%02d.%02d (IPSO %d, SID 0x%02X)", val >> 8, val & 0xFF, ipso_type, sid); + } else { + MESH_DEBUG_PRINTLN("OneWire: BINARY2BYTE = 0x%04X (IPSO %d, SID 0x%02X)", val, ipso_type, sid); + } + } + break; + } + + default: + MESH_DEBUG_PRINTLN("OneWire: Unhandled IPSO %d (len=%d)", ipso_type, data_len); + break; + } +} + +bool OneWireSensorHub::hasVoltage() const { return _has_voltage; } +float OneWireSensorHub::getVoltage() const { return _cached_voltage; } +bool OneWireSensorHub::hasCurrent() const { return _has_current; } +float OneWireSensorHub::getCurrent() const { return (float)_cached_current_ma / 100.0f; } +bool OneWireSensorHub::hasBatteryPercent() const { return _has_battery_pct; } +uint8_t OneWireSensorHub::getBatteryPercent() const { return _cached_battery_pct; } +bool OneWireSensorHub::hasTemperature() const { return _has_temperature; } +float OneWireSensorHub::getTemperature() const { return _cached_temperature; } +bool OneWireSensorHub::hasSerialNumber() const { return _has_serial; } +uint32_t OneWireSensorHub::getSerialNumber() const { return _cached_serial; } +bool OneWireSensorHub::hasError() const { return _has_error; } +uint16_t OneWireSensorHub::getError() const { return _cached_error; } +bool OneWireSensorHub::hasFwVersion() const { return _has_fw_version; } +uint16_t OneWireSensorHub::getFwVersion() const { return _cached_fw_version; } +uint8_t OneWireSensorHub::getNumPids() const { return _found_pid_count; } + +#endif // ENV_INCLUDE_ONEWIRE diff --git a/src/helpers/sensors/OneWireSensorHub.h b/src/helpers/sensors/OneWireSensorHub.h new file mode 100644 index 000000000..8d46a7fb1 --- /dev/null +++ b/src/helpers/sensors/OneWireSensorHub.h @@ -0,0 +1,77 @@ +#pragma once + +#ifdef ENV_INCLUDE_ONEWIRE + +#include + +#ifndef ONEWIRE_DISCOVERY_TIMEOUT_MS +#define ONEWIRE_DISCOVERY_TIMEOUT_MS 8000 +#endif + +#ifndef ONEWIRE_POLL_INTERVAL_MS +#define ONEWIRE_POLL_INTERVAL_MS 30000 +#endif + +#ifndef ONEWIRE_PIN +#define ONEWIRE_PIN PIN_SERIAL2_RX +#endif + +#define ONEWIRE_MAX_PIDS 5 + +class OneWireSensorHub { +public: + bool begin(); + void loop(); + + bool hasVoltage() const; + float getVoltage() const; + bool hasCurrent() const; + float getCurrent() const; + bool hasBatteryPercent() const; + uint8_t getBatteryPercent() const; + bool hasTemperature() const; + float getTemperature() const; + bool hasSerialNumber() const; + uint32_t getSerialNumber() const; + bool hasError() const; + uint16_t getError() const; + bool hasFwVersion() const; + uint16_t getFwVersion() const; + uint8_t getNumPids() const; + +private: + uint8_t _found_pids[ONEWIRE_MAX_PIDS]; + uint8_t _found_pid_count = 0; + + volatile float _cached_voltage = 0.0f; + volatile bool _has_voltage = false; + volatile int16_t _cached_current_ma = 0; + volatile bool _has_current = false; + volatile uint8_t _cached_battery_pct = 0; + volatile bool _has_battery_pct = false; + volatile float _cached_temperature = 0.0f; + volatile bool _has_temperature = false; + volatile uint32_t _cached_serial = 0; + volatile bool _has_serial = false; + volatile uint16_t _cached_error = 0; + volatile bool _has_error = false; + volatile uint16_t _cached_fw_version = 0; + volatile bool _has_fw_version = false; + + unsigned long _next_poll_ms = 0; + unsigned long _last_rx_time = 0; + uint8_t _current_poll_idx = 0; + + uint8_t _rxbuf[256]; + uint16_t _rxlen = 0; + + static OneWireSensorHub* _instance; + static void _onewire_callback(const uint8_t pid, const uint8_t sid, + const SNHUBAPI_EVT_E eid, uint8_t* msg, uint16_t len); + + void handleEvent(uint8_t pid, uint8_t sid, SNHUBAPI_EVT_E eid, uint8_t* msg, uint16_t len); + void registerPid(uint8_t pid); + void parseSensorData(uint8_t sid, uint8_t ipso_type, uint8_t* data, uint16_t data_len); +}; + +#endif // ENV_INCLUDE_ONEWIRE diff --git a/variants/rak4631/platformio.ini b/variants/rak4631/platformio.ini index 737ef5652..f8eda1a4e 100644 --- a/variants/rak4631/platformio.ini +++ b/variants/rak4631/platformio.ini @@ -46,6 +46,31 @@ build_src_filter = ${rak4631.build_src_filter} + +<../examples/simple_repeater> +[env:RAK_4631_repeater_onewire] +extends = rak4631 +build_flags = + ${rak4631.build_flags} + -D DISPLAY_CLASS=SSD1306Display + -D ADVERT_NAME='"RAK4631 Repeater"' + -D ADVERT_LAT=0.0 + -D ADVERT_LON=0.0 + -D ADMIN_PASSWORD='"password"' + -D MAX_NEIGHBOURS=50 + -D ENV_INCLUDE_ONEWIRE=1 + -D ONEWIRE_PIN=PIN_SERIAL1_RX + -UENV_INCLUDE_GPS + -D ONEWIRE_DISCOVERY_TIMEOUT_MS=5000 + -D ONEWIRE_POLL_INTERVAL_MS=30000 +; -D MESH_PACKET_LOGGING=1 +; -D MESH_DEBUG=1 +build_src_filter = ${rak4631.build_src_filter} + + + + + +<../examples/simple_repeater> +lib_deps = + ${rak4631.lib_deps} + beegee-tokyo/RAK-OneWireSerial + [env:RAK_4631_repeater_bridge_rs232_serial1] extends = rak4631 build_flags =