• 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.

MMM-Temperature/Humidity Module (DHT11, DHT22 and AM2302 sensors.)

Scheduled Pinned Locked Moved Utilities
34 Posts 11 Posters 31.0k Views 10 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.
  • P Offline
    paviro Admin
    last edited by paviro Sep 28, 2016, 7:59 PM Sep 28, 2016, 7:59 PM

    Please also share a link to your module and some screenshots!

    We're all stories in the end. Just make it a good one, eh?

    – The Doctor

    1 Reply Last reply Reply Quote 0
    • P Offline
      psk
      last edited by Sep 28, 2016, 9:01 PM

      oops!! I forgot to post the link. My bad :|

      The module can be found here.

      P.S.K

      1 Reply Last reply Reply Quote 0
      • C Offline
        cowboysdude Module Developer
        last edited by Sep 28, 2016, 10:57 PM

        What is the brand and perhaps part number you’re using for this? Wiring?

        1 Reply Last reply Reply Quote 0
        • B Offline
          Bangee Module Developer
          last edited by Sep 29, 2016, 8:50 AM

          @psk Do you need to run magicmirror as root?

          I try to find a solution to do the same as pi

          1 Reply Last reply Reply Quote 0
          • J Offline
            Jopyth Moderator
            last edited by Sep 29, 2016, 9:46 AM

            @Bangee As far as I know, the normal pi user has sudo rights already. I use a module to shutdown the mirror which needs sudo rights, but works fine with exec from a normal node_helper.

            Helpful sticky: How to troubleshoot

            1 Reply Last reply Reply Quote 0
            • B Offline
              Bangee Module Developer
              last edited by Sep 29, 2016, 11:11 AM

              @Jopyth yes, he has, but he’s going to start the MagicMirror with sudo npm start

              for security reasons I try to run everything without sudo commands.

              1 Reply Last reply Reply Quote 0
              • P Offline
                psk
                last edited by Sep 29, 2016, 11:18 AM

                @cowboysdude DHT11 - This is the sensor that I am using.

                It has three pins -
                +ve - Connected to 5v
                -ve - Ground
                Data - Connected to pin 2

                0_1475147721302_Screenshot_20160929-130338.png

                @Bangee Now, I am running as sudo npm start. Without sudo, it will throw an exception that says it cannot open dev/mem

                0_1475147793966_permission.png

                This is the module screenshot.0_1475147819902_temp.png

                P.S.K

                1 Reply Last reply Reply Quote 1
                • B Offline
                  Bangee Module Developer
                  last edited by Sep 29, 2016, 11:23 AM

                  0_1475148058296_DHT22.JPG

                  I’m using node-dht-sensor

                  As user pi I don’t have an error but after starting MagicMirror thers a crash.

                  @psk you should cool down your room :-)

                  1 Reply Last reply Reply Quote 1
                  • C Offline
                    cowboysdude Module Developer
                    last edited by Sep 29, 2016, 11:49 AM

                    I really do like this! Great job!

                    1 Reply Last reply Reply Quote 1
                    • P Offline
                      psk
                      last edited by paviro Oct 3, 2016, 12:25 PM Sep 29, 2016, 11:55 AM

                      @Bangee According to bcm2835 v1.50-

                      "Running as root
                      Prior to the release of Raspbian Jessie in Feb 2016, access to any peripheral device via /dev/mem on the RPi required the process to run as root. Raspbian Jessie permits non-root users to access the GPIO peripheral (only) via /dev/gpiomem, and this library supports that limited mode of operation.

                      If the library runs with effective UID of 0 (ie root), then bcm2835_init() will attempt to open /dev/mem, and, if successful, it will permit use of all peripherals and library functions.

                      If the library runs with any other effective UID (ie not root), then bcm2835_init() will attempt to open /dev/gpiomem, and, if successful, will only permit GPIO operations. In particular, bcm2835_spi_begin() and bcm2835_i2c_begin() will return false and all other non-gpio operations may fail silently or crash."

                      So i guess we have run with sudo until some other library comes up :D

                      PS: I should!! Its too hot in here… :D :D

                      @cowboysdude Thanks! Cheers :D

                      P.S.K

                      1 Reply Last reply Reply Quote 2
                      • 1
                      • 2
                      • 3
                      • 4
                      • 1 / 4
                      1 / 4
                      • First post
                        6/34
                        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