Disclaimer: This code is not connected to (and even less endorsed by) the Espressif company - I'm a big fan and user of ESP chips, but that's all.
This component is a collection of objects to ease Wifi comms in projects, and it relies on the ESP-IDF Framework from Espressif. This code targets professional projects, or hobbyists who came to appreciate the ESP-IDF Framework.
I created it in order not to keep reinventing the wheel each time a project needs IP features over Wifi, like a tiny web interface to set up a wifi password, TCP or UDP clients, UPnP, etc...
Most of the code is mine, possibly occasionally flawed, and UPnP is adapted from TinyUPnP which was initially written for the Arduino framework. If you like Arduino, great, I started on it too, but the obvious ease of use for newbies also has a bunch of downsides. Each one their own... Just don't come whining about a port to Arduino, I'm not interested: I suffered enough porting that UPnP part from Arduino to ESP-IDF, and I tend to walk forward, not backwards.
A big thank you to our sponsors, with a reminder you guys get top priority on new requests or bug fixes...
This component is written for the ESP-IDF framework, version 5.0 and above.
Please don't ask to make it work for versions under 5.0, I have no time for that at this point. If anyone wants to create and maintain a branch for previous versions of the framework, feel free to do it, but it will be a constant work porting the new features and kind of backward IMHO.
Clone the repository in the components folder in your project, or add it there as a submodule, then add esp-comm under the REQUIRES directives
Use the following classes as required:
- Wifi
- CaptivePortal
- WebServer (includes APIs, Firmware Updates...)
- TCPClient
- UDPClient
- UPnP (through Wifi class)
Additionally these classes can be of use, depending:
- IPAddress
- Timer
See wiki
You can compile the example project right inside the example/basic folder (it uses a relative link to the component itself, using the extra_component_dirs directive in the top CMakeLists.txt file)
- TCP Server -> 0% (should be easy though)
- UDP Server -> 0% (should be easy too)
- Web Server (with APIs/dynamic pages) -> done
- File Server -> done
- Firmware Updater -> 95% (needs a few changes)
- Captive Portal -> 90% (assemble the elements above to build a simple portal )
- Documentation
Please open relevant issues, with details. Priorities as:
- Blocking fixes
- Non-blocking fixes
- Feature adjustments
- New features
I'm currently working alone on this, on my spare time. If you want to help, here's how:
- Help fix/extend/improve code, by submitting a pull request
- You could prefer to fork your own repo. That's fine with me, but don't come whining if this one keeps getting better and better ;-P You can be a team player, or not. Your choice, not mine. Also, sometimes people opinions and choices diverge, that's life ;)
- Star this repo to make it more "reputable"
- Donate? I haven't setup anything yet, but I will. In the meantime:
-
Listen to my music (search for PeerGum on Spotify, Apple Music, Youtube Music, etc... ). Every listen brings me a tiny fraction of a cent. Better than nothing :D
-
Send crypto (confirm rates before depositing - values under minimum crypto will be lost):
Crypto Address Min.Amount ETH/ERC-20 0x989f7290d5227d9d6451ab813900f1feb8a11c7b 0.00001 BTC 3AAQHy983Bc9dYZ9WSrehKtg3fxGx3HEKe 0.0001 LTC LYiDAwKN3xUeTqWNYnVThTtYgPNbKBDfcD 0.01 ATOM cosmos1p8actjzzmxxr6dvwx3q05ykvpxyqjd2j4jn8pe 1.00 DASH XoxPsd6U2xVG7gBzirpuWDbDtq5bfHdDbE 0.01 MATIC 0x989f7290d5227d9d6451ab813900f1feb8a11c7b 6.50 -
Send me a virtual coffee (I like virtual Mint Tea or Chai too)
-
Be happy and enjoy using the code.
-
This library is released under GPLv3 License
Copyright (c) 2023, PeerGum. Some Parts derived from TinyUPnP and (c) their author.
Under the GPLv3 license, you're are obligated to disclose the source of your work if it includes this library, modified or not. If you don't, and try to patent your product, your patent could be invalidated by law. Either you share too, or you write your own code, there's no free lunch.