Code Monkey home page Code Monkey logo

meshtastic-gui-installer's Introduction

Meshtastic-gui-installer

The python flasher tool is no longer being actively maintained

Currently supported flashing methods are documented here.

If you would like to maintain the python flasher please post on discord.

Pylint codecov PyPI - Downloads CLA assistant

Cross Platform GUI for installing Meshtastic Firmware. It also checks and updates the RAK 4631 and LilyGo T-Echo bootloaders.

Example showing esp32 device:

Screen Shot 2022-02-24 at 12 39 59 PM

Example showing a RAK WisBlock Core RAK4631:

Screen Shot 2022-02-24 at 12 41 05 PM

To install:

See https://meshtastic.org/docs/software/python/flasher

Note: The "single executable" installation option has been deprecated as of March 10, 2022.

Advanced options

To go into the Advanced Options page, press the "A" key or click on the "Advanced Options" in the top left of the main screen

Capabilities:

  • Update mode for esp32 devices: Instead of doing a complete flash, you can do an "update"
  • view the equivalent of meshtastic --info
  • send a simple text message
  • backup the connected device configuration to yaml file
  • restore configuration from yaml file to the connected device

Device Settings

  • Click on the "Device Settings" at the top of the main screen to change settings.
  • "Factory Reset" is available in the Admin tab
  • "Hotkeys" and "Tips" are also options

Installation for Development

  • Steps to install from PyPi - typically used for development

First clone repo and change into the Meshtastic-gui-installer directory.

python3 -m venv venv
source venv/bin/activate
# or if on windows: venv\scripts\activate
pip install --upgrade pip
pip install .

To run, type in "meshtastic-flasher"

To lint (for developers)

pylint *.py

or

make lint

To test (for developers)

pytest

For more info

https://wiki.qt.io/Qt_for_Python

https://pygithub.readthedocs.io/en/latest/introduction.html

https://meshtastic.org/

https://github.com/meshtastic/Meshtastic-device

Tested on

  • Ubuntu 20.04, 21.04, and 22.04 (x86_64)

If you get this error:

qt.qpa.plugin: Could not load the Qt platform "xcb" in "" even though it was found.
This application failed to start because not Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vkkrrdisplay, vnc, wayland-egl, wayland, xcb.
Aborted.

Then this might solve the issue:

sudo apt-get install '^libxcb.*-dev' libx11-xcb-dev libglu1-mesa-dev libxrender-dev libxi-dev libxkbcommon-dev libxkbcommon-x11-dev
  • Fedora 33 (x86_64)
  • Manjaro 21.2.3 (x86_64)
  • Linux Mint 20.3 (x86_64)
  • MacOS (arm and x86)
  • Windows 7, 8.1, 10, and 11 (may work on other versions)
  • ArchlinuxArm with the following commands:
pacman -S qt6 pyside6
pip install meshtastic-flasher

Known limitations

The following are known limitations:

  • Raspberry Pi is not available, since it is arm-based and there are no pre-built libraries for PySide. There is an interesting link here: piwheels/packages#4 (comment) .

  • Ubuntu 20.04 is the version used for testing, it may work with other versions (Known issue with Wayland #8 )

  • Ubuntu 18.04 will not work as PySide6/Qt6 libraries are not available.

  • Many linux arm variations will work as Qt does not support arm. See https://doc.qt.io/qt-6/supported-platforms.html

  • If you just run the pip install meshtastic-flasher outside of a fresh python virtual environment (like say on a mac that has used brew to install things) you may get this error:

    from meshtastic_flasher.installer import main
  File "/usr/local/lib/python3.9/site-packages/meshtastic_flasher/installer.py", line 20, in <module>
    from meshtastic.util import detect_supported_devices, findPorts, detect_windows_needs_driver

If you get this error, then install in a python virtual environment as described in the Installation step above.

Note to Developers

Please keep code as simple as possible.

meshtastic-gui-installer's People

Contributors

caveman99 avatar charminultra avatar dcherrera avatar douile avatar fsgl1tch avatar garthvh avatar maciejla avatar mc-hamster avatar mkinney avatar rishikumarray avatar sachaw avatar thebentern avatar thedeepself avatar tjdownes avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

meshtastic-gui-installer's Issues

user reported warning "DEPRECATION: Configuring installation scheme with distutils config files is deprecated and will no longer work in the near future. If you are using a Homebrew or Linuxbrew Python

Output

$ pip install --upgrade pip
DEPRECATION: Configuring installation scheme with distutils config files is deprecated and will no longer work in the near future. If you are using a Homebrew or Linuxbrew Python, please see discussion at https://github.com/Homebrew/homebrew-core/issues/76621
WARNING: Ignoring invalid distribution -ip (/usr/local/lib/python3.9/site-packages)
WARNING: Ignoring invalid distribution -eshtastic (/usr/local/lib/python3.9/site-packages)
<snip>

Homebrew/homebrew-core#76621

improve the look of the input forms in Settings

The tabs are not really visible as tabs.

The input fields have a distinct look and feel that could be improved.

Anyone want to take a stab at changing the stylesheet for tabs/input fields?

Clean up `print` statements

Spin thru the print statements and either comment out or remove them. They were mainly used for dev. Not sure what info to leave for debugging issues if user has an issue.

Could convert those to logging statements and enable debug logging or something.

Cannot install on raspberry pi

Tried:

$ pip install meshtastic-flasher==1.0.43
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Collecting meshtastic-flasher==1.0.43
  Using cached https://www.piwheels.org/simple/meshtastic-flasher/meshtastic_flasher-1.0.43-py3-none-any.whl (34 kB)
Collecting esptool
  Using cached https://www.piwheels.org/simple/esptool/esptool-3.2-py3-none-any.whl (326 kB)
Collecting psutil
  Using cached https://www.piwheels.org/simple/psutil/psutil-5.9.0-cp39-cp39-linux_armv7l.whl (278 kB)
ERROR: Could not find a version that satisfies the requirement pyside6 (from meshtastic-flasher)
ERROR: No matching distribution found for pyside6

Trying m-flasher on Ubuntu lxde-vnc

This is interesting...

docker run -p 6080:80 -p 5900:5900 -v /dev/shm:/dev/shm dorowu/ubuntu-desktop-lxde-vnc

Screen Shot 2022-02-09 at 10 19 53 AM

(manually transcribed)

qt.qpa.plugin: Could not load the Qt platform "xcb" in "" even though it was found.
This application failed to start because not Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vkkrrdisplay, vnc, wayland-egl, wayland, xcb.
Aborted.

Win 8.1 - error message: invalid literal for int()

The installer hangs with the following error:
ValueError: invalid literal for int() with base 10: "8.1"

It seems that on win 8.1 it tries to store 8.1 into an int variable.

There was no such issue on 1.0.46 last time I tried it.
meshtastic-flasher_1 0 64 erro message

Trying m-flasher on Linuxmint

Got an error:

start of detect
Traceback (most recent call last):
  File "/home/vagrant/Meshtastic-gui-installer/venv/lib/python3.8/site-packages/meshtastic_flasher/installer.py", line 355, in keyPressEvent
    self.detect()
  File "/home/vagrant/Meshtastic-gui-installer/venv/lib/python3.8/site-packages/meshtastic_flasher/installer.py", line 836, in detect
    self.warn_linux_users_if_not_in_dialout_group()
  File "/home/vagrant/Meshtastic-gui-installer/venv/lib/python3.8/site-packages/meshtastic_flasher/installer.py", line 489, in warn_linux_users_if_not_in_dialout_group
    username = os.getlogin()
OSError: [Errno 6] No such device or address
Q was pressed... so quitting

Forcing 921600 baud rate causes flash failure on tbeam

As with the device-install.sh script, this GUI installer fails because it uses the forced baud rate option with 921600 as the baud rate.
Simply removing the baud rate option to esptool allows the tool to auto-negotiate the baud rate correctly and the flashing succeeds.

Note that this is fixed in the included device-install.sh script that comes with firmware-1.2.53.19c1f9f so that installer could be used for reference in fixing Meshtastic-gui-installer

Trying m-flasher on Manjaro

Looks like there is no "dialout" group on Manjaro.

$ ls -al /dev/ttyU*
crw-rw---- 1 root uucp 188, 0 Feb  9 01:37 /dev/ttyUSB0

Fix bundling for Ubuntu wayland

pyinstaller/pyinstaller#6483

research ubuntu error that Garth got:

./meshtastic-flasher-ubuntu
qt.qpa.wayland: Failed to load client buffer integration: "wayland-egl"
qt.qpa.wayland: Available client buffer integrations: QList()
qt.qpa.wayland: No shell integration named "xdg-shell" found
qt.qpa.wayland: No shell integration named "wl-shell" found
qt.qpa.wayland: No shell integration named "ivi-shell" found
qt.qpa.wayland: Loading shell integration failed.
qt.qpa.wayland: Attempted to load the following shells QList("xdg-shell", "wl-shell", "ivi-shell")

Detect Ports does not work on (my) Windows System

If needed, i can attach the output of powershell.exe "Get-PnpDevice -PresentOnly | Format-List" too...

PS C:\Users\thomas> meshtastic-flasher.exe
Traceback (most recent call last):
  File "C:\Users\thomas\AppData\Local\Programs\Python\Python310\lib\site-packages\meshtastic_flasher\installer.py", line 283, in detect
    supported_devices_detected = detect_supported_devices()
  File "C:\Users\thomas\AppData\Local\Programs\Python\Python310\lib\site-packages\meshtastic\util.py", line 300, in detect_supported_devices
    _, sp_output = subprocess.getstatusoutput('powershell.exe "Get-PnpDevice -PresentOnly | Format-List"')
  File "C:\Users\thomas\AppData\Local\Programs\Python\Python310\lib\subprocess.py", line 624, in getstatusoutput
    data = check_output(cmd, shell=True, text=True, stderr=STDOUT)
  File "C:\Users\thomas\AppData\Local\Programs\Python\Python310\lib\subprocess.py", line 420, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
  File "C:\Users\thomas\AppData\Local\Programs\Python\Python310\lib\subprocess.py", line 503, in run
    stdout, stderr = process.communicate(input, timeout=timeout)
  File "C:\Users\thomas\AppData\Local\Programs\Python\Python310\lib\subprocess.py", line 1136, in communicate
    stdout = self.stdout.read()
  File "C:\Users\thomas\AppData\Local\Programs\Python\Python310\lib\encodings\cp1252.py", line 23, in decode
    return codecs.charmap_decode(input,self.errors,decoding_table)[0]
UnicodeDecodeError: 'charmap' codec can't decode byte 0x81 in position 12273: character maps to <undefined>

Test m-flasher on Windows11

Test on Windows 11

Steps:

  • mkdir win11
  • cd win11
  • vagrant init StefanScherer/windows_11
  • edit Vagrantfile so these lines are uncommented:
  config.vm.provider "virtualbox" do |vb|
  #   # Display the VirtualBox GUI when booting the machine
    vb.gui = true
  #
  #   # Customize the amount of memory on the VM:
    vb.memory = "4096"
  end
  • vagrant up
  • install python
  • open command prompt
  • mkdir m-flasher
  • cd m-flasher
  • python -m venv venv
  • venv\scripts\activate
  • upgrade pip
(venv) C:\Users\vagrant\m-flasher>pip install --upgrade pip
Requirement already satisfied: pip in c:\users\vagrant\m-flasher\venv\lib\site-packages (21.2.4)
Collecting pip
  Downloading pip-22.0.3-py3-none-any.whl (2.1 MB)
     |████████████████████████████████| 2.1 MB 3.3 MB/s
Installing collected packages: pip
  Attempting uninstall: pip
    Found existing installation: pip 21.2.4
    Uninstalling pip-21.2.4:
      Successfully uninstalled pip-21.2.4
ERROR: Could not install packages due to an OSError: [WinError 5] Access is denied: 'C:\\Users\\vagrant\\AppData\\Local\\Temp\\pip-uninstall-5yy15jxr\\pip.exe'
Check the permissions.

Looks like it might need admin privs (opening the command prompt)
Also need to share serial/usb ports

  • Shutdown VM
  • open virtual box
  • enable serial port (prob do not need this)
  • enable usb
  • boot VM
  • open command prompt using Admin
  • cd c:\users\vagrant\m-flasher
  • venv\Scripts\activate
  • meshtastic-flasher

Looks like Windows does not like driver:

Caption                     : CP2102 USB to UART Bridge Controller
Description                 : CP2102 USB to UART Bridge Controller
InstallDate                 :
Name                        : CP2102 USB to UART Bridge Controller
Status                      : Error
Availability                :
ConfigManagerErrorCode      : CM_PROB_FAILED_INSTALL
ConfigManagerUserConfig     : False
CreationClassName           : Win32_PnPEntity
DeviceID                    : USB\VID_10C4&PID_EA60\0001
ErrorCleared                :
ErrorDescription            :
LastErrorCode               :
PNPDeviceID                 : USB\VID_10C4&PID_EA60\0001
PowerManagementCapabilities :
PowerManagementSupported    :
StatusInfo                  :
SystemCreationClassName     : Win32_ComputerSystem
SystemName                  : VAGRANT-11
ClassGuid                   :
CompatibleID                : {USB\Class_FF&SubClass_00&Prot_00, USB\Class_FF&SubClass_00,
                              USB\Class_FF}
HardwareID                  : {USB\VID_10C4&PID_EA60&REV_0100, USB\VID_10C4&PID_EA60}
Manufacturer                :
PNPClass                    :
Present                     : True
Service                     :
PSComputerName              :
Class                       :
FriendlyName                : CP2102 USB to UART Bridge Controller
InstanceId                  : USB\VID_10C4&PID_EA60\0001
Problem                     : CM_PROB_FAILED_INSTALL
ProblemDescription          :

No devices detected
end of detect

Screen Shot 2022-02-09 at 3 22 57 PM

  • Run Meshtastic-flaser:

Screen Shot 2022-02-09 at 3 24 48 PM

Windows 11 needs to be run as Adminstrator

Discovered today that Windows 11 needs to be run as Administrator.

Need to check for that.

https://raccoon.ninja/en/dev/using-python-to-check-if-the-application-is-running-as-an-administrator/ has a nice little snippet:

import ctypes, os
 
def isAdmin():
    try:
        is_admin = (os.getuid() == 0)
    except AttributeError:
        is_admin = ctypes.windll.shell32.IsUserAnAdmin() != 0
    return is_admin

Use it like this:

if isAdmin():    
    print("Admin! Oh yeah!")
else:
    print("Just a mortal!")

`pip` installation on MacOS

I've been unable to get this running on a MacOS machine running Catalina (10.15.4). I was able to successfully get it running on a clean installation of Monterey, so it could be my python environment potentially. Here are the errors.

Installation method:

pip3 install meshtastic-flasher

Results:

$ meshtastic-flasher
Traceback (most recent call last):
  File "/usr/local/bin/meshtastic-flasher", line 5, in <module>
    from meshtastic_flasher.installer import main
  File "/usr/local/lib/python3.9/site-packages/meshtastic_flasher/installer.py", line 19, in <module>
    from meshtastic.util import detect_supported_devices, findPorts, detect_windows_needs_driver
ImportError: cannot import name 'detect_supported_devices' from 'meshtastic.util' (/usr/local/lib/python3.9/site-packages/meshtastic/util.py

$ python3 --version
Python 3.9.2

Upgraded:

pip3 install --upgrade meshtastic-flasher

Upgraded Results (Same as above):

$ meshtastic-flasher
Traceback (most recent call last):
  File "/usr/local/bin/meshtastic-flasher", line 5, in <module>
    from meshtastic_flasher.installer import main
  File "/usr/local/lib/python3.9/site-packages/meshtastic_flasher/installer.py", line 19, in <module>
    from meshtastic.util import detect_supported_devices, findPorts, detect_windows_needs_driver
ImportError: cannot import name 'detect_supported_devices' from 'meshtastic.util' (/usr/local/lib/python3.9/site-packages/meshtastic/util.py)

Having trouble flashing T-Beam

I've tried this several times, and it keeps hitting a dead end with this message:
Step 2/4 esp32 full
ESPTOOL Using command:--port COM9 write_flash 0x1000 1.2.55.9db7c62/system-info.bin
usage: esptool write_flash [-h] [--erase-all] [--flash_freq {keep,40m,26m,20m,80m}]
[--flash_mode {keep,qio,qout,dio,dout}] [--flash_size FLASH_SIZE]
[--spi-connection SPI_CONNECTION] [--no-progress] [--verify] [--encrypt]
[--encrypt-files

[ ...]]
[--ignore-flash-encryption-efuse-setting] [--compress | --no-compress]
[ ...]
esptool write_flash: error: argument : [Errno 2] No such file or directory: '1.2.55.9db7c62/system-info.bin'

T beam shows multiple times in devices when 1.0.0 is used

User plugged in TBeam with 1.0.0 version on mac and got multiple
"tbeam" entries in device dropdown

Screen_Shot_2022-02-10_at_10 21 00_PM

Log:

Successfully installed meshtastic-flasher-1.0.54
(venv) chayss-MacBook-Pro:Testing chays$ meshtastic-flasher 
on_select_firmware_changed value:1.2.55.9db7c62
on_select_firmware_changed value:
on_select_firmware_changed value:1.2.55.9db7c62
start of detect
Detected T-Lora
Detected T-Beam
Detected T-Beam
Detected T-Beam
Detected T-Lora
Detected T-Lora
Detected T-Beam
Warning: Could not find any ports using the Meshtstic python autodetection method.
from find_ports ports:['/dev/cu.wchusbserial51850283211']
Getting version and hwModel from Meshtastic python library
Exception:This version of meshtastic-python requires device firmware version 1.2 or later. For more information see https://tinyurl.com/5bjsxu32
filenames:['1.2.55.9db7c62/firmware-heltec-v2.0-1.2.55.9db7c62.bin', '1.2.55.9db7c62/firmware-heltec-v1-1.2.55.9db7c62.bin', '1.2.55.9db7c62/firmware-tlora_v1_3-1.2.55.9db7c62.bin', '1.2.55.9db7c62/firmware-tlora-v2-1.2.55.9db7c62.bin', '1.2.55.9db7c62/firmware-tlora-v1-1.2.55.9db7c62.bin', '1.2.55.9db7c62/firmware-rak11200-1.2.55.9db7c62.bin', '1.2.55.9db7c62/firmware-tbeam-1.2.55.9db7c62.bin', '1.2.55.9db7c62/firmware-tlora-v2-1-1.6-1.2.55.9db7c62.bin', '1.2.55.9db7c62/firmware-tbeam0.7-1.2.55.9db7c62.bin', '1.2.55.9db7c62/firmware-meshtastic-diy-v1-1.2.55.9db7c62.bin', '1.2.55.9db7c62/firmware-heltec-v2.1-1.2.55.9db7c62.bin']
end of detect

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.