Code Monkey home page Code Monkey logo

Comments (9)

klues avatar klues commented on July 26, 2024

Timeout is 15 seconds, defined here: https://github.com/asterics/Addon-Bluetooth-WebGUI/blob/main/webgui/js/communication/ATDevice.js#L206
You can change it, if you want.
I can also change the behaviour so that AT SR is only sent after a successful upgrade.

from addon-bluetooth-webgui.

benjaminaigner avatar benjaminaigner commented on July 26, 2024

👍 THX for the hint, I will have a look!

from addon-bluetooth-webgui.

klues avatar klues commented on July 26, 2024

Did you test with a longer timeout? Currently I'm sending AT SR in a finally-block, so in any case in order to restore GUI-functionalities that are dependent on live values. So I think we should just increase the timeout and not change the AT SR behaviour.

What timeout should be sufficient?

from addon-bluetooth-webgui.

benjaminaigner avatar benjaminaigner commented on July 26, 2024

What timeout should be sufficient?
Hard to say, it depends on the binary size and even on the chip revision.

I think your implementation with the finally is the correct choice,
maybe we should increase the timeout. 20s seems very long,
but the GUI is not waiting that long if the "FIN" string is received...

from addon-bluetooth-webgui.

klues avatar klues commented on July 26, 2024

OK, I've increased it to 20s: 1db2bb8 - should already be live. Why can this take so long, whats happening in the background? In my current test it took about 5 seconds, how could it happen that it sometimes takes >15 seconds? Maybe the transmission speed is a littlebit too fast and so sometimes the upgrade fails and waiting for OTA:FIN runs into a timeout?! See the throttling code here: https://github.com/asterics/Addon-Bluetooth-WebGUI/blob/main/webgui/js/adapter/sercomm.js#L93
I'm sending chunks of 2048 bytes and then waiting for 50ms. These values I've just found out by trial and error.

from addon-bluetooth-webgui.

klues avatar klues commented on July 26, 2024

Hint: for testing purposes you can open the browser console and run logReceived = true in order to get the received raw values logged and see what response is received where "OTA:FIN" is supposed.

from addon-bluetooth-webgui.

benjaminaigner avatar benjaminaigner commented on July 26, 2024

Hint: for testing purposes you can open the browser console and run logReceived = true in order to get the received raw values logged and see what response is received where "OTA:FIN" is supposed.

THX!

Regarding the transmission size: this could be the problem as well.
I'm sending 128Bytes with 10ms delays:
https://github.com/asterics/esp32_addon_bootloader/blob/b803e2d336759a2793094c209ccb36b7a3e2f7d5/update.py#L38

from addon-bluetooth-webgui.

klues avatar klues commented on July 26, 2024

OK, then I'll adapt this as well. However your speed is 12,8B/ms and mine is 40,96B/ms - much faster and seems to also work for most cases. So maybe we should use something like 30B/ms?! Do you know what's the limiting factor here?

Edit: Ah, just realized that you're using FABIs and I'm testing with the FLipMouse. So we could simply use two different speeds for both...

from addon-bluetooth-webgui.

klues avatar klues commented on July 26, 2024

Changed BT upgrade speeds to:

  • FLipMouse: 256B chunk / 10ms pause -> 25,6B/ms
  • FABI: 128B chunk / 10ms pause -> 12,8B/ms

Tested both several times and seemed to work.

Additionally added a global variable which can be used to show the upgrade button, even if BT module version is not found or latest:

  1. open browser console and write showUpgradeButton = true;
  2. go to "Tab General" or switch to other tab and go back to "Tab General" in order to let the variable take effect.

from addon-bluetooth-webgui.

Related Issues (13)

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.