Coder Social home page Coder Social logo

avm: wrong avm_wlan_index about plugins HOT 10 CLOSED

smarthomeng avatar smarthomeng commented on August 28, 2024
avm: wrong avm_wlan_index

from plugins.

Comments (10)

sisamiwe avatar sisamiwe commented on August 28, 2024 1

@gruberth
Bugfix PR has been merged to develop.
Issue can be closed

from plugins.

sisamiwe avatar sisamiwe commented on August 28, 2024

@gruberth
The Plugin handles the avm_wlan_index '(1: 2.4Ghz, 2: 5Ghz, 3: Gaeste)' as written in the plugin.yaml.
The AVM API uses index 0, 1, 2. That's why the read avm_wlan_index is reduced by 1 to match the API.

So in my opinion the current code is correct.

from plugins.

gruberth avatar gruberth commented on August 28, 2024

I don't know what you mean by 'read avm_wlan_index'. This is not the read part of settings, its the write wlan settings to the device method.

As far as I saw, the original code uses the decremented index 0,1,2 for the writing part using the self.set_wlanconfig(...) method and the index of the plugin 1,2,3 for the reading part used in the self._update_wlan_config(...) method. So something weird must be going on between writing and reading the wlan settings.

The code form above was my solution without going to much into detail. But since I changed this section in the plugin code I had no troubles on both of my devices anymore. Writing and reading the state of the indexed wifi works great.

Btw I am using a Fritz!Box 5490 with the actual Fritz!OS 07.29 and a Fritz!Repeater 2400 with the same Fritz!OS 07.29.

from plugins.

sisamiwe avatar sisamiwe commented on August 28, 2024

@gruberth
Ok, Which version are you using (master / develop)?

from plugins.

gruberth avatar gruberth commented on August 28, 2024

For testing I tried both. But now I am using the master version.

from plugins.

sisamiwe avatar sisamiwe commented on August 28, 2024

@gruberth

I'm working on further update / bugfixing which is close to be ready.
Could you try the upcoming version 1.6.7. which is here: https://github.com/sisamiwe/shng-avm-plugin
If the reported issue is solved, this will be the next develop release.

from plugins.

gruberth avatar gruberth commented on August 28, 2024

I have the same problem on your newest version.

When I send False to the item with the avm_wlan_index@fritzbox_5490 : 2 attribute it shuts the 2,4 GHz wifi off. For a couple of minutes this item is also False, until it gets an update form the device (here by the 5Ghz wifi setting, wich has never been turned off) and writes in this 5 GHz item True again. Same problem on the repeater. I use to check the state of the wifi the settings webinterface of the router/repeater. Despite the wrong behavior there is no warning or error in SHNG and the log.

For me its quite obvious that the write wlan_index is wrong, or/and there is a problem between writing and reading the wlan settings.

Here is a log where I set the item of the 5Ghz wifi from the repeater to False. But it really turned of the 2,4GHz and after these 3 minutes the item System.Avm.repeater1.wlan.wlan_5 was back on True again but the 2,4 GHz wifi on the device stayed off.

2022-04-19  17:31:51 INFO     modules.admin.systemdata item_change_value_html: item 'System.Avm.repeater1.wlan.wlan_5' set to value 'false'
2022-04-19  17:35:09 DEBUG    plugins.avm         repeater_2400_1@: Starting update loop for instance repeater_2400_1
2022-04-19  17:35:09 DEBUG    plugins.avm         repeater_2400_1@: Request Update for System.Avm.repeater1.uptime
2022-04-19  17:35:09 DEBUG    plugins.avm         repeater_2400_1@: Sending POST request successful
2022-04-19  17:35:09 DEBUG    plugins.avm         repeater_2400_1@: Request Update for System.Avm.repeater1.serial_number
2022-04-19  17:35:09 DEBUG    plugins.avm         repeater_2400_1@: Accessing dev_info response cache for action GetInfo and item System.Avm.repeater1.serial_number!
2022-04-19  17:35:09 DEBUG    plugins.avm         repeater_2400_1@: Request Update for System.Avm.repeater1.wlan.wlan_24
2022-04-19  17:35:09 DEBUG    plugins.avm         repeater_2400_1@: Sending POST request successful
2022-04-19  17:35:09 DEBUG    plugins.avm         repeater_2400_1@: Request Update for System.Avm.repeater1.wlan.wlan_24_ssid
2022-04-19  17:35:09 DEBUG    plugins.avm         repeater_2400_1@: Accessing wlanconfig response cache for action GetInfo and item System.Avm.repeater1.wlan.wlan_24_ssid!
2022-04-19  17:35:09 DEBUG    plugins.avm         repeater_2400_1@: Request Update for System.Avm.repeater1.wlan.wlan_5
2022-04-19  17:35:09 DEBUG    plugins.avm         repeater_2400_1@: Sending POST request successful

The log from the repeater was:

19.04.22 17:31:51 WLAN wurde über die Benutzeroberfläche deaktiviert (2,4 GHz).

The item is defined as the following:

wlan_5:
          type: bool
          visu_acl: rw
          enforce_updates: yes
          avm_data_type@repeater_2400_1: wlanconfig
          avm_wlan_index@repeater_2400_1: 2

from plugins.

sisamiwe avatar sisamiwe commented on August 28, 2024

@gruberth

The bug is found!
Please try again the upcoming version which is here: https://github.com/sisamiwe/shng-avm-plugin

from plugins.

gruberth avatar gruberth commented on August 28, 2024

@sisamiwe works great!! thanks a lot.

from plugins.

sisamiwe avatar sisamiwe commented on August 28, 2024

I just created a PR for version 1.6.7 which contains the bugfix

from plugins.

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.