Hello everyone,
My rfm69 stands on a mountain 18km away (yep range is amazing!) and uses a few i2c sensors as a weather station. The problem that i'm facing is the i2c sometimes freezes (yes i'm aware about the default wire library faults) and i'm in the process of replacing that library. The watchdog timer is no good or pressing the reset button on the board. I need to cut power to the whole arduino and give it back to have it run again.
So the question is, can i control the rfm69 GPIO pins directly? Would be really amazing to do a power reset on that arduino using an external NC relay. It would be lovely to send a command to the RFM69 and use e.g. GPIO3 to activate the relay and do a power reset on the whole thing. Any ideas? Is this possible? I've read through the RFM69 docs but can't really understand if it's feasible...
thank you for your time!
Vangelis
You should use a watchdog timer such as TPL5010 to reset your board if there is any expectation the board might freeze.
While watchdogs have their place in electronics, in this case it is more of a bandaid than a resolution.
Instead of slapping a band aid at the problem, I would try determine why it freezes and fix the root of the problem.
Thank you very much for the answer Felix, i looked into the problem and found another i2c library that uses timeout, now it works without freezing at all. However the question still remains, is it possible to directly control the GPIOs of the rfm69 to control a device without a microcontroller? ;D
moreover, i connected a catalex SD card module to the arduino, and even though the rfm69 works perfectly, and the sd module also works perfectly using the default sd library, they can't work together. program freezes (and resets via software watchdog) when initializing. they're wired in different SS pins ofcourse, any idea what that could be? Forgive me, this might be a completely different subject...
thanks again!
Vangelis
So you want to run the radio without a uC? You can't do that, need the uC to program and switch states etc. So why bother.
Or are you trying to use the radio's extra pins to increase the GPIO of your uC? I'd have to dig the datasheet for the answer, but generally those pins are for interrupts, not for GPIO purposes.
With SPI, ensure your voltages are correct between MCU and SPI devices, then ensure CS lines are separate and pulled up, and only 1 is used at 1 time on a shared SPI bus. The RFM69 library uses SPI transactions so ensure arduino SPI transactions are used in all other libraries.
First of all, i want to congratulate and thank you for your patience and perseverence!
As for the SD card problem, it's solved. I had the notorious catalex module, which after a lot of research i couldn't fix either in hardware or software. Today i replaced it and it worked immediately ;D
Now about the module, no i don't want to extend the mcu gpio pins, or use it without an mcu. i just wanted to know if there's a command of some kind that i can send to the rfm69 to turn on/off a certain GPIO pin. For example, i have my whole setup and i want to perform a power cycle remotely. GPIO3 could be always LOW, keeping a NC relay working, which would give power to my board, and if i could somehow send it a command to make GPIO3 HIGH, it would automatically break power, and the whole thing would reset. like the GPIO0 sends a signal when data is received, something like that...
Is it clearer now? :D ::)
Thank you!
Send a message to the RFM69 without the MCU intervention, to tell a GPIO to turn ON/OFF? No and that makes no sense. ::)
He wants to keep a pin HIGH on the radio module itself and be able to send a special command to the remote mountain radio and drive that radio pin LOW. That could be used to rig up a power reset for the whole project to rescue it from a frozen state. I haven't looked at the radio's datasheet through that lens but if you enable interrupts on a pin, they flip often. There are four additional pins available that are not broken out on Mote but because they all overlap duties so much, I don't think it is possible to find one that is addressable with a specific packet.
You want to inspect table 22 in the RFM69W datasheet and focus on what the various interrupt pins do when the radio is in receive mode as your mountain-radio is. FifoFull on DIO3 strikes me right away as a possibility since only a 64-byte packet will trigger that interrupt.
Quote from: ChemE on June 25, 2020, 04:59:50 PM
He wants to keep a pin HIGH on the radio module itself and be able to send a special command to the remote mountain radio and drive that radio pin LOW. That could be used to rig up a power reset for the whole project to rescue it from a frozen state.
You should never need that type of thing if the firmware is coded properly.
But otherwise just use a proper TPL5010 watchdog if the unexpected is expected... ::)
Quote from: Felix on June 26, 2020, 07:25:41 PM
You should never need that type of thing if the firmware is coded properly.
But otherwise just use a proper TPL5010 watchdog if the unexpected is expected... ::)
100% agree. The TPL5010 is amazing and its hard to beat 38nA of sleep current!