While I think Linux is probably the best OS to use when tinkering around with Meshtastic, not everyone is comfortable with it, and let’s face it – Windows is simply the predominant OS out there. Fortunately, the Meshtastic API tool is written in Python, which can be run on Windows with a little bit of work. Meshtastic is an amazing project and deserves to be enjoyed by everyone, especially given the active, friendly development and explosive growth of the community. Hopefully this guide will help you as Windows user dive into the fascinating world of low power, long range mesh radio communications with an active and very fast-growing project!
Note: This guide was written with the TTGO T-Beam v1.1 in mind as the target hardware, as it is the recommended platform at the time of this writing (and the version I’m starting with just has v1.0.0 firmware). Also, I am located in the US, so I’ll be using 915MHz hardware and the US region settings (which is now the default in 1.2.x versions of Meshtastic firmware builds).
Other note: I documented all of this with a Windows 10 x64 VM, and must admit that I am a total n00b with Python and Meshtastic on Windows – hopefully this guide will be as instructional to readers as writing it was for myself.
So… Let’s install Python! Go to Python Releases for Windows | Python.org and download the most recent installer for your Windows version – in my case, 3.9.2 for Windows 10 (if running Windows 7 or earlier, you will need to use an earlier Python version). Run the installer, and on the very first screen, make sure to check the box for “Add Python 3.9 to PATH” – this will ensure that no matter which folder/directory you might happen to be in in a command prompt, Windows will still know how to find the Python binaries.
Click on ‘Install Now’ and let the installer complete.
Sweet, Python is now installed on your machine, and you can click the ‘Close’ button. Now, let’s get old school and open a command prompt. Click on the Start menu button, type in ‘cmd’ and launch the ‘Command Prompt’ (if the search doesn’t find it, you can find the Command Prompt in the ‘Windows System’ folder in the Start menu):
Okay, now just type in ‘pip’ in the command prompt and you should see output very similar to this:
Fantastic! Pip is the package installer for Python – kind of like the Microsoft Store, but for Python stuff. Let’s now install Meshtastic itself by running ‘pip install meshtastic’:
Looks like the version of Pip that got installed is a little older, but that’s okay, we now have the Meshtastic Python API installed, which is what we are after! We’ll need one more piece of Python software for later, that being the flash utility itself – type in ‘pip install esptool’:
Okay, let’s see if it works by just typing in ‘meshtastic’ at the command prompt:
Success! Now, this is technically all that you need in order to communicate with your Meshtastic device. However, if you want to upgrade the firmware on your device (which you almost certainly do, given how quickly the project is advancing), you might find the ESPHome-Flasher GUI tool limiting, as it doesn’t update the partition table on the board. This may cause headaches when trying to work with the built-in webserver. So, let’s install one more tool – Git BASH. This will give us a much more powerful command line that lets us use the same flashing method as on Linux. So, go to https://gitforwindows.org/ and click the Download button right on the front page:
Run the installer, proceed through the prompts, and leave the default component options as they are:
When you get to selecting an editor, the default choice is to use Vim. If you’re not familiar with Linux/Unix, you probably don’t want this – best to select ‘Use Notepad as Git’s default editor’, unless you know that you have one of the other options available on your system (and are comfortable using it):
Honestly, this selection probably won’t matter much if we’re just playing with Meshtastic, as I’m not sure how the editor gets invoked, but Vim will leave an unwary user as bamboozled as a Unix greybeard will be delighted. You can proceed through the rest of the prompts leaving the defaults selected. After the installation is complete, make sure that your Meshtastic device is recognized by Windows – the first time you attach it to your computer, you should get notifications about installing the ‘CP2104 USB to UART Bridge Controller’:
However, at least in my case, Windows didn’t install the proper drivers – open up the Device Manager in the Windows Control Panel and look for issues:
Windows doesn’t seem to know how to get the correct drivers on its own, so go to CP210x USB to UART Bridge VCP Drivers - Silicon Labs, click on the ‘Downloads’ tab at the top, and download the CP210x Universal Windows Driver:
Extract the downloaded file and run the “CP210xVCPInstaller_x64.exe” installer (or CP210xVCPInstaller_x86 if you are running 32-bit Windows). There’s no options to set, so just proceed through all the prompts:
Once complete, you should see the device show up in Device Manager as a COM port:
If you’ve gotten this far, then your system is now all set! Now we can download the latest Meshtastic firmware – go to Releases · meshtastic/Meshtastic-device · GitHub and see what the latest version is. As of this writing, 1.2.10 just dropped, so we’ll click on the ‘assets’ section of the release notes and download the .zip file (https://github.com/meshtastic/Meshtastic-device/releases/download/1.2.10/firmware-1.2.10.zip). Extract the .zip to a folder, then right-click on that folder and select ‘Git Bash Here’:
This will open up a BASH terminal right in the target folder. Let’s make sure that we can actually run the Python tool, so just type in ‘meshtastic’ right at the dollar sign prompt:
Great! So we’re able to run the tool in a BASH prompt. Let’s see if our system can see our board, so type in ‘meshtastic –info’:
Success! Yes, that may look like an error, but the last line tells us the full story – the board has been detected, but it’s running firmware older than v1.2. If the board wasn’t detected at all, the Exception would say “No Meshtastic devices detected”:
So, let’s install that firmware! We’ll use the device-install script (which is why we went through all the trouble of installing Git BASH in the first place). Type ‘ls’ (which is the Unix equivalent of ‘dir’) to see all the files in the directory, and then type in ‘./device-install.sh’:
Okay, that gives us the format that the script is expecting. Let’s cross our fingers and type in ‘./device-install.sh -f ./firmware-tbeam-1.2.10.bin’:
Success! We’ve now updated the device firmware to v1.2.10. The device should reboot and show us that version on the splash screen:
Now, we should be able to run ‘meshtastic –info’ and see what the board returns:
Success! That’s it – you should now be able to proceed with making setting changes, enabling plugins, etc.