RFLink flashing on Mega 2560 in MacOS

I use RFLink as a gateway for communication with RF 433 devices. The needed hardware for RFLink is cheap and also RF devices are widely available for low prices, sometimes second hand bargains. I use rf plugs, a window sensor and an outdoor temp/humidity sensor.

Yesterday I had to reinstall RFLink on a Mega 2560 clone with CH340 driver, because my old one was damaged.

RFLink is available for free and in the downloadable release a compiled hex file is provided which can be loaded onto a Arduino Mega 2560.

The RFLink website provides a Windows firmware loader executable for uploading it on the Mega. However there is no loader software for MacOS available on the website.

As it wasn’t that easy to find how to upload a .hex file to an arduino on the mac, I will share the
method I used here as well for others.

Method 1: EasyUploader

I personally didn’t use this method. But found this application afterwards. Online people report it as useful, so I reckon it will work. Connect Arduino, Select type, Select port and .hex file and your good to go.

Download page: https://www.polaxis.be/downloads/

Below screenshot is from their website.
afbeelding

You probably do have to allow the program within Security & Privacy settings on the Mac first.

Method 2: via terminal

To do the firmware load on the Mac it is possible to use the command line. If you want to use below commands, you do have to have the Arduino IDE installed as avrdude is needed which comes with Arduino IDE.

I found some instruction on the Domoticz forum, however this contained old paths, which have changed in later updates of Arduino IDE. The new path in MacOS is currently /Users/username/Library/Arduino15/packages/arduino/tools/avrdude/6.3.0-arduino17/bin/.

Also this forum post on the arduino forum was helpful.

I downloaded the latest RFLink release on the RFLink website and unzipped the downloaded zip file.

I connected the Mega 2560 to the mac with a USB cable. (In my case my first tried cable gave timeouts on firmware loading and often didn’t show the device in the list to my frustration, took a while until I found that another cable did work)

I did install a CH340 driver, but I don’t think it is neccessary, but it was part of my troubleshooting attempts.

When the Mega 2560 is plugged in via USB, run ls /dev or ls /dev/*serial* in the terminal window to see if it shows up in the list. It should show as tty.wchusbserial1410 or similar, you can also see the same ports in the Arduino IDE software interface if you open this.

afbeelding

Then I navigated in the terminal window to the folder path where the RFLink.cpp.hex was located. And executed below command within the terminal window:

/Users/username/Library/Arduino15/packages/arduino/tools/avrdude/6.3.0-arduino17/bin/avrdude -v -p atmega2560 -c stk500 -P /dev/tty.usbserialREPLACE -b 115200 -D -U flash:w:RFLink.cpp.hex:i -C /Users/username/Library/Arduino15/packages/arduino/tools/avrdude/6.3.0-arduino17/etc/avrdude.conf

Note: make sure to replace ‘username’ and you serial path with your own so that the right username folder is used in the paths for avrdude and avrdude.conf.

Also the path for avrdude.conf can change in future versions of Arduino IDE. This forum post can be helpful in those situations.

If things went correct below output is displayed.

After installation I connected my WL101 Receiver and XD-FST FS1000A transmitter and hooked it up to my Home Assistant installation. For more instruction on how to configure see the RFLink integration page.

Happy reading and controlling RF devices!

I saw there was a upgrade to the other day, do you know if there’s a way to update the mega directly from the Pi?
Looks like avrdude can be run on the Pi?