Code Monkey home page Code Monkey logo

Comments (7)

JoseJX avatar JoseJX commented on May 30, 2024 1

I've pulled and built 01eaceb, but unfortunately, it still persists with the same unknown value and error in logcat. Mutex locking was a good idea though! I'll try this on another android phone this weekend to try to figure out if it's the lighthouses themselves or the phone's BT implementation that might be causing the issue.

from lighthouse_pm.

jeroen1602 avatar jeroen1602 commented on May 30, 2024

Hmm, it should only allow the second power state read when the first one has finished.

I do know that this sometimes happens when an old device is still reading while a new scan is happening. But the error is handled and I don't think it is the problem.

What I'm wondering is. Is it spamming this stack trace or is it just once (for every device)? If this is not the case then I think the problem might be that the older firmware revisions don't report back their power-state. Or have different values for their states.

from lighthouse_pm.

JoseJX avatar JoseJX commented on May 30, 2024

It's once per read, per lighthouse device.

Both of my lighthouses have firmware 3002. I haven't figured out a way to update them yet without a working Windows setup. I might be able to borrow a laptop from a friend in a week or so, but it isn't something I can do right away.

I am able to use the CLI version of lighthouse-v2-manager to turn them on/off from my PC. If there's any other information I could provide that might help, please let me know!

from lighthouse_pm.

jeroen1602 avatar jeroen1602 commented on May 30, 2024

According to this Stackoverflow post this happens when another transaction is still going on.

Though I can't find in the code where this transaction may hang. If you want to also try and have a look then you should take a look in lib/lighthouseProvider/devices/BLEDevice.dart and/ or lib/lighthouseProvider/devices/LighthouseV2Device.dart. That is where all the communication happens.

However I do see that I should probably use atomic locks for this instead of a boolean since write operation is also supposed to wait.

from lighthouse_pm.

jeroen1602 avatar jeroen1602 commented on May 30, 2024

I've implemented an actual Mutex lock (#37) can you check if the problem still persists?

I'm also adding a work-around in case this error ever pops up again see: #38

from lighthouse_pm.

jeroen1602 avatar jeroen1602 commented on May 30, 2024

I hope the new Play store release that has been released today can help with this problem. Maybe not the state not working but at least making the app usable.

from lighthouse_pm.

JoseJX avatar JoseJX commented on May 30, 2024

Sorry, I've been busy with work and haven't had a chance to respond. I did test the latest version and can confirm that even though the state is still 0xFF, I can now turn on and off the lighthouses with this app.

Thanks!

from lighthouse_pm.

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.