Notifications From iPhone to ESP32-Watch
2024-07-08 | By M5Stack
License: General Public License Bluetooth / BLE Displays Wifi Arduino M5Stack M5Stick ESP32
Thanks for the source code and project info provided by @SASAKI TAKERU
Things used in this project
Hardware components
M5Stick C/M5Stick C plus2 with watch accessories x1
Software apps and online services
Story
Recently, I found about ANCS that enables BLE devices to receive iPhone's notifications.
I have BLE including development board M5StickC. That has a display and battery, etc. I only need to write the code.
I decided to make a prototype. Just receive notifications and show them.
It will be something interesting, maybe...
Set RTC
Not required to set RTC.
https://github.com/takeru/Arduino_ESP32_ANCS/commit/2ceb8445611ee356b184592afb69fe4d01e1c08a
(!!!Not required to do this!!!)
First, you need to set RTC.
Use your own tool or mine: https://gist.github.com/takeru/c2922ec229dcc9ad9fc3c601930160aa
You need to configure WiFi SSID & password. And ntp address, timezone, etc.
Code
https://github.com/takeru/Arduino_ESP32_ANCS/blob/M5StickC_Watch_Contest/Arduino_ESP32_ANCS.ino
Clone and open with Arduino IDE and write the sketch to M5StickC.
Open iPhone's Bluetooth setting. Find device named "Watch".
Select it and do pairing. After that, you will be asked to allow "Watch" to use notification data.
If you have notifications. RED LED is notice every 10sec.
If you had called-in, LED will flick and show "Calling.." in display.
If you misplaced your iPhone (BLE Connection is lost), the watch will alert you on LED and Display.
Ah, this is a watch. You can see what time it is and sometimes it shows the current time.
Customize
We can receive more contents from iPhone. Sender name, summary of message, etc... Filter notifications only you want to know.
Play sound from SPEAKER HAT. "Watch, Can you read a message ?"
Many interesting gadgets will be born from M5StickC🍊 & iPhone🍎
Links
I referenced many codes from:
https://github.com/nkolban/esp32-snippets/issues/430
https://github.com/S-March/esp32_ANCS
Complete project code
https://github.com/takeru/Arduino_ESP32_ANCS
Have questions or comments? Continue the conversation on TechForum, DigiKey's online community and technical resource.
Visit TechForum