Navigation

    • Register
    • Login
    • OpenHardware.io
    • Categories
    • Recent
    • Tags
    • Popular
    1. Home
    2. palande.vaibhav
    3. Best
    • Profile
    • Following
    • Followers
    • Topics
    • Posts
    • Best
    • Groups

    Best posts made by palande.vaibhav

    • RE: How to send message from one sensor to other or send message with different node and sensor ID?

      Got it after some trial and error with getters and setters.

      In case someone needs. I did following.

      MyMessage msg();  //Create a blank MyMessage instance. Do this before void setup()
      

      then when you want to send the message. Create a message on the fly like following.

      1. msg.setType(2);
      2. msg.setSensor(1);
      3. msg.setDestination(2);
      4. send(msg.set(1));
      

      This is what I am doing above:

      1. set message type ex. V_LIGHT is 2. Look at API for more
      2. Set sensor child ID of the sensor you want to change status of
      3. This is the destination node ID which has the sensor you are trying to reach
      4. Send the message just like you would usually.

      Hope this helps someone

      posted in Troubleshooting
      palande.vaibhav
      palande.vaibhav
    • RE: CRC doesn't match. File is corrupted. MySensors version 2.0

      @mfalkvidd
      I have extracted the zip from GitHub, renamed the folder to MySensors and pasted it into Documents\Arduino\libraries folder. I don't have MySensors stuff in Program Files(86)\Arduino\libraries folder.

      And it works. Arduino library manager now shows MySensors library version 2.0.0 as installed.

      posted in Troubleshooting
      palande.vaibhav
      palande.vaibhav
    • RE: Problem getting the code to run with MySensors library 2.0

      @ayo

      Oh I get it now. Now I understand. I must have a gateway and at least one sensor node running for this to work. If there is no gateway then sensor nodes don't work because of the constant loop trying to find a parent.

      My problem was I was trying to write and run the code with just the sensor node.

      I will also do the modifications you mentioned to the core files.

      Thanx a lot for your help. I really appreciate it. 👍

      posted in Troubleshooting
      palande.vaibhav
      palande.vaibhav
    • RE: 💬 Connecting the Radio

      @DiverAlpha said:

      Hi all,

      I'm using the Arduino Micro with al NRF24L01 radio. With the micro it's not posible to use the pin config of the Nano.
      I got it working with the connections below.

      NRF24 > Micro
      Miso > Miso
      Mosi > Mosi
      SCK > SCK
      CSN > Pin D7
      CE > Pin D8

      Thereby I put the code below in my arduino code before de "#include <SPI.h>"

      // Pin Confuguration for Arduino Micro
      #define MY_RF24_CE_PIN 8
      #define MY_RF24_CS_PIN 7

      Maybe this is helpful for some other users.

      Grtz Diver

      @DiverAlpha
      Thanx a lot for commenting with that information. I was having problems with the Arduino Mega. I connected the NRF24L01+ to the appropriate SPI pins on the Mega and then just defined the CE and CS pins in the code an now it works. Thanks again

      posted in Announcements
      palande.vaibhav
      palande.vaibhav
    • How does MySensors actually work

      Hello everyone,

      I know this is a very dumb question but I am very new to all this. My question is how does this thing work? I have seen the getting started videos and I have also read the whole getting started page on the website. Here is what I understood.

      1. I need to get the Arduino, radio and a sensor. Wire everything up as shown on the website and power up.

      What after that? I figure I need to connect to the internet using the radio. but after that how does this all connect up? What is vera? Do I need to have it? It looks like a router. Can I use my own router I already have at my home for this? How does the android app connect to the sensors?

      All the videos show how to make a gateway and how to wire up arduino and sensors but then after that they suddenly show the web interface and the android app and everything just starts working. I am having hard time connecting the dots here.

      I am very new to all this but I think I have read whats on the website and also watched the videos before posting this question. So can anyone guide me through the step by step process?

      Thank You

      posted in General Discussion
      palande.vaibhav
      palande.vaibhav
    • RE: 💬 Connecting the Radio

      @DiverAlpha
      I am no expert in this. But when I started using MySensors few months ago, I also had some problems. Not because there is a problem with MySensors but because I was doing the simplest of the mistakes and I needed to think simple and do simple things first.

      What I would suggest is just try the simplest of the code first. This post is considering that you are using MySensors library 2.0.

      This is what I did when I was trying out MySensors and I think you can try this too.

      Firstly connect Arduino you are using properly to the radio with the proper connections using the instructions here. If you are using Arduino Mega, the SPI pins are different. Here is the link for Arduino Mega: https://forum.mysensors.org/topic/4940/arduino-mega-nrf-wiring/3. Make sure you have decoupling capacitors attached between the VCC and GND pins of both the radios.

      After you make the connections upload the code for the gateway to one of the Arduinos. You can find the code in Arduino IDE, File > Examples > MySensors > GatewaySerial. Don't make any changes just upload the code.

      Then what I did the first time is just run the following motion sensor code to the other Arduino. I have made a few changes to make things simpler for the node to find the gateway.

      // Enable debug prints
      #define MY_DEBUG
      
      // Enable and select radio type attached
      #define MY_RADIO_NRF24
      //#define MY_RADIO_RFM69
      
      #define MY_NODE_ID 1
      
      #define MY_PARENT_NODE_ID 0
      
      #include <SPI.h>
      #include <MySensors.h>
      
      //unsigned long SLEEP_TIME = 120000; // Sleep time between reports (in milliseconds)
      #define DIGITAL_INPUT_SENSOR 3   // The digital input you attached your motion sensor.  (Only 2 and 3 generates interrupt!)
      #define CHILD_ID 0   // Id of the sensor child
      
      // Initialize motion message
      MyMessage msg(CHILD_ID, V_TRIPPED);
      
      void setup()  
      {  
        pinMode(DIGITAL_INPUT_SENSOR, INPUT);      // sets the motion sensor digital pin as input
      }
      
      void presentation()  {
        // Send the sketch version information to the gateway and Controller
        sendSketchInfo("Motion Sensor", "1.0");
      
        // Register all sensors to gw (they will be created as child devices)
        present(CHILD_ID, S_MOTION);
      }
      
      void loop()     
      {     
        // Read digital motion value
        boolean tripped = digitalRead(DIGITAL_INPUT_SENSOR) == HIGH; 
              
        Serial.println(tripped);
        send(msg.set(tripped?"1":"0"));  // Send tripped value to gw 
      
        // Sleep until interrupt comes in on motion sensor. Send update every two minute.
        //sleep(digitalPinToInterrupt(DIGITAL_INPUT_SENSOR), CHANGE, SLEEP_TIME);
      }
      

      Here, I have defined a NODE ID and defined the PARENT NODE ID for the node. Defining parent ID makes sure that the gateway that you have is the one, the node is supposed to connect to. I didn't even have motion sensor connected to the node here. This is just to make sure that first time you get everything working.

      If this is done correctly the node and gateway should talk to each other and gateway should have the motion sensor registered.

      Hope this helps.

      posted in Announcements
      palande.vaibhav
      palande.vaibhav
    • RE: 💬 Connecting the Radio

      @ZsoltZombori

      I had a problem of the LED on pin 13 glowing dim after some time of system running fine when I had 2 sensors connected to the Arduino and sensors had their own separate 5V power supply. So, I had a 5V power supply separate from the Arduino's 5V and that was supplying current to those sensors.

      I had the sensor's data pins connected to Arduino but I didn't have GND of power supply and Arduino connected. I solved the problem by connecting the GND of power supply to the GND of the Arduino.

      See if that is the case with you.

      Hope this helps.

      posted in Announcements
      palande.vaibhav
      palande.vaibhav