Hello guys,
I am looking to build "my dream" project and I am stucked. I have to admit, I am not good at all as I believed
The project
A 1m long with 144pixels strip driven by a NodeMCU ESP8266 - let's call it "TUBE"
To it, I've attached a rotary encoder and a 0.9" OLED
I've designed a small menu controlled by the encoder, which actually works in which you can chose the MODE: COLOR, SFX, MANUAL, etc and for each MODE, it's PROGRAMS and finally the DIMMING.
Now, I want to link multiple TUBES via Wi-Fi and to be able to control them accordingly.
This what I want to do:
I have a "SERVER" - a standalone ESP8266 which acts like a directory and main director - it has a WiFi name set ex.: wizzMACADDRESS so no duplicates can be created.
Each TUBE will scan and look for a wizz* network, and if they find it they will connect to it.
Here I would like them to change a tiny bit of info so we can know for sure it is a valid server as: CLIENT ASKS FOR MAC. SERVER REPLIES MAC. CLIENT COMPARES MAC AND WIFINAME.
After that, each client can chose to be a MASTER or to be a SLAVE to a already existing MASTER. It will register with its MAC and a value defining if it will be SLAVE or MASTER and will receive an INDEX NUMBER which will display each on its screen.
If a MASTER changes whatever from the MENU, its SLAVE should get it also.
The SERVER, on the other hand, will display a HTML page where all the CLIENTS TREE are displayed and be controlled from that page, ALL, BY GROUP or INDIVIDUALLY.
Alsom I would like that the server keeps in the EEPROM the CLIENT TREE and each CLIENT it's INDEX NUMBER received upon registration.
I couldn't think of any other solutions for accomplishing this and I widely open to suggestions.
On the CLIENT side should sound like:
scan for SERVER
if SERVER is found ask SECURITY INFO and compare SECURITY VALUE received
if MASTER register "M"+MAC and receive "M"+INDEX
if SLAVE ask SERVER for MASTERS
SELECT from MASTER "M.INDEX" register "S"+["M"+INDEX]+MAC and receive "S"+["M"+INDEX]
if CLIENT is REGISTERED as MASTER and changes MENU send SERVER all the info (MODE, PROGRAM, DIM, RGB VALUES)
if CLIENT is REGISTERED and COMMANDS arrive act accordingly (set MODE, PROGRAM, DIM, RGB VALUES)
On the SERVER side:
start WiFi spot (wizz+MAC with no ":")
load from EEPROM CLIENTS TREE if exists
serving the HTML page - onchange pass values accordingly
listening for incoming new connections
if NEW CLIENT asks for SECURITY INFO - return SECURITY VALUE
if NEW CLIENT register it and write it to EEPROM
if SLAVE pass it the values from its MASTER
if a MASTER sends values (menu changed) pass it to its SLAVES
Thank you,
Razvan
I am new to this and new to this forum and I don't know if I should post the code I have by now, even though I think it's irrelevant as no part of code covers any of the items I've described.