A favor requested from someone running Windows?

Hi ya’ll,

If you are running windows can you post what “pip3 install pytap2” does on your machine? I don’t think the pytap2 lib will work on windows, but I want to make sure it at least installs.

1 Like

@geeksville If you want a Windows 10 desktop for any reason, let me know – I can provision you one on my ESXi host and give you VPN and Remote Desktop to get in. I have enough Windows licenses to spare.

ps. Please approve https://github.com/meshtastic/arduino-esp32/pull/1

1 Like

@geeksville
I am also using Windows, and just updated the Python app to Version: 1.1.27
pip3 install meshtastic
after this, when I run it, I get
ModuleNotFoundError: No module named 'pytap2'

I then installed pytap2, and ran again, and get
ModuleNotFoundError: No module named 'fcntl' EDIT: fcntl

Are there some missing dependencies in the latest version?

Thanks, Andy

2 Likes

Apparently there are some windows differences between users ;-). I just pushed out a python release that makes tun optional. Pip3 - install -upgrade should granite l grab it.

Thanks - just after posting I saw your updates in github. I tried pip3, but just got the same version.
I still get this if run meshtastic
ModuleNotFoundError: No module named 'fcntl'

1 Like

ok - I think I just properly conditionalized things to not include the IP tunnel code on windows. Anyone willing to try “pip3 install --upgrade meshtastic” and tell me if it works? 1.1.28 is the new version.

Since I wasn’t sure os-x doesn’t have this problem I just turned that off as well. If someone has os-x, they can try changing the have_tunnel check in main.py to be less paranoid and see if it works there?

Hi Kevin - yes, it does now work, but still get a message after each command
'Namespace' object has no attribute 'tunnel'
for example:

>meshtastic --port COM9 --sendtext "hello kevin"
Connected to radio
Sending text message hello kevin to ^all
'Namespace' object has no attribute 'tunnel'

>meshtastic
Traceback (most recent call last):
  File "c:\users\xx\appdata\local\programs\python\python36\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "c:\users\xx\appdata\local\programs\python\python36\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Users\xx\AppData\Local\Programs\Python\Python36\Scripts\meshtastic.exe\__main__.py", line 7, in <module>
  File "c:\users\xx\appdata\local\programs\python\python36\lib\site-packages\meshtastic\__main__.py", line 461, in main
    common()
  File "c:\users\xx\appdata\local\programs\python\python36\lib\site-packages\meshtastic\__main__.py", line 320, in common
    args.tunnel or args.router != None or args.qr:
AttributeError: 'Namespace' object has no attribute 'tunnel'

ooh thanks - I’ll fix!

@qurm ok fixed in 1.1.29 (I think). Can you try “pip3 install --upgrade meshtastic” and confirm?

Well, the error is being handled ok, but still shows the message.
I do have a dev environment on Windows for Meshtastic-python, if I can do anything else?

C:\Users\xx>meshtastic --port COM10 --info
Connected to radio
my_node_num: 862628933
has_gps: true
num_channels: 20
region: "1.0-ANZ"
hw_model: "tbeam"
firmware_version: "1.1.23"
..

Nodes in mesh:
{'num': 862628933, 'user': {'id': '!c44f336aac45', 'longName': 'Unknown ac45', 'shortName': '?45', 'macaddr': 'xE8zaqxF'}, 'position': {'batteryLevel': 100}}
'Namespace' object has no attribute 'tunnel'

C:\Users\xx>meshtastic --port COM10 --sendtext "hello kevin"
Connected to radio
Sending text message hello kevin to ^all
'Namespace' object has no attribute 'tunnel'

C:\Users\xx>meshtastic --version
1.1.29

ok definitely fixed now ;-). thanks for the remote debugging help @qurm.

1 Like

I just upgraded the python API to 1.1.30 on my Ubuntu machine and there is a reference to pytap2 missing somewhere. I had to install it manually. Here is the full log:

> pip3 install -U  meshtastic
Collecting meshtastic
  Downloading meshtastic-1.1.30-py3-none-any.whl (37 kB)
Requirement already satisfied, skipping upgrade: dotmap>=1.3.14 in /home/claes/.local/lib/python3.8/site-packages (from meshtastic) (1.3.14)
Requirement already satisfied, skipping upgrade: pygatt>=4.0.5 in /home/claes/.local/lib/python3.8/site-packages (from meshtastic) (4.0.5)
Requirement already satisfied, skipping upgrade: pyserial>=3.4 in /home/claes/.local/lib/python3.8/site-packages (from meshtastic) (3.4)
Requirement already satisfied, skipping upgrade: pyqrcode>=1.2.1 in /home/claes/.local/lib/python3.8/site-packages (from meshtastic) (1.2.1)
Requirement already satisfied, skipping upgrade: pexpect>=4.6.0 in /usr/lib/python3/dist-packages (from meshtastic) (4.6.0)
Requirement already satisfied, skipping upgrade: protobuf>=3.13.0 in /home/claes/.local/lib/python3.8/site-packages (from meshtastic) (3.13.0)
Requirement already satisfied, skipping upgrade: pypubsub>=4.0.3 in /home/claes/.local/lib/python3.8/site-packages (from meshtastic) (4.0.3)
Requirement already satisfied, skipping upgrade: enum-compat in /home/claes/.local/lib/python3.8/site-packages (from pygatt>=4.0.5->meshtastic) (0.0.3)
Requirement already satisfied, skipping upgrade: setuptools in /usr/lib/python3/dist-packages (from protobuf>=3.13.0->meshtastic) (45.2.0)
Requirement already satisfied, skipping upgrade: six>=1.9 in /usr/lib/python3/dist-packages (from protobuf>=3.13.0->meshtastic) (1.14.0)
Installing collected packages: meshtastic
  Attempting uninstall: meshtastic
    Found existing installation: meshtastic 1.1.25
    Uninstalling meshtastic-1.1.25:
      Successfully uninstalled meshtastic-1.1.25
Successfully installed meshtastic-1.1.30
> meshtastic --info
Traceback (most recent call last):
  File "/home/claes/.local/bin/meshtastic", line 5, in <module>
    from meshtastic.__main__ import main
  File "/home/claes/.local/lib/python3.8/site-packages/meshtastic/__main__.py", line 15, in <module>
    from . import tunnel
  File "/home/claes/.local/lib/python3.8/site-packages/meshtastic/tunnel.py", line 18, in <module>
    from pytap2 import TapDevice
ModuleNotFoundError: No module named 'pytap2'
> pip3 install -U  pytap2
Collecting pytap2
  Downloading pytap2-2.0.0-py3-none-any.whl (5.4 kB)
Installing collected packages: pytap2
Successfully installed pytap2-2.0.0
> meshtastic --info
Connected to radio
my_node_num: 3220213000
num_channels: 10
region: "1.0-EU865"
hw_model: "tlora-v1"
firmware_version: "1.1.30"
packet_id_bits: 32
current_packet_id: 1051273344
node_num_bits: 32
message_timeout_msec: 300000
min_app_version: 20120

preferences {
  ls_secs: 300
  region: EU865
}
channel_settings {
  modem_config: Bw125Cr48Sf4096
  psk: "\001"
}

Channel URL https://www.meshtastic.org/c/#GAMiAQE=
Nodes in mesh:
{'num': 3220213000, 'user': {'id': '!3c71bff08d08', 'longName': 'Desk', 'shortName': 'Dsk', 'macaddr': 'PHG/8I0I'}}
{'num': 681024020, 'user': {'id': '!246f28979a14', 'longName': 'Nexus', 'shortName': 'Nxs', 'macaddr': 'JG8ol5oU'}, 'snr': 11.75}
{'num': 681022624, 'user': {'id': '!246f289794a0', 'longName': 'Claes', 'shortName': 'Cls', 'macaddr': 'JG8ol5Sg'}, 'snr': 10.25}
>

Happened to me as well on Raspberry Pi OS some API releases ago.

@claesg hmm - that’s really strange. I though I had quashed this one for @qurm. It seems your windows python install was more aggressive about trying to resolve imports (which were guarded by a conditional to prevent their resolution). Can you try upgrading to 1.1.31 I just released to bury things deeper?

@claesg: what version of python do you have installed?
@qurm: what version of python do you have installed?
(I’m trying to figure out of later versions of python don’t have this problem)

1.1.31 sems to work without pytap2. Thanks for the fix!
I am runnig Python 3.8.5 on Ubuntu 20.04.1 LTS

> pip3 uninstall pytap2
Found existing installation: pytap2 2.0.0
Uninstalling pytap2-2.0.0:
  Would remove:
    /home/claes/.local/lib/python3.8/site-packages/pytap2-2.0.0.dist-info/*
    /home/claes/.local/lib/python3.8/site-packages/pytap2/*
Proceed (y/n)? y
  Successfully uninstalled pytap2-2.0.0
> pip3 install -U meshtastic
Collecting meshtastic
  Downloading meshtastic-1.1.31-py3-none-any.whl (37 kB)
Requirement already satisfied, skipping upgrade: pyserial>=3.4 in ./.local/lib/python3.8/site-packages (from meshtastic) (3.4)
Requirement already satisfied, skipping upgrade: pyqrcode>=1.2.1 in ./.local/lib/python3.8/site-packages (from meshtastic) (1.2.1)
Requirement already satisfied, skipping upgrade: pexpect>=4.6.0 in /usr/lib/python3/dist-packages (from meshtastic) (4.6.0)
Requirement already satisfied, skipping upgrade: pygatt>=4.0.5 in ./.local/lib/python3.8/site-packages (from meshtastic) (4.0.5)
Requirement already satisfied, skipping upgrade: dotmap>=1.3.14 in ./.local/lib/python3.8/site-packages (from meshtastic) (1.3.14)
Requirement already satisfied, skipping upgrade: pypubsub>=4.0.3 in ./.local/lib/python3.8/site-packages (from meshtastic) (4.0.3)
Requirement already satisfied, skipping upgrade: protobuf>=3.13.0 in ./.local/lib/python3.8/site-packages (from meshtastic) (3.13.0)
Requirement already satisfied, skipping upgrade: enum-compat in ./.local/lib/python3.8/site-packages (from pygatt>=4.0.5->meshtastic) (0.0.3)
Requirement already satisfied, skipping upgrade: six>=1.9 in /usr/lib/python3/dist-packages (from protobuf>=3.13.0->meshtastic) (1.14.0)
Requirement already satisfied, skipping upgrade: setuptools in /usr/lib/python3/dist-packages (from protobuf>=3.13.0->meshtastic) (45.2.0)
Installing collected packages: meshtastic
  Attempting uninstall: meshtastic
    Found existing installation: meshtastic 1.1.30
    Uninstalling meshtastic-1.1.30:
      Successfully uninstalled meshtastic-1.1.30
Successfully installed meshtastic-1.1.31
> python --version
Python 3.8.5
claes@big-ubuntu:~$ cat /etc/issue
Ubuntu 20.04.1 LTS \n \l

> meshtastic --info
Connected to radio
my_node_num: 3220213000
num_channels: 10
region: "1.0-EU865"
hw_model: "tlora-v1"
firmware_version: "1.1.30"
packet_id_bits: 32
current_packet_id: 380013883
node_num_bits: 32
message_timeout_msec: 300000
min_app_version: 20120

preferences {
  ls_secs: 300
  region: EU865
}
channel_settings {
  modem_config: Bw125Cr48Sf4096
  psk: "\001"
}

Channel URL https://www.meshtastic.org/c/#GAMiAQE=
Nodes in mesh:
{'num': 3220213000, 'user': {'id': '!3c71bff08d08', 'longName': 'Desk', 'shortName': 'Dsk', 'macaddr': 'PHG/8I0I'}, 'position': {}}
{'num': 681024020, 'user': {'id': '!246f28979a14', 'longName': 'Nexus', 'shortName': 'Nxs', 'macaddr': 'JG8ol5oU'}, 'position': {'batteryLevel': 43}, 'snr': 11.0}
{'num': 681022624, 'user': {'id': '!246f289794a0', 'longName': 'Claes', 'shortName': 'Cls', 'macaddr': 'JG8ol5Sg'}, 'position': {'batteryLevel': 45}, 'snr': 9.0}
claes@big-ubuntu:~$
1 Like

Can someone help me out install Meshtastic on windows 10? This is what I get when when trying to install pytap2;

If I try to install Meshtastic, this is what I get;

I have installed Python 3.9 already, not sure what is the issue?

Thanks

UPDATE: Figured it out, I was in the wrong directory - windows user with hidden directories.
Once I selected ‘show hidden items’ in windows file explorer I was able to find the correct directory with python scripts. Both pytap2 and Meshtastic installed without issues.

image

Maybe someone as skillful as me will need this :slight_smile:

2 Likes

I went through the exact same problems, as well as a few other dummy steps.

Like trying to type “Sudo” at the beginning multiple times haha.

Would definitely be good to clarify a few things on the install process.

1 Like

thanks ya’ll for the feedback. If either of you new windows users are willing to improve README.md in meshtastic-python, I’d eagerly merge the changes. It would really help everyone else.

Here’s a good tutorial if you wanna learn how to do this fun and helpful thing. (no good deed goes unpunished :wink: )

1 Like

You bet! I’ve been brainstorming some windows/general things to add, it’s the least I could do to contribute! I just want to learn it well enough that I can know what I’m talking about!

1 Like