Skip to content

ednieuw/ESP32Communications

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ESP32 Communications template

(Readme is in progress. See here for complete reference: Wordclock )

A template sketch to:

  • connect to WIFI
  • get the date and time via NTP
  • store time in an optional DS3231 RTC
  • WPS to connect automatically to a router
  • OTA to upgrade the software
  • SoftAP page to enter credentials instead of using WPS
  • DNS to see the BLE broadcast name given on the TAB of the web page
  • a HTML web page to operate the menu to control the ESP32
  • a log view web page of a few Mb long
  • BLE UART menu to use the menu from a phone, tablet or PC
  • HTML serial monitor to see the serial output
  • IR-remote control or
  • rotary encoder or
  • keypad to control the microcontroller or
  • BLE time sender iPhone app or BLE HTML webpage to send or set time and date
  • a built-in BLE time sender function that sends time and date
  • controls WS2812 RGB or SK6812 RGBW LED strips.

The sketch is developed on an Arduino Nano ESP32 which is an ESP32-S3.
The sketch can be used with other ESP32 boards. Change the pin numbers in the sketch for the specific board.

Small PCB This is a basic sketch for a ESP32 connected to:

  • a LDR,
  • a rotary,
  • or keypad,
  • or IR-remote controler
  • and a DS3231 RTC-module. The DS3231 is for use when no WIFI is available and an accurate time in needed.

The sketch is a spin-off from the Arduino Nano ESP32 word clock.
This sketch has been stripped from the word clock specifics and can be used for all kind of developments where WIFI, BLE, Serial input and output is needed.

NanoESP32-V04-3D

With the small or a larger Fritzing PCB design, in this repository, PCB's can be ordered from PCBway for less than €10.
The PCB's are designed for an Arduino Nano ESP32.
Fritzing design with Gerber files in this respority.

The microcontroller can be controlled with

  • a BLE serial terminal program on your PC like the serial monitor of the Arduino IDE.
  • a BLE serial terminal program in a browser HTML BLE serial terminal
  • a tablet or phone with a serial terminal app like: BLE serial terminal or
  • with a HTML page built in the sketch.

A software-enabled access point is created by the ESP32 that can be accessed in a browser with the url: http://169.4.1.1 to set up and configure the WIFI SSID and password to your router through a smartphone or web browser.

There is also a WPS method to set up a connection with the router that can be started with option Z in the menu.

With an Over the air (OTA) connection .bin software updates can be loaded.

An unique Bluetooth station name, given to the device in the menu of the ESP32, is also shown in your router and can be used as an URL, like http://GivenName, to get the menu in a browser. .

Settings are stored permanently in the ESP32.

In some browsers like Chrome and Edge it is possible to split a TAB to see the both the menu and the "Log view"

image

Start up logging in the Arduino IDE Serial monitor or start in your browser a web page with like 192.168.178.172 which you can find in the serial monitor or BLE serial terminal app or in your router.

Serial started
Stored settings loaded
LED strip started
Found I2C address: 0X57
Found I2C address: 0X68
External RTC module IS found
DS3231 RTC started
BLE started
Starting WIFI/NTP
[WiFi] WiFi is disconnected, will reconnect
WiFi lost connection.
[WiFi] WiFi is disconnected, will reconnect
Connected to access point
Connected to : FRITZ!BoxEd
Obtained IP address: 192.168.178.49
IP Address: 192.168.178.49
NTP is On and synced
___________________________________
I Menu, II long menu
K LDR reads/sec toggle On/Off
N Display off between Nhhhh (N2208)
R Reset settings
@ = Restart
___________________________________
Slope: 50     Min: 5     Max: 255 
BLE name: WordClock
IP-address: 192.168.178.49/update
WIFI=On NTP=On BLE=On FastBLE=Off
31/05/2025 15:55:31 
___________________________________
Web page started
WIFI started
31/05/2025 15:55:31

<<<<<<< HERE

The software can be used on this PCB: small PCB.
Fritzing design with Gerber files in this repository.
Five PCB's can be ordered from PCBway for ~25€ / $.

c72d9be7281def152df39a8ad47c6aeb1b30f7fd

image

Connect via Bluetooth

To make life easy it is preferred to use a phone or tablet and a Bluetooth communication app to enter the WIFI credentials into the clock.
image

BLESerial nRF BLE Serial Pro Serial Bluetooth Terminal

  • Download a Bluetooth UART serial terminal app on your phone, PC, or tablet.

  • For IOS iPhone or iPad (Buy this one to support me): BLE Serial Pro.
    Or the free, less sophisticated app: BLE serial nRF.
    Tip: Turn on Fast BLE with option + in the menu for a faster transmission.

  • For Android use: Serial Bluetooth terminal.
    Do not turn on Fast BLE in the menu. (Off = default)

About

A template sketch to connect WIFI, receive NTP time, use WPS, OTA, SoftAP, DNS, HTML &BLE UART menu

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors