Giter Club home page Giter Club logo

Comments (10)

Salamek avatar Salamek commented on June 21, 2024

It should be in https://github.com/Salamek/huawei-lte-api/blob/1a28bbf96eec2480b04e03b46584f67ffeb9dc11/huawei_lte_api/api/Security.py#L15

But i see only adding url filter implemented right now...

from huawei-lte-api.

TheLime1 avatar TheLime1 commented on June 21, 2024

i used this

def set_multi_basic_settings(self, clients: list) -> SetResponseType:
"""
:param clients: list of dicts with format {'wifihostname': hostname,'WifiMacFilterMac': mac}
"""
return self._session.post_set('wlan/multi-basic-settings', {
'Ssids': {
'Ssid': clients
},
'WifiRestart': 1
})

this is my code

from huawei_lte_api.Client import Client
from huawei_lte_api.Connection import Connection
from huawei_lte_api.api.WLan import WLan

with Connection('http://admin:[email protected]/') as connection:
    client = Client(connection)
    wlan = client.wlan
    clients = [{'wifihostname': 'B612-233',
                'WifiMacFilterMac': '66:77:88:99:AA:BB'}]

    response = wlan.set_multi_macfilter_settings(clients)

and it give me

Traceback (most recent call last):
  File "c:\Users\everp\Documents\GitHub\fixbox\getmac.py", line 11, in <module>
    response = wlan.set_multi_macfilter_settings(clients)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\everp\AppData\Local\Programs\Python\Python311\Lib\site-packages\huawei_lte_api\api\WLan.py", line 146, in set_multi_macfi
lter_settings                                                                                                                                 return self._session.post_set('wlan/multi-macfilter-settings', {
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\everp\AppData\Local\Programs\Python\Python311\Lib\site-packages\huawei_lte_api\Session.py", line 215, in post_set        
    self._post(endpoint, data, refresh_csrf, prefix, is_encrypted, is_json)
  File "C:\Users\everp\AppData\Local\Programs\Python\Python311\Lib\site-packages\huawei_lte_api\Session.py", line 34, in wrapped
    return fn(*args, **kw)
           ^^^^^^^^^^^^^^^
  File "C:\Users\everp\AppData\Local\Programs\Python\Python311\Lib\site-packages\huawei_lte_api\Session.py", line 254, in _post
    response_data = cast(str, self._check_response_status(self._process_response_data(response)))
                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\everp\AppData\Local\Programs\Python\Python311\Lib\site-packages\huawei_lte_api\Session.py", line 156, in _check_response_
status                                                                                                                                        raise error_code_to_exception.get(error_code, ResponseErrorException)(
huawei_lte_api.exceptions.ResponseErrorException: 9003: Unknown

from huawei-lte-api.

TheLime1 avatar TheLime1 commented on June 21, 2024

when i click save
image

from huawei-lte-api.

TheLime1 avatar TheLime1 commented on June 21, 2024

and using this

from huawei_lte_api.Client import Client
from huawei_lte_api.Connection import Connection
from huawei_lte_api.api.WLan import WLan

with Connection('http://admin:[email protected]/') as connection:
    client = Client(connection)
    wlan = client.wlan
    wlan.set_mac_filter('myhostname', '66:77:88:99:AA:BB')

give

tHub/fixbox/getmac.py                                                                                                                     Traceback (most recent call last):
  File "c:\Users\everp\Documents\GitHub\fixbox\getmac.py", line 8, in <module>
    wlan.set_mac_filter('myhostname', '66:77:88:99:AA:BB')
  File "C:\Users\everp\AppData\Local\Programs\Python\Python311\Lib\site-packages\huawei_lte_api\api\WLan.py", line 159, in set_mac_filter 
    return self._session.post_set('wlan/mac-filter', OrderedDict((
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\everp\AppData\Local\Programs\Python\Python311\Lib\site-packages\huawei_lte_api\Session.py", line 215, in post_set        
    self._post(endpoint, data, refresh_csrf, prefix, is_encrypted, is_json)
  File "C:\Users\everp\AppData\Local\Programs\Python\Python311\Lib\site-packages\huawei_lte_api\Session.py", line 34, in wrapped
    return fn(*args, **kw)
           ^^^^^^^^^^^^^^^
  File "C:\Users\everp\AppData\Local\Programs\Python\Python311\Lib\site-packages\huawei_lte_api\Session.py", line 254, in _post
    response_data = cast(str, self._check_response_status(self._process_response_data(response)))
                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\everp\AppData\Local\Programs\Python\Python311\Lib\site-packages\huawei_lte_api\Session.py", line 156, in _check_response_
status                                                                                                                                        raise error_code_to_exception.get(error_code, ResponseErrorException)(
huawei_lte_api.exceptions.ResponseErrorNotSupportedException: 100002: No support

from huawei-lte-api.

TheLime1 avatar TheLime1 commented on June 21, 2024

i see a pattern with this erorr code
https://github.com/Salamek/huawei-lte-api/issues?q=is%3Aissue+is%3Aopen+100002

from huawei-lte-api.

Salamek avatar Salamek commented on June 21, 2024

You have used wrong function, your router is using set_multi_macfilter_settings call, try that

from huawei-lte-api.

TheLime1 avatar TheLime1 commented on June 21, 2024

You have used wrong function, your router is using set_multi_macfilter_settings call, try that

this is my code

from huawei_lte_api.Client import Client
from huawei_lte_api.Connection import Connection
from huawei_lte_api.api.WLan import WLan

with Connection('http://admin:[email protected]/') as connection:
    client = Client(connection)
    wlan = client.wlan
    clients = [{'wifihostname': 'B612-233',
                'WifiMacFilterMac': '66:77:88:99:AA:BB'}]

    response = wlan.set_multi_macfilter_settings(clients)

and it give me

Traceback (most recent call last):
  File "c:\Users\everp\Documents\GitHub\fixbox\getmac.py", line 11, in <module>
    response = wlan.set_multi_macfilter_settings(clients)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\everp\AppData\Local\Programs\Python\Python311\Lib\site-packages\huawei_lte_api\api\WLan.py", line 146, in set_multi_macfi
lter_settings                                                                                                                                 return self._session.post_set('wlan/multi-macfilter-settings', {
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\everp\AppData\Local\Programs\Python\Python311\Lib\site-packages\huawei_lte_api\Session.py", line 215, in post_set        
    self._post(endpoint, data, refresh_csrf, prefix, is_encrypted, is_json)
  File "C:\Users\everp\AppData\Local\Programs\Python\Python311\Lib\site-packages\huawei_lte_api\Session.py", line 34, in wrapped
    return fn(*args, **kw)
           ^^^^^^^^^^^^^^^
  File "C:\Users\everp\AppData\Local\Programs\Python\Python311\Lib\site-packages\huawei_lte_api\Session.py", line 254, in _post
    response_data = cast(str, self._check_response_status(self._process_response_data(response)))
                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\everp\AppData\Local\Programs\Python\Python311\Lib\site-packages\huawei_lte_api\Session.py", line 156, in _check_response_
status                                                                                                                                        raise error_code_to_exception.get(error_code, ResponseErrorException)(
huawei_lte_api.exceptions.ResponseErrorException: 9003: Unknown

from huawei-lte-api.

Salamek avatar Salamek commented on June 21, 2024

Is that correct payload? Check what is your router sending in browser debug tools "Payload" card...

from huawei-lte-api.

Salamek avatar Salamek commented on June 21, 2024

Closed by #204

from huawei-lte-api.

Salamek avatar Salamek commented on June 21, 2024

Released in 1.8.1

from huawei-lte-api.

Related Issues (20)

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.