I've switched my node from default config to 8Mhz internal oscillator. Gateway is still on 16Mhz external (moteino default).
When transmitting from node to gateway using SendWithRetry() , acks are no longer received with no timeout specified (I think it defaults to 50ms?). I've needed to double the timeout to 100ms, but this seems backwards since a single clock cycle now corresponds to more time on the node. I should be able to half it to 25ms, right?
At least with the listenmode example sketch, I needed to half the sleep times below to get the "woke" message to return to the gateway in time.
if (from) {
while (burstRemaining > 0) {
LowPower.powerDown(SLEEP_60MS, ADC_OFF, BOD_OFF);
burstRemaining -= 60;
}
LowPower.powerDown(SLEEP_30MS, ADC_OFF, BOD_OFF);
radio.send(from, "woke", 4);
}
If you did everything right, I'd expect the time to be respected in code, Xms to be Xms and not multiples or halves.
I think part of this change involves making your code compile for 8mhz instead of 16mhz, ie altering your boards.txt as mentioned in other threads realating to running @ 8mhz.
Quote from: Felix on May 19, 2016, 01:27:10 PM
If you did everything right, I'd expect the time to be respected in code, Xms to be Xms and not multiples or halves.
I think part of this change involves making your code compile for 8mhz instead of 16mhz, ie altering your boards.txt as mentioned in other threads realating to running @ 8mhz.
I double checked and I do have the right frequency specified in boards.txt.
##############################################################
Moteino8mhz.name=Moteino8mhz
Moteino8mhz.upload.tool=arduino:avrdude
Moteino8mhz.upload.protocol=arduino
Moteino8mhz.upload.maximum_size=31744
Moteino8mhz.upload.speed=57600
Moteino8mhz.bootloader.low_fuses=0xD2
Moteino8mhz.bootloader.high_fuses=0xDC
Moteino8mhz.bootloader.extended_fuses=0xFE
Moteino8mhz.bootloader.path=optiboot
Moteino8mhz.bootloader.file=optiboot_atmega328_8mhz.hex
Moteino8mhz.bootloader.unlock_bits=0x3F
Moteino8mhz.bootloader.lock_bits=0xCF
Moteino8mhz.build.mcu=atmega328p
Moteino8mhz.build.f_cpu=8000000L
Moteino8mhz.build.core=arduino:arduino
Moteino8mhz.build.variant=arduino:standard
Moteino8mhz.build.board=AVR_MOTEINO
##############################################################
Just to clarify - if I don't make the burst-remaining timing change, the gateway thinks there was no response and that the wake attempt failed.
Ok so how exactly did you switch to 8mhz internal RC?
Used the adafruit guide to turn my raspberry pi into a programmer (gpio pins + avrdude command lines) https://learn.adafruit.com/program-an-avr-or-arduino-using-raspberry-pi-gpio-pins/overview (https://learn.adafruit.com/program-an-avr-or-arduino-using-raspberry-pi-gpio-pins/overview) Set fuses per what's in the boards.txt above.
Recompiled your boatloader using 8mhz and 57600 baud compile options... Then I burned it.
What happens if you program your new 8mhz board with a 1 second ON/OFF blink? Does it blink for 1 second?
Why didn't I think of that? :P
And yes, it is flashing at 1s... Which now baffles me as to why the listenmode example has stopped working... It was working fine when I was running the node off the 16mhz external oscillator.