meshtastic / python

The Python CLI and API for talking to Meshtastic devices
https://meshtastic.org
371 stars 157 forks source link

meshtastic --nodes results in charmap codec error #273

Closed RicInNewMexico closed 2 years ago

RicInNewMexico commented 2 years ago

Command and results:

Ric@Ric-PC MINGW64 ~/Downloads/firmware
$ meshtastic --nodes
Connected to radio
Aborting due to: 'charmap' codec can't encode characters in position 0-77: character maps to <undefined>

Ric@Ric-PC MINGW64 ~/Downloads/firmware
$ meshtastic --version
1.2.84

meshtastic --support output:

System: Windows
   Platform: Windows-7-6.1.7601-SP1
   Release: 7
   Machine: AMD64
   Encoding (stdin): cp1252
   Encoding (stdout): cp1252
 meshtastic: v1.2.84
 Executable: C:\Users\Ric\AppData\Local\Programs\Python\Python37\Scripts\meshtastic
 Python: 3.7.6rc1 CPython MSC v.1916 64 bit (AMD64)

meshtastic --info output:

Ric@Ric-PC MINGW64 ~/Downloads/firmware
$ meshtastic --info
Connected to radio

Owner: NMPATP2 (P2)
My info: { "myNodeNum": 2475137016, "hasGps": true, "numBands": 13, "firmwareVersion": "1.2.55.ab96579-d", "rebootCount": 5, "bitrate": 247.13243, "messageTimeoutMsec": 300000, "minAppVersion": 20200, "maxChannels": 8, "hasWifi": true, "channelUtilization": 1.005, "airUtilTx": 0.12677777 }

Preferences: { "phoneTimeoutSecs": 900, "lsSecs": 300 }

Channels:
  PRIMARY psk=default { "txPower": 20, "REDACTED": "AQ==", "bandwidth": 250, "spreadFactor": 10, "codingRate": 4 }
  SECONDARY psk=secret { "psk": "REDACTED", "name": "admin" }

Primary channel URL: https://www.meshtastic.org/d/#REDACTED
Complete URL (includes all channels): https://www.meshtastic.org/d/#REDACTED
mkinney commented 2 years ago

This issue might help: https://github.com/meshtastic/Meshtastic-gui-installer/pull/33

RicInNewMexico commented 2 years ago

Functions correctly on ubuntu

rock64@rockpro64:~$ meshtastic --nodes
Connected to radio
╒═════╤═════════╤═══════╤═══════════╤═══════╤═════════════╤═════════╕
│   N │ User    │ AKA   │ ID        │ SNR   │ LastHeard   │ Since   │
╞═════╪═════════╪═══════╪═══════════╪═══════╪═════════════╪═════════╡
│   1 │ NMPATP2 │ P2    │ !938797f8 │ N/A   │ N/A         │ N/A     │
╘═════╧═════════╧═══════╧═══════════╧═══════╧═════════════╧═════════╛

meshtastic --support info:

 System: Linux
   Platform: Linux-4.4.190-1233-rockchip-ayufan-gd3f1be0ed310-aarch64-with-Ubuntu-18.04-bionic
   Release: 4.4.190-1233-rockchip-ayufan-gd3f1be0ed310
   Machine: aarch64
   Encoding (stdin): UTF-8
   Encoding (stdout): UTF-8
 meshtastic: v1.2.84
 Executable: /home/rock64/.local/bin/meshtastic
 Python: 3.6.9 CPython GCC 8.4.0

I suspect it's not handling the encoding differences on some platforms well.

RicInNewMexico commented 2 years ago

This issue, for me anyway, seems to be confined to Mingw64's bash terminal. I discovered that --nodes works as expected within the windows command prompt.

mkinney commented 2 years ago

I'm going to close this issue since it is recommended to use a command prompt.