• Recent
  • Tags
  • Unsolved
  • Solved
  • MagicMirror² Repository
  • Documentation
  • 3rd-Party-Modules
  • Donate
  • Discord
  • Register
  • Login
MagicMirror Forum
  • Recent
  • Tags
  • Unsolved
  • Solved
  • MagicMirror² Repository
  • Documentation
  • 3rd-Party-Modules
  • Donate
  • Discord
  • Register
  • Login
A New Chapter for MagicMirror: The Community Takes the Lead
Read the statement by Michael Teeuw here.

Module Developer Challenge - I surrender!

Scheduled Pinned Locked Moved Solved Development
33 Posts 6 Posters 17.0k Views 5 Watching
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    Mykle1 Project Sponsor Module Developer @ninjabreadman
    last edited by Feb 15, 2018, 2:51 AM

    @ninjabreadman

    You know, I started out with that package but had some trouble with it. Likely, the problem was me, but I moved to the pc-stats package and had no problems. However, as you saw, that package doesn’t offer the cpu temps. I then tried unsuccessfully to use other packages along with pc-stats to get the temps but my knowledge and abilities are woefully inadequate. For whatever reason, I was able to get a return from pc-stats. That’s no small miracle where I’m concerned. I do like the data that the return gives me, especially the multicore support.

    Anyway, I did give it more than a few days and more than a few attempts but I will look at systeminformation again in the hopes that I can stumble across some success. Really, I am not qualified to be doing any of this. I just find it so fascinating that I keep trying until I get something right. And then there are the few special people that have taken pity on me and taught me what I needed to know at any given moment. They have my deepest gratitude and respect.

    Thanks for pointing me back to where I should have been all along. :-)

    Create a working config
    How to add modules

    N 1 Reply Last reply Feb 15, 2018, 1:22 PM Reply Quote 0
    • N Offline
      ninjabreadman @Mykle1
      last edited by Feb 15, 2018, 1:22 PM

      @Mykle1 Depending on the style/implementation you’re using, you may want to read up on Promises in JS.

      Also, see this note here about the lm-sensors package.

      Alternatively, have a look at MMM-SystemStats which uses vcgencmd on the CLI to retrieve the system temp, which would be far easier to integrate into your current module.

      Problem with config or JavaScript? Copy/paste it into JSHint.
      Check out the detailed walkthroughs on install, config, modules, etc.

      M 1 Reply Last reply Feb 16, 2018, 1:22 AM Reply Quote 1
      • M Offline
        Mykle1 Project Sponsor Module Developer @ninjabreadman
        last edited by Feb 16, 2018, 1:22 AM

        @ninjabreadman said in Module Developer Challenge - I surrender!:

        Alternatively, have a look at MMM-SystemStats which uses vcgencmd on the CLI to retrieve the system temp, which would be far easier to integrate into your current module.

        Thanks ninja. I will give this a shot first. In fact, I’m going to look at that right now.

        Create a working config
        How to add modules

        N 1 Reply Last reply Feb 16, 2018, 1:35 AM Reply Quote 1
        • N Offline
          ninjabreadman @Mykle1
          last edited by ninjabreadman Feb 16, 2018, 1:42 AM Feb 16, 2018, 1:35 AM

          @Mykle1 Hmm, it may be that vcgencmd is specific to the RPi. You can try these; acpi seems like a contender, as does lm-sensors.

          Problem with config or JavaScript? Copy/paste it into JSHint.
          Check out the detailed walkthroughs on install, config, modules, etc.

          M 2 Replies Last reply Feb 16, 2018, 1:48 AM Reply Quote 0
          • M Offline
            Mykle1 Project Sponsor Module Developer @ninjabreadman
            last edited by Feb 16, 2018, 1:48 AM

            @ninjabreadman said in Module Developer Challenge - I surrender!:

            Hmm, it may be that vcgencmd is specific to the RPi.

            Ha! I see. Ok, on to the others. :-)

            Create a working config
            How to add modules

            N 1 Reply Last reply Feb 16, 2018, 2:16 AM Reply Quote 0
            • N Offline
              ninjabreadman @Mykle1
              last edited by Feb 16, 2018, 2:16 AM

              @Mykle1 It actually might be best to run cat /sys/class/thermal/thermal_zone*/type to see if they’re already populating on your Ubuntu install. If so, you can run cat /sys/class/thermal/thermal_zone*/temp to get all the values, or just cat a specific one. Should be to three decimal places (i.e. 64000 means 64.000°C).

              You might run it a few times to see that the values change, and if they do, then use the same exec() method from MMM-SystemStats with the right command and some math.

              Problem with config or JavaScript? Copy/paste it into JSHint.
              Check out the detailed walkthroughs on install, config, modules, etc.

              1 Reply Last reply Reply Quote 0
              • M Offline
                Mykle1 Project Sponsor Module Developer @ninjabreadman
                last edited by Feb 16, 2018, 4:07 AM

                @ninjabreadman said in Module Developer Challenge - I surrender!:

                acpi seems like a contender, as does lm-sensors.

                Made some progress with lm-sensors which gives me great hope. I can see the return in the terminal but not in the node_helper. Still, I’m encouraged. I’ll continue to work on it tomorrow. I’m feeling a bit tired tonight.

                Sockets connected & modules started ...
                Launching application.
                { 'nouveau-pci-0100': { 'PCI adapter': { temp1: [Object] } },
                  'coretemp-isa-0000': 
                   { 'ISA adapter': 
                      { 'Core 0': [Object],
                        'Core 1': [Object],
                        'Core 2': [Object],
                        'Core 3': [Object] } } }
                Whoops! There was an uncaught exception...
                TypeError: this.sendSocketNotification is not a function
                    at /home/pop/MagicMirror/modules/MMM-PC-Stats/node_helper.js:32:9
                    at /home/pop/MagicMirror/modules/MMM-PC-Stats/node_modules/sensors.js/lm-sensors.js:96:12
                    at ChildProcess.exithandler (child_process.js:209:7)
                    at emitTwo (events.js:106:13)
                    at ChildProcess.emit (events.js:194:7)
                    at maybeClose (internal/child_process.js:899:16)
                    at Socket. (internal/child_process.js:342:11)
                    at emitOne (events.js:96:13)
                    at Socket.emit (events.js:191:7)
                    at Pipe._handle.close [as _onclose] (net.js:510:12)
                

                Create a working config
                How to add modules

                E 1 Reply Last reply Feb 16, 2018, 10:27 AM Reply Quote 0
                • E Offline
                  E3V3A @Mykle1
                  last edited by Feb 16, 2018, 10:27 AM

                  @Mykle1 Not sure what you’re doing in your code. But…

                  1. You’ll get a temp reading for each cpu core, so you need to choose|add|average…, and
                  2. How do you execute the script? Did you give it proper permissions?
                  3. I’m you already know, but you also need to allow the external file to be read from node_helper.js.

                  "Everything I do (here) is for free – altruism is the way!"
                  MMM-FlightsAbove, MMM-Tabulator, MMM-Assistant (co-maintainer)

                  M 1 Reply Last reply Feb 16, 2018, 12:45 PM Reply Quote 0
                  • M Offline
                    Mykle1 Project Sponsor Module Developer @E3V3A
                    last edited by Feb 16, 2018, 12:45 PM

                    @E3V3A said in Module Developer Challenge - I surrender!:

                    Not sure what you’re doing in your code. But…

                    Neither am I. :-)

                    Create a working config
                    How to add modules

                    S 1 Reply Last reply Feb 16, 2018, 7:54 PM Reply Quote 0
                    • S Offline
                      strawberry 3.141 Project Sponsor Module Developer @Mykle1
                      last edited by Feb 16, 2018, 7:54 PM

                      @Mykle1 you might want to upload your current version to a github branch so we can see what your doing

                      Please create a github issue if you need help, so I can keep track

                      1 Reply Last reply Reply Quote 0
                      • 1
                      • 2
                      • 3
                      • 4
                      • 2 / 4
                      2 / 4
                      • First post
                        17/33
                        Last post
                      Enjoying MagicMirror? Please consider a donation!
                      MagicMirror created by Michael Teeuw.
                      Forum managed by Sam, technical setup by Karsten.
                      This forum is using NodeBB as its core | Contributors
                      Contact | Privacy Policy