Jeff,
It should be possible to use the Uno as stand alone. However, I would be careful interfacing it with the HLK-RM04 as the Uno runs at 5V and the HLK-RM04 logics runs at 3.3 V. Furthermore, the 3.3 V version of the Arduino Pro Mini operates at 8 MHz which makes it necessary to recompile the...
I've put together a light version of the Heatermeter using an Arduino Pro Mini (3.3 V, 8 MHz) connected to an HLK-RM04 (32 MB) as the wifi interface:
Size: 70x50x35 mm (2.8X2.0x1.4 inch)
Full Heatermeter 4.0 functionality except what is noted below
Full Linkmeter wifi interface including AVR...
It needs 1min15s for a firmware update, so the speed is reasonable. I've basically taken the gpio-bitbang code straight from avrdude 6.0.1 (the "linuxgpio" mode) and it is based on the sysfs interface.
Now when it is up and running, the HLK-RM04 seems to do the trick quite well although the...
I have added some functionality to hmdude (basically a new version of the spi_transaction function and some initialization stuff) such that it is now possible to use it with the four exposed gpios (0, 1, 2, 14) of the HLK-RM04. The AVR firmware upgrade works flawlessly from within linkmeter!
The combined uartf/gpio mode is now working, done by patching the pinctrl driver pinctrl-rt2880.c:
/* mark the pins as gpio */
for (i = 0; i < p->groups[group].func[0].pin_count; i++)
p->gpio[p->groups[group].func[0].pins[i]] = 1;
- } else {
+ }
+ /* combined uartf and gpio function */...
Yes, sysupgrade works fine when openwrt is up and running. The bootloader must be replaced from start and when loading the first openwrt image, I know of no other way than via tftp.
I'm currently trying to push the RT5350 into the combined uartf/gpio mode such that it would be possible to...
And the solution to the unexport bug can be found in the openwrt ticket #14309: https://dev.openwrt.org/ticket/14309
Avrdude now works great from within Heatermeter.
Yes, flashing the AVR works fine replacing hmdude with avrdude!
Besides adjusting the options in avrupdate, I had to disable part of avrdude's exit routine where it performs an unexport of the gpios. Apparently, there is a bug on the openwrt side when unexporting gpios on the RT5350. It is not...
An update:
On the 32M hlk-rm04 I have now used avrdude-6.0.1 in linuxgpio mode to flash the atmega. Due to the limited number of exposed gpio pins on the hlk, I had to sacrifice the uartf, meaning that there is just one physical serial port, and use those pins as gpio. The gpio configuration is...
Further testing the HLK-RM04, 32M RAM, with Linkmeter/Heatermeter:
It works fine with Heatermeter using wifi and, after patching the linkmeter Makefile to allow for simple wifi-mode switching, it's happily switching between access point and client mode:
- if [ "$(CONFIG_TARGET_brcm2708)" =...
I got my HLK-RM04 with 32M RAM from China today. Couldn't wait to test it, so I flashed a new bootloader (uboot256), changed the memory size in HLKRM04.dts file to 32M and remade the image (no other changes relative to my previous post).
The result is great: Linkmeter runs flawlessly, even on...
Linkmeter on HLK-RM04, necessary mods:
Use Bleeding Edge r39237 and the latest Linkmeter update, including Bryans RT5350 patch
linkmeter.uci-defaults, change tty port:
SERIAL_DEVICE="/dev/ttyS0"
Bryan's install.sh modified such that:
#!/bin/sh
REPO_PATH=$(pwd)
TARGET="$1"
WRT_PATH="$2"
if [...
Many thanks for the feedback! And the quick linkmeterd patch!
I'll be more than happy to share the details when I have worked my way through the busy week I have ahead of me.
There's a new version of the HLK-RM04 with 8MB flash and 32MB RAM. I've ordered two units from China, will be here in a...