www.switchdoc.labs
Version 009 July 24, 2018: Fixed problem in AP Provisioning WiFi selection. If you had connected before with your BC24, you couldn't make the AP Method work again.
Version 008 July 11, 2018: Fixed ClockTimeOffsetToUTC Bug so it is properly read and stored in preferences. You will need to hold MODE down during Reset to get the preferences to start recording the default ClockTimeOffsetToUTC. Change #define DEFAULTCLOCKTIMEOFFSETTOUTC -25200 for your time preferences. This will be replaced with a REST command in a new version
Version 007 June 30, 2018: Added Kludge to fix latest ESP32 SDK problem
Version 006 June 18, 2018: Added multiple methods for getting IP addresses from WiFi - Provisioning
In order to install the Arduino IDE with support for the ESP32 on the BC24, please follow the tutorial here:
http://www.switchdoc.com/2018/07/tutorial-arduino-ide-esp32-bc24/
Select the Adafruit ESP32 Feather under Tools
If you get a "\SDL_ESP32_BC24DEMO\SDL_ESP32_BC24DEMO.ino:69:21: fatal error: TimeLib.h: No such file or directory"
Go to this link github.com/PaulStoffregen/Time and download the .zip file. Then, in the IDE, go to Sketch>Include Library and click on Add .ZIP Library... In your file download area, you should be able to find the Time-Master.zip. Click on it and Open. It will install the Time.h required for the compilation of the sketch. Try to compile. If you get a repeat error, ,then close the IDE and restart it. Then re-compiling should work.
Plug a USB Micro to USB connector into your computer (the one with the power supply will work) to establish the connection.
The Demo program has four different modes:
We have four goodies for you right out of the box.
- Rainbow Display Demo (Mode 1)
- Monitor the Dow Jones Average Live! (Mode 2)
- Blue Theater Chasing Circle (Mode 3)
- Digital LED Clock (synced with NIST clocks for high accuracy) (Mode 4)
THe program remmebers which mode you pushed last. Whne you push the mode button, it may take a while before the software recognizes the button push, but it will. Then it will display the mode number (one green light) and you are now in the new mode. Note: Mode 2 and Mode 4 requires a WiFi connection. FIVE red lights will flash if you go to 2 or 4 without a WiFi Connection.
On Startup the software looks for a previously set WiFI connection. If it finds it then, you will see three green lights flash. If it doesn't find the WiFi or has never been connected to a WiFi, then it starts though the WiFi detection sequence.
- SmartConfig
- WPS Button on AP
- Local AP on ESP32 (192.168.4.1)
Note: This was developed for the BC24 ESP32 Based 24 RGBW Pixel LED Board
https://community.particle.io/t/smart-config-the-missing-manual-now-available/442
In order to do SmartConfig, you need a smartphone or tablet (Android or iOS) that connected to WiFi network (which you want ESP32 to connect to) and installed a special application. On this application, you just supply the ssid and password of WiFi network so that the application can use, encode them and then broadcast (via UDP) encoded ssid and password (under packet format) over the air. When this software is being run, the ESP32 (with the SmartConfig software loaded) will capture these packets, decode back ssid and password and use them to connect to Wifi network.
After connecting to WiFi, the ESP32 will use mDNS to multicast a message to the application to notify that it has successfully connected to WiFi.
The source code of special application is supplied by Espressif. You can download at:
https://github.com/EspressifApp/EsptouchForAndroid
https://github.com/EspressifApp/EsptouchForIOS
This application is also available on App Store. You can use it to test SmartConfig feature.
- For Android, this application is available under name "IOT_Espressif" or another application "ESP8266 SmartConfig" (this is for ESP8266 but you can use it for ESP32):
https://play.google.com/store/apps/details?id=com.cmmakerclub.iot.esptouch
https://play.google.com/store/apps/details?id=com.espressif.iot
- For iOS, this application is available under name "Espressif Esptouch":
https://itunes.apple.com/us/app/espressif-esptouch/id1071176700?mt=8
There is also another app on the iOS Appstore, search on "SmartConfig"
- Three White Lights
- Three Red on failure
- Three Green on success
Wi-Fi Protected Setup (WPS; originally, Wi-Fi Simple Config) is a network security standard to create a secure wireless home network.
Introduced in 2006, the goal of the protocol is to allow home users who know little of wireless security and may be intimidated by the available security options to set up Wi-Fi Protected Access, as well as making it easy to add new devices to an existing network without entering long passphrases.
This library will wait 60 seconds (in the example) for the WPS packets to be recieved by the ESP32.
A major security flaw was revealed in December 2011 that affects wireless routers with the WPS PIN feature, which most recent models have enabled by default.
This software does not use the PIN feature.
Default Time: 30 seconds timeout if no WPS button sent from AP- Three White Lights
- Two White Lights during search
- Two Red Lights on failure
- Two Green on success
For the third provisioning method, the ESP32 is set up as an access point (192.168.4.1) - look at your list of WiFi APs on your computer when it is running. A small web server is started that will allow you to select the AP that you want the ESP32 to connect to and then you can enter the password for the access point. It runs for 60 seconds by default.
Default Time: 60 seconds timeout if No completed Webform returned- One Blink of single White Light
- One Blinking White Light during AP page active
- One Red Light on failure
- One Green on success
Remember that all of these features may fail and have to be repeated. Nature of the beast.
Hold the Mode button down while you press and release Reset - erases stored information The two general defines in the example are:- BC24:
Define BC24 if you are using a BC24 ESP32 based device.
- BC24DEBUG:
Define BC24DEBUG (by default in the example it is defined) to see lots of debugging information which can help resolve problems and issues.