Create passwords.py to connect your wi-fi network with SSID and password.
Import this folder to your esp32
This file consists with these componensts below:
- Network configulation
- Establish connection
- Flag
- main
import passwords from your passwords.py. Define your SSID_NAME_*.
Establish connection with your SSID_NAME_* by executing connect_*_wifi().
connect_*_wifi() calls wifiscan() searchs nearby Wi-Fi signals.
flag() decides whather activate 'cm_main.py' or 'ch_main.py'.
This file normalizes 2 parameter values(battery, number of connectabele nodes) and calculate euclidian distance.
Normalize battery and number of connectable nodes.
Reading battery and number of connectable nodes from 'node_data.csv', normalize these 2 parameters. Then, write the normalized data to 'normalized_node_data.csv'.
extract_from_csv() extracts 2 values from 'normalized_node_data.csv' and call sim_score().
sim_score() calculates euclidian distance using given 2 arguments from extract_from_csv().
set unique number
set "True" for initial cluster head
set "False" for initial cluster member
delete file before starting experiment.
write "0" or delete file before start experiment