EspNowSkip: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 2: | Line 2: | ||
|Name=EspNowSkip | |Name=EspNowSkip | ||
|Picture=plaatje dat je geupload hebt op de wiki | |Picture=plaatje dat je geupload hebt op de wiki | ||
|Omschrijving=Muziekskipknop op basis van ESP- | |Omschrijving=Muziekskipknop op basis van ESP-Now protocol | ||
|Status=Initializing | |Status=Initializing | ||
|Contact=bertrik | |Contact=bertrik | ||
Line 16: | Line 16: | ||
* the skip button should be mobile, so it is battery powered and has to conserve power | * the skip button should be mobile, so it is battery powered and has to conserve power | ||
The ESP- | The ESP-Now protocol is connectionless, you don't need to set up a session/get an ip-address to communicate between nodes. | ||
== Hardware == | == Hardware == | ||
Line 36: | Line 36: | ||
** a single central "master" node | ** a single central "master" node | ||
** one or more "slave" skip-buttons | ** one or more "slave" skip-buttons | ||
* when the skip button is pressed, it wakes up from deep sleep and sends an ESP- | * when the skip button is pressed, it wakes up from deep sleep and sends an ESP-Now "SKIP" message to the last known channel and MAC address of the central node | ||
** if the skip button doesn't receive an ACK from the central node, it starts a kind of discovery to re-establish the channel and address of the central node | ** if the skip button doesn't receive an ACK from the central node, it starts a kind of discovery to re-establish the channel and MAC address of the central node | ||
* the central node sets up an AP by name (e.g. "espnow-revspace") | * the central node sets up an AP by name (e.g. "espnow-revspace") | ||
* the discovery procedure tries to find the central node by name, this AP name is the only thing that needs to be agreed upon in advance between master and slave code | * the discovery procedure tries to find the central node by name, this AP name is the only thing that needs to be agreed upon in advance between master and slave code | ||
** from the AP name, the slave node can determine the wifi channel | ** from the AP name, the slave node can do a scan to determine the wifi channel and MAC address to use | ||
** the slave node keeps both wifi channel and MAC address in (emulated) EEPROM and goes back to sleep | ** the slave node keeps both wifi channel and MAC address in (emulated) EEPROM and goes back to sleep | ||
Revision as of 00:09, 6 May 2018
Project EspNowSkip | |
---|---|
350px | |
Muziekskipknop op basis van ESP-Now protocol | |
Status | Initializing |
Contact | bertrik, jelly |
Last Update | 2018-05-06 |
Introduction
This page is about using the ESP8266/ESP32 ESP-Now protocol in the music skip button.
A music skip button has some tricky requirements:
- you want it to react reasonably quickly, with little latency between pressing the button and skipping to the next song
- the skip button should be mobile, so it is battery powered and has to conserve power
The ESP-Now protocol is connectionless, you don't need to set up a session/get an ip-address to communicate between nodes.
Hardware
The hardware is based on ESP8266, they are cheap and ubiquitous.
The sender/slave/skip button is wired such that the actual physical button just wakes up the ESP8266.
The receiver/master is connected to a raspberry pi or similar, receiving packets over ESP-Now, sending received data over serial to the raspberry pi.
Software
Source code
I plan to store source code here:
Proposed EspNowSkip protocol
It could work something like this:
- there are two roles:
- a single central "master" node
- one or more "slave" skip-buttons
- when the skip button is pressed, it wakes up from deep sleep and sends an ESP-Now "SKIP" message to the last known channel and MAC address of the central node
- if the skip button doesn't receive an ACK from the central node, it starts a kind of discovery to re-establish the channel and MAC address of the central node
- the central node sets up an AP by name (e.g. "espnow-revspace")
- the discovery procedure tries to find the central node by name, this AP name is the only thing that needs to be agreed upon in advance between master and slave code
- from the AP name, the slave node can do a scan to determine the wifi channel and MAC address to use
- the slave node keeps both wifi channel and MAC address in (emulated) EEPROM and goes back to sleep
References
- Read-the-docs about the low-level IDF ESP-Now API
- WifiEspNow project on github