HeaterMeter Monitor and ESP8266/ESP32 Streaming Library


 

KeithC

TVWBB Member
I'm aware of wifimanager, but I didn't use it because that's how HeaterMeter's wifi used to be and a vocal majority seemed to not understand the concept of connecting to an AP to configure it. It wasn't helped by Android silently switching off the wifi if it determined that there was no Internet access, but at least now they show a message and let you use it. Does newer WifiManager emulate the webpage google tries to pull to test Internet connectivity now to fake it out or anything? We need to add a camera to HeaterMeter Monitor so it can scan the wifi sharing QR code!
the code is pretty well commented and several examples are available that show advanced config, timeouts, etc. I'm not sure how to make it all work lol. this one uses it's own page to select the network and set it up, so not seeing anything google here. Not sure what the griping was in the past but this is common practice with IoT devices, for ones not using QR codes anyway. If you can solder this together and was willing to write your WiFi login password as code this is a piece of cake in comparison and more secure (especially if you set a password on the temp ap, which is an option). Now you don’t have to drag a computer along if you use this somewhere else or with a different network.

071B231B-2F0F-4C24-B45C-382B1148F882.png 2040146C-8186-4A25-A4F3-4CD25B451C42.png2C5901B3-BB6F-401A-AC30-90EF0B0728C8.png
 

Steve_M

TVWBB Guru
For my espresso controller, I'm using the IotWebConf library which borrows a lot of code from WiFiManager. It allows for extra configuration parameters as well as OTA updates.

nAUaQKBl.png
 

Bryan Mayland

TVWBB Hall of Fame
Yeah I've used WifiManager many times, and I know that this is the standard for IoT device setup, but I can't tell you how many hundreds of posts and emails I've answered about confusion trying to connect to the AP's captive portal to configure the wifi. That's why there's like 800 ways to configure HeaterMeter's wifi because every single one of them has been determined to be "too complicated to set up". I've even tried hooking an analog input to the HeaterMeter LEDs and using my cellphone's screen to flash on and off and blink wifi credentials through pulses of light and dark. For something like the Monitor that requires you build the source yourself, it might make more sense. I just wanted that project to have as few dependencies and as straight-forward a setup as possible to just build it and go instead of build it and then set it up. I also didn't want to add ArduinoOTA support and WebServer support and all that extra junk since it is just a demo that few people will use and will clutter up the code.

Android 10 added wifi bootstrapping support to assist with this, but I've not been able to find any generic open source app that just does this for bootstrapping WifiManager devices, on account of the term "wifi manager" being too generic to find anything related to it and not managing wifi. If there was something like that I'd for sure be on board with writing to that API to remove all the steps of Turn off mobile data, Search for a wifi network named "ESP_XXXX", if a popup comes up about internet access stay connected, go to the web browser and load the portal page, etc, etc.
 

KeithC

TVWBB Member
@Bryan Mayland man, I thought I did something cool, spent my afternoon working on it lol. I guess if I'm the only one that uses it, oh well. Anyone, please feel free to grab my code and tinker / share!
 

Steve_M

TVWBB Guru
@Bryan Mayland man, I thought I did something cool, spent my afternoon working on it lol. I guess if I'm the only one that uses it, oh well. Anyone, please feel free to grab my code and tinker / share!

I think Bryan wanted to release a helpful library and let people tinker with it. Want to expand your project that uses the HeaterMeterClient library as well as WifiManager, cool. What I think Bryan is trying to avoid is turning the library into a full fledged project that now requires more support effort outside of fixing bugs specific to HeaterMeterClient.

Nothing worse than becoming a victim of your own success :cool:
 

KeithC

TVWBB Member
I think Bryan wanted to release a helpful library and let people tinker with it. Want to expand your project that uses the HeaterMeterClient library as well as WifiManager, cool. What I think Bryan is trying to avoid is turning the library into a full fledged project that now requires more support effort outside of fixing bugs specific to HeaterMeterClient.

Nothing worse than becoming a victim of your own success :cool:
Oh I get that. He might have a day job or other projects he's working on as well. The guy that started the MPCNC project, that *is* his day job now because it became so popular. That may or may not be Bryan's wish. My only intent is to be helpful & not appear that I'm just griping...
 

Steve_M

TVWBB Guru
I don't think anyone thinks you're griping. If you don't already have a GitHub account, I'd create one and create your own repository for your HeaterMeterClient based project and post your code there. It can act as both a place to document your process and let others see it as well. I always post my stuff on GH since it's like a free backup for my projects :) My GH repos are here.

It was the HeaterMeter project that got me interested in microcontroller projects as I didn't have any previous experience with them. Now they're my goto device when in the past it would have always been a Raspberry Pi since I was way more familiar with Linux than writing C style code for a microcontroller.
 

Bryan Mayland

TVWBB Hall of Fame
@Bryan Mayland man, I thought I did something cool, spent my afternoon working on it lol. I guess if I'm the only one that uses it, oh well. Anyone, please feel free to grab my code and tinker / share!
I've got to apologize if that's how I made you feel, I was just explaining why I didn't include that myself. You took what I started and got into it and made it do what you want, which is what the whole HeaterMeter project is all about! I may be a little old programmer salty about IoT wifi configuration in general and I think that leaked out. Of course you should be excited about adding a useful feature. I'll get this added to the standard project.

How difficult would it be to add a “fan on” led to this
None hard! Just hook up your resistor and LED to D8, then add one line to setup():
pinMode(D8, OUTPUT);
And one line to the end of displayTemps():
digitalWrite(D8, hm.state.Output.Current > 0);
That line will light the LED if it the Output is on at all, but if you really just want Fan on, it is hm.state.Output.Fan > 0.
 

Andrew F

TVWBB Super Fan
None hard! Just hook up your resistor and LED to D8, then add one line to setup():
pinMode(D8, OUTPUT);
And one line to the end of displayTemps():
digitalWrite(D8, hm.state.Output.Current > 0);
That line will light the LED if it the Output is on at all, but if you really just want Fan on, it is hm.state.Output.Fan > 0
I will be adding this shortly. I’ll have to dig for a resistor and led.
 
Last edited:

Andrew F

TVWBB Super Fan
If I’m reading everything correctly, and that is a big IF, I should be able to a few lines and another led display and have it display fan percentage?
 

Bryan Mayland

TVWBB Hall of Fame
Yeah you can use D8 to run another Data line and bridge the clock, 5V, and GND from the others to add another module. There is some sort of limit on how many you can gang together, because they all have pullup resistors on the lines so each one added in parallel reduces the pullup resistor so it might reach a point where they start acting flakey. If adding one more hits that point then just remove one of the pullup resistors from the LED module. I'd have to look to see which it is but let me know if you encounter that and I'll check.

You can also use D4 and D3 (GPIO 0 and 2) pins but those have special functions and cause problems with the wemos failing to boot or be flashable so be careful adding anything using those pins.
 

Andrew F

TVWBB Super Fan
Got my “MM” printed and assembled. Smoked plexiglass cover and fan on LED.
 

Attachments

  • 2A9D22C4-3D3A-4638-BD31-96B75B32BAEB.jpeg
    2A9D22C4-3D3A-4638-BD31-96B75B32BAEB.jpeg
    103.6 KB · Views: 12

Top