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. Arduino Mega + RelayWithButtonActuator sketch

Arduino Mega + RelayWithButtonActuator sketch

Scheduled Pinned Locked Moved Troubleshooting
11 Posts 5 Posters 4.2k 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.
  • SzmaluS Offline
    SzmaluS Offline
    Szmalu
    wrote on last edited by
    #1

    Hi guys :)

    First of all, I thank u very much for such a briliant site !
    I do at home overhaul, so I decided a few things to automate. I have Mysensors serial gw (Arduino Uno) connected to Raspbery Pi with Domoticz on it. With simple sketches it works like a charm (with Arduino Nano nodes). But not with my Arduino Mega :(

    I'd like to make arduino mega node which will be connected to 16 channel (or more) relay board witch will controll lights all over my house. The perfect sketch for it is RelayWithButtonActuator (so I could control it both from standard buttons and Domoticz). And it works perfect with arduino nano board (I've tried unmodyfied sketch). I' cant even start with Mega because all I can get from it's serial port is "check wires" message...

    I know that Mega has diferent pinout then nano/uno/pro... but i've connected it like below

    pin D8-----------CE (chip enable in)
    SS pin D53----------CSN (chip select in)
    SCK pin D52----------SCK (SPI clock in)
    MOSI pin D51----------SDI (SPI Data in)
    MISO pin D50----------SDO (SPI data out)

    But what with IRQ pin ? And should I change sth . in sketch file? I'm just getting started with all that Arduino stuff so thank u in advance for guiding me :) And sry for my English.

    1 Reply Last reply
    0
    • hekH Offline
      hekH Offline
      hek
      Admin
      wrote on last edited by
      #2

      Skip the IRQ if you want (we don't use it in the library currently).

      3v3 output on the mega is super junk. Try using a step down from the 5V rail to feed the radio.

      1 Reply Last reply
      0
      • SzmaluS Offline
        SzmaluS Offline
        Szmalu
        wrote on last edited by
        #3

        nothing has changed

        1 Reply Last reply
        0
        • SzmaluS Offline
          SzmaluS Offline
          Szmalu
          wrote on last edited by
          #4

          shouldn't I change sth in RF24_config.h ?

          1 Reply Last reply
          0
          • T Offline
            T Offline
            TimO
            Hero Member
            wrote on last edited by
            #5

            Did you change the sketch according to the connected CSN/CE Pins?

            1 Reply Last reply
            0
            • SzmaluS Offline
              SzmaluS Offline
              Szmalu
              wrote on last edited by
              #6

              What exactly should i change?

              1 Reply Last reply
              0
              • T Offline
                T Offline
                TimO
                Hero Member
                wrote on last edited by
                #7

                http://www.mysensors.org/download/sensor_api_14#gateway

                You have to add CSN/CE Pin with the initialization.

                Something like:

                MySensor gw(8, 53);
                
                1 Reply Last reply
                1
                • SzmaluS Offline
                  SzmaluS Offline
                  Szmalu
                  wrote on last edited by
                  #8

                  Wow :) TimO thx a lot !!! it's alive :+1: I've connected humidity and temp sensor for testing,

                  1 Reply Last reply
                  0
                  • SzmaluS Offline
                    SzmaluS Offline
                    Szmalu
                    wrote on last edited by
                    #9

                    Ok, so as temperature/humidity sensor it works ok :)

                    But I can't get it to work as relay node.
                    Rx led is blinking when I push the button but nothing else is happening (no affection @ relay).

                    repeater started, id 0
                    send: 0-0-0-0 s=255,c=0,t=18,pt=0,l=5,st=fail:1.4.1
                    send: 0-0-0-0 s=255,c=3,t=6,pt=1,l=1,st=fail:0
                    send: 0-0-0-0 s=255,c=3,t=11,pt=0,l=14,st=fail:Relay & Button
                    send: 0-0-0-0 s=255,c=3,t=12,pt=0,l=3,st=fail:1.0
                    send: 0-0-0-0 s=1,c=0,t=3,pt=0,l=5,st=fail:1.4.1
                    send: 0-0-0-0 s=1,c=1,t=2,pt=2,l=2,st=fail:0
                    send: 0-0-0-0 s=1,c=1,t=2,pt=2,l=2,st=fail:0
                    send: 0-0-255-255 s=255,c=3,t=7,pt=0,l=0,st=fail:
                    send: 0-0-0-0 s=1,c=1,t=2,pt=2,l=2,st=fail:0
                    send: 0-0-0-0 s=1,c=1,t=2,pt=2,l=2,st=fail:0
                    send: 0-0-0-0 s=1,c=1,t=2,pt=2,l=2,st=fail:0
                    send: 0-0-0-0 s=1,c=1,t=2,pt=2,l=2,st=fail:0
                    send: 0-0-0-0 s=1,c=1,t=2,pt=2,l=2,st=fail:0
                    send: 0-0-0-0 s=1,c=1,t=2,pt=2,l=2,st=fail:0
                    send: 0-0-0-0 s=1,c=1,t=2,pt=2,l=2,st=fail:0
                    send: 0-0-255-255 s=255,c=3,t=7,pt=0,l=0,st=fail:
                    send: 0-0-0-0 s=1,c=1,t=2,pt=2,l=2,st=fail:0
                    send: 0-0-0-0 s=1,c=1,t=2,pt=2,l=2,st=fail:0
                    send: 0-0-0-0 s=1,c=1,t=2,pt=2,l=2,st=fail:0
                    send: 0-0-0-0 s=1,c=1,t=2,pt=2,l=2,st=fail:0
                    send: 0-0-0-0 s=1,c=1,t=2,pt=2,l=2,st=fail:0
                    send: 0-0-0-0 s=1,c=1,t=2,pt=2,l=2,st=fail:0
                    send: 0-0-0-0 s=1,c=1,t=2,pt=2,l=2,st=fail:0
                    send: 0-0-255-255 s=255,c=3,t=7,pt=0,l=0,st=fail:```
                    1 Reply Last reply
                    0
                    • sj44kS Offline
                      sj44kS Offline
                      sj44k
                      wrote on last edited by
                      #10

                      As you can see in your messages the code "st=fail" means there is an issue.
                      Did you install the decoupling capacitor like mentioned here

                      As @hek mentioned the 3v3v output of a mega is (and I quote) "super junk" this might be the cause of your issue, the decoupling capacitor might just solve this (by the way it is always advisable to install these) but also the usage of a step down regulator so you can use the 5v rail to feed the radio could be necessary (in combination with the capacitor).

                      I have had a Mega + radio running on it's 3v3 feed with only the capacitor installed but all depends of the quality of your components so hard to say that this is always a winning combination, but that would be my way to go.

                      1 Reply Last reply
                      0
                      • jnatherJ Offline
                        jnatherJ Offline
                        jnather
                        wrote on last edited by
                        #11

                        Please, could you post your code? I can´t make my arduino mega work.

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


                        13

                        Online

                        11.7k

                        Users

                        11.2k

                        Topics

                        113.0k

                        Posts


                        Copyright 2019 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