Git Product home page Git Product logo

python-wifi-connect's People

Contributors

maggie44 avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar

python-wifi-connect's Issues

Hotspot start up error 802-11-wireless-security.psk: property is invalid

So iset up this up with balena-starter-interface but I'm running in to this isse.

Setup:
OpenBalena
generic-amd64-2.115.1-v14.11.1.img

[2023-05-24T12:57:04.234Z] [2023-05-24 12:57:04] - [INFO] - Checking for previously configured Wi-Fi connections...
[2023-05-24T12:57:19.546Z] [2023-05-24 12:57:19] - [INFO] - Adding connection of type HOTSPOT
[2023-05-24T12:57:19.587Z] [2023-05-24 12:57:19] - [ERROR] - Connection failed.
[2023-05-24T12:57:19.588Z] Traceback (most recent call last):
[2023-05-24T12:57:19.588Z] File "/app/common/wifi.py", line 126, in connect
[2023-05-24T12:57:19.588Z] Pnm.Settings.AddConnection(conn_dict)
[2023-05-24T12:57:19.589Z] File "", line 4, in AddConnection
[2023-05-24T12:57:19.589Z] File "/root/.local/lib/python3.8/site-packages/dbus/proxies.py", line 141, in __call__
[2023-05-24T12:57:19.589Z] return self._connection.call_blocking(self._named_service,
[2023-05-24T12:57:19.590Z] File "/root/.local/lib/python3.8/site-packages/dbus/connection.py", line 652, in call_blocking
[2023-05-24T12:57:19.590Z] reply_message = self.send_message_with_reply_and_block(
[2023-05-24T12:57:19.590Z] dbus.exceptions.DBusException: org.freedesktop.NetworkManager.Settings.Connection.InvalidProperty: 802-11-wireless-security.psk: property is invalid
[2023-05-24T12:57:19.591Z] Traceback (most recent call last):
[2023-05-24T12:57:19.591Z] File "/app/common/wifi.py", line 126, in connect
[2023-05-24T12:57:19.591Z] Pnm.Settings.AddConnection(conn_dict)
[2023-05-24T12:57:19.591Z] File "", line 4, in AddConnection
[2023-05-24T12:57:19.592Z] File "/root/.local/lib/python3.8/site-packages/dbus/proxies.py", line 141, in __call__
[2023-05-24T12:57:19.592Z] return self._connection.call_blocking(self._named_service,
[2023-05-24T12:57:19.592Z] File "/root/.local/lib/python3.8/site-packages/dbus/connection.py", line 652, in call_blocking
[2023-05-24T12:57:19.592Z] reply_message = self.send_message_with_reply_and_block(
[2023-05-24T12:57:19.592Z] dbus.exceptions.DBusException: org.freedesktop.NetworkManager.Settings.Connection.InvalidProperty: 802-11-wireless-security.psk: property is invalid
[2023-05-24T12:57:19.593Z]
[2023-05-24T12:57:19.593Z] During handling of the above exception, another exception occurred:
[2023-05-24T12:57:19.593Z]
[2023-05-24T12:57:19.593Z] Traceback (most recent call last):
[2023-05-24T12:57:19.594Z] File "run.py", line 68, in
[2023-05-24T12:57:19.594Z] connect()
[2023-05-24T12:57:19.594Z] File "/app/common/wifi.py", line 166, in connect
[2023-05-24T12:57:19.594Z] raise WifiHotspotStartFailed
[2023-05-24T12:57:19.594Z] common.errors.WifiHotspotStartFailed

Unsupported DeviceType

This looks like a neat solution, but unfortunately I'm not able to start the container. When I try to do so I get the following message:

Traceback (most recent call last):
  File "run.py", line 30, in <module>
    device = get_device()
  File "/app/common/wifi.py", line 248, in get_device
    [(x.DeviceType, x) for x in Pnm.NetworkManager.GetDevices()]
  File "<string>", line 8, in GetDevices
  File "/root/.local/lib/python3.8/site-packages/NetworkManager.py", line 550, in to_python
    val = fixups.base_to_python(val)
  File "/root/.local/lib/python3.8/site-packages/NetworkManager.py", line 607, in base_to_python
    return [fixups.base_to_python(x) for x in val]
  File "/root/.local/lib/python3.8/site-packages/NetworkManager.py", line 607, in <listcomp>
    return [fixups.base_to_python(x) for x in val]
  File "/root/.local/lib/python3.8/site-packages/NetworkManager.py", line 620, in base_to_python
    return globals()[classname](val)
  File "/root/.local/lib/python3.8/site-packages/NetworkManager.py", line 348, in __new__
    klass = device_class(obj.Get('org.freedesktop.NetworkManager.Device', 'DeviceType', dbus_interface='org.freedesktop.DBus.Properties'))
  File "/root/.local/lib/python3.8/site-packages/NetworkManager.py", line 368, in device_class
    return {
KeyError: dbus.UInt32(30, variant_level=1)

I'm not very familiar with both NetworkManager and Python. Is this something that needs to be fixed in python-networkmanager? I've experienced a similar issue with wifi-connect for which I did find this issue. I've scanned my network using the nmcli on the host, and there are no WPA3 networks in the list.

Thanks for your effort and please let me know if there is anything I can check or try!

Can't access API

I'm trying to get this working with the starter-interface, but it seems nothing is running on port 9090. You can check the docker-compose file here.

Logs from the python-wifi-connect container:

[2023-03-05 17:53:59] - [INFO] - Checking for previously configured Wi-Fi connections...
command failed: Resource busy (-16)
[2023-03-05 17:54:12] - [WARNING] - IW resource busy. Retrying...
[2023-03-05 17:54:12] - [WARNING] - IW is unable to complete the request. This can happen on some devices and is usually nothing to worry about.
[2023-03-05 17:54:13] - [INFO] - Adding connection of type HOTSPOT
[2023-03-05 17:54:15] - [INFO] - Connection active.
[2023-03-05 17:54:15] - [INFO] - Listening on 172.17.0.1 port 9090

Payload from starter-interface:

{
    "message": "\u001b[31mconnect ECONNREFUSED 127.0.0.1:9090\u001b[39m",
    "name": "Error",
    "stack": "Error: \u001b[31mconnect ECONNREFUSED 127.0.0.1:9090\u001b[39m\n    at AxiosError.from (/app/node_modules/axios/dist/node/axios.cjs:789:14)\n    at RedirectableRequest.handleRequestError (/app/node_modules/axios/dist/node/axios.cjs:2744:25)\n    at RedirectableRequest.emit (node:events:525:35)\n    at eventHandlers.<computed> (/app/node_modules/follow-redirects/index.js:14:24)\n    at ClientRequest.emit (node:events:513:28)\n    at Socket.socketErrorListener (node:_http_client:494:9)\n    at Socket.emit (node:events:513:28)\n    at emitErrorNT (node:internal/streams/destroy:151:8)\n    at emitErrorCloseNT (node:internal/streams/destroy:116:3)\n    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)",
    "config": {
      "transitional": {
        "silentJSONParsing": true,
        "forcedJSONParsing": true,
        "clarifyTimeoutError": false
      },
      "adapter": [
        "xhr",
        "http"
      ],
      "transformRequest": [
        null
      ],
      "transformResponse": [
        null
      ],
      "timeout": 30000,
      "xsrfCookieName": "XSRF-TOKEN",
      "xsrfHeaderName": "X-XSRF-TOKEN",
      "maxContentLength": -1,
      "maxBodyLength": -1,
      "env": {},
      "headers": {
        "Accept": "application/json, text/plain, */*",
        "User-Agent": "axios/1.2.3",
        "Accept-Encoding": "gzip, compress, deflate, br"
      },
      "baseURL": "http://127.0.0.1:9090/",
      "method": "get",
      "url": "v1/connection_status"
    },
    "code": "ECONNREFUSED",
    "status": null
  }```

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.