Giter Site home page Giter Site logo

Comments (8)

ssbrewco avatar ssbrewco commented on August 30, 2024 2

Side note: If possible, bring back the CLI as well. Not having it breaks the device provisioning flow we had.

Issue #20 open on this one.

from mdash.

younesmaia avatar younesmaia commented on August 30, 2024 1

I can confirm the same problem is happening to me on mDash v1.2.16 and Platformio ESP32 core 6.3.1 (latest).
Opened a ticket about it:
#21

The loop() task indeed stops when mDash functions are called. I'm having random issues even with mDashConfigGet.

Side note: If possible, bring back the CLI as well. Not having it breaks the device provisioning flow we had.

from mdash.

cpq avatar cpq commented on August 30, 2024

Gents, the code is wide open.

Sends your PRs.

from mdash.

younesmaia avatar younesmaia commented on August 30, 2024

I've temporarily commented lines 104 and 107 (xSemaphoreTakeRecursive and xSemaphoreGiveRecursive) for testing and mDash works perfectly (for as long as you don't call any mDash function while another is still running 😀).
So, this is definetely an Mutex-related issue.
But, I could not find anything wrong with the implementation in mDash.c itself. The calls for taking and giving the semaphore are properly placed and there should be no holdup...

from mdash.

Thermelgy-Repo avatar Thermelgy-Repo commented on August 30, 2024

I have solved the issue, plz check the PR. #24

from mdash.

cpq avatar cpq commented on August 30, 2024

You just added a duplicate of notify without the locks - that's not a proper fix.

I guess that the core of the issue is here:

mDash/src/mDash.c

Lines 736 to 740 in 8bd6647

void mDashPoll(void) {
MDashMutexLock();
mg_mgr_poll(&s_mgr, 50);
MDashMutexUnlock();
}

All functions that may be called by the mDashPoll(), for example mDashShadowUpdate(), will deadlock.
So I guess that the proper fix would be to just remove the locks from mDashShadowUpdate() and document that the mutex locks must be called manually before and after, in case the function is called outside the mdash thread.

from mdash.

Thermelgy-Repo avatar Thermelgy-Repo commented on August 30, 2024

You just added a duplicate of notify without the locks - that's not a proper fix.

I guess that the core of the issue is here:

mDash/src/mDash.c

Lines 736 to 740 in 8bd6647

void mDashPoll(void) {
MDashMutexLock();
mg_mgr_poll(&s_mgr, 50);
MDashMutexUnlock();
}

All functions that may be called by the mDashPoll(), for example mDashShadowUpdate(), will deadlock. So I guess that the proper fix would be to just remove the locks from mDashShadowUpdate() and document that the mutex locks must be called manually before and after, in case the function is called outside the mdash thread.

Thankq @cpq for your suggestion, So you meant to directly remove the MutexLocks from the mDashNotify() as well as mDashPoll() functions?

from mdash.

cpq avatar cpq commented on August 30, 2024

@Thermelgy-Repo from the mDashNotify only.
It would be a user responsibility to surround the mDashNotify call with locks manually if it gets called from the outside of Mongoose task.

from mdash.

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.