Looking for original firmware sketch for RFM69Pi

I have an RFM69Pi. It may have been purchased in July 2015, or it may be one that I purchased a bit later. I have two.

I am interested in modifying the firmware. I am using the directions found here to try to locate a sketch: RFM69Pi V3 - OpenEnergyMonitor Wiki

The only non-compiled sketch I can find in the folder in question is for a RFM69CW radio:
RFM2Pi / firmware / RFM69CW_RF_Demo_ATmega328 / RFM69CW_RF12_Demo_ATmega328 /

When I compile this and load it I get garbled results like this.

Does anyone know where a working sketch would be for this device, so I could add my changes and recompile?

Thanks!
Brandon

AFAIK that is the correct sketch. Did you stop the emonhub service before uploading?

That sort of output normally suggests a baud rate error but I can see the command line says 38400, which is correct to the sketch. What “board” type did you select for compiling? The RFM2Pi’s are NOT “Uno” based boards as they run at 8MHz not 16MHz, you will possibly need a custom entry on the boards.txt file of the Arduino IDE as described on that wiki page.

[edit - Actually you can use the “Arduino Pro or Pro mini” board option and select “ATmega328p (3.3v 8MHz)” that should give you the same board spec as a RFM2Pi.]

1 Like

Thanks! I had stopped reading the wiki when I got to “The ATmega328 on the RFM69Pi should come pre-loaded with the Optiboot bootloader and RFM69Pi firmware. This step should not be required unless you have assembled the RFM69Pi with a blank ATmega328.”

So I followed the steps in “Modified OptiBoot Bootloader”. Now I get this error when trying to compile for that board.

C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Arduino.h:257:26: fatal error: pins_arduino.h: No such file or directory

I made the following change in trying to troubleshoot. I changed the filename of the bootloader found on Martin’s GitHub from “Optiboot328_8mhz_RF12_Demo.hex” to “optiboot_atmega328_384_8.hex”, to match the line in the board definitions that says: “atmega328_384_8.bootloader.path=optiboot
atmega328_384_8.bootloader.file=optiboot_atmega328_384_8.hex”

You do not need to change the bootloader. That wiki page tels you how to load a pre-compiled hex or how to recompile/load the bootloader and sketch. There is an option between those where you only recompile the sketch (not bootloader) and upload that (not a pre-compiled hex). But for that you cannot use the “Uno” board option you need a 3.3v 8Mhz ATmega328p board, there is a bespoke boards.txt entry included on that wiki page as part of the upload new bootloader guide, that could be used, or you could try using a Pro/Pro mini board option as in the edit I just made to my last post.

If you are using the serial port (ftdi header or gpio) to upload your sketches, the install bootloader options will fail as you cannot install a bootloader via serial, only via the 2x6 in-circuit programmer header can you change the bootloader as that is what provides the ability to upload via serial.

[edit - If you have edited the board.txt as part of your previous attempts then you should have a new “8MHz type board” entry you can select when using the Arduino IDE so you may not need to use “pro/pro mini” now]

1 Like

That worked! Thanks!