Git Product home page Git Product logo

Comments (6)

LiSongMWO avatar LiSongMWO commented on August 28, 2024 1

@stefanwichmann I just updated. It seems that CPU usage has dropped from ~20% to ~6% CPU which is a significant improvement. Thanks!

from kelvin.

stefanwichmann avatar stefanwichmann commented on August 28, 2024

Hi Emily,

thanks for giving Kelvin a try!

Sadly the observed behavior is normal when using Kelvin. Currently the Hue bridge has no way of informing users that the state of a light changed. So the only way to realize programs like Kelvin is to ask the bridge for changes again and again... Kelvin currently does this every second for every light! This is why you see a load of 20%... If I would reduce this polling frequency it would take much longer for Kelvin to become active once you turn on a light.

If you feel adventurous and now a little bit about go you can adjust the polling value here: https://github.com/stefanwichmann/kelvin/blob/master/light.go#L45

If you are just concerned about energy consumption I think you should not worry to much. The Raspberry PI Zero is a low power device by design and the CPU isn't the only component using energy. If you take the memory and the wifi chip into consideration, the 20% shouldn't matter to much.

Nevertheless I would love to see a way for Kelvin to consume less energy while maintaining the same level of service. If you have ideas I am all ears! :-)

from kelvin.

LiSongMWO avatar LiSongMWO commented on August 28, 2024

Anything C++, and I'm your girl but Go... not really :D

Still, it's a 1 GHz CPU with around 1 IPC so a 20% load for a polling frequency of 1 Hz sounds high to me.

Is there an easy way for me to profile and see where the time is spent? I tried dumping stacks from gdb but that didn't really give much without symbols.

from kelvin.

stefanwichmann avatar stefanwichmann commented on August 28, 2024

This blog post provides an introduction to go profiling:

https://blog.golang.org/profiling-go-programs

If you feel like it, give it a try! This help would definitely be very welcome. Can't promise a timeline but will also look into it...

from kelvin.

jpds avatar jpds commented on August 28, 2024

@stefanwichmann Can we make that light update interval a configurable option? With the 'remember-last-light-state' option in the new firmware update - I don't require my lights to change that much when I switch them on. Also, I have a large number of bulbs at home, to the point where I can't use the mobile app while Kelvin is running.

from kelvin.

stefanwichmann avatar stefanwichmann commented on August 28, 2024

Just released Kelvin 1.2.0 which should improve the performance a lot! Especially in setups with many lights... Let me know if it works for you!

from kelvin.

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.