MagicMirror Forum

    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • Donate
    • Discord

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

    Utilities
    11
    34
    22831
    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.
    • H3L1o150
      H3L1o150 last edited by

      @yawns Tanks for the help

      maybe i’m wrong in code. with me show a white screen

      psk 1 Reply Last reply Reply Quote 0
      • psk
        psk @H3L1o150 last edited by paviro

        @H3L1o150 currently, to define the pin to which sensor is connected, you need to edit the node_helper.js file ind MMM-Temperature-Humidity directory and edit line number 12.
        var dht = new rpiDhtSensor.DHT11(2); to var dht = new rpiDhtSensor.DHT11(21);

        you can leave the config as

                    {
        			module: 'MMM-Temperature-Humidity',
        			position: 'bottom_right',
        			config: {
        				refreshInterval: 10000,
        				temperaturePrefix: "Room temperature: ",
        				temperatureSuffix: "°C",
        				humidityPrefix: "Humidity: ",
        				humiditySuffix: "%"
        			}
        		},
        

        guess this needs to be improved in future release… 😃


        Note from admin: Please use Markdown on code snippets for easier reading!

        P.S.K

        1 Reply Last reply Reply Quote 0
        • H3L1o150
          H3L1o150 last edited by

          Tanks @psk

          1 Reply Last reply Reply Quote 1
          • J
            jsyzthz last edited by

            i found MMM cannot auto startup if use it. because it must be run with sudo. but i don’t know how to run sudo with ‘DISPLAY=:0’? @psk

            psk 1 Reply Last reply Reply Quote 0
            • Bangee
              Bangee Module Developer last edited by

              @jsyzthz checkt this out: https://forum.magicmirror.builders/topic/738/mmm-dht22-humidity-and-temperature-module

              1 Reply Last reply Reply Quote 0
              • psk
                psk @jsyzthz last edited by psk

                @jsyzthz Unfortunately neither did I have any luck executing with sudo while using ‘DISPLAY=:0’ .

                For auto start I used PM2.

                This is my mm.sh file

                cd ~/MagicMirror
                DISPLAY=:0 sudo npm start
                

                P.S : I haven’t yet tried this alternative by Bangee. But it sure looks promising in this scenario where we need the mirror to start from ssh(or Terminal) while specifying the display device.

                If i come across any workarounds, I’ll update.
                Cheers.

                P.S.K

                1 Reply Last reply Reply Quote 0
                • J
                  jsyzthz last edited by

                  @psk , when i execute your command in my pi3 from putty. will get below error.
                  0_1476980028924_upload-94e2d7d2-b3a1-493a-a093-7ac8645113c3

                  1 Reply Last reply Reply Quote 0
                  • D
                    d3r last edited by

                    I’m going to order the dht-22 soon. I was reading about the sensor set up and most guides mention using a resistor. Do you guys have one in your set up?

                    psk 1 Reply Last reply Reply Quote 0
                    • psk
                      psk @d3r last edited by

                      @d3r Dht 22 and 11 series doesnt require one 🙂

                      PS: Just saw the post.Was out of town for two weeks…

                      P.S.K

                      yawns 1 Reply Last reply Reply Quote 0
                      • yawns
                        yawns Moderator @psk last edited by

                        @psk
                        That depends on the sensor you buy. If you use a sensor with 4 pins you need the resistor. If you use the sensor with 3 pins mounted to a circuit board you don’t need the resistor.

                        1 Reply Last reply Reply Quote 0
                        • 1
                        • 2
                        • 3
                        • 4
                        • 3 / 4
                        • First post
                          Last post
                        Enjoying MagicMirror? Please consider a donation!
                        MagicMirror created by Michael Teeuw.
                        Forum managed by Paul-Vincent Roll and Rodrigo Ramírez Norambuena.
                        This forum is using NodeBB as its core | Contributors
                        Contact | Privacy Policy