Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion RollerShutterNode/FW/MyRollershutter/MyNodeDefinition.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
#define MY_RFM69_ATC_LEVEL 70 // Uncomment and set RSSI target for ATC mode. Not mandatory for GW
//#define MY_RFM69_LISTENMODE // Uncomment to enable ListenMode (RX duty cycle communication for sleeping node)

// set timeout for transport init (if gateway is down)
#define MY_TRANSPORT_WAIT_READY_MS 30000

//#define MY_NODE_LOCK_FEATURE //!< Enable lockdown of node if suspicious activity is detected

Expand Down Expand Up @@ -89,7 +91,7 @@
#define TEMPERATURE_ALARM 60 // temperature threshold for alarm

#define TEMP_MEASURE_INTERVAL 3000 // How many milli seconds between each measurement
#define FORCE_TRANSMIT_INTERVAL 30 // number of seconds, the sensor is forced to report all values to the controller
#define FORCE_TRANSMIT_INTERVAL 30*1000 // number of milliseconds, the sensor is forced to report all values to the controller
#define TEMP_TRANSMIT_THRESHOLD 2 // how much the temperature should have changed since last time it was transmitted.

// ********************* BUTTONS STATES **********************************************
Expand Down
13 changes: 10 additions & 3 deletions RollerShutterNode/FW/MyRollershutter/MyRollershutter.ino
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ float oldTemperature = 0;
float hilinkTemperature = 0;
OneWire ow_ds1820(DS18B20_PIN);

//Transmission time
unsigned long LastTransmission = 0;

// Authentication
const int sha204Pin = ATSHA204_PIN;
//atsha204Class sha204(sha204Pin);
Expand Down Expand Up @@ -228,9 +231,13 @@ void loop() {
tx = true;
ShutterStop();
}
oldTemperature = hilinkTemperature;
if (tx) send(msgTemperature.set((uint8_t)hilinkTemperature), 1); // TODO problem sending float to jeedom???weird..need to check

if (millis()-LastTransmission)>FORCE_TRANSMIT_INTERVAL) tx=true;

if (tx) {
send(msgTemperature.set((uint8_t)hilinkTemperature), 1); // TODO problem sending float to jeedom???weird..need to check
oldTemperature = hilinkTemperature;
LastTransmission=millis();
}
}
/* ======================================================================
Function: receive
Expand Down