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

Not even login works #5

Open
greuff opened this issue Aug 5, 2021 · 1 comment
Open

Not even login works #5

greuff opened this issue Aug 5, 2021 · 1 comment

Comments

@greuff
Copy link

greuff commented Aug 5, 2021

Tested against openwrt-19.07:

#!/usr/bin/python3

from ubus import Ubus

ubus = Ubus('192.168.0.1')
ubus['session']['login'](username='root', password='xxx')

Result:

Traceback (most recent call last):
  File "main.py", line 6, in <module>
    ubus['session']['login'](username='root', password='xxx')
  File "/home/tw/.local/share/virtualenvs/openwrt-wifi-presence-mqtt-L6rf1mrk/lib/python3.8/site-packages/ubus/protocol.py", line 259, in __getitem__
    if item not in self.namespaces:
  File "/home/tw/.local/share/virtualenvs/openwrt-wifi-presence-mqtt-L6rf1mrk/lib/python3.8/site-packages/ubus/protocol.py", line 247, in namespaces
    self._ifaces = self._fetch_ifaces()
  File "/home/tw/.local/share/virtualenvs/openwrt-wifi-presence-mqtt-L6rf1mrk/lib/python3.8/site-packages/ubus/protocol.py", line 251, in _fetch_ifaces
    ifaces = {x: UbusNamespace(self, x) for x in self._do_request('list', '*', '')}
  File "/home/tw/.local/share/virtualenvs/openwrt-wifi-presence-mqtt-L6rf1mrk/lib/python3.8/site-packages/ubus/protocol.py", line 242, in _do_request
    raise UbusException("Got a non-200 retcode: %s" % res.status_code)
ubus.protocol.UbusException: Got a non-200 retcode: 404
@rytilahti
Copy link
Owner

It's been a while since I touched any of this, but have you installed uhttpd-mod-ubus and configured it as discussed in https://oldwiki.archive.openwrt.org/doc/techref/ubus#access_to_ubus_over_http ?`

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

2 participants