8000 2016-11-27 · Smeedy/esp32-snippets@ecc89d9 · GitHub
[go: up one dir, main page]

Skip to content

Commit ecc89d9

Browse files
author
kolban
committed
2016-11-27
1 parent 5ecdbdc commit ecc89d9

File tree

8 files changed

+563
-2
lines changed

8 files changed

+563
-2
lines changed

.cproject

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@
2121
<builder id="org.eclipse.cdt.build.core.settings.default.builder.473998174" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="Gnu Make Builder" superClass="org.eclipse.cdt.build.core.settings.default.builder"/>
2222
<tool id="org.eclipse.cdt.build.core.settings.holder.libs.354998465" name="holder for library settings" superClass="org.eclipse.cdt.build.core.settings.holder.libs"/>
2323
<tool id="org.eclipse.cdt.build.core.settings.holder.360963571" name="Assembly" superClass="org.eclipse.cdt.build.core.settings.holder">
24-
<option id="org.eclipse.cdt.build.core.settings.holder.incpaths.916191028" superClass="org.eclipse.cdt.build.core.settings.holder.incpaths" valueType="includePath">
24+
<option id="org.eclipse.cdt.build.core.settings.holder.incpaths.916191028" name="Include Paths" superClass="org.eclipse.cdt.build.core.settings.holder.incpaths" valueType="includePath">
25+
<listOptionValue builtIn="false" value="/opt/xtensa-esp32-elf/lib/gcc/xtensa-esp32-elf/4.8.5/include"/>
2526
<listOptionValue builtIn="false" value="&quot;${IDF_PATH}/components/vfs/include&quot;"/>
2627
</option>
2728
<inputType id="org.eclipse.cdt.build.core.settings.holder.inType.1400544808" languageId="org.eclipse.cdt.core.assembly" languageName="Assembly" sourceContentType="org.eclipse.cdt.core.asmSource" superClass="org.eclipse.cdt.build.core.settings.holder.inType"/>
@@ -36,9 +37,10 @@
3637
<listOptionValue builtIn="false" value="&quot;${IDF_PATH}/components/log/include&quot;"/>
3738
<listOptionValue builtIn="false" value="&quot;${IDF_PATH}/components/tcpip_adapter/include&quot;"/>
3839
<listOptionValue builtIn="false" value="&quot;${IDF_PATH}/components/lwip/include/lwip&quot;"/>
39-
<listOptionValue builtIn="false" value="&quot;${IDF_PATH}/components/vfs/include&quot;"/>
4040
<listOptionValue builtIn="false" value="/opt/xtensa-esp32-elf/xtensa-esp32-elf/include/c++/4.8.5"/>
4141
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/myapp/build/include}&quot;"/>
42+
<listOptionValue builtIn="false" value="/opt/xtensa-esp32-elf/lib/gcc/xtensa-esp32-elf/4.8.5/include"/>
43+
<listOptionValue builtIn="false" value="&quot;${IDF_PATH}/components/vfs/include&quot;"/>
4244
</option>
4345
<inputType id="org.eclipse.cdt.build.core.settings.holder.inType.1608399615" languageId="org.eclipse.cdt.core.g++" languageName="GNU C++" sourceContentType="org.eclipse.cdt.core.cxxSource,org.eclipse.cdt.core.cxxHeader" superClass="org.eclipse.cdt.build.core.settings.holder.inType"/>
4446
</tool>
@@ -53,6 +55,7 @@
5355
<listOptionValue builtIn="false" value="&quot;${IDF_PATH}/components/tcpip_adapter/include&quot;"/>
5456
<listOptionValue builtIn="false" value="&quot;${IDF_PATH}/components/lwip/include/lwip&quot;"/>
5557
<listOptionValue builtIn="false" value="&quot;${IDF_PATH}/components/vfs/include&quot;"/>
58+
<listOptionValue builtIn="false" value="/opt/xtensa-esp32-elf/lib/gcc/xtensa-esp32-elf/4.8.5/include"/>
5659
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/myapp/build/include}&quot;"/>
5760
</option>
5861
<inputType id="org.eclipse.cdt.build.core.settings.holder.inType.30884209" languageId="org.eclipse.cdt.core.gcc" languageName="GNU C" sourceContentType="org.eclipse.cdt.core.cSource,org.eclipse.cdt.core.cHeader" superClass="org.eclipse.cdt.build.core.settings.holder.inType"/>

networking/bootwifi/README.md

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# Bootwifi
2+
It is common to want to start an ESP32 and have it connect to a WiFi environment but how
3+
does one bootstrap it? To connect to a WiFi environment, we typically need to know the
4+
SSID and password of the network to which we wish to connect. But without network connection
5+
to the ESP32, how do we set it? This component provides a potential solution.
6+
7+
The module exposes a function called `bootwifi` which, when called, will own the connection
8+
of the device to the local WiFi environment. To do this, it looks in its flash storage to see
9+
if it has previously been given an SSID/password pair. If it has, it attempts to connect to that
10+
access point and join the network.
11+
12+
However, let us assume that it has never been given that information. In this case it will become
13+
an access point in its own right. Now you can connect to the ESP32 using your phone or other WiFi
14+
device as it will appear as an access point against which we can connect. Once connected, we can
15+
open a browser to it. In the browser page, we will be prompted for the SSID and password we wish
16+
to subsequently use. This will be saved and used from then on. Now the device will connect to that
17+
network.
18+
19+
What if we take our ESP32 to a new environment where the previously saved access point is no longer
20+
accessible or we simply just fail to connect? Again, we will fall back into being an access point
21+
and the user will be able to supply new information.
22+
23+
What if we want to change the access point to which the ESP32 connects even if that access point has
24+
been previously saved and is still connectable? Simple, the ESP32 can check a GPIO pin at startup and,
25+
if that pin is high (default low) then that can be used as a manual indication that we should become
26+
an access point without even attempting to connect to the network.
27+
28+
This code is supplied in the form of an ESP-IDF module. It depends on a partner module called `mongoose`
29+
that provides a Web Server in order to server up the web pages. A build of `mongoose` is available
30+
however, [Cesanta](https://www.cesanta.com/), the makers of Mongoose are still working on a formal
31+
port to the ESP32 which is anticipated to be available before 2017 so we should really wait for that
32+
to become available.
33+
34+
##Future enhancements
35+
There is always room for enhancements:
36+
37+
* Improve the web page shown to the user - Right now it is pretty basic and ideally could be
38+
dramatically improved. Features to be added include
39+
- listing of available access points for selection
40+
- Responsive visuals for better reading/styling on mobile devices
41+
* Integrate SSL security.
42+
* Configuration of GPIO pin to use (if any) for GPIO over-ride
43+
* NeoPixel support for visualization of connection status:
44+
- Green - connected
45+
- Blue - being an access point
46+
- Red - Connecting
47+
- Flashing red - failed
48+
* Ability to specify an IP address for static IP address connection to the access point.
49+
* mDNS support when available.
50+
* Component configuration options including:
51+
- Network SSID to use when being an access point.
52+
- Network password to use when being an access point (if any).

0 commit comments

Comments
 (0)
0