Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does not start on Windows Server 2022 #639

Open
tuesdays opened this issue Jul 16, 2024 · 1 comment
Open

Does not start on Windows Server 2022 #639

tuesdays opened this issue Jul 16, 2024 · 1 comment

Comments

@tuesdays
Copy link

When starting the via pip3 installed version of the cli, it crashes while validating the OS.

PS C:\meshtastic\cli\meshtastic> meshtastic --info
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python312\Scripts\meshtastic.exe\__main__.py", line 7, in <module>
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python312\Lib\site-packages\meshtastic\__main__.py", line 1573, in main
    common()
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python312\Lib\site-packages\meshtastic\__main__.py", line 1064, in common
    client = meshtastic.serial_interface.SerialInterface(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python312\Lib\site-packages\meshtastic\serial_interface.py", line 64, in __init__
    StreamInterface.__init__(
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python312\Lib\site-packages\meshtastic\stream_interface.py", line 41, in __init__
    self.is_windows11 = is_windows11()
                        ^^^^^^^^^^^^^^
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python312\Lib\site-packages\meshtastic\util.py", line 513, in is_windows11
    if float(platform.release()) >= 10.0:
       ^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: could not convert string to float: '2022Server'

How to reproduce:

  1. Install Python 3.12.4 with the default "next - next - next" setup on Windows Server 2022
  2. Run pip3 install --upgrade pytap2
  3. Run pip3 install --upgrade meshtastic
  4. Run meshtastic --info
@tuesdays
Copy link
Author

tuesdays commented Jul 17, 2024

After commenting the check function out, the CLI works fine.
For easy fix, here the list of platform.release() return values for Windows OS.

Windows 7: '7'
Windows 8: '8'
Windows 8.1: '8.1'
Windows 10: '10'
Windows 11: '10.0'
Windows Server 2012 R2: '2012R2Server'
Windows Server 2016: '2016Server'
Windows Server 2019: '2019Server'
Windows Server 2022: '2022Server'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant