This boards have to be programed via FTDI, USB, WiFi. This is for Arduino experienced users not always easy going as we have seen on the two different COM ports of the Feather M0 or a non-standard FTDI connection of the bare LoPy.
In the rising sun of the BOB project I am worried about “normal” users or “just beekeepers” that want to use our hardware.
In the most cases you will always have to tweak some settings:
for WiFi devices: set SSID / password and the endpoint for data transmission
for GSM/GPRS devices set APN
for TTN different keys in case there is no “central” TTN application
for all systems with scale: adjust / calibrate your device
So it is a straight learning curve to get familiar with the IDE, 5 V vs, 3.3 V cables or adapter or FTP connections to get your new device running.
I hesitate a bit with this decision but for a really user friendly configuration without too much external help I see only the chance to do it via WiFi with a tool like WiFi Manager there is a nice description also. You have a graphical user interface without any IDE or cable and library stuff, perhaps you can upload also firmware packages (I have to figure this out).
But is it worth to carry a full WIFi stack with you, only for an initial configuration perhaps once in the lifetime of the device? What do you think? How can we make the life easy for non-hackers or lower at least the barrier for novices? This would also be a clear decision or at least a favorite role for ESP based nodes.
Thanks, @Andreas for pointing to this discussions. But my point is a step before. In case you have a running device updates (e.g. other measuring intervalls) are remote via some kind of “back channel” possible. But to establish this channel you need in the most cases to upload a sketch to the device with WiFi cedentials or with mobil network specifications like APN. My suggestions are: How can this be done without uploading a new sketch.
For firmware updates you are right, there we need a kind of firmware builder and we have to evaluate if an update is possible via WiFi. OTA for RFMxx radio modules would be also possible but I think this is for advanced users only and so not the target group I had in mind with the first post.
Thanks for writing in. The firmware builder was designed for this very use case as it doesn’t require to set up any toolchain at all. It’s not about updating anything using a backchannel or doing OTA updates, as this is an advanced use case.
It’s really about the “getting started” step for users not that tech-savvy without touching any code or compiler at all. After that, the AVRDUDESS program would be the way to go for uploading the compiled program to the microcontroller:
As this is a program with an user interface available for Windows, Linux and Mac OS X, this is way more accessible to users without any experience on the command line.
So the whole process would be:
Visit a web page for putting in the required configuration variables
Press the “Build firmware” button which will trigger the download
Upload the firmware using AVRDUDESS
It’s really the most easy way following the KISS principle i can imagine - at least for non-networked microcontrollers.
For MCUs being on any kind of network (Ethernet, WiFi), it’s obviously a totally different story and we should very well think about embedding a captive portal like WiFiManager or using a firmware framework already bringing one along like Homie.
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.
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.
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.
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.
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.
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.
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?
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.