Hello everybody. Ok, I've made some shopping, according to your advices, waiting for items to arrive. Until then, see you soon and take care, thanks again. I'll post the results of the new combination, hoping for success.
Ciao.
Rolland
@Rolland
Best posts made by Rolland
-
RE: Serial GW and motion sensor functionning, but no activity between them
-
RE: Serial GW and motion sensor functionning, but no activity between them
@skywatch I've got some 10 µF and 100 µF electrolytic capacitors, and just received a bunch of other various capacitors, ranging from 1 to 470 µF. I haven't tested them for now.
But good news ! I also received 3 NRF24L01+ with built in antennas, reset the entire crew of nodes and gateway, and it works like a charm
I'm more than happy. Thanks again for all your advices.
I'll post some news later, testing the capacitors with NRF24L01+ and antennas.
Ciao. -
RE: Serial GW and motion sensor functionning, but no activity between them
@parachutesj , i've only used the basic example for the mysensors site, no modification at all. Here is the sensor sketch code :
/* * 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-2019 Sensnology AB * Full contributor list: https://github.com/mysensors/MySensors/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. * ******************************* * * REVISION HISTORY * Version 1.0 - Henrik Ekblad * * DESCRIPTION * Motion Sensor example using HC-SR501 * http://www.mysensors.org/build/motion * */ // Enable debug prints #define MY_DEBUG // Enable and select radio type attached #define MY_RADIO_RF24 //#define MY_RADIO_NRF5_ESB //#define MY_RADIO_RFM69 //#define MY_RADIO_RFM95 #include <MySensors.h> uint32_t 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 1 // 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 bool 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); }
And here is the GW code :
/** * 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-2019 Sensnology AB * Full contributor list: https://github.com/mysensors/MySensors/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 * */ // Enable debug prints to serial monitor #define MY_DEBUG // Enable and select radio type attached #define MY_RADIO_RF24 //#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 #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 }
@parachutesj, I've read again the presentation of mysensors functionning principles, and indeed, i've missed the fact that i must define a child id for every sensor, but the sketch already made this. I've the same problem with a DHT-11 node, with child_id_hum set to 0 and child_id_temp set to 1. I've tried to change these ids to 1 and 2, but nothing changed...
Is the code of the sensor and GW above get you any new ideas ?
Thanks a lot. -
RE: Serial GW and motion sensor functionning, but no activity between them
Hi everybody.
I'm progressing, thanks to you. Here is some more infos :- @mfalkvidd and @electrik , ok thanks a lot, i'll put the ID part of the plan aside for a while. Following your advice, when I unplug everything but the power and radio, I've got some weird things happening, worst of all is a sudden crash and reboot of computer when I try to open serial link monitor... :-x
- @skywatch : nano clones are these ones, and nRF24L01+ are those ones.
- @parachutesj : i've tried some very good sketches and begin to see a little clearer about nrf24. Using TMRh20 libraries and sketches, I've tried to make a couple of radios+nanos to communicate. The result I got is not so good : One radio just made my computer reboot :-x , while the two others seem more stable, BUT, when sending the ping between the two of them, the serial link console freezes for a little while, then shows back the sketch from the beginning. From what I've been reading, I think this could be a power supply problem (this post, "Power problems" section. I'll try to connect capacitors between VCC and GND of radios to avoid this "freeze" and "reboot" symptoma.
Next steps for me would be (I think) :
- see if capacitors can do the job and solve the problem
- try some other radio modules maybe ?
- try an official Arduino nano maybe ?
Again, thank you all for your help !
Latest posts made by Rolland
-
RE: Serial GW and motion sensor functionning, but no activity between them
@skywatch I've got some 10 µF and 100 µF electrolytic capacitors, and just received a bunch of other various capacitors, ranging from 1 to 470 µF. I haven't tested them for now.
But good news ! I also received 3 NRF24L01+ with built in antennas, reset the entire crew of nodes and gateway, and it works like a charm
I'm more than happy. Thanks again for all your advices.
I'll post some news later, testing the capacitors with NRF24L01+ and antennas.
Ciao. -
RE: Serial GW and motion sensor functionning, but no activity between them
Hello everybody. Ok, I've made some shopping, according to your advices, waiting for items to arrive. Until then, see you soon and take care, thanks again. I'll post the results of the new combination, hoping for success.
Ciao. -
RE: Serial GW and motion sensor functionning, but no activity between them
Hi everybody.
I'm progressing, thanks to you. Here is some more infos :- @mfalkvidd and @electrik , ok thanks a lot, i'll put the ID part of the plan aside for a while. Following your advice, when I unplug everything but the power and radio, I've got some weird things happening, worst of all is a sudden crash and reboot of computer when I try to open serial link monitor... :-x
- @skywatch : nano clones are these ones, and nRF24L01+ are those ones.
- @parachutesj : i've tried some very good sketches and begin to see a little clearer about nrf24. Using TMRh20 libraries and sketches, I've tried to make a couple of radios+nanos to communicate. The result I got is not so good : One radio just made my computer reboot :-x , while the two others seem more stable, BUT, when sending the ping between the two of them, the serial link console freezes for a little while, then shows back the sketch from the beginning. From what I've been reading, I think this could be a power supply problem (this post, "Power problems" section. I'll try to connect capacitors between VCC and GND of radios to avoid this "freeze" and "reboot" symptoma.
Next steps for me would be (I think) :
- see if capacitors can do the job and solve the problem
- try some other radio modules maybe ?
- try an official Arduino nano maybe ?
Again, thank you all for your help !
-
RE: Serial GW and motion sensor functionning, but no activity between them
I've also tried to clear the eeprom memory of the node, and flash again sensor sketch, but still the same problem... i've also tried to see if the motion sensor was working correctly, and made up a simple sketch with just the sensor and the Arduino, it's working fine.
-
RE: Serial GW and motion sensor functionning, but no activity between them
@parachutesj said in Serial GW and motion sensor functionning, but no activity between them:
try and put this into your code of the node
#define MY_NODE_ID 2
replace the number (2) for each further node with numbers between 1 and 255
what happens then?
Hi. Nothing change. I still got the same 3 debug lines, no sign of communication between node and gw...
-
RE: Serial GW and motion sensor functionning, but no activity between them
Ok guys, thanks a lot for all your advices. I understand better. @skywatch : my gateway is on USB port of a Raspberry Pi 3+ with Home Assitant. But on this side I don't understand fully how to configure the link between gateway and HA, or at least to see if everything is going normal. HA is powerful but there's so much to learn when you discover it.
I'm discovering a lot of things in a little time : Mysensors, Home assistant, arduino...
Thanks anyway for your help and kindness.
@parachutesj , I'll modify my sketch and see what happens. -
RE: Serial GW and motion sensor functionning, but no activity between them
@electrik Yes, that's all debug lines that i get, no matter how long I wait. I've just checked again the connection between Arduino nano and NRF24, for GW and sensor, and it's all good, according to the connect informations on this page. I didn't connect the IRQ pin as mentionned.
-
RE: Serial GW and motion sensor functionning, but no activity between them
@parachutesj Reading the library's API, I've understood that the node ID is defined automatically. I don't know how to find the info on seeing this is manually, if this is needed in my case. Can you help?
-
RE: Serial GW and motion sensor functionning, but no activity between them
@parachutesj , i've only used the basic example for the mysensors site, no modification at all. Here is the sensor sketch code :
/* * 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-2019 Sensnology AB * Full contributor list: https://github.com/mysensors/MySensors/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. * ******************************* * * REVISION HISTORY * Version 1.0 - Henrik Ekblad * * DESCRIPTION * Motion Sensor example using HC-SR501 * http://www.mysensors.org/build/motion * */ // Enable debug prints #define MY_DEBUG // Enable and select radio type attached #define MY_RADIO_RF24 //#define MY_RADIO_NRF5_ESB //#define MY_RADIO_RFM69 //#define MY_RADIO_RFM95 #include <MySensors.h> uint32_t 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 1 // 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 bool 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); }
And here is the GW code :
/** * 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-2019 Sensnology AB * Full contributor list: https://github.com/mysensors/MySensors/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 * */ // Enable debug prints to serial monitor #define MY_DEBUG // Enable and select radio type attached #define MY_RADIO_RF24 //#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 #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 }
@parachutesj, I've read again the presentation of mysensors functionning principles, and indeed, i've missed the fact that i must define a child id for every sensor, but the sketch already made this. I've the same problem with a DHT-11 node, with child_id_hum set to 0 and child_id_temp set to 1. I've tried to change these ids to 1 and 2, but nothing changed...
Is the code of the sensor and GW above get you any new ideas ?
Thanks a lot. -
Serial GW and motion sensor functionning, but no activity between them
Hello everyone ! My first topic here, to search for a help. I'm new to MySensors and a little confused by its working process, but i don't understand why my really simple and standard setup isn't working. Here it is :
A Serial Gateway on arduino nano clone, with NRF24L01+ attached.
A SR501 motion sensor on arduino nano clone with same radio attached.
I've only used the example sketches found here on mysensors, compiled on Arduino IDE 1.8.12.
GW and sensor are (for now) powered via USB on a desktop computer.Here is the log of sensor :
16 MCO:BGN:INIT NODE,CP=RNNNA---,FQ=16,REL=255,VER=2.3.2 26 TSM:INIT 28 TSF:WUR:MS=0
As far as i understand, the sensor is initializing, but that's all, no communication with GW, no data gathering...
And for the GW :
0;255;3;0;9;0 MCO:BGN:INIT GW,CP=RNNGA---,FQ=16,REL=255,VER=2.3.2 0;255;3;0;9;5 TSM:INIT 0;255;3;0;9;7 TSF:WUR:MS=0 0;255;3;0;9;15 TSM:INIT:TSP OK 0;255;3;0;9;18 TSM:INIT:GW MODE 0;255;3;0;9;21 TSM:READY:ID=0,PAR=0,DIS=0 0;255;3;0;9;24 MCO:REG:NOT NEEDED 0;255;3;0;14;Gateway startup complete. 0;255;0;0;18;2.3.2 0;255;3;0;9;28 MCO:BGN:STP 0;255;3;0;9;35 MCO:BGN:INIT OK,TSP=1 0;255;3;0;9;38 TSM:READY:NWD REQ 0;255;3;0;9;1850 ?TSF:MSG:SEND,0-0-255-255,s=255,c=3,t=20,pt=0,l=0,sg=0,ft=0,st=OK:
That's it...
I've tried with different sensors, with other pieces of radio, other nanos... nothing changes.
Hope it's a ridicoulous newbie problem and i thank you for the help you can bring me.
Thanks a lot !