geoffwhittington / meshtastic-matrix-relay

A relay between a Matrix.org room and a Meshtastic radio. This relay extends your Matrix.org-based communication with a LoRa-based Meshtastic radio mesh. This is not an official product of Matrix.org or Meshtastic.
MIT License
78 stars 11 forks source link

MMRelay not loading in Windows since at least 0.3.23-0.3.24 #52

Closed jeremiah-k closed 1 year ago

jeremiah-k commented 1 year ago

I built an installer for the latest changes with shortnames (0.4.0) so I could test it out in Windows machines. This is what happens when running the relay via python in GitBash.

$ python main.py
2023-06-09 14:20:03 -0500 INFO:Meshtastic:Connecting to serial port COM7 ...
2023-06-09 14:20:04 -0500 INFO:Meshtastic:Connected to M<>M / TBEAM_V0P7
Traceback (most recent call last):
  File "C:\Users\Laura\Desktop\mmrelay-0.3.24\main.py", line 85, in <module>
    asyncio.run(main())
  File "C:\Program Files\Python310\lib\asyncio\runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "C:\Program Files\Python310\lib\asyncio\base_events.py", line 649, in run_until_complete
    return future.result()
  File "C:\Users\Laura\Desktop\mmrelay-0.3.24\main.py", line 40, in main
    load_plugins()
  File "C:\Users\Laura\Desktop\mmrelay-0.3.24\plugin_loader.py", line 25, in load_plugins
    HealthPlugin(),
  File "C:\Users\Laura\Desktop\mmrelay-0.3.24\plugins\base_plugin.py", line 29, in __init__
    if "plugins" in relay_config and self.plugin_name in relay_config["plugins"]:
TypeError: argument of type 'NoneType' is not iterable
(.pyenv)
Laura@DESKTOP-FNV2O8D MINGW64 ~/Desktop/mmrelay-0.3.24
$

When the relay is run from the .exe sometimes it would error out with something along the lines of: Could not open port ‘COM7’: PermissionError(13, ‘Access is denied.’, None, 5)

Rebooting would not fix it, I would have to disable/enable the COM port in the Device Manager, then reboot and it would come out of it.

jeremiah-k commented 1 year ago

Nevermind! It was a configuration issue. Might need some error handling in the future, but there's no problem with the correct config.