Feature #1193
openIntegrate pwscan/pwremote as single sensor device on Xiao ESP32C3
20%
Description
- Three modes of operation
- Pairing
- Scanning for remotes
- Remote Control of outlets
- Mode can be set programmatically via web interface.
- Web interface should provide output from scans
- Web interface should allow selecting buttons to enable/disable.
This device must be built for an ESP32C3 in order to support WiFi.
This also needs to be mounted in an enclosure. That will be tracked in RM #1192.
Related issues
Updated by Hammel 24 days ago
- Related to Feature #1192: Create enclosure for pwremote/pwscan device added
Updated by Hammel 7 days ago
- Subject changed from Integrate pwscan/pwremote as single sensor device on Arduino Uno to Integrate pwscan/pwremote as single sensor device on Xiao ESP32C3
- Status changed from New to In Progress
- % Done changed from 0 to 10
Note: this was for Arduino Uno but that board doesn't have WiFi. So I'm switching to the Seeed Studio Xiao ESP32C3.
pwremote now configures the correct family for the Xiao ESP32C3: esp32:esp32:XIAO_ESP32C3
You can find this with
arduino-cli board listall | grep ESP32C3
Now the build gets farther but fails with
Alternatives for ESP8266WiFi.h: [] ResolveLibrary(ESP8266WiFi.h) -> candidates: [] /home/mjhammel/src/ximba/xarduino/lightsw/src/pwrmgmt/pwremote/pwremote.ino:17:10: fatal error: ESP8266WiFi.h: No such file or directory 17 | #include <ESP8266WiFi.h>
So this library doesn't work with the ESP32C3. I need to port it to whatever library works with the ESP32.
Updated by Hammel 6 days ago
Things I need to port for Xiao ESP32C3.
- ESP8266WebServer server - try
- NetworkServer server
- WebServer server
- This may also have spiffs support
- HTTPClient
- SPIFFS.exists()
- Udp.beginPacketMulticast()
Updated by Hammel 4 days ago
Most of the porting is done, simply by using the correct headers for ESP32.
I'm left with the following.- UDP.beginPacketMulticast(): This may be the NetworkUDP support in the Network library.
- Dir dir = ...: This seems to be deprecated in favor of SPIFFS support, such as the listdir() function in the SPIFFS Test example
Updated by Hammel 4 days ago
The pinout shows there is no GPIO0 on the Xiao board. But there are extra GPIO pins so I can test for both Reset (which would be converted to a function like pairEnabled) and the pairEnabled GPIO. Note that Reset would be handled first before pairEnabled is turned on, though pairEnabled doesn't make sense if Reset was on.
So if Reset is enabled, it clears memory first and then goes into config mode.
But maybe this can all be done with a single button.- Hold button and power on: Reset mode, then config mode.
- Hold button after power on: config mode (without reset)
- Press button twice after power one: pairEnabled
- Press once after to go into operational mode.