Thank you, but ... it's not working.
For the first board, I have compiled the following code:
Code: Select all
// add library ds18b20
#include <ZUNO_DS18B20.h>
// pin connection ds18b20
#define PIN_DS18B20 11
OneWire ow(PIN_DS18B20);
// onewire connection temperature sensors
DS18B20Sensor ds1820(&ow);
int temp; // here we will store the temperature
int tempSent=-10;
int reportThreshold=10;
// set up channel
ZUNO_SETUP_CHANNELS(
ZUNO_SENSOR_MULTILEVEL(ZUNO_SENSOR_MULTILEVEL_TYPE_TEMPERATURE,
SENSOR_MULTILEVEL_SCALE_CELSIUS,
SENSOR_MULTILEVEL_SIZE_TWO_BYTES,
SENSOR_MULTILEVEL_PRECISION_TWO_DECIMALS,
getterTemp)
);
ZUNO_SETUP_SLEEPING_MODE(ZUNO_SLEEPING_MODE_FREQUENTLY_AWAKE);
void setup() {
}
void loop() {
temp=ds1820.getTempC100(NULL);
digitalWrite(PIN_DS18B20, LOW);
if(abs(temp-tempSent)>reportThreshold){
zunoSendReport(1);
tempSent=temp;
}
zunoSetCustomWUPTimer(30);
zunoSendDeviceToSleep();
}
word getterTemp() {
return temp;
}
For the second board, I have the following code compiled:
Code: Select all
#include "Arduino.h"
#define MY_SERIAL Serial
ZUNO_REPORTS_HANDLER(SensorMultilevel, SensorMultilevelReport);
void logReportTitle(const char * text, ReportAuxData_t *report_data) {
MY_SERIAL.print(millis());
MY_SERIAL.print(" ");
MY_SERIAL.print(text);
MY_SERIAL.print(" NODE:");
MY_SERIAL.print(REPORT_NODE_ID(report_data));
MY_SERIAL.print(" VALUE:");
}
void SensorMultilevelReport(ReportAuxData_t *report_data) {
logReportTitle("SENSOR MULTILEVEL", report_data);
switch(REPORT_SENSOR_MULTILEVEL_SIZE(report_data)) {
case 1:
MY_SERIAL.fixPrint(int(REPORT_SENSOR_MULTILEVEL_VALUE_1B(report_data)), REPORT_SENSOR_MULTILEVEL_PRECISION(report_data));
break;
case 2:
MY_SERIAL.fixPrint(int(REPORT_SENSOR_MULTILEVEL_VALUE_2B(report_data)), REPORT_SENSOR_MULTILEVEL_PRECISION(report_data));
break;
case 4:
MY_SERIAL.fixPrint(long(REPORT_SENSOR_MULTILEVEL_VALUE_4B(report_data)), REPORT_SENSOR_MULTILEVEL_PRECISION(report_data));
break;
}
MY_SERIAL.print(" TYPE:");
MY_SERIAL.print(REPORT_SENSOR_MULTILEVEL_TYPE(report_data), HEX);
MY_SERIAL.print(" SCALE:");
MY_SERIAL.println(REPORT_SENSOR_MULTILEVEL_SCALE(report_data), HEX);
}
/* the setup function runs once, when you press reset or power the board */
void setup() {
MY_SERIAL.begin(115200);
MY_SERIAL.print("START");
}
/* the loop function runs over and over again forever */
void loop() {
delay(1000);
}
According to the instructions, I updated the board software in the manager to 3.09.B10. I checked by comparing the files in the "Z-Uno2 (Beta)" directory with the unpacked z-uno2_core_03_00_09_beta10.zip. I have excluded both boards from the Z-Way. I've updated bootloaders and recompiled the codes. Then include to Z-Way. In the association lifeline configuration of the first board, I added a second board (previously, for the whole winter, it was added Eurotronic Spirit thermostat working on the radiator, so the first board works). Z-Way receives unsolicited reports and displays the updated temperature. By contrast, the serial port monitor connected to the second board only displayed START.