Slider Knobs -> Volume Hi Mid Low Stop/ Start W/ Display
Consider: OTA, Flash Defaults SPIFFS, Broad/Multi/Uni, Chip/Module/Board
Plan Part 2
ColorWheel Maps to Octaves. Avg top 3 freq/colors
Only Admin may broadcast
gatway sends to children
children never message siblings
only msg 1 relative per bc & prefer to send to gateway
children deliver inbound messages to gateway
gateway delivers data to admin... go to step 1...
Broadcasts are limited by # hops. #hops is managed by GW?
userA -> gatewayA userB -> gatewayB userC -> gatewayC
gatewayA -> nodeA1 gatewayB -> nodeB1 gatewayC -> nodeC1
gatewayA -> nodeA2 gatewayB -> nodeB2 gatewayC -> nodeC2
gatewayA -> nodeA3 gatewayB -> nodeB3 gatewayC -> nodeC3
gatewayA -> gatewayB gatewayB -> gatewayA gatewayB -> gatewayC gatewayC -> gatewayB
nodeA3 -> nodeB1 nodeB1 -> nodeA3
nodeC3 -> nodeB3 nodeB3 -> nodeC3
gateway broadcasts user cmds. leaf's unicast out farther but not to eachother.
gateway and leafs unicast recieved msgs to user if not from the user
Do not relay msgs from anyone other than the user
user may choose to relay a msg it recieved from someone else.
pub/sub should allow you to act simply as a router or to extend the pub/sub by replicating and posting the message as well.
Command and satellite must share same channel.
Multi-Acess Frequency Hopping allows for a shared transmission medium
1Peer FF:FF:FF:FF -> Broadcast to all peers on ch -> esp32
Set Peer Mac Addr -> Broadcast by sending to common mac addr -> ESP32
Adhoc Addressing Layer
Frequency hoping, channels limit # conn, multi access method requires
macaddr of other devices
or soft ap sharing
or bt sharing
or sendbroadcast to all on network
How it works
Command->STA->WifiMacAddr()
Satellite->AP->WifiSoftAPMacAddr()
0-14ch: 2.4GHZ: 802.11.n
Max paired devices = 20. Sent from STA or AP modes.
-> circumvent unicasting by setting all nodes to have the same MAC ADDR
Service/ Character
EspOwnerName
EspDeviceName
Pin 13 2
LED #
SSIDConnectorNamePrefix
ifUpdates->Broadcast onReception =>
update State of leafnode values
get rout node values
subscriptionValues
Send data 2 clients so they may "subscribe".
Leaf nodes need a log(val @ timestamp)
Setup
ConfigDeviceAP (mac=ssid, pass=1234, print-yay!)
RegisterCallbacks (msgsnt,msgrcvd-write2pin)
Init ESPNow(onMsgSnt, OnMsgRcvd): refers to step 2
strip.begin
strip.show
BLEESP = ESPName
BLEESP.CreateService .createCharacteristic
BLEESP Register Callback
BLEESP Set Value("HelloWorld")
BLEESP.start
Loop
Scan4LeafNodes
Wifi.ScanNetwork
For Node in AP = add to list
Manage Leaf Nodes
For each leaf node: if name = "espname": check if paired.
Send Data - ESP
If Command = XYZ
OnBLERecieved: if leafnodes -> ESPNow Broadcast. Run Command
ONESPRecieved: if BLE!connected:DoNothing. Else: if send="espname:donothing" else:"send2ble"
Config Device AP
scan4leafnodes
if a node with esp.bt exists and you are not connected to the user then there is already a gateway and bluetooth is not needed for thihs node.
manage leaf nodes
try to connect to user usin bt. if success then change wifi name to include bt so that other nodes know that you are the gateway and they do not need to connect.
espnow_senddata(command)
if not leader do not send
only if leader. or send the data but only read from leaders & leaders would read from everyone...
if btmessage -> relay out if publicmsg -> if msg is leader: run cmd & broadcast. else: if in group do nothing
Partition Table
Includes root. values from different people + all current data to be fwded from leafs to rest
Group: Updated: Val
Leafid: Updated: Val
How MSG Works
Within body of a node with an ssid=espname... Body(rootnodessid, rootsentthis@, command)
msg recv & isroot?
& root nodessid = espname+bt
runbroadcast, update timestamp, is command the same as before?
check timestamp, same broadcast? relay nothing
or root nodessid = espname only
patitiontable: groupname:command:timestamp
or root nodessid != espname... do nothing.