Z-Uno bootloader version:2.1.5
Security:none
Frequency:EU
Device included:yes
Device included securely by controller:no
Controller:PC with Ubuntu runnuing Domoticz, AEONTEC Z-Wave USB Stick (but it does not bother about the problem)
Hi there,
I have running the following code on the Z-Uno:
Code: Select all
// LED pin number
// 13 pin - user LED of Z-Uno board
#define OTHER_PIN 21
// Potentiometer pin number
#define LDR_PIN A3
// channel number
#define ZUNO_CHANNEL_NUMBER_ONE 1
// Last saved potentiometer value
int giLastValue = 0;
int gbOn = true;
int giCounter = 0;
int giLightOn = 0;
int giLightOff = 0;
//ZUNO_SETUP_CHANNELS(ZUNO_SENSOR_MULTILEVEL_GENERAL_PURPOSE(getter));
ZUNO_SETUP_CHANNELS(
ZUNO_SENSOR_MULTILEVEL(ZUNO_SENSOR_MULTILEVEL_TYPE_LUMINANCE,
SENSOR_MULTILEVEL_SCALE_PERCENTAGE_VALUE,
SENSOR_MULTILEVEL_SIZE_TWO_BYTES,
SENSOR_MULTILEVEL_PRECISION_ZERO_DECIMALS,
getter)
);
ZUNO_SETUP_SLEEPING_MODE(ZUNO_SLEEPING_MODE_SLEEPING); // SLEEPING MODE
// the setup routine runs once when you press reset:
void setup()
{
Serial.begin (115200);
pinMode (OTHER_PIN, OUTPUT);
pinMode (LDR_PIN, INPUT); // setup potentiometer pin as input
}
void loop ()
{
int iValue = analogRead (LDR_PIN);
if (iValue > 500)
giLightOn++;
else
giLightOff++;
if (giCounter % 10 == 0)
{
gbOn = ! gbOn;
}
if (gbOn)
digitalWrite (OTHER_PIN, HIGH);
else
digitalWrite (OTHER_PIN, LOW);
if (giCounter == 40)
{
if (giLightOn > 30)
giLastValue = 100;
else if (giLightOff > 30)
giLastValue = 0;
else
giLastValue = 50;
zunoSendReport (ZUNO_CHANNEL_NUMBER_ONE);
zunoSendDeviceToSleep ();
}
giCounter++;
delay (100);
}
byte getter (void)
{
return giLastValue;
}
The wake up interval has been successfully set through the server to 960 seconds (16 minutes).
The first couple of times, the Z-Uno is waking up regularly and reporting correctly.
But after an non determinable number of reports it is not waking up anymore (see example attachement).
Even on pressing "reset" the Z-Uno reports once and goes back to sleep forever...
I have to factory reset the Z-Uno and reset the sleeping time of 960 s in order to get correct
behaviour back for some reports and than it fails again.
Could you help/check please?
Thanks and best regards
Christoph Malloth