Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
  1. Home
  2. My Project
  3. DHT11 and Ethernet Gateway with enc28j60

DHT11 and Ethernet Gateway with enc28j60

Scheduled Pinned Locked Moved My Project
9 Posts 2 Posters 1.2k Views 2 Watching
  • 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.
  • giangiredG Offline
    giangiredG Offline
    giangired
    wrote on last edited by
    #1

    Hallo.
    That's my first project with MySensor since so foar I have only tested different examples I found on internet,
    My project is to create a Temperature/Humidity sensor in each room of my house and then control the temperature of each room by using a dedicated electric valve for each radiator (interfaced with a MySensor node based on relay). As temperature/humidity sensor I have DHT11 and as gateway I have enc28j60. I'm using a Arduino Pro Mini 5v. The "brain" of the system will be a Raspberry PI 3 equipped with DomoticZ.
    First problem is how to combine the examples I have found in MySensors (DHT code and enc28j60 code) in a sketch. Can you help me or indicate where to find how to integrate two sketches (examples) in one?

    mfalkviddM 1 Reply Last reply
    0
    • giangiredG giangired

      Hallo.
      That's my first project with MySensor since so foar I have only tested different examples I found on internet,
      My project is to create a Temperature/Humidity sensor in each room of my house and then control the temperature of each room by using a dedicated electric valve for each radiator (interfaced with a MySensor node based on relay). As temperature/humidity sensor I have DHT11 and as gateway I have enc28j60. I'm using a Arduino Pro Mini 5v. The "brain" of the system will be a Raspberry PI 3 equipped with DomoticZ.
      First problem is how to combine the examples I have found in MySensors (DHT code and enc28j60 code) in a sketch. Can you help me or indicate where to find how to integrate two sketches (examples) in one?

      mfalkviddM Offline
      mfalkviddM Offline
      mfalkvidd
      Mod
      wrote on last edited by
      #2

      @giangired https://forum.mysensors.org/topic/2597/combining-mysensors-examples should get you going I think. Try it, and if you run into trouble post information about the trouble and your sketch.

      1 Reply Last reply
      0
      • giangiredG Offline
        giangiredG Offline
        giangired
        wrote on last edited by
        #3

        @mfalkvidd Thanks a lot. Effectively I did the same with DHT11 sketch and enc28j60 gateway sketch. The combined sketch has been successfully compiled and later on I will test it. I have a question: the temp and humidity values are sent through the Arduino serial link (correct?) by using the "send" instruction. Adding the enc28j60 gateway code, it is automatically send through the Etehernet link?

        mfalkviddM 1 Reply Last reply
        0
        • giangiredG giangired

          @mfalkvidd Thanks a lot. Effectively I did the same with DHT11 sketch and enc28j60 gateway sketch. The combined sketch has been successfully compiled and later on I will test it. I have a question: the temp and humidity values are sent through the Arduino serial link (correct?) by using the "send" instruction. Adding the enc28j60 gateway code, it is automatically send through the Etehernet link?

          mfalkviddM Offline
          mfalkviddM Offline
          mfalkvidd
          Mod
          wrote on last edited by
          #4

          @giangired yes that is correct.

          1 Reply Last reply
          0
          • giangiredG Offline
            giangiredG Offline
            giangired
            wrote on last edited by giangired
            #5

            @mfalkvidd I did the test and I obtained a weird result. After several initial test (I started with examples to check the functionality of the ENC28j60, like pinging the Google site) i can say that the wiring between Arduino Pro Mini and ENC28j60 is correct (I saw pinging on my serial monitor). When I test my sktech (that concern one DHT11, two relays and one switch) the connection with the controller (Raspberry PI 3 with Domoticz) is not assured. Time to time I see teh connection on Domoticz but very often the connection is not present. Which debug I can do? Which string I have to receive on my serial monitor to be sure that the Ethernet module is properly recognized? For your info, the power led on the ENC28j60 is lighted and the two leds (green and yellow) on RJ45 port are blinking. I tried to ping the ENC28j60 but I cannot ping it.

            mfalkviddM 1 Reply Last reply
            0
            • giangiredG giangired

              @mfalkvidd I did the test and I obtained a weird result. After several initial test (I started with examples to check the functionality of the ENC28j60, like pinging the Google site) i can say that the wiring between Arduino Pro Mini and ENC28j60 is correct (I saw pinging on my serial monitor). When I test my sktech (that concern one DHT11, two relays and one switch) the connection with the controller (Raspberry PI 3 with Domoticz) is not assured. Time to time I see teh connection on Domoticz but very often the connection is not present. Which debug I can do? Which string I have to receive on my serial monitor to be sure that the Ethernet module is properly recognized? For your info, the power led on the ENC28j60 is lighted and the two leds (green and yellow) on RJ45 port are blinking. I tried to ping the ENC28j60 but I cannot ping it.

              mfalkviddM Offline
              mfalkviddM Offline
              mfalkvidd
              Mod
              wrote on last edited by
              #6

              @giangired I don't have any ethernet gateways, but from earlier forum discussion this seems to be normal output:

              0;255;3;0;9;MCO:BGN:INIT GW,CP=R-NGA--,VER=2.1.1
              IP: 192.168.178.134
              0;255;3;0;9;Eth: connect
              0;255;3;0;9;MCO:BGN:STP
              0;255;3;0;9;MCO:REG:NOT NEEDED
              0;255;3;0;9;MCO:BGN:INIT OK,TSP=NA
              
              giangiredG 2 Replies Last reply
              0
              • mfalkviddM mfalkvidd

                @giangired I don't have any ethernet gateways, but from earlier forum discussion this seems to be normal output:

                0;255;3;0;9;MCO:BGN:INIT GW,CP=R-NGA--,VER=2.1.1
                IP: 192.168.178.134
                0;255;3;0;9;Eth: connect
                0;255;3;0;9;MCO:BGN:STP
                0;255;3;0;9;MCO:REG:NOT NEEDED
                0;255;3;0;9;MCO:BGN:INIT OK,TSP=NA
                
                giangiredG Offline
                giangiredG Offline
                giangired
                wrote on last edited by
                #7

                @mfalkvidd My output is identical with the exception of the row related the Eth. I see the row only when the connection with Domoticz is established. Could be a problem of power? I mean, can be a problem related the power despite the green/yellow led of the RJ45 are blinking?

                1 Reply Last reply
                0
                • mfalkviddM mfalkvidd

                  @giangired I don't have any ethernet gateways, but from earlier forum discussion this seems to be normal output:

                  0;255;3;0;9;MCO:BGN:INIT GW,CP=R-NGA--,VER=2.1.1
                  IP: 192.168.178.134
                  0;255;3;0;9;Eth: connect
                  0;255;3;0;9;MCO:BGN:STP
                  0;255;3;0;9;MCO:REG:NOT NEEDED
                  0;255;3;0;9;MCO:BGN:INIT OK,TSP=NA
                  
                  giangiredG Offline
                  giangiredG Offline
                  giangired
                  wrote on last edited by giangired
                  #8

                  @mfalkvidd
                  Now it's working fine. It was an electrical problem. I changed the power supply and now it's working.
                  Now I have a new question. I use an Arduino Pro Mini Node with ethernet gateway. I have connected to the same node two relays, one switch, one PIR and one DHT11. The question is: what about sleep times? I mean, from the examples of DHT and PIR and others, often it's indicated a Sleep time. SInce the sketch has a unique Loop, how I have to manage the Sleep. Currently I have removed the sleep and I use a counter for each sensor attached to the same MySensors Node. Is this the right solution?

                  mfalkviddM 1 Reply Last reply
                  0
                  • giangiredG giangired

                    @mfalkvidd
                    Now it's working fine. It was an electrical problem. I changed the power supply and now it's working.
                    Now I have a new question. I use an Arduino Pro Mini Node with ethernet gateway. I have connected to the same node two relays, one switch, one PIR and one DHT11. The question is: what about sleep times? I mean, from the examples of DHT and PIR and others, often it's indicated a Sleep time. SInce the sketch has a unique Loop, how I have to manage the Sleep. Currently I have removed the sleep and I use a counter for each sensor attached to the same MySensors Node. Is this the right solution?

                    mfalkviddM Offline
                    mfalkviddM Offline
                    mfalkvidd
                    Mod
                    wrote on last edited by
                    #9

                    @giangired yes, a counter or using millis() (which technically is a counter) is the right solution. Relay nodes can’t sleep, because nodes can not receive incoming commands when sleeping.

                    1 Reply Last reply
                    0
                    Reply
                    • Reply as topic
                    Log in to reply
                    • Oldest to Newest
                    • Newest to Oldest
                    • Most Votes


                    30

                    Online

                    11.7k

                    Users

                    11.2k

                    Topics

                    113.1k

                    Posts


                    Copyright 2025 TBD   |   Forum Guidelines   |   Privacy Policy   |   Terms of Service
                    • Login

                    • Don't have an account? Register

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • MySensors
                    • OpenHardware.io
                    • Categories
                    • Recent
                    • Tags
                    • Popular