adding meshtastic post
Deploy Website / build (push) Successful in 42s Details

This commit is contained in:
James Ravenscroft 2024-10-19 14:19:13 +01:00
parent d75b1aa9e8
commit 122bcb779d
1 changed files with 79 additions and 0 deletions

View File

@ -0,0 +1,79 @@
---
title: "Flashing Heltec v3 nodes on Ubuntu"
date: 2024-10-19T13:12:27+01:00
draft: false
description: Some troubleshooting tips for successfully flashing Heltec v3 nodes on Ubuntu.
url: /2024/10/19/flashing-heltec-meshtastic
type: posts
mp-syndicate-to:
- https://brid.gy/publish/mastodon
tags:
- meshtastic
- ubuntu
- linux
- heltec
---
I recently purchased a [Heltec v3 Radio](https://heltec.org/project/wifi-lora-32-v3/) after being inspired by [Jan Wildeboer](https://social.wildeboer.net/@jwildeboer/113191557900339340) and in turn [Andy Kirby](https://www.youtube.com/watch?v=yt6NOm0Gdy8) to try out [meshtastic](https://meshtastic.org/), a LoRa mesh network that facilitates off-grid messaging over a mesh network. I purchased my radio from AliExpress and it took a couple of weeks to get here but it arrived this morning.
The first thing you need to do in order to connect it to the meshtastic network is flash the firmware onto the device. Meshtastic provide [a very fancy web-based firmware flashing tool](https://flasher.meshtastic.org/) which uses standard browser APIS in Chromium to talk to your device over USB serial port in order to write the new firmware. The [provided documentation](https://meshtastic.org/docs/getting-started/) is very good and provides links to USB drivers for windows and mac. As it happens, drivers for linux are typically already installed in modern distributions like Ubuntu but there may be a little bit of extra work involved in setting things up so that your machine can use them.
I ran through all of the following steps but the breakthrough was the final step - connecting Chrome's snap container to raw USB comms.
## Ensure the Kernel Modules are loaded
The drivers you need are `cp210x` and `usbserial`. You can load them into the kernel (if they're not already loaded) by running:
```bash
sudo modprobe usbserial
sudo modprobe cp210x
```
This will ensure that your machine can talk to the device. If you run `lsusb` you should be able to see the CP210x drivers show up:
```bash
> lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
...
other stuff
...
Bus 001 Device 005: ID 10c4:ea60 Silicon Labs CP210x UART Bridge
...
other stuff
```
## Ensure Permissions are Correct
On a couple of forums I visited, it was suggested that users need to be in the `dialout` group in order to have read/write access to the USB serial port. You can set this by running:
```bash
sudo usermod -a -G dialout <yourusername>
```
You might need to reboot or log out of your desktop environment and log back in again to ensure that this new group permission propagates to all running applications.
## Ensure snap Permissions are Correct
Modern Ubuntu distros typically ship Chrome and Chromium in snap packages rather than normal deb packages these days. Snap packages are isolated from the rest of the operating system in a kind of lightweight VM. By default these packages don't have permission to access USB devices on the machine so you need to add this by running:
```shell
sudo snap connect chromium:raw-usb
```
If you restart chrome/chromium you should see a bunch of additional USB devices in the selection box.
### Which Device Do I Pick?
Assuming your Heltec board is plugged in, when the flasher tool pops up and asks for permission to talk to your device you want to select CP2102 USB to UART Bridge from the dropdown menu.
![a screenshot of the device list as displayed in chrome](https://media.jamesravey.me/i/f9d05929-3bbc-48f8-952d-b80aad470fd1.jpg)
### Flashing the device
Once you get this far you should be able to follow the meshtastic instructions and flash the device via the web tool.
### What to do next
Once you're done flashing your device you can start connecting to the mesh network. Check out some of the other meshtastic resources over at the [meshtastic website](https://meshtastic.org) or [Andy Kirby's youtube channel](https://www.youtube.com/@andykirby).