Update- and configuration-strategy for Arduino-based devices

I see, it is much more easy to use this scenario than an IDE and getting confused with librarys and board management. But it could be still complicated to connect the board or having no FTDI cable on hands Thanks for the described step-by-step scenario … just thinking how it could be as easy as possible.

Right ;]. That’s the reason we wanted to have every single bit (libraries, build chain, etc.) available in a single repository (GitHub - hiveeyes/arduino: Arduino-compatible MCU firmware code for sensor-, telemetry-, and gateway-appliances.) for supporting this scenario on the backend side from the very beginning.

It was a pleasure. Same with me.

That’s right, but i can’t think of any way making this even more simple other than shipping pre-flashed MCUs which would require way more logistics on the upstream side.


But let me drop some more links for sparking more ideas ;]:

In any case, proper wiring and additional hardware for programming the microcontroller will always be required. With FTDI and AVRDUDESS, we are already standing on the shoulders of giants here.

Here is an additional link for the ESP8266 and OTA:

http://s6z.de/cms/index.php/homeautomation-homecontrol/hardwareplattformen/esp8266/133-ota-esp8266-over-the-air-flashen

reminder:

Dear Clemens,

would you consider having a look at the pull request mentioned above so that we can think about merging it? Thanks in advance!

Cheers,
Andreas.

I’ve recently also discovered GitHub - dreed47/WifiMQTTManager: ESP32/ESP8266 library for managing your IoT devices. and – drumroll(!) – GitHub - prampec/IotWebConf: ESP8266/ESP32 non-blocking WiFi/AP web configuration Arduino library. @Stefan might want to look into that for the Bienenwaage mit TTGO T-CALL und ESP32-Arduino-Software he contributed the other day.

1 Like

Hi @Andreas,

By now I’m working with the tzapu/WiFiManager lib with development branch which supports the ESP32.

But the GitHub - prampec/IotWebConf: ESP8266/ESP32 non-blocking WiFi/AP web configuration Arduino library) lib looks quite good at a first short view.

First I’ll go forward with the current solution, but why not have a deeper look at the proposed lib, as the possibility to store custom values looks interesting.

2 Likes

I think tzapu’s WiFiManager is the WifiManger used most often in the past. But less activity development in the last month.

Btw. a nice overview and comparison between tzapu’s and prampec’s WifiManager aka IotWebConf now! ;-)

Seems also possible GitHub - prampec/IotWebConf: ESP8266/ESP32 non-blocking WiFi/AP web configuration Arduino library

Highlights
[…]
Firmware OTA update support,

[edit] Auch heise.de hat den für eigene Projekte entdeckt: https://www.heise.de/hintergrund/ESP-Projekte-WLAN-mit-IotWebConf-5022556.html und benennt einen Nachteil des WifiManagers:

Kennt der WifiManager noch keine WLAN-Zugangsdaten, wartet die Bibliothek in setup() darauf. loop() führt der ESP dann erst aus, wenn das WLAN konfiguriert ist. Was für viele Smart-Home-Basteleien ein sinnvolles Vorgehen ist, blockiert allerdings Geräte, deren WLAN-Kommunikation nur ein Zusatzfeature ist.

D.h. es wird wohl GitHub - prampec/IotWebConf: ESP8266/ESP32 non-blocking WiFi/AP web configuration Arduino library

2 Likes

Scheint nicht mehr so zu sein, siehe:

1 Like

wifiManager.startConfigPortal("OnDemandAP"); tut beim WifiManager genau das was es soll, ich habe z.B. einen Testsketch hinbekommen, der nur nach der reset cause POWERON_RESET, d.h. power cycle oder reset button das captive portal lädt. Die custom variables sind beim WifiManager leider kein Spaß. die gibt es zwar konfigurierbar in der UI, um alles was mit denen gemacht werden soll muss man sich aber selbst kümmern, etwa im EEPROM speichern oder wieder auslesen … hatte ich mir anders vorgestellt. Und ein einfaches Beispiel dazu habe ich bisher auch noch nicht gefunden.

Bei IotWebConf ist der use case relativ eindeutig vorgegeben – ein device, das per WiFi mit dem Netz verbunden ist. Im example IotWebConf16OffLineMode.ino gibt es eine Funktion iotWebConf.goOffLine(); die das WLAN-Modul disconnected. Aber initial scheint es dennoch zu laufen, da suche ich noch eine Möglichkeit das on demand zu starten. forceApMode() habe ich mir noch nicht genauer angeschaut, ggf. macht das so was.

Hi Clemens,

benutzt Du denn nun WiFiManager oder IotWebConf bzw. wäre nicht letzteres Dein Favorit? Wir können ja gerne ein paar Änderungen machen, wenn Dich der aktuelle Umgang mit WiFi dabei irgendwie stört, sofern Du, wie geschrieben, mit dem TTGO T-Call-SIM800L ausschließlich GSM nutzen willst.

Viele Grüße,
Andreas.

Ich habe mich noch nicht entschieden bzw. weiß nicht, ob man mit der einen oder der anderen Bibliothek unser Szenario abdecken kann.

Nach dem heise-Artikel war ja der Stand der Dinge, dass so was mit dem WifiManager nicht möglich ist. Nach meiner Recherche scheint die dort beschriebene zwingende WiFi-Konfiguration kein Blocker zu sein. Doku beim WifiManager ist ganz schön messi und auch in den Beispielen sind kleine Schnitzer drin, die wenig Pflege vermuten lassen.

Mein Favorit wäre momentan IotWebConf, wenn der ganze WLAN-Kram nicht zu sehr “im System” integriert ist. Vielleicht sollte ich mal das heise-Beispiel anschauen … ggf. bin ich dann schlauer.

Ja, ich dachte auch, dass das unser aktueller Favorit wäre. Also schauen wir doch dort, was wir tun können, um es auf Deinen Anwendungsfall anzupassen bzw. zu erweitern?

Das hört sich jetzt nicht so gut an

IotWebConf vermeidet, dass ein ESP beim Abfragen der WLAN-Daten blockiert. Für Geräte, die sowohl für sich als auch eingebunden in ein WLAN funktionieren sollen, ist das eine gute Lösung. Der Preis dafür ist, dass die loop()-Funktion regelmäßig in die Bibliothek springen muss. delay() ist in loop() daher fast verboten und der Code muss stattdessen mit millis() prüfen, ob genug Zeit für den nächsten Schritt vergangen ist. Ein Beispiel, wie so etwas aussieht:

aus: ct 03/2021

Die TinyGSM blockiert definitiv, die Frage ist ob das dann egal ist und dennoch funktioniert.

See also Execute normal code after configuration. · Issue #123 · prampec/IotWebConf · GitHub

Vielleicht hilft hier auch schon die Begutachtung von @Stefan bei Inbetriebnahme und Weiterentwicklung der Firmware für Arduino (Bienenwaage 2.0 und 5.0) - #40 by Stefan etwas weiter?

Vielleicht ist die richtige Methode, die direkt aus setup() aufgerufen werden sollte, startupOffLine()?

IotWebConf on demand as configuration tool · Issue #223 · prampec/IotWebConf · GitHub

1 Like

Er nimmt ja den WifiManager und nicht IotWebConf, kann man machen, muss sich dann aber um das handling der custom Variablen selbst kümmern.

Hi again,

I also just discovered this library. It doesn’t look bad.

Cheers,
Andreas.

Khoi Hoang empfiehlt selbst die oben nicht mehr, sondern die neuere

Von ihm gibt es gefühlt 100 Wifi-Manger libs im Arduino-Lib-Manager, ich weiß nicht woher die Inflation kommt. Das wirkt auch alles sehr werbelastig (“Speed is OMG”) und in den Beispielen sind teilweise pin-Definitionen drinnen und anderes für spezifische boards.

Weiter braucht es z.B. für die double reset-button-Funktion eine weitere Bibliothek. Mir ist der Mehrwert dieser lib bisher noch nicht klar.

1 Like