No ACK before Reset
Posted: 24 Nov 2017 16:08
I get no ACK when I want to update. However, it works after pressing RST button.
Any ideas what this could be? Is the battery mode causing this?
Any ideas what this could be? Is the battery mode causing this?
Updated CodeZ-Wave Error device "test" does not support on command
Code: Select all
// V1.3
ZUNO_SETUP_SLEEPING_MODE(ZUNO_SLEEPING_MODE_SLEEPING);
ZUNO_SETUP_CHANNELS(
ZUNO_SENSOR_MULTILEVEL(ZUNO_SENSOR_MULTILEVEL_TYPE_GENERAL_PURPOSE_VALUE, SENSOR_MULTILEVEL_SCALE_PERCENTAGE_VALUE, SENSOR_MULTILEVEL_SIZE_TWO_BYTES, SENSOR_MULTILEVEL_PRECISION_ZERO_DECIMALS, getterStatus),
ZUNO_SWITCH_BINARY(getterNull, setterAutomower));
uint8_t requestStatusAutomower[5] = { 0x0F, 0x01, 0xF1, 0x00, 0x00 };
uint8_t autoAutomower[5] = { 0x0F, 0x81, 0x2C, 0x00, 0x01 };
uint8_t chargeAutomower[5] = { 0x0F, 0x81, 0x2C, 0x00, 0x03 };
uint8_t statusAutomower[5] = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF };
uint8_t commandAutomower[5] = { 0x0F, 0x01, 0xF1, 0x00, 0x00 };
uint8_t leer[5] = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF };
int statusInt;
void SerialWriteBuf(uint8_t *buffer, size_t size)
{
while (size != 0) {
Serial0.write((uint8_t) * buffer);
buffer++;
size--;
}
}
void setup() {
Serial0.begin(9600);
}
void loop() {
}
int getterStatus(void) {
while (Serial0.available())
Serial0.read();
memcpy(commandAutomower, requestStatusAutomower, sizeof(commandAutomower));
SerialWriteBuf(commandAutomower, sizeof(commandAutomower));
Serial0.readBytes(statusAutomower, 5);
statusInt = statusAutomower[4] << 8 | statusAutomower[3]; // Last two bytes inverted!
return statusInt; // ID according to list (-1 is no RS-232)
}
int getterNull(void) {
// no status, switch only triggers
return 0;
}
void setterAutomower(byte value) {
while (Serial0.available())
Serial0.read();
if (value == 1) {
//switch on, Automower AUTO
memcpy(commandAutomower, autoAutomower, sizeof(commandAutomower));
SerialWriteBuf(commandAutomower, sizeof(commandAutomower)); //Serial0.write(commandAutomower, 5);
Serial0.readBytes(statusAutomower, 5); //make sure interface has finished sending
}
else {
//switch off, Automower HOME (charge)
memcpy(commandAutomower, chargeAutomower, sizeof(commandAutomower));
SerialWriteBuf(commandAutomower, sizeof(commandAutomower));
Serial0.readBytes(statusAutomower, 5); //make sure interface has finished sending
}
}