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. Troubleshooting
  3. Help please ! total noob here !!

Help please ! total noob here !!

Scheduled Pinned Locked Moved Troubleshooting
16 Posts 4 Posters 3.6k Views 4 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.
  • Dominic BonneauD Dominic Bonneau

    hi, I just bought everything I need to build a mqtt Gateway and a door sensor (i think it's the simplest one ! )

    So I need my sensor to tell my mqtt gateway when the door is open. then he will tell my mqtt broker (my mac mini and i test it it work ) and from there openhab take the info.

    Here my issue : I follow a lot of tutorial on the web but no one did it the same way and with the same code So i can not take the info from one and from another ...

    So i need a schema for my mqtt gateway (who is arduino uno r3, NRF24L01 Radio and W5100 Ethernet module )

    I need the code for it ( I look here but i didn't understand why i have a .h and a .ino https://www.mysensors.org/build/mqtt_gateway )

    and also a code for my arduino mini pro 3.3v (don't need the schema is pretty easy ) can i use this one ?
    https://www.mysensors.org/build/binary

    I read about noob tutorial but it doesn't help much with my sensors library

    I look here but the guy don't show is shema so i'm a bit lost http://forum.mysensors.org/topic/2352/guide-setting-up-and-testing-mqtt-client-gateway/2

    finaly how did i make my 2 arduino talk to each other with the NRF24L01 ?

    Ok so thanks for all the answer you gonna give me even it's a little bit and i know i'm asking a lot a the same time but I REALY want to do my own sensor and understand well the arduino.

    p.s sorry for my bad english ...

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

    So i need a schema for my mqtt gateway (who is arduino uno r3, NRF24L01 Radio and W5100 Ethernet module )

    Wiring for W5100 is available at https://www.mysensors.org/build/ethernet_gateway
    Wiring for nrf24l01+ is available at https://www.mysensors.org/build/connect_radio

    I need the code for it ( I look here but i didn't understand why i have a .h and a .ino https://www.mysensors.org/build/mqtt_gateway )

    To understand why a .h file is used, you'll probably need to learn quite a lot about c programming. A short introduction to h files is available at http://www.learncpp.com/cpp-tutorial/19-header-files/
    However, it should be possible to use the examples without understanding every detail.

    and also a code for my arduino mini pro 3.3v (don't need the schema is pretty easy ) can i use this one ?
    https://www.mysensors.org/build/binary

    Yes

    finaly how did i make my 2 arduino talk to each other with the NRF24L01 ?

    That's what MySensors is for. If you follow the examples, they will start talking.

    1 Reply Last reply
    2
    • M Offline
      M Offline
      Matt
      wrote on last edited by
      #3

      I tried openhab and MQTT via an ethernet gateway when I first got started, and quickly got lost with all the bindings and suchlike. I switched to domoticz via serial gateway, which kind of 'just works' and haven't looked back. Keep at it, you will get there.

      Dominic BonneauD 1 Reply Last reply
      0
      • M Matt

        I tried openhab and MQTT via an ethernet gateway when I first got started, and quickly got lost with all the bindings and suchlike. I switched to domoticz via serial gateway, which kind of 'just works' and haven't looked back. Keep at it, you will get there.

        Dominic BonneauD Offline
        Dominic BonneauD Offline
        Dominic Bonneau
        wrote on last edited by
        #4

        @Matt Thank you for your answer but my openhab setup is already configure... Yes it was a pain at first but right now I understand the system and everything works fine so i try to stick to it

        1 Reply Last reply
        0
        • Dominic BonneauD Offline
          Dominic BonneauD Offline
          Dominic Bonneau
          wrote on last edited by
          #5

          Thank you for your help but i still have a major question !

          So i follow this guide : https://www.mysensors.org/build/ethernet_gateway

          even for the wiring because of the sofspi

          and upload this code : https://www.mysensors.org/build/mqtt_gateway

          I set up the ip address for it but i can't understand how he gonna talk to my mqtt server there no place in the code to add my mqtt server.

          p.s my mac didn't see my arduino mini pro i'm gonna bring it to my office and try it there but is there something i can do ?

          Than you

          1 Reply Last reply
          0
          • martinhjelmareM Offline
            martinhjelmareM Offline
            martinhjelmare
            Plugin Developer
            wrote on last edited by
            #6

            The mqtt gateway sketch in the build section of the mysensors site will create an mqtt broker. If you want the gateway to act as an mqtt client you have to use the dev branch, ie not any 1.5 releases, mysensors library and mqtt gateway sketch at github.

            The pinned guide in the forum about mqtt client gateway is for the dev branch library. If you read the first post carefully you should be able to set that up. But first you need to have a copy of the dev branch mysensors library in your Arduino IDE, so that you can build the mqtt client sketch.

            1 Reply Last reply
            1
            • Dominic BonneauD Offline
              Dominic BonneauD Offline
              Dominic Bonneau
              wrote on last edited by
              #7

              OK thank you ! and if i use another code can i use the same wiring ?

              https://www.mysensors.org/build/ethernet_gateway

              1 Reply Last reply
              0
              • martinhjelmareM Offline
                martinhjelmareM Offline
                martinhjelmare
                Plugin Developer
                wrote on last edited by
                #8

                Yeah, the wiring should be the same for both release and dev branch, to my knowledge.

                1 Reply Last reply
                0
                • Dominic BonneauD Offline
                  Dominic BonneauD Offline
                  Dominic Bonneau
                  wrote on last edited by
                  #9

                  Hum ... when i use this code : https://www.mysensors.org/build/mqtt_gateway

                  I can ping my arduino

                  But when i use the one you told me to : https://github.com/mysensors/Arduino/blob/development/libraries/MySensors/examples/GatewayW5100MQTTClient/GatewayW5100MQTTClient.ino

                  I can't ping it .. what happen ? is it because it's not the same wiring ?

                  1 Reply Last reply
                  0
                  • martinhjelmareM Offline
                    martinhjelmareM Offline
                    martinhjelmare
                    Plugin Developer
                    wrote on last edited by
                    #10

                    Are you sure you have the correct address? Have you changed the sketch and defined the ip address of the arduino or commented those lines? If you comment them, you should use the address that your router or similar assigns to the arduino.

                    / Enable MY_IP_ADDRESS here if you want a static ip address (no DHCP)
                    #define MY_IP_ADDRESS 192,168,178,87
                    
                    // If using static ip you need to define Gateway and Subnet address as well
                    #define MY_IP_GATEWAY_ADDRESS 192,168,178,1
                    #define MY_IP_SUBNET_ADDRESS 255,255,255,0
                    
                    1 Reply Last reply
                    1
                    • Dominic BonneauD Offline
                      Dominic BonneauD Offline
                      Dominic Bonneau
                      wrote on last edited by
                      #11

                      Ok that is weird ! I try with and without static adress and it both didn't work BUT the first time I try without static IP it worked ! the ping worked ! so i try to unplug the arduino to see if it was the right device and yes the ping stop so I plug it back and since then ... nothing ...

                      I was wondering, I replace all the mysensor library with de developer branch is that ok ?

                      1 Reply Last reply
                      0
                      • martinhjelmareM Offline
                        martinhjelmareM Offline
                        martinhjelmare
                        Plugin Developer
                        wrote on last edited by
                        #12

                        Yes, you should replace the whole library when changing between versions. Personally I use git for this, but you can also just delete the old library and copy/paste the new library.

                        1 Reply Last reply
                        0
                        • Dominic BonneauD Offline
                          Dominic BonneauD Offline
                          Dominic Bonneau
                          wrote on last edited by
                          #13

                          ok so what is wrong then ?

                          1 Reply Last reply
                          0
                          • martinhjelmareM Offline
                            martinhjelmareM Offline
                            martinhjelmare
                            Plugin Developer
                            wrote on last edited by
                            #14

                            How do you know the ip address of the arduino when not setting a static ip in the sketch or in the config? Have you mapped a static ip to the mac address of the arduino in your router?

                            If you're 100% sure you're pinging the correct address each time, and you successfully pinged the arduino after one boot but not after a restart with the same sketch, I would suspect hardware problems. Could be a power issue.

                            1 Reply Last reply
                            0
                            • Dominic BonneauD Offline
                              Dominic BonneauD Offline
                              Dominic Bonneau
                              wrote on last edited by Dominic Bonneau
                              #15

                              Hi, first of all, thank you very much for helping me like that !

                              I'm a Noob with my sensor but i'm a network guy (it's my job !) I know how to find an ip address !

                              I know pretty much all my device on my network so i just look on my dhcp server to see if new device show up . Also i use a software to scan every device on the network

                              I don't map the mac adress because i didn't have the time. Like I said it work only one time.

                              I was afraid that was a physical problems so I retry with the first sketch
                              ( https://www.mysensors.org/build/mqtt_gateway )

                              And it work ! I ping it without any problem...

                              EDIT : I just saw this in my code :

                              //W5100 Ethernet module SPI enable (optional if using a shield/module that manages SPI_EN signal)
                              //#define MY_W5100_SPI_EN 4  
                              

                              Do I need to uncomment the second line ?

                              1 Reply Last reply
                              1
                              • Dominic BonneauD Offline
                                Dominic BonneauD Offline
                                Dominic Bonneau
                                wrote on last edited by
                                #16

                                It look like the issue come from the dev branch :

                                https://forum.mysensors.org/topic/1728/uno-ethernet-shield-radio-init-fail-solved/2

                                Is there something i can do ?

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


                                19

                                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