#258

  Рет қаралды 20,761

Ralph S Bacon

Ralph S Bacon

Күн бұрын

Пікірлер: 279
@KevinDC5
@KevinDC5 Жыл бұрын
I just found the channel and have been watching and learning so much! I wish I would’ve found your insight 4 years ago when I first started my dive into the world of MCUs. You’re an amazing instructor. 🤘🏼🤘🏼 from Texas!
@RalphBacon
@RalphBacon Жыл бұрын
You are so welcome! But where have you been? Well, now you've found me, so happy viewing!
@chrisshipman6253
@chrisshipman6253 Жыл бұрын
Your videos just seem to get better and better! really nicely explained, as always.
@RalphBacon
@RalphBacon Жыл бұрын
Thank you very much! 👍
@Toro-Tor
@Toro-Tor Жыл бұрын
Frog with the sunglasses is most hilarious - love the sense of humor !
@RalphBacon
@RalphBacon Жыл бұрын
Such a bright screen! 🐸
@Chriva
@Chriva Жыл бұрын
Welcome BACK(!) to you Mr. Bacon :)
@RalphBacon
@RalphBacon Жыл бұрын
You got that right, Christian! 👍
@ForwardGuidance
@ForwardGuidance Жыл бұрын
The warnings about security make me chuckle. A lot of people don't even have a computer anymore so all they know is how to play games and interact socially on their cellphone and I feel the few that can hack into my network have bigger fish to fry. Near none of my 20 to 30 year old relatives have a computer now, because after spending 1000 on a cellphone, they don't want to spend another 1500 on a computer. As always Ralph, this one was informative and entertaining. Thanks.
@RalphBacon
@RalphBacon Жыл бұрын
I totally agree with "... the few that can hack into my network have bigger fish to fry." Our home Wi-Fi networks are sort of secure to casual kiddie bedroom hackers but as real hackers can bring the British Post Office to its knees I'm guessing our home networks would be hacked in minutes!
@stevex3976
@stevex3976 Жыл бұрын
Great timing. I am just starting a project where I can use this information. Thanks Ralph, great job as always.
@RalphBacon
@RalphBacon Жыл бұрын
Obviously tailor-made just for you, SteveX!
@veedonfleece3694
@veedonfleece3694 Жыл бұрын
Ralph, thank you for the clear linking of the various aspects of this. You have a great knack for focusing on the key parts, well done!
@RalphBacon
@RalphBacon Жыл бұрын
Glad it was helpful! Don't forget to watch Part 2, coming to a screen near you soon!
@alcanceweb
@alcanceweb Жыл бұрын
A clear and enough detailed tutorial over a great tool, the OTA. Thank you, sir.
@RalphBacon
@RalphBacon Жыл бұрын
Glad it was helpful!
@hariseldon2577
@hariseldon2577 Жыл бұрын
Thanks again. A tip for beginners. One thing I have found useful is to copy the path of the actual .ino file on my computer into the start of the .ino file, as a variable. I then print this variable out to the console when the program first runs. That way, as I tend to leave a number of ESP32s running for some time and tend to forget which file is actually running , at every reboot it is displayed on the console. This can of course be printed to a ver.html file, which I can call to verify which version of the code I am actually running. Hope it helps.
@RalphBacon
@RalphBacon Жыл бұрын
Great way to track what's telling the information 👍
@TheUnofficialMaker
@TheUnofficialMaker Жыл бұрын
i do this too!
@dom1310df
@dom1310df Жыл бұрын
For as long as I can remember I have always configured the DHCP server to hand out the same IP to the same MAC address, unless it runs out of addresses. Makes life so much easier, and it allows the same code to be flashed to multiple devices without specifying the IP, gateway and DNS servers within the code.
@RalphBacon
@RalphBacon Жыл бұрын
I do that too (belt and braces) but recently I've lapsed, secure in the knowledge that I don't need to touch my router; this static address is honoured and the router just leaves it alone. Of course, it's wise to tell the router to NOT use DCHP addresses in the range that you are now allocating static addresses. And don't forget to change the code (IP address) for each device. I've never forgotten that, not once. 🤥 What? No, really I 🤥 haven't. 😁😉
@theonlymudgel
@theonlymudgel Жыл бұрын
Your new Texan viewer is right. You’re a very good teacher. A little bit of British humour doesn’t go astray either. Cheers mate.
@RalphBacon
@RalphBacon Жыл бұрын
Nice of you to say! We have to have some sort of sense of humour with all our rain! Tally-ho!
@johntoe6127
@johntoe6127 Жыл бұрын
Great video Ralph. I've pretty much given up on fancy displays, knobs, and switches on my ESP32 projects. I use the methods you've just described for controlling things: Webpages, WebSerial, and OTA. My current project is a Mailbox Monitor that uses ESP32 to connect to WiFi. Powered by Solar/tp4056/Lipo, it sleeps most of the time, but uses IR sensors to tell you when there's mail in the box. Opening the mailbox door wakes it up.
@RalphBacon
@RalphBacon Жыл бұрын
Sounds perfect! In the UK we don't have mailboxes, as such. The postman must put all the letter through the letter-box, built into most front doors. But a sensor to detect something there would work too.
@neilcampbell6026
@neilcampbell6026 Жыл бұрын
Your OTA update in this video and a previous one (better for ota) is the greatest thing since sliced bread. I do not change a thing and leave bee hives and all that in there. It reminds me who is king bee. Oh no. Queen? Oh well thanks Ralph. Keep us challenged.
@RalphBacon
@RalphBacon Жыл бұрын
Thanks for sharing!
@airbrushernst
@airbrushernst 2 ай бұрын
Hi Ralph thank you so much for this library. It works great. I work on a project with an ESP32-S2. To upload on this board you have to push a couple of buttons (you probaly know :-) ) If my project is finised it hangs on the wall and updating the webpage interface works great now with the arduino IDE Thanks for sharing !!!!
@RalphBacon
@RalphBacon 2 ай бұрын
So glad you got it working, well done! 👍
@jeffbluejets2626
@jeffbluejets2626 Жыл бұрын
For us newbies, the whiteboard is usually the best to "get the message" of what connects where, and what runs on what. Just a thought.
@RalphBacon
@RalphBacon Жыл бұрын
After all this time, Jorgo, you cannot serious consider yourself a "newbie" any longer?!? 😉 Anyway, thanks for the feedback.
@allinclusive5762
@allinclusive5762 Жыл бұрын
@17:00 OMG! I have written a program that writes the html-code into a variable like this: cTmp += " "; cTmp += " "; 😭 Thank you for this hint!!
@RalphBacon
@RalphBacon Жыл бұрын
Writing it to a variable is fine but you lose the overall visual structure. That doesn't matter if you know HTML but beginners need a few visual clues of how it's put together, I feel! You will still need to "break" the raw literal to inject variable values (although JavaScript would work too). Or you can modify the entire string using C++ function to replace, for example, placeholders with actual values. So if your raw literal contained the word @parm1 then you could do a string substitution of that value with an actual variable value.
@allinclusive5762
@allinclusive5762 Жыл бұрын
@@RalphBacon ... and I have the advantage that I can very easily incorporate queries. f.e.: if ( iAnzFritzverbrauchersteckdosen == 2 ){ cTmp += "Aktueller Schaltp. 2 bei:" + String(iSchaltenBeiWatt[1]) + " W"; cTmp += "Akt. P FritzVerbraucher 2:" + String(fVerbrauchswatt[1],0)+ " W/ "+ String(iTemperatur[1])+ "°C"; }
@RalphBacon
@RalphBacon Жыл бұрын
Only in German can we have a word like Fritzverbrauchersteckdosen. Why can't they just say FritzSmartPlug - all I hear is English expressions on Antenne1 all day so they are obviously understood! So ein Mist!
@allinclusive5762
@allinclusive5762 Жыл бұрын
@@RalphBacon 😂 yes - i am ashamed of it too - but i was just too lazy to adjust the code
@mr.bianchirider8126
@mr.bianchirider8126 Жыл бұрын
Yet again, another great video ! Please continue by adding some inputs (open relays) and outputs (temperature) to the web page. Maybe even some security to the inputs.
@RalphBacon
@RalphBacon Жыл бұрын
Great suggestion!
@gpTeacher
@gpTeacher Жыл бұрын
Really terrific topic today Ralph! Thank you as always!
@RalphBacon
@RalphBacon Жыл бұрын
Glad you liked it!
@paulsmulders4072
@paulsmulders4072 Жыл бұрын
Thank you Ralph for this excellent video (I've enjoyed many of your other videos too!).
@RalphBacon
@RalphBacon Жыл бұрын
Glad you like them, Paul!
@keldsor
@keldsor Жыл бұрын
Really nice ... I hate to go out in the field to update - so I'll try to make e general system to all my projects ! THX for sharing !👍
@RalphBacon
@RalphBacon Жыл бұрын
Yes, it works well. Just don't upload code that hangs the device or you'll be connecting that USB cable again! Not that I've ever done that. 🤥Nope. 🤥Not me.
@emj6724
@emj6724 Жыл бұрын
Just came across your Channel. Your content is fantastic Please keep it coming Very cool accent also
@RalphBacon
@RalphBacon Жыл бұрын
Thank you! Will do! I don't have an accent, everyone else does!
@rinokentie8653
@rinokentie8653 Жыл бұрын
Great stuff, would be nice if you could extend the example with some variables.
@RalphBacon
@RalphBacon Жыл бұрын
Yes, Part 2!
@U8uxa8SP
@U8uxa8SP Жыл бұрын
Please continue with the building of the landing page. I. love your videos.
@RalphBacon
@RalphBacon Жыл бұрын
More to come! Part 2 already been thought about...
@U8uxa8SP
@U8uxa8SP Жыл бұрын
@@RalphBacon great, thanks.
@CraftyOldGit
@CraftyOldGit Жыл бұрын
Very useful -- thanks. Every time I looked at implementing OTA, I turned back 'cos it was going to take ages to work out how to do it.
@RalphBacon
@RalphBacon Жыл бұрын
Glad it helped! Well, will help, if you try it out. Remember, demo code in the GitHub.
@TheUnofficialMaker
@TheUnofficialMaker Жыл бұрын
thanks for explaining and look forward to part 2!
@RalphBacon
@RalphBacon Жыл бұрын
Glad it was helpful!
@1_HighDuke
@1_HighDuke Жыл бұрын
Fantastic explanation. Thank you once again!
@RalphBacon
@RalphBacon Жыл бұрын
Glad you liked it!
@henkoegema6390
@henkoegema6390 Жыл бұрын
Thanks for very interesting video. I didn't know this was possible, but it is what I always wanted. Well done. 👍
@RalphBacon
@RalphBacon Жыл бұрын
Glad you liked it!
@zyghom
@zyghom Жыл бұрын
great video! I was in a need of such few years back - but I got there - no issue. Next step: button on the web that will upload the firmware from the web server directly to ESP and will initiate update of the firmware. Or even better: sketch, that would check from time to time if the new version of the firmware exists on the server and if so, it would update automatically. Challenge?.... accepted? ;-)
@RalphBacon
@RalphBacon Жыл бұрын
The problem is that 90% of all beginners could not configure a server if their lives depended on it. Even if they did get one up and running they could not fix it if (when) it goes wrong. Lots of suggestions like this but sometimes KISS rulz!
@zyghom
@zyghom Жыл бұрын
@@RalphBacon oh, so challenge... refused ;-) Don't underestimate your audience ;) It can be hosted on AWS, Github or one command in docker
@largepimping
@largepimping Жыл бұрын
Hard-coding an IP address in C code as shown in the video is a terrible idea for the vast majority of people. It's almost guaranteed to _eventually_ create IP address conflicts that will be EXTREMELY difficult for most people to track down. Setting up DHCP Reservations in your DHCP server ("router") is the correct way to do this kind of thing -- while that's obviously an "outside the scope of this video" kind of thing, I'd strongly suggest that people avoid what Ralph shows here unless you know exactly what you're doing (and if you did, you wouldn't do it this way anyway! 🙂).
@RalphBacon
@RalphBacon Жыл бұрын
Well, I did mention changing the range in which your router hands out DHCP addresses, although I suspect most users won't know their router well enough to do this. Assuming you did, then if you then use the same IP address for two ESP32s, well, you'll get a conflict although how that is reported remains to be seen. The other way is to tell the router to always give the same IP address for the ESP32s MAC address, but that's depending on your router just a little too much.
@danman32
@danman32 Жыл бұрын
I'm not keen on static either. But there are pros and cons with any IP assignment method. A static ip assignment in the pool range might not cause a future conflict if the ESP is on most of the time as likely DHCP will possibly check if the IP candidate is already in use.
@u2bist
@u2bist Жыл бұрын
DHCP reservation would be better, but I wouldn't be so emphatic about hardcoded ip addresses. The main issue is that a device could demand a specific ip that's already be in use. But if you define the range of ip addresses dhcp can use, numbers outside of that are safe to hardcode. The other issue is the decentralization, but that's just a matter of being organized.
@electronics.unmessed
@electronics.unmessed Жыл бұрын
Well done - like your explanation. If I only had it before I started programming my ESP32 HTML projects.
@RalphBacon
@RalphBacon Жыл бұрын
Well, it's never too late to jump ships mid-stream! How do you program you HTML projects?
@electronics.unmessed
@electronics.unmessed Жыл бұрын
@@RalphBacon Well, I am not the greatest programmer on earth. Just straight forward using client.println( .. ). My dream is to realize nice gauge sites with HTML + ..
@stephenashdown2581
@stephenashdown2581 Жыл бұрын
Nice introduction, could you expand on this in a future video to embed some sensor data into your webpage to make it more functional?
@RalphBacon
@RalphBacon Жыл бұрын
Indeed, that is Part 2, out soon!
@danman32
@danman32 Жыл бұрын
I have yet to find a decent wifi library that lets you securely store multiple wifi credentials, will automatically go to one of them that is currently present and, non-blocking, will go to AP mode if none present, and will regularly check for SSID changes to go to an already configured SSID. There's also the problem with some WiFi libraries that latch onto a specific BSSID in a multi/mesh Wifi AP environment rather than allow roaming between APs. I've used one that came close and included a built-in web platform and OTA. The web platform confused me, was JSON based and not clear to me on formatting and I/O.
@kitecattestecke2303
@kitecattestecke2303 Жыл бұрын
Yes you are right.. Its just painful to realize if your esp project won't join a WiFi again if it lost connection and doesn't scan and join :-/ kind of pointless to have WiFi in the first place then :-/
@RalphBacon
@RalphBacon Жыл бұрын
There is a library that allows multiple SSIDs to be scanned and it will join the one with the best signal. Of course, you still need to know the correct password (I'm sure you could design a simple, encrypted password storer using LittleFS). The library is called WiFiMulti.h from Espressif (bit.ly/3HONTlL ) and detailed here: randomnerdtutorials.com/esp32-wifimulti/
@danman32
@danman32 Жыл бұрын
@@RalphBacon does said library automatically join the SSID autmatically or not? If not and you have to enter the password each time it wants to connect, that's not fitting my criteria.
@RalphBacon
@RalphBacon Жыл бұрын
Automatically? Anything joining a Wi-Fi network has to know the SSID and Password, however that is supplied. You can't "just join", although you can programmatically make it appear that's what happens, without any manual password entry.
@danman32
@danman32 Жыл бұрын
@@RalphBacon that's what I've been saying: enter and store SSID and password, or remember and store recent connections. That way when you come near one stored, it will reconnect. Like your phone and laptop does.
@wjn777
@wjn777 Жыл бұрын
Thanks for the nice overview. Do you need to change any partitioning details in the platform io config file for this to work?
@RalphBacon
@RalphBacon Жыл бұрын
No need! In fact, if you look at the .ini file I use, I don't even mention partitioning because we don't specifically use that feature. I'm guessing that, by default, we're using all the memory for program space but I can't guarantee that. We'll cover that soon too.
@noweare1
@noweare1 Жыл бұрын
@@RalphBacon I think you need an ota partition for ota to work. Both programs are actually in flash at the same time so the esp32 can revert back to the old program if something goes wrong. The partition you are using would already have an ota partition.
@ronen124
@ronen124 Жыл бұрын
I guess I will use your tutorial one day, thanks Ralph
@RalphBacon
@RalphBacon Жыл бұрын
"One day" is just another way of saying "never", Ronen. 😢😲 (OK, I took this from the film _Knight & Day_ but it's true).
@ronen124
@ronen124 Жыл бұрын
@@RalphBacon I already have two ESP32 dev boards lying around inside my tool boxes and waiting to be used with WiFi 😊
@OsoPolarClone
@OsoPolarClone Жыл бұрын
Very informative as always Ralph. Yes some instruction/tutorial for making the html page more “useful” would be nice. Thanks!!!!!😅
@RalphBacon
@RalphBacon Жыл бұрын
Noted! I knew that Part 2 would be needed...
@OsoPolarClone
@OsoPolarClone Жыл бұрын
@@RalphBacon Ralph. Will ChatGPT write HTML code? Could it write the Part 2 type tasks?
@OsoPolarClone
@OsoPolarClone Жыл бұрын
@@RalphBacon you may find this interesting. kzbin.info/www/bejne/i6HapISomJd9otU
@flemmingchristiansen2462
@flemmingchristiansen2462 Жыл бұрын
Part 2 soon please.
@RalphBacon
@RalphBacon Жыл бұрын
Yup, on the list!
@gfodale
@gfodale Жыл бұрын
Thank you for this. I'll give it a try when I'm thinking a bit clearer. (I stepped in a hole, in the dark, and broke my face almost 2 weeks ago. Pain pills are working, but not real conducive to thinking.) I want to set up garage door opening, and had done it before, but there was no security code and it was opening and closing on it's own. (I think someone left their phone on the page when they were done. Hence the security code to arm next attempt.) This format will be a great help as I've never done OTA.
@RalphBacon
@RalphBacon Жыл бұрын
Sorry to hear about your drunken 😲accident (what do you mean, you were stone-cold sober?) and I wish you a speedy and pain-free recovery. You'll find OTA is a bit of a non-event when you do it this way; it "just works". You can also detect when an OTA is underway to you can stop processing stuff in the main loop (your ESP32 continues to run whilst the OTA happens, albeit more slowly). I'll explain more in Part 17 of this video!
@gfodale
@gfodale Жыл бұрын
@@RalphBacon Thanks!
@johnpipe362
@johnpipe362 Жыл бұрын
Using the library ESPmDNS.h , you can access the ESP32 using a logical name: like "office" in the address rather than a bunch of numbers. It is so much easier and only requires a few extra lines of code.
@RalphBacon
@RalphBacon Жыл бұрын
I must admit to editing my Windows 'hosts' file so I can access my ESP32 devices from my PC, but I've not used the ESPmDNS library (yet). I will take a look. Presumably, you must create a separate (additional) DNS resolver for your local network using this?
@bobowen7861
@bobowen7861 Жыл бұрын
Excellent Video as usual Ralph. Will this also work using IDE 1.8.... or does it only work with the new 2.0 IDE? Many thanks for keeping us up on new topics and our brains engaged.
@Cptnbond
@Cptnbond Жыл бұрын
It works the same for IDE 1.8.x
@bobowen7861
@bobowen7861 Жыл бұрын
@@Cptnbond Many thanks. That info helps. Will give it a test.
@RalphBacon
@RalphBacon Жыл бұрын
@Bob Owen Yes, as Sgt-Bond has indicated, it will work with all versions of the Arduino IDE, but I do recommend you download the new version 2.0.x and take advantage of its new features, not least of which includes code completion. 😉
@bobowen7861
@bobowen7861 Жыл бұрын
@@RalphBacon Trying out the new Arduino IDE 2.0.X version is on my list of things to do. It's only that I hate change and tend to stick with that which has worked before. Thankfully, there are content providers like yourself who make things easier by providing great resource materials. Thank you.
@aclam9839
@aclam9839 Жыл бұрын
Excellent
@RalphBacon
@RalphBacon Жыл бұрын
Thank you, glad you liked it!
@lindsaymcphee2885
@lindsaymcphee2885 Жыл бұрын
I've customised a similar library so that I upload the new bin file to a *private* gitHub repository and the esp32 checks there for an update during each boot (without forced update, but that is also possible) to display "new version" on landing page, with link to /update page. Needs a sketch based version tracking variable and an extra version tracking text file uploaded, so that the esp32 can detect if newer firmware than currently loaded is available and also prevents malicious update from unknown source that someone commented on. Took me ages to find a good library to use as a starting point. ElegantOTA was certainly an excellent choice though and one I looked at for a good long time. Not in front of code at the moment and can't remember the library I settled on as a starting point for customisation. My HTML pages can show real-time digitalRead updates for diagnostics/installation and facilitate downloading/deleting files (with directory browsing) from onboard SDCard, or initiate SQL INSERT INTO a remote server on the Interwebs. The project has many different libraries, so cutting it down for an OTA Update example would take some serious effort: SD card, RTC, Preferences, Wi-Fi AP/client, MORSE Code LED error flasher, MCP23017 port expander, SQL Client, NTP clock sync, I2C EEPROM, with version 2 thoughts for GPS/GPX, 9dof sensor, temp, altitude, CAN bus OBDII interface etc
@lindsaymcphee2885
@lindsaymcphee2885 Жыл бұрын
And ASync web server and OTAUpdate of course
@RalphBacon
@RalphBacon Жыл бұрын
Sounds like you have a fully fledged auto-update system there, Lindsay. Did you publish on GitHub?
@lindsaymcphee2885
@lindsaymcphee2885 Жыл бұрын
No, not published anywhere public. It's a small part of an ongoing project. My intent was to make firmware updates super easy for non-technical people.. read computer illiterate.. "how do I save an attachment from an email to my hard drive?" and I wanted the ability to send software updates to many users with the least amount of my time and effort - rather than maintaining a user mailing list/database. I work as Tech Support for an importer/distributor in the Point Of Sale industry in Australia and I've seen some major international receipt printer/barcode scanner manufacturers write clunky flash update/Wi-Fi config utility software locked to one OS, requiring cable connections and I wanted to avoid all the pain points I've seen others foist onto their customers. Upon figuring out how I could do this, I may have made statements to the effect that I've created the easiest IoT device to connect to. Everything in my project is web based, OS agnostic, so end users can do everything from a browser - starting with out of the box config: 3x Wi-Fi client settings: home, work and away (through esp32's AP feature) and Social website account creation. All the user needs to know is that the device will broadcast an SSID (product name_serial number) and will respond on a static IP address with a default password that can be immediately changed. The initial brief was a multi digit 7 segment display with buttons to cycle through the data.. And maybe IOS and Android apps via Bluetooth etc. The gitHub repo I've cloned/forked is by romehein called ESPecial and ESPInstaller. I found his logic intriguing, freeing and limiting all at the same time, due to the scope of my project potentially having 3 distinct end user groups and product names with the same underlying hardware. Sorry, for being intentionally vague. I've added extra fields to his JSON structure to allow me, at the first run time, to load one of the 3 product software branches and thereafter it is locked into that branch. I've completely restructured his project into a library with external (??) reference for AsynchWebServer object and Wi-Fi credentials that can be passed in during instantiation or starting... Been a while since I looked at that code. So that the OTA library uses the same instance that the rest of the sketch uses - avoiding dueling web servers on the same ip:port I'm pretty new to gitHub Desktop and how to publish forks etc.. even after a bunch of reading. I'll have to think about how to publish one aspect of the project without giving away details I hope to make money on... one day... ;) demo repo, demo paths, demo apps with the common OTAUpdate library etc. Additionally, I don't know if my code is up to the standard that others will appreciate. Having seen other repos, some people aren't so concerned with this. 🤐 I need to learn more about the R string function you used... I've used HTML, CSS, JavaScript and sketch variables all encapsulated in C (C++??) strings and passed onto browser.. it's uuuugly, but it works. I'm a VB6 programmer at heart, so C strings take me some time. 👀
@lindsaymcphee2885
@lindsaymcphee2885 Жыл бұрын
The landing page (as AP) will display the ip address it has been given as a Wi-Fi client and can also use MDNS for Mac, iOS, (Linux??) and windows clients with bonjour loaded.. sadly not available on Android from my reading.
@danny12345
@danny12345 Жыл бұрын
Thank you for this lesson
@RalphBacon
@RalphBacon Жыл бұрын
You're welcome, Danny 👍
@LesCollier
@LesCollier Жыл бұрын
Thank for the video, just need to know how to put buttons onto the web screen and indicators and I will be in business
@RalphBacon
@RalphBacon Жыл бұрын
That will be Part 3, due soon. "Soon", as in Arduino soon, Real World about 1 month, maybe less. 😮
@byronwatkins2565
@byronwatkins2565 Жыл бұрын
Incidentally, the page heading's title will go on your browser's tab so you can return to it if you go to another tab momentarily.
@RalphBacon
@RalphBacon Жыл бұрын
Indeed it does, Byron, and I will show this in more detail in Part 2.
@sargetester99
@sargetester99 Жыл бұрын
Part 2 yes!
@RalphBacon
@RalphBacon Жыл бұрын
Noted! 👍
@danman32
@danman32 Жыл бұрын
I agree, as we haven't learned displaying variables and receiving data in web pages, nor multiple pages and embedded links allowing one to easily go from one page to another. Plenty of tutorials out there on single column pages but not so much making neat columns, especially when I/O is involved
@TheEmbeddedHobbyist
@TheEmbeddedHobbyist Жыл бұрын
I like to use the esp32 idf, sa it gives the old grey cells a work out.
@RalphBacon
@RalphBacon Жыл бұрын
By all means. It's more powerful (it exposes more of the bare ESP32 metal) and in a production environment I guess it would be mandatory. But for us hobbyists, I think I'll stick with the (easier to use) Arduino framework.
@fredflintstone1
@fredflintstone1 Жыл бұрын
@@RalphBacon it's just TEH showing off again🙂
@allinclusive5762
@allinclusive5762 Жыл бұрын
I do the OTA differently: 1. it is automatically looked at the reboot whether there is an update. The new version number is in a .PHP file on the server. If the version is different, the update is installed and then the .bin file is deleted. This reduces the probability of getting another file foisted.
@RalphBacon
@RalphBacon Жыл бұрын
So the microcontroller is actively accessing a server to check for a software update? Is this a standard library function you use to do this, or is it homegrown?
@allinclusive5762
@allinclusive5762 Жыл бұрын
@@RalphBacon homegrown: it's PHP. The Version is"g".
@JCWren
@JCWren Жыл бұрын
@@allinclusive5762 I think he's referring to the ESP32 side of the project.
@allinclusive5762
@allinclusive5762 Жыл бұрын
@@JCWren no - this is universal ( i mostly use the D1mini )
@JCWren
@JCWren Жыл бұрын
@@allinclusive5762 OK. He's asking (I think) how you're doing this on the D1Mini side. What library or homegrown C/C++ code are you using to check the server for the image, download if present, and then install it for the upgrade. And if that's not what Ralph is asking, well, then I am :)
@NelsonSantander
@NelsonSantander Жыл бұрын
Excellent !
@RalphBacon
@RalphBacon Жыл бұрын
Thank you! Cheers!
@elvisochieng3454
@elvisochieng3454 Жыл бұрын
Great video but can I use these libraries to update an Arduino uno with an Ethernet shield
@RalphBacon
@RalphBacon Жыл бұрын
I believe you can use the libraries with an Arduino, after all we're not fiddling about with registry values here. You'll have to read the GitHub pages for each of the library and if it states it supports a Wi-Fi enabled UNO then you know it will work.
@bronzedbrews
@bronzedbrews Жыл бұрын
Where did you get that IPEX antenna? Do you have a view about the pcb antennas that are available? Cheers
@RalphBacon
@RalphBacon Жыл бұрын
I had a lot of various IPEX antennas included with various devices but you can buy them on AliExpress for a very low price. I have "proper", case mounted and adjustable antennas, stick on ones that you can hide inside or outside of an enclosure, simple springs (mainly for the HC-12 devices I showed recently) and these ones which are probably the worst as they don't stay in place! PCB antennas (such as the ones normally included with ESP32 devices) work well enough for home use. Switching to a case-mounted, orientable device (not easy as you have to un/solder a 0Ω resistor the size of a speck of dust on an ESP32 device) is like chalk and cheese, range-wise. I use these to communicate from sensors in my attic to my workshop (about 10 metres away) and it's faultless.
@munna6022
@munna6022 11 ай бұрын
Thanks for the video. My router has DHCP , after the lease time the static IP is no more useful. Need some guidance , How to overcome this ?
@RalphBacon
@RalphBacon 11 ай бұрын
Using static IP addresses is great but your router needs to be told not to issue addresses beyond a certain range (where you have your static IP range). So in the DHCP section of your router, you might say the range for IP addresses is 192.168.1.2 to 192.168.1.100 and that's it. You can then assign static address from 192.168.1.101 to 192.168.1.254 (careful! your router might be in that range) and the DHCP will not affect it. Alternatively (and I do not do this as I want better control) you can have the lease time set to "infinite" and check the box that says "always give the same IP address to this MAC address". But you are then depending more on the router.
@ferencszabo3504
@ferencszabo3504 Жыл бұрын
The same project with Freertos would be fun too !
@RalphBacon
@RalphBacon Жыл бұрын
Well, the ESP32 runs FreeRTOS natively, so I'm not sure how different you expect it to be!
@tubeDude48
@tubeDude48 Жыл бұрын
What's ElegantOTA? Thanks Ralph!
@RalphBacon
@RalphBacon Жыл бұрын
No idea, got me beat there! 😆
@TheUnofficialMaker
@TheUnofficialMaker Жыл бұрын
rewatch the video!
@jyvben1520
@jyvben1520 Жыл бұрын
If you have another webserver (python webserver) you could redirect the query from the esp to the external webserver, adding the ip for that esp to the query, would allow you to have (big) images and let you update the webpage(s) layout without updating the esp, the extra webserver would need to add the esp ip to html output (base keyword) sent to the browser. When using several identical esp setups (like temp monitoring) these all could use the same page(s), 1 change to html would update all. Also like in test.html you can have links to all known installed devices, store this on your browser device (mail it as attachment)
@RalphBacon
@RalphBacon Жыл бұрын
Yes, sounds very do-able but unfortunately not for noobs who struggle with the construct of a simple HTML anchor link!
@danman32
@danman32 Жыл бұрын
Not to mention the IoT couldn't be mobile or would cease to work at all if the web server were down.
@jyvben1520
@jyvben1520 Жыл бұрын
@@danman32raspberry pi is mobile, cease to work like no power to the esp, should only be used for non critical systems, nice to have, also esp could still react to other simple queries with plain text answers. query like ip/text
@deslomeslager
@deslomeslager Жыл бұрын
High Ralph. I noticed the bin file was a lot smaller with the Arduino compiler. Is that always or mostly the case?
@RalphBacon
@RalphBacon Жыл бұрын
I didn't notice that at all! I will have to check. Same compiler, same framework... how intriguing!
@danman32
@danman32 Жыл бұрын
It could be platformIO natively adds support libraries that Arduino 2.0 does not.
@mainer8912
@mainer8912 Жыл бұрын
Had a terrible time getting the esp32 to connect. Kept getting 4 way handshake errors. Then found Ralph on a github forum with similar but different problem. Solved, but you did not tell us that tx power could be set higher!!!! :)
@RalphBacon
@RalphBacon Жыл бұрын
If the TX power was the issue with you then that's fine, you've solved it. But if you have a Revision 0 of the ESP32 (shown on boot up) then throw it away because it will never play nicely. (kzbin.info/www/bejne/bHOuZZmwh8Z5fbs )
@mainer8912
@mainer8912 Жыл бұрын
@@RalphBacon Yes I remember that video. Fortunately I have rev 1 and it is connecting and running very stable. I remember reading how wonky those early esp32 boards were and that is why I avoided them until now. Looking forward to part two of this video.
@imstubby6844
@imstubby6844 Жыл бұрын
Thanks Ralph I understand a load more now, i do know or can build a website just with HTML didn't understand how to link it together. Never mind another vid how about a whole series!
@RalphBacon
@RalphBacon Жыл бұрын
Yes, another video showing something useful (erm, like turning an LED on and off?) is on the cards.
@danman32
@danman32 Жыл бұрын
I'd like to see something a bit more complex than LED on/off. Plenty out there for on/off. Perhaps temp monitoring and adjustable thresholds.
@TheUnofficialMaker
@TheUnofficialMaker Жыл бұрын
@@danman32 check out random nerd!
@paulstubbs7678
@paulstubbs7678 Жыл бұрын
Now how to do the same with a Raspberry pi pico W, please
@RalphBacon
@RalphBacon Жыл бұрын
Hmm, the RasPi is not really a microcontroller, it's more or a SoC or probably a SoM. It has Wi-Fi capabilities right out of the box so coding an example web page using Python, and using the RasPi as a Web Server is probably a no-brainer. Probably.
@fredflintstone1
@fredflintstone1 Жыл бұрын
well a very nice video, do you have any asprin for my head🙂
@TheEmbeddedHobbyist
@TheEmbeddedHobbyist Жыл бұрын
What too much barking at the screen Fred. :-)
@fredflintstone1
@fredflintstone1 Жыл бұрын
@@TheEmbeddedHobbyist No just up the wrong tree🙂
@TheEmbeddedHobbyist
@TheEmbeddedHobbyist Жыл бұрын
@@fredflintstone1 lol
@RalphBacon
@RalphBacon Жыл бұрын
If you were to download the example(s) onto an ESP32 (which I know you have, Barney) it might make more sense to you! Go on, try it out!
@fredflintstone1
@fredflintstone1 Жыл бұрын
@@RalphBacon I will try🙂 I see you say there will be a part 2 I best order some more Asprin🙂
@AndroidJeek
@AndroidJeek 9 ай бұрын
What if the new code I uploaded using the OTA, doesn't have the codes for OTA itself? Will it break the OTA function?
@RalphBacon
@RalphBacon 9 ай бұрын
Yes it will. Your new code must be able to accept future OTA updates. You should test out a new version of code on a test device before uploading it to your live device!
@ismzaxxon
@ismzaxxon Жыл бұрын
Awesome.. Thank you.
@RalphBacon
@RalphBacon Жыл бұрын
You're welcome!
@theovannieuwenhuizen5756
@theovannieuwenhuizen5756 Жыл бұрын
Hi Ralph, love your content! I do have one concern with PCB Way. Why is it they are able to have these absurd low prices? Can't get my head around that. To me there is no logic in having a commercial business and not make money. Can anyone help me understand?
@RalphBacon
@RalphBacon Жыл бұрын
Don't think for a minute that PCBWay is not running a profitable, commercial business! When you order a PCB, it gets put on a large sheet with dozens of others. So, potentially, lots of $5 orders. Factor in the low cost of labour in the Far East (and probably the standard FR-4 substrate material too, but I'm guessing) and they will still not make anything approaching a loss. Whilst we hobbyists just order (up to) 10 pieces with a maximum size of 100mm x 100mm, there are probably many businesses ordering much larger and more complex designs - remember they do some mind-blowing advanced PCBs too, albeit at a cost. A business could easily order 5,000 boards (my electronics engineer consultant tells me). Many other PCB manufacturers would not even consider such a "small" run 😲 I do not know how they calculate their shipping, but there they offer some (much) lower cost routes (especially to the UK) so I can't believe they subsidise it from that side of things. What I do know is that in my experience with them, their products are without a doubt second-to-none, from the base PCB all the way through the solder masks and silk screen printing (I once looked at one under the microscope in a video, amazing quality). If this were not the case I would not feature them as sponsors on my videos!
@ami6packs
@ami6packs Жыл бұрын
I've written a separate library for doing automatic updates by running a local web server. And the MCU just checks for a new version just once in a day or so.
@RalphBacon
@RalphBacon Жыл бұрын
The 'problem' with your solution is this: _"I've written a separate library for doing automatic updates by running a local web server."_ Most newbies to web-enabling would not have your skills in doing this although I'm trying to think of an easy way of implementing this for such noobs.
@ami6packs
@ami6packs Жыл бұрын
@@RalphBacon If you are interested in showing it, i could make my source code open source and you could just showcase it. :)
@stub1116
@stub1116 Жыл бұрын
Brilliant!
@RalphBacon
@RalphBacon Жыл бұрын
Glad you liked it, Stu! Part 2 and Part 3 out "shortly".
@MisterkeTube
@MisterkeTube Жыл бұрын
The problem with this approach of OTA is that it is unusable for devices that spend most of their time in deep-sleep. I use a different approach where each ESP when woken and having done its measurement and then sending that over the network, then also checks a server URL to see whether the firmware there has a different checksum than it is running at this time (a very simple compare of 2 numbers) and if so it downloads the new firmware and reboots into it. This way the device can still be in deep sleep most of the time (and run on battery) and if I need to push a new firmware, I just put it on the server and on the next wake-up the device will upgrade to it ...
@RalphBacon
@RalphBacon Жыл бұрын
Yes, this is fine if you need the ESP32 to sleep lots. Personally, I don't like the approach because it can update itself (and hang, not work) at literally any hour of the day. I like to watch and see what happens! Perhaps I should have more confidence in my code! 😁 But, as I say, if the ESP32 needs to sleep then that's a good option you describe.
@lilbuzz999
@lilbuzz999 Жыл бұрын
Might be time for an update to this project as AsyncElegantOTA is no longer supported, and is replaced by ElegantOTA. ElegantOTA needs a small change to the .H file to enable async operation, and a call to it's loop member in the sketch's loop method.
@RalphBacon
@RalphBacon Жыл бұрын
Indeed, and I am using the newer version in my latest project; it was just a matter of replacing one library with another (and that loop( ) call). That said, all my old project will continue to use AsyncElegantOTA as they should work going forward (and if they do ever stop working on a recompile I'll replace the library).
@lilbuzz999
@lilbuzz999 Жыл бұрын
@@RalphBacon Before I suggested that this code be updated, I should have said thank you for this very helpful video, since I used this concept in a few of my projects after seeing it.
@pramagetable
@pramagetable Жыл бұрын
smart programming method :)
@RalphBacon
@RalphBacon Жыл бұрын
Works for me!
@iam_sandeepsaini
@iam_sandeepsaini Жыл бұрын
But if my firmware is kind a mess, it is divided into four parts and needs different hex code like 0x8000, 0x10000, ex000 something like that. What should do now
@RalphBacon
@RalphBacon Жыл бұрын
Not sure what you mean by "four parts". Do you not compile a sketch with the standard entry point of 0x8000? How do the other bits get uploaded (without OTA)?
@juanperezgarcia9963
@juanperezgarcia9963 Жыл бұрын
Could you update the code OTA using ESP32? I am thinking of changing the code to fix some bugs or implement new functionalities but my device is located in a factory far away from my home and I would love to upload a new sketch OTA using arduino IOT Cloud or these libraries.
@RalphBacon
@RalphBacon Жыл бұрын
You're talking about a "pull" update, where the device checks for an update and pulls it down (just like your PC/Mac does). You could use an ESP32 for that by creating a simple web server with some memory for the flash image. I will have to explore this one day.
@Kevin-sx6we
@Kevin-sx6we 11 ай бұрын
If esp32 is changed to AP mode, will it be simpler? But generally OTA does not seem to have this setting?
@RalphBacon
@RalphBacon 11 ай бұрын
Well, OTA could connect to the device in AP mode (or, perhaps, your app in running in that mode on the device). However, I don't see how it would be simpler; it just works when running as a standard wi-fi client (STA)!
@MarkMatts
@MarkMatts Жыл бұрын
I have tried to implement this using a wired network instead of WiFi using an ESP32 & ENC28J60 ethernet board but cannot get it working at all. I tried to replace the WiFi element with the EthernetENC library but couldn't get it to work at all, too many conflicts which I didn't understand. I currently use the EthernetENC library in some of my other script and they work fine for my needs, however, I would much rather use the ESPAsyncWebServer and AsyncElegantOTA libraries. Do you know whether this is at all possible Ralph?
@RalphBacon
@RalphBacon Жыл бұрын
If you are using an ESP32 why not get it all working _first_ using Wi-Fi and then make a copy of the sketch and use the EthernetENC module; that way you might find where the issues or conflicts lie? I have only used that module using an Arduino (video #74, kzbin.info/www/bejne/fGPQd5-Di9-LZq8 ) but in theory it should work with an ESP32 (or there is another library for that hardware platform).
@MarkMatts
@MarkMatts Жыл бұрын
@@RalphBacon Thank you so much for the reply and advice Ralph. I have tried many varied combinations trying to get this to work and I cannot fathom it out so I've gone back to just using EthernetENC and given up on trying to get the AsyncElegantOTA. It was only me being lazy so I can update the ESP32 without having to plug it in to a PC.
@pintokitkat
@pintokitkat Жыл бұрын
Nice pjs
@RalphBacon
@RalphBacon Жыл бұрын
My dress sense has never let me dow----- hang on, PJs? 😲😢😁
@mainer8912
@mainer8912 Жыл бұрын
Can the esp32 serve up a web page from an sd card on a sd shield? Currently using a mega with ethernet shield for extensive web page, too much to put in the body of the code.
@RalphBacon
@RalphBacon Жыл бұрын
Yes. Absolutely. And I will be showing you a way of doing this in Part 2 and Part 3, so keep tuned and keep practicing with Part 1 for now!
@darktherapy
@darktherapy Жыл бұрын
Have you messed with IOTAppstory?
@RalphBacon
@RalphBacon Жыл бұрын
I haven't, and with good reason! It looks pretty complex for my modest needs. A bit like using a full blown NodeRed system to control a few peripherals in my workshop. I'm not doing that either! Well, not this year, anyway.
@fenceup07944931177
@fenceup07944931177 Жыл бұрын
Sorry if you have covered this before. This is a local connection, why does it seem that you have to use some form of 3rd party cloud services to do the same thing over the web. Is it to do with security?
@RalphBacon
@RalphBacon Жыл бұрын
Not sure to what you are referring. Can you clarify please?
@fenceup07944931177
@fenceup07944931177 Жыл бұрын
@@RalphBacon if I have it correct. In this example, you have to be on the same network as the ESP32 to connect to it from your browser. It seems to do the same thing from another network, using the world wide Web. You have to use a 3rd party like Arduino cloud.
@noweare1
@noweare1 Жыл бұрын
@@fenceup07944931177 To connect to the esp32 you would need the external address of your network and setup port forwarding so that you router wil let in external traffic. This is pretty insecure though unless there is some security turned on in the esp32, some kind of authentication. I am reading using a vpn provides safety for accessing the esp32 from outside your network. A vpn will make your outside computer look like its on the internal network. I have not read up too much on this though.
@ccmine8fun374
@ccmine8fun374 4 ай бұрын
I'm trying to upload the github platformio code onto my ESP-32S, and I'm getting errors from the AsyncTCP library. Anyone else having this problem?
@RalphBacon
@RalphBacon 2 ай бұрын
There are several versions of that library; see if you can find others (eg webhome versions) that work better.
@fenceup07944931177
@fenceup07944931177 Жыл бұрын
If I want to connect to the ESP32 from an other computer that isn't on the same network. How could I do that. I see many examples of this, but all use a third party cloud service like "Blink or Arduino Cloud". Sorry If this is a repeat, I'm not sure you get a notification of a reply to a reply.
@RalphBacon
@RalphBacon Жыл бұрын
To communicate with any device on a network, you have to be on that network. The way 3rd parties do it is to connect the ESP32 to the cloud network and then you send stuff up to the cloud network from your home Wi-Fi, thus using them as a middle-man. The alternative is use a cheap, low power device (like an ESP-01) that just does the same as I described. It connects to "the other" network, receives data and sends it to the local ESP32 via a serial connection. Sounds clunky but no more so than using a 3rd party network.
@fenceup07944931177
@fenceup07944931177 Жыл бұрын
@@RalphBacon I'm sorry I know I must be missing something, but if the ESP is acting as a server, why can't it serve the information regardless of what network I'm on. Isn't it just a matter of connecting to it's external IP address? I'm sure that it would involve opening ports, and thing that I only have limited knowledge about. Sorry to go on but I just can't get my head around it.
@RalphBacon
@RalphBacon Жыл бұрын
The ESP32 can indeed run as a server, but you then are connecting to it via your own home router (as you say) from elsewhere. Yes, you can "just" set up port forwarding to route all external requests for, say, port 80 to a single ESP32 device on your home Wi-Fi. Some ports won't be (easily) allowed by your browser but ports 81, 82 are OK (I've tested those). Port 103 was disallowed by Chrome. You can force it on a PC/Mac but on my phone it's just an app and verboten! Once you open that port, of course, you are increasing the risk that a knowledgeable person will hack your entire home network. I don't know how likely that is but I'd want to know before doing it. Incidentally, my CCTV allows this but I can't find an entry in my port forwarding page so it's a mystery!
@IstadR
@IstadR Жыл бұрын
Next part would be to move HTML over to LittleFS. So much easier to work with, and more powerful, then incode HTML. And authentication for OTA.
@RalphBacon
@RalphBacon Жыл бұрын
But adding in variables is not such a trivial task, wherever the HTML is sited. But certainly, having the pages in a file would be a good idea.
@danman32
@danman32 Жыл бұрын
I hadn't thought of that. Plus it appears the OTA allows you to update files in the ESP storage so you could in theory update the HTML without updating the whole code.
@joramotorsportteam3277
@joramotorsportteam3277 Жыл бұрын
We need an OTA + WiFi selector for connecting for the first time to WiFi
@RalphBacon
@RalphBacon Жыл бұрын
Catch-22 perhaps? You can't upload to a device with OTA without knowing its IP address. Obvs. But assuming you have uploaded at least once to a device, you can write a sketch to scan for all networks it can find (and the signal level) and then ask for a password from you, whilst it operates (temporarily) in AP mode with a known IP address (so you can talk to it on its private network). There are many examples out there.
@espesp32
@espesp32 9 ай бұрын
hi cant you do this using espressif IDE?
@RalphBacon
@RalphBacon 9 ай бұрын
Well, if you want to use the ESP-IDF from Espressif, be my guest (and may the force be with you). Be aware that the Espressif IDF does not have any Arduino-like syntactic sugar; everything must be coded by you or use their implementations. But of course it can be done.
@WndSks
@WndSks Жыл бұрын
mDNS is a bit more polished than forcing a static ip.
@RalphBacon
@RalphBacon Жыл бұрын
Yes, it is but I do feel this is "good enough" for beginners to get to grips with things on the ESP32. Perhaps I'll introduce that topic separately.
@yogeshitaliya473
@yogeshitaliya473 Жыл бұрын
😍😍😍😍🙏
@RalphBacon
@RalphBacon Жыл бұрын
Quick off the mark, today, Yogesh!
@lezbriddon
@lezbriddon Жыл бұрын
I dream of a day when i can just drop the bin file into a public google drive folder and my esp8266's camoflaged all around the world for total domination and a ransom of 1 million dollars can just see that new file and update my latest scheme.....
@RalphBacon
@RalphBacon Жыл бұрын
Wake up, Lez, 💤WAKE UP, you were 💤dreaming again! 😁
@lezbriddon
@lezbriddon Жыл бұрын
@@RalphBacon seen it done with GitHub but I like Google drive folders. I do wonder what changes it would really need to the GitHub sketch. If I get some time I'm going to hit my head against that wall but I'm busy building ebike things
@hotswapster
@hotswapster Жыл бұрын
I see static IP addresses used in multiple tutorials. I think it's worth while people learn how to use a dynamically assigned static IP in thier router, then use DHCP on their device. Then they can use the name they give it instead of messing with IP addresses. This is helpful for when you connect a deceive in future and you can't remember what address you gave it. Typing a shortname.local is also much easier and typing 192.168.xx.xxx.
@RalphBacon
@RalphBacon Жыл бұрын
Well, yes, a name is preferable to an IP address although it's been my experience that it's always good practice to know the IP address of key devices in your network. But maybe this could be a Part 3 of this video? 😉I'm sure viewers would find it useful.
@hotswapster
@hotswapster Жыл бұрын
@@RalphBacon agreed knowing the ip address of key devices, but if you run the DHCP reservation tables, you'll know those addresses and then have a live, one-stop-shop to view these.
@WaldekDudzinski
@WaldekDudzinski Жыл бұрын
Arduino boards ESP8266
@RalphBacon
@RalphBacon Жыл бұрын
Um... this works fine with an ESP8266 but not an Arduino Uno/Nano because an Arduino hasn't got Wi-Fi. Is that what you meant?
@jasonlee3247
@jasonlee3247 Жыл бұрын
It's not a chevron lol They're called angled brackets :)
@RalphBacon
@RalphBacon Жыл бұрын
I've always called them chevrons although angle brackets work too. At work we called them chevrons too, must be a British thing, as we have road signs warning of sharp deviations with chevrons, see here: bit.ly/UKchevrons
@hariseldon2577
@hariseldon2577 Жыл бұрын
Gawd...just came back to revisit because my system wasn't working. Note to self ------Turn off your browsers VPN if you want to visit your local network!!!!!! 🤣🤣🤣
@RalphBacon
@RalphBacon Жыл бұрын
Who knew that a VPN doesn't allow a connection to a local network?
@hariseldon2577
@hariseldon2577 Жыл бұрын
@@RalphBacon😴
@jstro-hobbytech
@jstro-hobbytech Жыл бұрын
@@RalphBacon i took a weekend recently to learn css and js and it's worth it because then you know how to make it easier as you have an idea how to add buttons using the built in objects added to the css file. the only thing that annoyed me was that you have to order the css file or something out of order will undo something you spent a ton of time to plan earlier. makes your code better though being aware of those things.
@browaruspierogus2182
@browaruspierogus2182 Жыл бұрын
it would be more helpful to do that with IDF sdk not stupid unstable Arduino
@Cptnbond
@Cptnbond Жыл бұрын
Arduino IDE 1 8.x is rock solid if you want stabilty. Personally I prefer this over the 2.x series.
@RalphBacon
@RalphBacon Жыл бұрын
Not really a helpful comment. Arduino is not unstable in my experience as the framework has been ported from IDF by Espressif so they know what they are doing, so I guess they are not stupid, either. In fact, there are some features in the Arduino ESP32 framework that are not present in IDF because Arduino users expect them!
@browaruspierogus2182
@browaruspierogus2182 Жыл бұрын
@@RalphBacon thisr party libraries have mostly some questionable untested code to pull for public for later to find out about bugs and crashes. I'm not sure if you even realize of what you said from programming perspective because IDF is SDK not a framework with spaghetti greasy code
@renxula
@renxula Жыл бұрын
I thought we were already past hardcoding WiFi credentials and IP addresses in the firmware, thanks to WiFiManager 😆 (And to get a static IP address, you should configure your *router* to do it based on MAC address.) Anyway, I came to check out the OTA stuff specifically. Did not expect to be lectured on the basics of HTML and CSS and C++ string literals and how to get the ESP32 to connect to WiFi 🙄
@RalphBacon
@RalphBacon Жыл бұрын
Lectured? Really? 🤷‍♂️ You know this channel is for beginners and inexperienced coders, right? Who probably won't have your obvious level of expertise so they do get the basics included, I'm afraid. And doesn't include talk of setting a router to (hopefully) always give the same IP address; this is not about networking, it's about ESP32 stuff. As for the hardcoding of credentials, I don't know how often I have to say (or write) this, but this is a DEMO! 🤦‍♂️
@renxula
@renxula Жыл бұрын
@@RalphBacon A lecture is an educational talk given to an audience, so yes, really. I mean the OTA updating is super useful for ESP32 development in general but it has remained quite out of sight in KZbin maker videos. Has nothing to do with crafting basic web pages though 😆
@icarossavvides2641
@icarossavvides2641 5 ай бұрын
If you select the three dots next to the 'save' lozenge' you can disable the option that forces you to watch.😛
@TheFikotech
@TheFikotech Жыл бұрын
The only problem I see is that you talk too much. Why do you assume that your viewers are all beginners? I might be wrong, but people subscribing to your channel do it for a reason and the reason might be as simple that they know most of what you are saying without feeding them with teaspoons all the time. I stopped watching your videos for the simple reason that you made it too boring to listen to, even though the topics are quite OK.
@RalphBacon
@RalphBacon Жыл бұрын
Well, I'm sorry you stopped watching but my videos have to assume no prior knowledge to allow the content to make sense to beginners. What I suggest is that you can watch at 1.25x speed (or even 1.5x 😮) to get to the bits you want to watch. I do this all the time with other KZbin videos (not Arduino-related, so I am that beginner).
@TheFikotech
@TheFikotech Жыл бұрын
@@RalphBacon As I said, why do you talk to much to explain for beginners? Just point them into right direction and go on with what you are doing. I'm sure you never made any survey about the level of your followers. I guess most of them knows and understands what you are talking about. All I'm saying is skip the boring talk and get to the point without wasting time.
@RalphBacon
@RalphBacon Жыл бұрын
Thanks for the feedback and suggestion 😉
@icarossavvides2641
@icarossavvides2641 5 ай бұрын
@@TheFikotech People who subscribe to this channel are BEGINNERS. Work it out. If you can do better, go ahead. I do hope your coding is better than your English...
@saffazone
@saffazone Жыл бұрын
Great Video had to make a small change to get it to compile with platformio - platform = espressif32@3.5.0 - seems there is a conflict with the latest platform release
@RalphBacon
@RalphBacon Жыл бұрын
There is an issue, correct and I'm very disappointed that me-no-dev has not addressed this after several months. But you can use the latest platform if you comment out the line in the platformio.ini line and enable the line to download that ESPAsyncWebServer library from the GitHub (see my example in my GitHub, it will be obvious).
@lumsdot
@lumsdot Жыл бұрын
I installed Moode Audio onto my Pi, which creates a wifi hotspot so you can connect to pi with your phone by connecting to hotspot, then you see the Moode web page and can configure its settings to connect to your network and reboot. On reboot you can connect to pi via a tablet (which is on your network) by going to Moode and you can connect to pi. I.e. no IP address is needed, no idea how it does it, but thought it was neat
@RalphBacon
@RalphBacon Жыл бұрын
Yes, sounds neat and I bet it acts as a DNS server that ties in to your network. I'll take a quick look!
@victoriavickers33
@victoriavickers33 Жыл бұрын
I am having issues with the libraries I am using Arduino IDE 1.8.18. I have previously tried this with Esp8266 but got nowhere so ordered 6 new esp32 mini but they were the purple ones and I spent too long failing to get the drivers installed so now have received 6 x esp32 mini V1.0.0 which are seen and have got the "simplewifisever" sketch working so now comes to this lesson. After zipping code 1st error was multi versions of WiFi library so deleted the one in main documents/ libraries. But still stuck on "ESP32_OTA_AsyncWeb_Framework:5:10: fatal error: ESPAsyncWebServer.h: No such file or directory #include " the only library that the manager found and installed was ESPAsyncWebSrv.h tried to just alter spelling in code to call this one but nothing works. I am not uptdate with my lessons as I have to keep waiting for Aliexpress to deliver to NZ
@RalphBacon
@RalphBacon Жыл бұрын
It sounds like your environment for the ESP32 is a bit mangled; I strongly suggest you archive it somewhere off your beaten (Windows) path and start again. BTW this will not work with the ESP8266 (I think you discovered that). Once you have the new environment, don't just install libraries willy-nilly that are not intended for your device; think about which ones are required (my demo sketch shows this clearly) and you are _guaranteed_ a successful build. Yup, guaranteed, but only if you use my demo sketch as the starting point - then you can expand on that for your own projects.
@1over137
@1over137 Жыл бұрын
I just did an OWASP cyber security and hacking course in work. Watching this makes me twitch. All the wonderful things you could do to the unsuspecting ESP32 if you discovered this page "out in the wild" on a public IP. Hmm. I can see an army of bots, just like Lez. Compromised IoT devices in the millions. I think ChatGPT will beat us all to that.
@1over137
@1over137 Жыл бұрын
Assuming a certain about of "sense", you won't put it on a public IP. You also won't forward a port to it such that you can access it publicly. You might use a VPN (an actual VPN, not a Nord et al scam). Fine. Your ESP32 is behind a firewall, it's safe, right? Not if I manage to get malware on your PC to scan your network for a list of different OTA library signatures. Ideally download the firmware from the devices, inject the payload and reflash. More stealth that way. Otherwise you can just wipe the device with your own firmware. That firmware establishes an outbound web connection to "phone home" and say, "I'm in! What do you want me to do?" The firmware I would write for it would have a port scanner and port tunneling software, allowing me to bridge myself into your network and browse around to my hearts content. Maybe open a few more backdoors to keep my access if one gets discovered or blocked.
@RalphBacon
@RalphBacon Жыл бұрын
Well, yes, nothing is secure in this world. Just ask the British Post Office how they got hacked with Ransomware over the last month and prevented us all sending parcels abroad. Yes, really. But do you really think hackers are out to cause mischief, or to make (lots of) money? I don't think my public-facing ESP32 even features on their radar! (He said, fingers crossed). And no, this was NOT a challenge 😲
@fillempie1501
@fillempie1501 Жыл бұрын
@@1over137 If you manage to access the ESP with a private IP address you have bigger problems then concerning about a ESP firmware flash .....
@TanjoGalbi
@TanjoGalbi Жыл бұрын
I would not open the ESP32 to the web with that Elegant OTA on it, does not look like there is any security! Someone could upload malicious code to allow them access to the rest of the network or worse! Also, you failed to mention how the server is started. Just including the header file for Elegant OTA is not enough, you also need to start it before starting the server: AsyncElegantOTA.begin(&server); // Start ElegantOTA server.begin(); // Start the web server EDIT: After posting this comment I found out they do have very basic security for the update page if you start Elegant OTA like this: AsyncElegantOTA.begin(&server, "username", "password"); // Start ElegantOTA server.begin(); // Start the web server It's not an ideal solution but I guess it should work for simple DIY projects, not recommended for release products! All it would take is for someone to get hold of the product and search the firmware data for the username and password as it wont be encrypted!
@RalphBacon
@RalphBacon Жыл бұрын
If you notice, I didn't even mention exposing such a device to the outside world! Apart from requiring some router knowledge (IP forwarding) it would also require that additional level of security to stop your neighbour potentially accessing your devices. I'm pretty sure a serious hacker is not interested in my ESP32 Pond Heater Controller 😁😆😉
@danman32
@danman32 Жыл бұрын
@@RalphBacon maybe not the pond controller itself but as OP said, your ESP can then be used as a jump point to the rest of your network. It has already happened with commercial IoT devices. A smart light bulb or some other IoT was used to hack into the HVAC of a hotel in Vegas What's ironic was that not long before the hack, I attended a convention by a network security vendor in that hotel that used that example to make their point.
@ManfredAckermann
@ManfredAckermann Жыл бұрын
You can protect Elegant OTA with a user/password combination and additionally, as the `/update` path can be changed to e.g. `/t07pNueykXYi5XUA6tEAxIhXmP3owT7H`, is't quite secure... But securest would be to switch WiFi off. Your have to live with compromises. You can also pull the firmware from a trusted server on startup... Then you don't expose any interface. I do that for my deep-sleep on battery project.
#228 ESP32 Over the Air (OTA) Updates with ONE LINE are EASY!
23:26
Ralph S Bacon
Рет қаралды 29 М.
Мясо вегана? 🧐 @Whatthefshow
01:01
История одного вокалиста
Рет қаралды 3,6 МЛН
Tuna 🍣 ​⁠@patrickzeinali ​⁠@ChefRush
00:48
albert_cancook
Рет қаралды 33 МЛН
快乐总是短暂的!😂 #搞笑夫妻 #爱美食爱生活 #搞笑达人
00:14
朱大帅and依美姐
Рет қаралды 14 МЛН
How to Fight a Gross Man 😡
00:19
Alan Chikin Chow
Рет қаралды 21 МЛН
Hacking a Web File Manager | THM CTF
15:13
Dragkob
Рет қаралды 1,5 М.
The EASY Guide To Over-The-Air (OTA) Updates With ArduinoOTA
11:52
Programming Electronics Academy
Рет қаралды 28 М.
#332 ESP32  OTA tutorial with tricks (incl. OTA debugging)
10:17
Andreas Spiess
Рет қаралды 137 М.
this is what happens when you let the intern write code.
12:50
Low Level
Рет қаралды 267 М.
#253 Accurate Task Scheduler for the Arduino (and STM32, ESP32...)
21:37
Revolutionize Your ESP32 Projects with Live GPIO Pin Monitoring!
8:08
The Last Outpost Workshop
Рет қаралды 189 М.
M5Stack Cardputer: ESP32-S3 Pocket Computer
17:06
ExplainingComputers
Рет қаралды 106 М.
#263 Using WhatsApp with  your ESP32 (and other μControllers)
18:31
Ralph S Bacon
Рет қаралды 13 М.
Мясо вегана? 🧐 @Whatthefshow
01:01
История одного вокалиста
Рет қаралды 3,6 МЛН