I would really like to get OTA working here as it's freezing outside and I have to go there to update the software in the greenhouse control system.
So please, can we have a 'how to' step-by-step guide to OTA? Please?
S.
Gawd bless ya @OldSurferDude , that just about answered every question I have to date, I especially thank you for indicating whether the item named is a software or hardware product.
On reading into the Cerbo GX capabilities I was very impressed with its sophistication and, just as you said, I will have to break the complicated parts down into bite-sized pieces and build from there.
It started with an idea for a project, essentially to take data on battery state of charge (SoC) from the Cerbo GX and use an Arduino Nano or ESP8266 to build a strategy so that I would have sufficient hot water in the morning, consistent with having enough battery power left in the evening. Only on further inspection did it occur that the Node Red software built into the Cerbo GX could do this for me...and thus the possibility that a wireless hot water temperature sensor (transducer) could be fabricated to feed that data into the Cerbo GX; hence my path to here.
I've dabbled in programming in C, mainly through the Arduino IDE, and in a previous life part of my work involved programming PLCs for industrial automation, so I am somewhat familiar with 'tech', but I lost interest once most systems seemed to go Windows based. In the intervening years the 'tech' has moved on apace and has left me behind, which is why I've struggled to follow the jargon, akin to trying to fit the second piece in a large jigsaw puzzle. Once the fundamentals are there I'll catch on.
So please, kind contributors, be tolerant of the silly questions we newbies ask, we won't always be newbies, and I'll be back for sensors stuff once I've tamed the red-hot node and sorted out my LBQTTs
Best wishes....MM
I bought the Every because it implied it was backward compatible with the nano. No, it's not, as we found out.
Be that as it may, any word on a getting the Every working with mySensors?
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;
}