@mfalkvidd you'r right, i was in a hurry , so i forgoted using my brain!!
the update was with domoticz and i have to check this way.
Thank.
Posts made by eric007
-
RE: MySensors 2.3.0 released
-
RE: MySensors 2.3.0 released
Hello,
I set the update, but now i've some issues.
I can't edit and manage switches anymore:
as soon i click on edit i have this word "undefined" .and that's all.
i can't set timers too.I tryed this:
My installation was pretty simple , so i stoped domoticz serveur , removed domoticz folder and proceeded to an fresh install.
Problems are still present.
log don't say anything.
so, anyone have a clue ?
thank
Eric.here what i get when i click on edit:
-
RE: Mysensors 2.2.0: need to force restart of nodes if controller or gateway are not available. How to do?
Hi,
Are you sure about node hang ?
i've read your sketch but i don't see wdt_reset().
I'm not sure but for canceling watchdog timer shouldn't you call wdt_reset() ?
that can't explain node hang but take a look.
Eric. -
RE: Auto reset node.
@gohan yes, i was thinking about using eeprom memory to set a data just before reaching timeout watchdog and use this data at next startup to decide if Arduino has been reseted by watchdog or not.
But using millis function is more clever and don't use eeprom memory.
Thank,
Eric. -
RE: Auto reset node.
Hi,
It works fine!!! No more signal issue.However, i don't know wich solution has worked but the idea of testing the millis function is perfect and should give a clue.
Thank for advices, it was so helpfull.
I'll post something when i'll have more details.
Eric.
-
RE: Auto reset node.
Thank you both of you,
i done a mix :
i setup a watchdog using istransportready and i added a capacitor to the NRF24 (i know i had to but i haden't done it yet, so now it's done).
for now, it seems working, i'll post a feedback in few days.
Bye,
Eric. -
Auto reset node.
Hi,
Here the thing,
I'm using domoticz(on raspberry) +serialgateway+nrf24L01 plus one node.My node is a 4 relays node used for watering my garden.
My node and the gateway are separated for 1m
In fact, the node is outside, but there were a hole in the wall so i brought back the rfn24L01 attached to my node inside. Gateway and node works fine together.My problem is : something like twice a week Gateway stop reaching the node and the problem persist until a do a reset on the node!
(a reset on my raspberry and gateway, don't solve anything)When i'm home, it's not a big deal but if i'm in holiday for 4 week, my garden will not be watered.
I'm thinking about setting up a watchdog on the node.
but i don't know nature of the problem:
if NRF24L01+ module has crashed or if Arduino nano is crashed, it's different;I would like to setup something like this:
I setup a watchdog on the node.
The gateway send a specific serial command each minutes to the node, and the node use this command to reset watchdog timer.
is there a way of doing this ?I probably could build a .c program on my raspberry to send a command to the node but i would like to do this from the gateway.
Thank,
Eric. -
RE: define weather scenario
@eric007 I think I found by myself: using events to manage my installation.
-
define weather scenario
Hi,
i've successfully setup a solution for watering my garden.
Arduino+domoticz as controller and gateway.
Arduino+nrf24 to control relays and watering my garden at different places.So, every evening , my vegetable garden is watered from 7:00pm to 7:30pm (planned with domoticz)
But now, i want to change the behavior of my installation:
I don't want to water my garden when if has rained.I registered an API to get weather (with Accuweather),
It works fine and i do have access to new devices : wind, rain, etc...But i don't know how to implement this devices to cancel watering in case of rain.
I even don't know if it's possible...Anyway, I don't want to waste money or water and need help for this.
Thanks,
Eric. -
RE: Using loop function with MySensors-master/examples/ (2.2)
Hi,
it works perfectly, you were so right from the beginning.
I took a wrong way because of the compilation success without loop() and setup() function in my sketch.
Anyway, my project works fine and thank you again. -
RE: Using loop function with MySensors-master/examples/ (2.2)
I'im using GarewaySerial and domoticz as controller.
Eric.
-
RE: Using loop function with MySensors-master/examples/ (2.2)
Ok! I did not know.
I was doing a try on my node and turned off my gateway.
tomorrow i will do it again and with the gateway!
i'll will send you a feedback.
Thank you so much for your answers and your availability,Eric,
-
RE: Using loop function with MySensors-master/examples/ (2.2)
Hi,
One more thing: even if compilation succeed, there are always two warnings:
Warnings are (my traduction):
WARNING : wrong .ci folder in library "Mysensors"
WARNINR : wrong .mystools floder in library "Mysensors"
For any sketch (using or not Mysensors) i do have this Warning, since i've installed mysensors library.It might be the the problem ?
thank,
Eric. -
RE: Using loop function with MySensors-master/examples/ (2.2)
here a snapshot of the Serial output (is that you wanted ?)
One more thing
usually, when I compile sketch without loop() or setup() function, an error is done.
But here, i can remove loop() and setup() function and compile without any errorscan both functions (loop and setup) be located elsewhere ? in a .h ou .cpp dependencies that used with #include Mysensors.h
One last thing,
I use last version of IDE Arduino , under debian computer.
When i compile other sketch (my very firsts examples, without Mysensors) loop() and setup() have the right behaviorthank for help,
Eric. -
RE: Using loop function with MySensors-master/examples/ (2.2)
Thanks for your answer,
here the thing:
i've 4 relays connected to an Adruino nano(328)
MysensorSerialGatreway is doing the right job and all is working.
But, i want to add a timeout option that switch off a relay after timeout reached.
I want this option in case of a freeze or bug with my domoticz controller (running on a raspberry pi)
Relay are used for watering my garden, so i prefer having a solution on my arduino for switching off relays in case of any bug.So, my idea is pretty simple:
each time a relay is switched on i store the time
(i'm doing this in receive() function)In the loop function i do some tests and check the timeout for each relay
I wanted to know if it was working (i do think my code is correct) so i put some Serial output.
as you can see in setup() or in loop(), there are two outputs.
I do have the Mysensors classic outputs but mine do not produce anything.
so have you an idea ?
thanks a lot.
here my 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-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.
- REVISION HISTORY
- Version 1.0 - Henrik Ekblad
- DESCRIPTION
- Example sketch showing how to control physical relays.
- This example will remember relay state after power failure.
- http://www.mysensors.org/build/relay
*/
// 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// Enable repeater functionality for this node
#define MY_REPEATER_FEATURE#include <MySensors.h>
#define RELAY_PIN 4 // Arduino Digital I/O pin number for first relay (second on pin+1 etc)
#define NUMBER_OF_RELAYS 4 // Total number of attached relays
#define RELAY_ON 1 // GPIO value to write to turn on attached relay
#define RELAY_OFF 0 // GPIO value to write to turn off attached relayunsigned long t1[4]; // Calcul de la durée depuis l'activation d'un relay
#define DUREEMAX 3600000 // duréee maximale après laquelle les relais sont automatiquement éteintsvoid before()
{
for (int sensor=1, pin=RELAY_PIN; sensor<=NUMBER_OF_RELAYS; sensor++, pin++) {
// Then set relay pins in output mode
pinMode(pin, OUTPUT);
// Set relay to last known state (using eeprom storage)
digitalWrite(pin, loadState(sensor)?RELAY_ON:RELAY_OFF);
}
}
void setup()
{
Serial.begin(115200);
Serial.println("setup ok");
}void presentation()
{
// Send the sketch version information to the gateway and Controller
sendSketchInfo("Relay", "1.0");for (int sensor=1, pin=RELAY_PIN; sensor<=NUMBER_OF_RELAYS; sensor++, pin++) { // Register all sensors to gw (they will be created as child devices) present(sensor, S_BINARY); }
}
void loop() //my watchdog
{
unsigned long t=millis();
unsigned long t2[4];if (t>=t1[0]) {t2[0]=t-t1[0];} // if t<t1 then millis() function have reached the max value on a arduino (after 50 working day ), and get back to 0
else
{t2[0]=4294967295-t1[0]+t; }if (t>=t1[1]) {t2[1]=t-t1[1];}
else
{t2[1]=4294967295-t1[1]+t; }if (t>=t1[2]) {t2[2]=t-t1[2];}
else
{t2[2]=4294967295-t1[2]+t; }if (t>=t1[3]) {t2[3]=t-t1[3];}
else
{t2[3]=4294967295-t1[3]+t; }if (t2[0]>DUREEMAX) { digitalWrite(RELAY_PIN,RELAY_OFF);} // switch off relay, timeout reached
if (t2[1]>DUREEMAX) { digitalWrite(RELAY_PIN+1,RELAY_OFF);} // switch off relay, timeout reached
if (t2[2]>DUREEMAX) { digitalWrite(RELAY_PIN+2,RELAY_OFF);} // switch off relay, timeout reached
if (t2[3]>DUREEMAX) { digitalWrite(RELAY_PIN+3,RELAY_OFF);} // switch off relay, timeout reachedSerial.println("loop test");
}
void receive(const MyMessage &message)
{
// We only expect one type of message from controller. But we better check anyway.
if (message.type==V_STATUS) {
// Change relay state
digitalWrite(message.sensor-1+RELAY_PIN, message.getBool()?RELAY_ON:RELAY_OFF);
// Store state in eeprom
saveState(message.sensor, message.getBool());
// Write some debug info
Serial.print("Incoming change for sensor:");
Serial.print(message.sensor);
Serial.print(", New status: ");
Serial.println(message.getBool());
if (message.sensor-1<4 && message.sensor-1>=0)
{t1[message.sensor-1] = millis();}}
}
-
Using loop function with MySensors-master/examples/ (2.2)
Hello,
I'm using Mysensors for the very first time (2.2 version)
I'm confused, everything is working excepted the loop function.
Precisely,
I'm editing RelayActuator and placed my code in loop function (it was already declared but empty) but my code is ignored.
Both functions, loop() and setup() usually used in a sketch are ignored.(I do think that they are ignored because each serial feedback, like Serial.println(...) don't do anything)
What can I do if i want to use them ?
Thanks,
Eric.