Frustrated Newbie - Help with Nodes and Sensors



  • @emenike Thank you for the sketch, Yes, you should keep both MySensors and MyController(Gateway) on the same port. Regards baud rate, I want to see your gateway sketch. Can you share your gateway sketch?



  • @jkandasa My Gateway is the no same as the tutorial on MySensors… I didn't change anything. Or should I? 😢

    /**
    * The MySensors Arduino library handles the wireless radio link and protocol
    * between your home built sensors/actuators and HA controller of choice.
    * The sensors forms a self healing radio network with optional repeaters. Each
    * repeater and gateway builds a routing tables in EEPROM which keeps track of the
    * network topology allowing messages to be routed to nodes.
    *
    * Created by Henrik Ekblad <henrik.ekblad@mysensors.org>
    * Copyright (C) 2013-2015 Sensnology AB
    * Full contributor list: https://github.com/mysensors/Arduino/graphs/contributors
    *
    * Documentation: http://www.mysensors.org
    * Support Forum: http://forum.mysensors.org
    *
    * This program is free software; you can redistribute it and/or
    * modify it under the terms of the GNU General Public License
    * version 2 as published by the Free Software Foundation.
    *
    *******************************
    *
    * DESCRIPTION
    * The ArduinoGateway prints data received from sensors on the serial link.
    * The gateway accepts input on serial which will be sent out on radio network.
    *
    * The GW code is designed for Arduino Nano 328p / 16MHz
    *
    * Wire connections (OPTIONAL):
    * - Inclusion button should be connected between digital pin 3 and GND
    * - RX/TX/ERR leds need to be connected between +5V (anode) and digital pin 6/5/4 with resistor 270-330R in a series
    *
    * LEDs (OPTIONAL):
    * - To use the feature, uncomment any of the MY_DEFAULT_xx_LED_PINs
    * - RX (green) - blink fast on radio message received. In inclusion mode will blink fast only on presentation received
    * - TX (yellow) - blink fast on radio message transmitted. In inclusion mode will blink slowly
    * - ERR (red) - fast blink on error during transmission error or receive crc error
    *
    */
    #include <SPI.h>
    // Enable debug prints to serial monitor
    #define MY_DEBUG
    
    
    // Enable and select radio type attached
    #define MY_RADIO_NRF24
    //#define MY_RADIO_NRF5_ESB
    //#define MY_RADIO_RFM69
    //#define MY_RADIO_RFM95
    
    // Set LOW transmit power level as default, if you have an amplified NRF-module and
    // power your radio separately with a good regulator you can turn up PA level.
    #define MY_RF24_PA_LEVEL RF24_PA_LOW
    
    // Enable serial gateway
    #define MY_GATEWAY_SERIAL
    
    // Define a lower baud rate for Arduinos running on 8 MHz (Arduino Pro Mini 3.3V & SenseBender)
    #if F_CPU == 8000000L
    
    //#define MY_BAUD_RATE 38400
    #define MY_BAUD_RATE 115200
    #endif
    
    // Enable inclusion mode
    #define MY_INCLUSION_MODE_FEATURE
    // Enable Inclusion mode button on gateway
    //#define MY_INCLUSION_BUTTON_FEATURE
    
    // Inverses behavior of inclusion button (if using external pullup)
    //#define MY_INCLUSION_BUTTON_EXTERNAL_PULLUP
    
    // Set inclusion mode duration (in seconds)
    #define MY_INCLUSION_MODE_DURATION 60
    // Digital pin used for inclusion mode button
    //#define MY_INCLUSION_MODE_BUTTON_PIN  3
    
    // Set blinking period
    #define MY_DEFAULT_LED_BLINK_PERIOD 300
    
    // Inverses the behavior of leds
    //#define MY_WITH_LEDS_BLINKING_INVERSE
    
    // Flash leds on rx/tx/err
    // Uncomment to override default HW configurations
    //#define MY_DEFAULT_ERR_LED_PIN 4  // Error led pin
    //#define MY_DEFAULT_RX_LED_PIN  6  // Receive led pin
    //#define MY_DEFAULT_TX_LED_PIN  5  // the PCB, on board LED
    
    #include <MySensors.h>
    
    void setup()
    {
    	// Setup locally attached sensors
    }
    
    void presentation()
    {
    	// Present locally attached sensors
    }
    
    void loop()
    {
    	// Send locally attached sensor data here
    }
    


  • @jkandasa Okay I have reverted to Com 5 for both MySensors Gateway and Com5 for Mycontroller. I restarted the controller and I was able to connect successfully. Phew!
    0_1543683298126_Screen Shot 4.png

    That's done, you still didn't say if the certificate error has a role to play. I have connected the sprinkler package to an external power and I am running Putty on the side to listen to Com5 No cheese...



  • @emenike Now your sketch configuration and MyController gateway configuration looks similar.
    The only thing, you should not open COM5 in any service(putty, etc.,) when you enabled in MyController.

    Follows these steps,

    • Disable Gateway in MyController
    • Close your putty and other services, which is listening to the serial port
    • Disconnect your hardware(MySensors gateway) from the computer
    • Reconnect your hardware again to the computer
    • make sure your MySensors gateway is available in COM5
    • Enable your gateway in MyController
    • Now you should see the nodes in your MyController, if not try to run discover on MyController's discover page.

    you still didn't say if the certificate error has a role to play

    Certificate error is completely different than this issue. Some tutorial, You may not worry about this.



  • @jkandasa Wow! That really helped, I was able to not only connect to the MyController Gateway, but two Nodes discovered and Nine sensors discovered. Thanks @jkandasa you never know how hard I tried. all along, connecting and disconnecting Arduino and Putty intermittently without knowing that I was disturbing the line. see what it now looks like. 0_1543747146086_Screen Shot 5.png

    So can I continue troubleshooting my problems with this tread or should I create a new one?



  • @emenike For me, it is ok to continue here. Up to your wish.

    I see the name of the sensor shows some debug message, looks like we have some issue with MyController.
    Can you disable debug in MySensors gateway sketch?

    // #define MY_DEBUG
    

    To update gateway sketch, you need to disable gateway in MyController and update your gateway sketch via Arduino IDE. After a successful update, you can enable gateway in MyController.



  • @jkandasa Thanks.
    I disabled the MyController Gateway, then commented out the debug line on the sketch via IDE. and uploaded the sketch the the MySensors gateway @ COM5. Closed the IDE and restarted enabled the MyController Gateway --- but now one node is down while the Gateway connected successfully. 0_1543792504887_Screen Shot 6.png



  • This is what ot looks like now...

    0_1543792608629_Screen Shot 7.png



  • @emenike Seems all ok in MyController side.
    Can you check your sprinkler node powered up and in RF coverage?


  • MOD

    Hi All,

    Sorry was out for a couple of days...,

    @Emenike
    jkandasa is right, as an addition you can also add the debug stuff to you sketch and hook it up to your laptop to see the debugging stuff from the sensor perspective...

    If the sensor is out of range of you gateway you have some options to fix it:

    1. you can put a repeater node in the middle between the sensor and the gateway to extend the range of your network

    2. check your radio, exchange it for another one to rule out any radio hardware issues. (some of the radios have issues... especially the Nrf24l01 radios with the round black blob instead of a chip... believe me, I have been there and the range was approx 1.5 meters.....)

    3. If you use the Nrf24l01, add the capacitor to the power line of the radio (tought this was a 47uf capacitor), this will also improve communication (make sure you add this on the sensor and the gateway radio!)



  • @tag @jkandasa

    My Sprinkler node is downstairs - just about 7 meters below the spot where the MySensors Gateway + MyController laptop is (with about 2 concrete walls separating them). Does this matter? For the records, I have capacitor on both MySensors Gateway, and the Water Sprinkler node.


  • MOD

    Can be an issue, can you try if you see the node if it is basically next to your gateway?



  • @tag Okay I will move them closer until I conclude with all the bugs, then I will move them apart and see if distance is the issue

    by the way... is This project in this video a MySensors Gateway or something entirely new?


  • MOD

    @emenike

    Okay, great!,
    Had a look at the link you send, it looks like mysensors, but it is something different...



  • @Emenike

    This bit is wrong in your gateway sketch.....

    // Define a lower baud rate for Arduinos running on 8 MHz (Arduino Pro Mini 3.3V & SenseBender)
    #if F_CPU == 8000000L
    
    //#define MY_BAUD_RATE 38400
    #define MY_BAUD_RATE 115200
    #endif
    

    The baud rate in the if statement should be 38400 as it says in the line above it.

    It won't matter if you are using a 5V arduino, but if you were to use a 3.3V one this would be a big problem.



  • @skywatch Thanks @skywatch

    Please note that I am using a Nano for my gate way...
    I thought the baud rate should be the same for Arduino and the Putty sniffer, I will revert to "38400"...


  • MOD

    @emenike

    Make sure that the same baudrate is used in the gateway sketch and mycontroller.....



  • @tag
    😭 but that was exactly how it was until you said to change 38400 …. but it connected alright after | changed to 38400 and brought the node next to the laptop.



  • @emenike said in Frustrated Newbie - Help with Nodes and Sensors:

    @skywatch Thanks @skywatch

    Please note that I am using a Nano for my gate way...
    I thought the baud rate should be the same for Arduino and the Putty sniffer, I will revert to "38400"...

    That part of the gateway sketch is an 'If' statement. It just tells the compilier that 'if' the board is a 3.3v 8MHz type, then reduce the baud rate to match. 8MHz boards are not reliable at 115200.


  • MOD

    @emenike

    Okay so if I understand correctly, all works if the nodes are basically next to each other... is that correct?


 

Suggested Topics

5
Online

430
Users

381
Topics

2.4k
Posts