@fot said:
Hi!
I ask my gateway about it's version (0;0;3;0;2;). It will responde with the library version number (1.4.1 in my case).
It tells me that the gateway software is up and running. But it will not give me any clue about if the (NRF)network is working.
That's a problem, right.
I only ask the gateway if no other packages are received in $timeout seconds.
/Magnus
Of course ! Thank you for pushing my nose on it. Sometimes you don't see the most obvious
Since my gateway is relatively close to the controller (Domoticz on a Raspi), I can do a hard reset of the gateway (via Raspi GPIO), which should resolve the issue.
Cheers
Josh
@Zwer2k my expectations seem correct. I created a bug report that also includes a rudimentary workaround.
https://github.com/mysensors/MySensors/issues/1496#issue-968399284
Do you have interest to try OH2 together with MySensors Ethernet Gateway to get working?
I do not have enough force to push developers to make this happen. At the moment there is some problem on this, because full control is not possible. I think that MySensors Serial Gateway is working with OH2, but I don't like to use it. I like to connect my devices into LAN not cabling via old fashioned way using serial wires.
You would use PID if you have a temperature feedback from the rooms, but in your case you are not interested so it doesn't matter much. Sure turning off pump when not needed is a good thing. I have colleague that also bought a few netatmo devices to control floor heating of some zones of his house and he is very happy.
I have success!
(oops, that's suppose to be Timer1)
I only sample for 1/60 of a second. What I did was to back up all the timer registered I used and then resorted them after I was done sampling. (As opposed to initializing the registers in setup and then starting the timer when needed.)
Now I have a Nano sampling the data and sending it to a MySensors Gateway on an RPi3B+ which then sends it to an MQTT broker runing on an old laptop. Also running on the laptop is Home Assistant running inside of VirtualBox.
If MySensors does use Timer1, it appears that restoring the registers allows it to be shared.
//------------------------------------------------------ISR
ISR(TIMER1_OVF_vect){ // interrupt service routine for overflow
TCNT1 = TimerPreloadValue; // must be first line! starts the timer counting again
digitalWrite(TRIGGER_START_SAMPLE_PIN,HIGH);
samplesVolts[--sample]=analogRead(VOLTS_IN_PIN); // decrement before capturing
samplesCurrent[sample]=analogRead(CURRENT_IN_PIN);
digitalWrite(TRIGGER_START_SAMPLE_PIN,LOW);
if (!sample){ // count down to zero
digitalWrite(TRIGGER_START_SAMPLE_PERIOD_PIN,LOW); // indicate that sampling is complete
samplingEnd = micros();
TCCR1B &= 248; // turns off timer
}
}
//------------------------------------------------------sampleOneCycle
void sampleOneCycle(){
// back up timer registers
uint8_t TCNT1_b = TCNT1;
uint8_t TCCR1B_b = TCCR1B;
uint8_t TCCR1A_b = TCCR1A;
uint8_t TIMSK1_b = TIMSK1;
// configure timer which starts the sampling
noInterrupts(); // disable all interrupts
TCCR1A = 0;
TCCR1B = 0;
TCNT1 = TimerPreloadValue; // preload timer
//TCCR1B |= (1 << CS10)|(1 << CS12); // 1024 prescaler
TCCR1B &= 248; // turns off timer?
TIMSK1 |= (1 << TOIE1); // enable timer overflow interrupt ISR
// demark sampling
sample = NUMBER_OF_SAMPLES; // count down to zero
digitalWrite(TRIGGER_START_SAMPLE_PERIOD_PIN,HIGH);
samplingStart = micros();
TCNT1 = 65535; // first trigger right away!
TCCR1B |= 1; // turns on timer
interrupts(); // enable all interrupts
// wait for sampling to be complete
while(digitalRead(TRIGGER_START_SAMPLE_PERIOD_PIN)){};
samplingEnd = micros();
// restore timer registers
TCNT1 = TCNT1_b;
TCCR1B = TCCR1B_b;
TCCR1A = TCCR1A_b;
TIMSK1 = TIMSK1_b;
}