Stable Firmware Release v14

Bryan Mayland

TVWBB Hall of Fame
NOTE: It is suggested to run the SNAPSHOT firmware and not the v14 release. The snapshot has bugfixes and support for Pi 3B+ and is just as stable.

It has been a year and a half since the v13 release (March 23, 2016) and I think we're finally ready for something new for both v4.2 and v4.3 users. The biggest feature in this release is support for the Raspberry Pi 3 and Zero W, which are compatible with the HeaterMeter 4.3 boards. This also includes support for their integrated wifi modules which work well enough for our purposes and make Edimax wifi modules unnecessary with those Pi models (look, no dongle!)



Along with the development of this release, we've also gained the ability to download firmware images pre-configured with your wifi client settings baked in. This simplifies first time setup so that no editing of config.txt is necessary. If that's not enough, you can also now insert any USB mass storage device with a config.txt file containing updated wifi information and it will be copied to the device. The USB's config.txt is never modified, so this allows easy switching between client mode and AP mode by just having two different USB sticks with different configurations and preventing the user from locking themselves out if they change their wifi network configuration. There's also an ultra-simplified new LinkMeter -> Wifi page in the webui to set the configuration. With this many ways to allow you to set up your wifi, we can't possibly have people incapable of configuring their wifi any more.




The underlying filesystem on the device is now read-only and any changes are stored in a separate filesystem. This allows an added layer of safety compared to the earlier filesystem, which could become corrupted and prevent the device from booting properly. This was an ultra-rare occurrence, but now it should be handled more gracefully. In the event the writeable filesystem becomes corrupted and is unrecoverable, it will be reset and HeaterMeter will return the the default configuration. In addition, this new filesystem allows us to completely reset any changes when you do a "Config Reset?" which is great for folks who have done something mysterious to their configuration and left HeaterMeter unable to function properly. Configuration will now only be retained between firmware flashes if performed from the System -> Backup / Flash Firmware page with "Keep settings" checked (no more NORESTORE command line option).

The underlying firmware also enables support for HTTPS web serving, security updates to the services, and a proper CA certificate bundle for verifying other secure servers' identity. There's an official API now for third party tool integration. The current HeaterMeter graph can be downloaded as a PNG image or as CSV data directly from the home page. There are more CSS tags available for theming the homepage if desired.



On the HeaterMeter microcontroller side, button responsiveness has been greatly improved. Buttons should react more quickly, and a 1/4 second "dead zone" after each button press should help with preventing mistaken double-taps. There's also button longpress support with just one new mapping. Long pressing the LEFT button (or direction on 4.2 boards) will turn HeaterMeter OFF. All output is set to 0 and the servo damper will close and its signal will be disabled shortly after. Servos will now be kept live the entire time HeaterMeter is ON, rather than disabling after not moving for a while. You can also enter OFF mode by entering a setpoint of "off", or simply "o". Any setpoint change will re-enable the output.



There were also a few minor fixes to the PID algorithm for corner cases. Thermoworks Pro Series probes are now the default thermistor probe, changed from Maverick ET-72/73.

Finally, the firmware should auto-configure itself with mail server settings to use heatermeter.com as a gateway to send your alarm emails / SMS. You are welcome to change the configuration and it will not overwrite it if you prefer to use your own mail server. We use your Pi serial number and the HeaterMeter Device Manager to verify you as an actual user, and your messages are limited to 1KB max.

Existing users can upgrade and keep their configuration by using the System -> Backup / Flash Firmware webui and doing an upgrade from URL:
Raspberry Pi 2 / 3
Raspberry Pi A / B / A+ / B+ / Zero / Zero W

223 commits - 118 files changed, 15701 insertions, 58688 deletions. Here is a condensed full changelog.

[wrt] Switch to LEDE fork of OpenWrt (v17.01.1 Linux 4.9.20)
[wrt] Add support for Raspberry Pi 3 / Zero W / Wifi module
[wrt] Enable squashfs for rootfs and overlayfs for rootfs_data, allowing a complete configuration reset
[wrt] Switch curl to OpenSSL, remove polarssl, replace hostapd/wpas with wpad-mini
[wrt] Update dnsmasq to 2.78 for CVE-2017-14491 et al
[wrt] Include CA certificates for proper HTTP / SMTP SSL connections
[wrt] Enable HTTPS for webui
[wrt] No longer redirect to /cgi-bin, use the native lua extension

[lm] Fix configuration changes not "sticking" if no HeaterMeter is present on first boot
[lm] Configure SMTP client to use heatermeter.com if no server is configured on install
[lm] Use sysfs GPIO to toggle reset line for hmdude, removes register use of bcm2835
[lm] Fix broken avrdude platform cleanup
[lm] linkmeterd no longer integrated into lucid (defunct), is its own process
[lm] Add 192x192 boxy robot icon to the webui homepage
[lm] Add the ability to save PNG images of live graphs as well as download CSV as attachment
[lm] Reorganize all the alarms into different config sections. Fixes problems with fields appearing in the wrong area on the webui. Ref #36
[lm] Update Thermoworks probe coefficients with lab tested results -- Thanks to Tim P
[lm] Add Steinhart coefficients for Maverick Industries ET-735
[lm] Sanitize wifi SSID and password when loading from config.txt and using wifi-client/ap
[lm] Add beginning of official REST API / add apikey to config page
[lm] Add ability to do wifi config from a USB mass storage device, same config.txt method
[lm] wifi-ap defaults to channel 6 if not supplied, fixes AP mode not starting if hostapd ACS fails
[lm] Add wifi page to linkmeter webui for quick wifi client / ap mode setup
[lm] Force setpoint units to uppercase, include support for OFF units = O
[lm] Snapshot current HM configuration when doing a stash

[hm] Greatly increase response of button input and disable input for 250ms after each event
[hm] Add menu button longpress support
[hm] Add PID output disabled mode
[hm] Limit I-sum to startup fan speed during startup and lid recover
[hm] Fix WDT not disabling on gcc-4.9.2 (Atmel 3.5.3)
[hm] Remove PIN_SOFTRESET
[hm] Update to Arduino 1.8
[hm] Fix possibility of being locked in startup mode when entering manual output mode
[hm] ThermoWorks Pro-Series probe now the default
[hm] Fix not able to disable alarm by pressing device button (snapshot only)
[hm] Output setpoint of U if output disabled, - if manual mode
[hm] Only disable the servo when the PID is off

[www] The downloaded PNG background color is now controlled by #download not #content so they can be different
[www] Fix HTML compliance causing 'Save' button to not work
[www] Updated security requires POST method on changes to any webui fields
[www] URL token no longer required in secure page requests
[www] Only show 2 decimal places in peak amplitude tooltip
[www] Add Google Project Fi to the list of SMS email gateways
[www] Rename Internal probe type to Thermistor
[www] Allow CSS coloring of graph line colors using .pcolorX
 
Last edited:

Steve_M

TVWBB Guru
Nicely done!

The 15701 insertions, 58688 deletions figure is wild. That's a whole lot of bloat removed!
 

Bryan Mayland

TVWBB Hall of Fame
What options did you select? I've tried all different client-type configurations and all of them seem to download fine.

Yup a good portion of the 58688 deletions was patches to get the pi working right in the kernel with all the features we need. I was so pleased to see how mostly integrated it is now and I didn't have to spend days going patch by patch and modifying them to work with the different kernel version.
 

Mache

TVWBB Fan
I downloaded the v14 release and everything worked fine, initially. After several hours, the WiFi link dies. Rebooting solves the problem for a while but again after several hours the WiFi link dies. Checking the router, there is no active link for the HeaterMeter. This did not happen with v13. I have 4.2.4 hardware. Any suggestions?
 

Bryan Mayland

TVWBB Hall of Fame
What wifi adapter do you have? There's a different driver for the Edimax one so that would be an obvious culprit. If that's it, I'm not sure how I'd fix it though. The driver from v13 was patched by me to work in nl80211 mode on the kernel we were running, but I didn't do that for v14 because it was so labor intensive. We tried the new rt8xxx driver, which worked in client mode but not AP mode, and finally went to the rtl8192cu driver which seemed to work ok but had been problematic in the past.
 
Last edited:

Mache

TVWBB Fan
I have a Edimax EW-7811Un adapter. Is there another adapter I can buy that is more stable? I run strictly client mode.
 
Last edited:

Peter F

TVWBB Fan
Is there a way to modify the contents of /rom?

I would like to use my own user interface but this gets overwritten by the default interface as soon as I do a "Reset Config"
 

Bryan Mayland

TVWBB Hall of Fame
ROM is read only, and all changes on the filesystem are reset when you do "Reset Config". The only way to change /rom is to extract the squashfs image to a directory on another machine, make the changes, rebuild the squashfs, and dd it back onto the microsd. Are you doing custom branded devices or something like that?
 

Peter F

TVWBB Fan
I've made a special layout for the members of the Dutch BBQ-society. This is quite a big group of heatermeter users (150+) and most of them are not so computer savvy. If they lose their familiar web interface every time they do a hard reset then I will be extremely busy fixing their heatermeters.
 

Mache

TVWBB Fan
Will I have better luck with the Airlink AWLL5099? The Rosewill RNX-MiniN2? Rather than the Edimax EW-7811Un.
 

Bryan Mayland

TVWBB Hall of Fame
Unfortunately it is a problem at the driver level. I set up 3x HeaterMeters with Edimax adapters yesterday to see if I could reproduce this and yup, one of the three dropped off in the middle of the night but came back up later this morning. I checked the kernel log on that device and there was no errors or even any log messages at all from the driver. I have one of the devices connected to a monitor and keyboard so I can look at it when it isn't working but it hasn't had a problem. I'm really not sure what to do about it because I've checked and the rtl8xxxu driver still doesn't support AP mode, and I guess the rtl8192cu driver isn't ever going to be stable. I'm continuing to work on it because maybe I can include both drivers and switch between them depending on the mode?

If anyone wants to give me a Halloween present, they can just add soft AP mode to the rtl8xxxu driver!
 

Bryan Mayland

TVWBB Hall of Fame
I've made a special layout for the members of the Dutch BBQ-society. This is quite a big group of heatermeter users (150+) and most of them are not so computer savvy. If they lose their familiar web interface every time they do a hard reset then I will be extremely busy fixing their heatermeters.
Is it all just usercss or is there more? If there is a backup it can be restored but I know that's not very helpful.
 

Bryan Mayland

TVWBB Hall of Fame
Oof, well let me think about that a bit and see what we can come up with.

On the Edimax front, I've spent 16 hours today working on that stupid 8192cu driver and I feel like I am making some progress. That thing is the worst. I am surprised it works at all given how hacked up the source code is.

Of my 3 test devices I had running the mainline rtl8192cu driver, all three have dropped off now and come back, all without any kernel messages or errors. Oddly, it can lose connection to the AP and come back. I tested carrying a HeaterMeter out of range and it dropped off, then started walking back and it came back up almost immediately. I've also seen it disconnect and reconnect and it reports that it lost the AP. So the mainline isn't complete garbage, but it definitely drops out and can take hours to come back. I gotta get that out-of-tree driver working. I got it updated and compiling on our kernel, but not against backports (the ole compat-wireless). I'm hoping that once it actually builds against it, then it will actually work and not just segfault on load or something.

Been a long day today.
 

Mache

TVWBB Fan
I really appreciate the effort. Thanksgiving is a'comin and I hope to have a sorted out controller to smoke my turkeys/other goodies. Thank you again.
 

Bryan Mayland

TVWBB Hall of Fame
It's more then just usercss, the index file is modified and there are two additional jpeg's
I've spent some time thinking about it and I can't think of how to do this in a persistent way. The old "config reset" was sort of half broken in that it only could reset certain files so it could leave things half reset, and it didn't work with the newer rebootless configuration restore process. The only way you can do this is to mod the squashfs image you use. It's a one time thing and can easily be scripted so I'd encourage you to do that.

  • Grab the two parts of the image from the proper target https://heatermeter.com/dl/stable_14/ you need boot.img and root.squashfs and the gen_rpi_sdcard_img.sh which is constant.
  • unsquashfs root.squashfs and copy your changes into the filesystem
  • rebuild the squashfs
    Code:
    ./mksquashfs4 XXX YYY -nopad -noappend -root-owned -comp xz -Xpreset 9 -Xe -Xlc 0 -Xlp 2 -Xpb 2 -Xbcj arm -b 256k -p '/dev d 755 0 0' -p '/dev/console c 600 0 0 5 1' -processors 1 -fixed -time `date "+%s"`
    # Where XXX is the directory with the uncompressed filesystem and YYY is the output file name
  • Make sure the squashfs image is a multiple of 64KB if you're going to flash it using a Mac flashing program that needs it to be
  • gen_rpi_sdcard_img.sh outputimage.img boot.img YYY 19 64

The only magic is really the mksquashfs command and I'm not sure how much of that is even actually needed.
 
Last edited:

Steve_M

TVWBB Guru
If you're using apple pi-baker on the mac, it shouldn't matter. The author has added the "conv=sync" option in recent releases after we were discussing it.
 

Top