sWitches is a collective formed by
Ella Hebendanz, Ines DeRu, and pamela varela
we explore the convergence of technology/nature/sexuality
as a new space for feminism/community/empowerment
{
shx is coming
rewriting redefining repositioning
reowning reclaiming rebooting
opening new circuits of connections
creating currents of electricity
flowing through a network that demands her hacking
shx is the future, the antagonist of patriarchal reigns,
gliding across worlds, a hybrid creature free from borders, emancipated: beast
shx shapes,
form and face shx changes
shx is mothxr, matrix and thousands of names
shx manifests in all that is living: earth, moon, sun, star, seed, wave, tree, spirit, animal, they, them
shx is many
shx is us
}
void void void setup
{
prisoners of patriarchy, capitalism, subordination
feeling anger and sharing frustration
the fire of their souls burning
toxins raising, exhaling from their bodies, spreading: viral
sie ist das Virus, dass das System verändern wird
ellxs son el virus que alterará el sistema
saya adalah virus yang akan mengubah sistem
we are the virus that will disrupt the system
call her
witch bruja hexe
slut puta schlampe
cunt perra hure
whore zorra fotze
bitch loba flittchen
we are here to unleash, unbound
diving deep into fragments of this our political poetry
it’s time for alignment, time to expand our biomagnetic fields
}
void void void update
{
we are cyberwitches
in this hybrid space
transforming codes into complex networks
mirroring patterns as above, so below
we embody the souls of the divine goddxssxs
daughtxrs of the moon, Müttxr der Sonne, hermanxs de la tierra
sexual beings, natural beings
exploring our bodies as our own territory
entangled in the roots, linking us to the matrix
as the current unites us
our power allows us to re-engineer the world
healing
fire, water, earth and air will we fuse
burning, wetting, reconstructing, deconstructing
the flowers of justice bloom
the fruits of freedom ripen
ready
for shaping a world which prejudice claims no more victims
ready
for reclaiming the corrupted system
ecstatic, in trance, celebrating,
shouting together
in the current void
we are the future voice
X
}
Working title: ặnim@
Field: cyberfeminist tECkhnO*magic
Medium: Sound/Visual/Movement generative installation-performance
Duration: 1 hour per performance, 4 times per day
We envision a world where our individual spells generate a ritualistic act of resistance, an ecosystem where our cyberfeminist tECkhnO magick influences the physical, virtual and mystical realms. Each of us will have her individual project, a spell that is part of the communal ritual we will create altogether.
1. electropoetry
electronic poetic piece
in collaboration with Montserrat Balmori and Victoria Martínez
A narrational sonic piece plays in space, the electropoetry. It is the futuristic, intellectual, ethereal entity. Electronic beats are rhythmic; poetry is rhytmic. Rhythm is the gateway of trance.
It contains voices, fragments of poems of the relellious poets-spirits, of struggle and feminism. It also contains my voice, texts from my thesis and poems by me. The sounds are a compilation that follows the theme of the whole piece.
I listen to the electropoetry with my ears, and I respond–through dance.
first prototype
poems by the spirits
Still I Rise, Maya Angelou
You may write me down in history
With your bitter, twisted lies,
You may trod me in the very dirt
But still, like dust, I'll rise.
Does my sassiness upset you?
Why are you beset with gloom?
’Cause I walk like I've got oil wells
Pumping in my living room.
Just like moons and like suns,
With the certainty of tides,
Just like hopes springing high,
Still I'll rise.
Did you want to see me broken?
Bowed head and lowered eyes?
Shoulders falling down like teardrops,
Weakened by my soulful cries?
Does my haughtiness offend you?
Don't you take it awful hard
’Cause I laugh like I've got gold mines
Diggin’ in my own backyard.
You may shoot me with your words,
You may cut me with your eyes,
You may kill me with your hatefulness,
But still, like air, I’ll rise.
Does my sexiness upset you?
Does it come as a surprise
That I dance like I've got diamonds
At the meeting of my thighs?
Out of the huts of history’s shame
I rise
Up from a past that’s rooted in pain
I rise
I'm a black ocean, leaping and wide,
Welling and swelling I bear in the tide.
Leaving behind nights of terror and fear
I rise
Into a daybreak that’s wondrously clear
I rise
Bringing the gifts that my ancestors gave,
I am the dream and the hope of the slave.
I rise
I rise
I rise.
-Woman Alone, Borderlands, Gloria Anzáldua, p. 174
Yo llamo a mujer,
canto por mujer.
Cubierta con serpientes vengo yo,
al lugar del encuentro me acerco,
repito conjuros para provocar amor.
Clamo por mujer.
Ya llego, llamo.
A Woman Speaks, Audre Lorde
Moon marked and touched by sun
my magic is unwritten
but when the sea turns back
it will leave my shape behind.
I seek no favor
untouched by blood
unrelenting as the curse of love
permanent as my errors
or my pride
I do not mix
love with pity
nor hate with scorn
and if you would know me
look into the entrails of Uranus
where the restless oceans pound.
I do not dwell
within my birth nor my divinities
who am ageless and half-grown
and still seeking
my sisters
witches in Dahomey
wear me inside their coiled cloths
as our mother did
mourning.
I have been woman
for a long time
beware my smile
I am treacherous with old magic
and the noon's new fury
with all your wide futures
promised
I am
woman
and not white.
Natsiká/Viaje, Celerina Patricia (mixteco)
Tsíká tsaá nuú ñu’ún yo’ó nchaa tsana’á
nuú ntsitsika kue natsanú nda’á tsi chí iso
nuú nikanchí tsi kue yoo savi
ra yo’o ingáyu tisi kue tú in núu ndó o
Tu’un tsá viíñaa ndakani tsi naa ndaku’un ino
Tu’un ñaa tsa a chi I takua ndaki on ichí
Kue tu’un ñña kunu in ora ndakasía nuúgo
Tu’un ñaa sa a yivi
Con mis pies descalzos he recorrido el camino de los ancestros
donde las abuelas caminaron con pasos firmes y contudentes
bajo el sol de muchas primaveras para no morir
aquí estoy con mi tenate de palabra
con un canto a su historia y su memoria
las palabras son fuerza/valor/camino
y van tejiendo nuestro ser
palabras que construyen mundos
They shut me up in Prose, EMILY DICKINSON
They shut me up in Prose –
As when a little Girl
They put me in the Closet –
Because they liked me “still” –
Still! Could themself have peeped –
And seen my Brain – go round –
They might as wise have lodged a Bird
For Treason – in the Pound –
Himself has but to will
And easy as a Star
Look down opon Captivity –
And laugh – No more have I –
Helen of Troy Does Countertop Dancing, Margaret Atwood
The world is full of women
who'd tell me I should be ashamed of myself
if they had the chance. Quit dancing.
Get some self-respect
and a day job.
Right. And minimum wage,
and varicose veins, just standing
in one place for eight hours
behind a glass counter
bundled up to the neck, instead of
naked as a meat sandwich.
Selling gloves, or something.
Instead of what I do sell.
You have to have talent
to peddle a thing so nebulous
and without material form.
Exploited, they'd say. Yes, any way
you cut it, but I've a choice
of how, and I'll take the money.
I do give value.
Like preachers, I sell vision,
like perfume ads, desire
or its facsimile. Like jokes
or war, it's all in the timing.
I sell men back their worse suspicions:
that everything's for sale,
and piecemeal. They gaze at me and see
a chain-saw murder just before it happens,
when thigh, ass, inkblot, crevice, tit, and nipple
are still connected.
Such hatred leaps in them,
my beery worshippers! That, or a bleary
hopeless love. Seeing the rows of heads
and upturned eyes, imploring
but ready to snap at my ankles,
I understand floods and earthquakes, and the urge
to step on ants. I keep the beat,
and dance for them because
they can't. The music smells like foxes,
crisp as heated metal
searing the nostrils
or humid as August, hazy and languorous
as a looted city the day after,
when all the rape's been done
already, and the killing,
and the survivors wander around
looking for garbage
to eat, and there's only a bleak exhaustion.
Speaking of which, it's the smiling
tires me out the most.
This, and the pretence
that I can't hear them.
And I can't, because I'm after all
a foreigner to them.
The speech here is all warty gutturals,
obvious as a slab of ham,
but I come from the province of the gods
where meanings are lilting and oblique.
I don't let on to everyone,
but lean close, and I'll whisper:
My mother was raped by a holy swan.
You believe that? You can take me out to dinner.
That's what we tell all the husbands.
There sure are a lot of dangerous birds around.
Not that anyone here
but you would understand.
The rest of them would like to watch me
and feel nothing. Reduce me to components
as in a clock factory or abattoir.
Crush out the mystery.
Wall me up alive
in my own body.
They'd like to see through me,
but nothing is more opaque
than absolute transparency.
Look--my feet don't hit the marble!
Like breath or a balloon, I'm rising,
I hover six inches in the air
in my blazing swan-egg of light.
You think I'm not a goddess?
Try me.
This is a torch song.
Touch me and you'll burn.
SANGRE NUESTRA, Susana Chávez
Sangre mía,
de alba,
de luna partida,
del silencio.
de roca muerta,
de mujer en cama,
saltando al vacío,
Abierta a la locura.
Sangre clara y definida,
fértil y semilla,
Sangre incomprensible gira,
Sangre liberación de sí misma,
Sangre río de mis cantos,
Mar de mis abismos.
Sangre instante donde nazco adolorida,
Nutrida de mi última presencia.
“Susana bla bla bla…”
MUJER, Maria Sabina
Soy la mujer que sólo nací.
Soy la mujer que sola caí.
Soy la mujer que espera.
Soy la mujer que examina.
Soy la mujer que mira hacia adentro.
Soy la mujer que mira debajo del agua.
Soy la nadadora sagrada
porque puedo nadar en lo grandioso.
Soy la mujer luna.
Soy la mujer que vuela.
Soy la mujer aerolito.
Soy la mujer constelación huarache.
Soy la mujer constelación bastón.
Soy la mujer estrella, Dios
porque vengo recorriendo los lugares desde su origen.
Soy la mujer de la brisa.
Soy la mujer rocío fresco.
Soy la mujer del alba.
Soy la mujer del crepúsculo.
Soy la mujer que brota.
Soy la mujer arrancada.
Soy la mujer que llora.
Soy la mujer que chifla.
Soy la mujer que hace sonar.
Soy la mujer tamborista.
Soy la mujer trompetista.
Soy la mujer violinista.
Soy la mujer que alegra
porque soy la payasa sagrada.
Soy la mujer piedra del sol.
Soy la mujer luz de día.
Soy la mujer que hace girar.
Soy la mujer del cielo.
Soy la mujer de bien.
Soy la mujer espíritu
porque puedo entrar y puedo salir
en el reino de la muerte.
my texts tryouts
2. me
I listen
I dance
props:
wearable electronics
movement
mask
costume
I am wearing an electronic micro-controller with a vaginal sensor (and potentially a pulse sensor too). The data is converted into beats and rhythms to be played by the drums, using solenoids and sticks.
I use ESP32, wireless micro-controllers coded with the Arduino software.
The genital/core area is the point of connection with our ancestors, as well as where oppressive gender differences originate.
~ ~ ~ ~ ~ the future ~ ~ ~ ~ ~
costume >>> in collaboration with Sofía Irene >>> dualism, myth, eagle, fire, air, "masculinity",
snake, water, earth, "femininity"
mask >>> in collaboration with Davide Amato >>> dualism, life, death, organic, inorganic, battle, purification
electronics >>> in collaboration with Marlot Meyer >>> potential addition of (only if not tacky) lights in the costume
just words, no draws ::::: yet :))) *coming soon*
dance in collaboration with Fazle Shairmahomed
electronics in collaboration with Marlot Meyer
3. drums
percussion in collaboration with Bob Verhoeven
metalwork in collaboration with Dennis Slootweg
The drums are the primal, ancestral, rooted entity. They represent our connection to the ground.
They react directly to the movements of my hips, through the vaginal muscle reader. Therefore, the sound they produce responds to the electropoetry playing in space.
The characteristics and aesthetics of the drums refer to nature. They recall tree roots and creatures of the forest. The mythological entities I am researching for the character development are the nymphs, not only because of their relation to nature, but also because of their etymological relation to the notion of “nymphomania”, an uncontrollable or excessive sexual desire in a woman (*read ironically*).
~ ~ ~ the future ~ ~ ~
character traits, inspired by the sound of each drum and represented also by its looks: paint, symbols, objects, colors;
bioplastic will certainly be used as a recollection of skin/flesh, both related to the body and to the drums themselves
aesthetics development
I have nine second-hand drums at the moment, and I am creating a rhythmic composition for them to be an ensamble. Some produce base sounds, and some high.
1. electropoetry
The loop closes when the electropoetry "hears" the drums and responds. This is then how the sonic clash, the battle, happens.
This is possible thanks to the wireless connection of my wearable micro-controller, which at the same time sends data to the computer that is connected to Ableton.
There is a delay, so the audience thinks the speakers speak after the drums play something, but in reality, I am still the only activator of both sides of the battle.
system in collaboration with Adriaan Wormgoor
who wins?
to be continued...
#include
#include
#define NUM_SLAVES 20 // ESP-Now can handle a maximum of 20 slaves
esp_now_peer_info_t slaves[NUM_SLAVES]; // Stores the information of each of the slave that is added as a peer
int slaveCount = 0; // Keeps count of no. of SLAVES with the defined prefix "slave"
#define CHANNEL 3
#define PRINTSCANRESULTS 0
#define PUSSY_PIN 32
int PUSSY_value = 0;
long sendTime;
void initESPNow();
void manageSLAVES();
void scanForSLAVES();
void onDataSent(const uint8_t *mac_addr, esp_now_send_status_t status);
void onDataRecv(const uint8_t *mac_add, const uint8_t *data, int data_len);
void sendData(uint8_t data);
int PUSStatus = 0;
// Init ESP Now with fallback
void initESPNow()
{
WiFi.disconnect();
if (esp_now_init() == ESP_OK)
{
Serial.println("ESPNow Init Success");
}
else
{
Serial.println("ESPNow Init Failed");
ESP.restart();
}
}
// Scan for slaves in AP mode
void scanForSlaves()
{
int8_t scanResults = WiFi.scanNetworks();
//reset slaves
memset(slaves, 0, sizeof(slaves));
slaveCount = 0;
Serial.println("");
if (scanResults == 0)
{
Serial.println("No WiFi devices in AP Mode found");
}
else
{
Serial.print("Found ");
Serial.print(scanResults);
Serial.println(" devices ");
for (int i = 0; i < scanResults; i++)
{
// Print SSID and RSSI for each device found
String SSID = WiFi.SSID(i);
int32_t RSSI = WiFi.RSSI(i);
String BSSIDstr = WiFi.BSSIDstr(i);
if (PRINTSCANRESULTS)
{
Serial.print(i + 1);
Serial.print(": ");
Serial.print(SSID);
Serial.print(" [");
Serial.print(BSSIDstr);
Serial.print("]");
Serial.print(" (");
Serial.print(RSSI);
Serial.print(")");
Serial.println("");
}
delay(10);
// Check if the current device starts with `Slave`
if (SSID.indexOf("SlaveL1") == 0)
{
// SSID of interest
Serial.print(i + 1);
Serial.print(": ");
Serial.print(SSID);
Serial.print(" [");
Serial.print(BSSIDstr);
Serial.print("]");
Serial.print(" (");
Serial.print(RSSI);
Serial.print(")");
Serial.println("");
// Get BSSID => Mac Address of the Slave
int mac[6];
if(6 == sscanf(BSSIDstr.c_str(), "%x:%x:%x:%x:%x:%x%c", &mac[0], &mac[1], &mac[2], &mac[3], &mac[4], &mac[5]))
{
for(int j = 0; j < 6; j++)
{
slaves[slaveCount].peer_addr[j] = (uint8_t)mac[j];
}
}
slaves[slaveCount].channel = CHANNEL; // pick a channel
slaves[slaveCount].encrypt = 0; // no encryption
slaveCount++;
}
}
}
if(slaveCount > 0)
{
Serial.print(slaveCount); Serial.println(" Slave(s) found, processing..");
}
else
{
Serial.println("No Slave Found, trying again.");
}
// clean up ram
WiFi.scanDelete();
}
// Check if the slave is already paired with the master.
// If not, pair the slave with master
void manageSlaves()
{
if(slaveCount > 0)
{
for(int i = 0; i < slaveCount; i++)
{
const esp_now_peer_info_t *peer = &slaves[i];
const uint8_t *peer_addr = slaves[i].peer_addr;
Serial.print("Processing: ");
for(int j = 0; j < 6; j++)
{
Serial.print((uint8_t) slaves[i].peer_addr[j], HEX);
if (j != 5)
{
Serial.print(":");
}
}
Serial.print(" Status: ");
// check if the peer exists
bool exists = esp_now_is_peer_exist(peer_addr);
if(exists)
{
// Slave already paired.
Serial.println("Already Paired");
}
else
{
// Slave not paired, attempt pair
esp_err_t addStatus = esp_now_add_peer(peer);
if(addStatus == ESP_OK)
{
// Pair success
Serial.println("Pair success");
}
else if (addStatus == ESP_ERR_ESPNOW_NOT_INIT)
{
// How did we get so far!!
Serial.println("ESPNOW Not Init");
}
else if (addStatus == ESP_ERR_ESPNOW_ARG)
{
Serial.println("Add Peer - Invalid Argument");
}
else if (addStatus == ESP_ERR_ESPNOW_FULL)
{
Serial.println("Peer list full");
}
else if (addStatus == ESP_ERR_ESPNOW_NO_MEM)
{
Serial.println("Out of memory");
}
else if (addStatus == ESP_ERR_ESPNOW_EXIST)
{
Serial.println("Peer Exists");
}
else
{
Serial.println("Not sure what happened");
}
delay(1000);
}
}
}
else
{
// No slave found to process
Serial.println("No Slave found to process");
}
}
uint8_t data = 0; // wasnt here but copied from example
// send data
void sendData(uint8_t data)
{
for(int i = 0; i < slaveCount; i++)
{
const uint8_t *peer_addr = slaves[i].peer_addr;
if (i == 0)
{
// print only for first slave
Serial.print("Sending: ");
Serial.println(data);
}
esp_err_t result = esp_now_send(peer_addr, &data, sizeof(data));
Serial.print("Send Status: ");
if (result == ESP_OK) {
Serial.println("Success");
} else if (result == ESP_ERR_ESPNOW_NOT_INIT) {
// How did we get so far!!
Serial.println("ESPNOW not Init.");
} else if (result == ESP_ERR_ESPNOW_ARG) {
Serial.println("Invalid Argument");
} else if (result == ESP_ERR_ESPNOW_INTERNAL) {
Serial.println("Internal Error");
} else if (result == ESP_ERR_ESPNOW_NO_MEM) {
Serial.println("ESP_ERR_ESPNOW_NO_MEM");
} else if (result == ESP_ERR_ESPNOW_NOT_FOUND) {
Serial.println("Peer not found.");
} else {
Serial.println("Not sure what happened");
}
delay(100);
}
}
// callback when data is sent from Master to Slave
void onDataSent(const uint8_t *mac_addr, esp_now_send_status_t status)
{
char macStr[18];
sendTime = millis();
snprintf(macStr, sizeof(macStr), "%02x:%02x:%02x:%02x:%02x:%02x",
mac_addr[0], mac_addr[1], mac_addr[2], mac_addr[3], mac_addr[4], mac_addr[5]);
Serial.print("Last Packet Sent to: ");
Serial.println(macStr);
Serial.print("Last Packet Send Status: ");
Serial.println(status == ESP_NOW_SEND_SUCCESS ? "Delivery Success" : "Delivery Fail");
}
void setup()
{
Serial.begin(9600);
pinMode(PUSSY_PIN, INPUT);
//Set device in STA mode to begin with
// WiFi.mode(WIFI_MODE_STA);
WiFi.mode(WIFI_STA);
// This is the mac address of the Master in Station Mode
Serial.print("STA MAC: ");
Serial.println(WiFi.macAddress());
// Init ESPNow with a fallback logic
initESPNow();
// Once ESPNow is successfully Init, we will register for Send CB to
// get the status of Trasnmitted packet
esp_now_register_send_cb(onDataSent);
esp_now_register_recv_cb(onDataRecv);
scanForSlaves();
if(slaveCount > 0) {
manageSlaves();
} else {
// No slave found to process
}
}
// THE TASK -> just divide PUSSY_value (range [0,4095]) so that it fits
// into the range [0, 255] -> in essence: divide by 16.
// BECAUSE -> the range [0, 255] is what the function sendData()
// expects.
// the answer: PUSSY_value = PUSSY_value / 16;
// and then: sendData(PUSSY_value);
void loop()
{
PUSSY_value = analogRead(PUSSY_PIN) / 16;
Serial.println("Analog Read: " + String(PUSSY_value));
sendData(PUSSY_value);
}
//void loop()
//{
// PUSSY_value = analogRead(PUSSY_PIN);
//
// Serial.println("Analog Read: " + String(PUSSY_value));
//
//if(PUSSY_value > 0 && PUSSY_value < 200)
// {
//
// sendData(0);
// } else {
// }
//
//if(PUSSY_value > 200 && PUSSY_value < 1100)
// {
//
// sendData(1);
// } else {
//
//// sendData(PUSSY_value);
//// sendData(String(PUSSY_value));
//// delay(10);
//
// //could also do it like this ^
//
// }
//
// if(PUSSY_value > 1100 && PUSSY_value < 2000)
// {
// sendData(2);
// } else {
// }
//
//// if(PUSSY_value == 4095)
//// {
//// sendData(1);
//// }
//
// if(PUSSY_value > 2000 && PUSSY_value < 2900)
// {
// sendData(3);
// } else {
// }
//
//if(PUSSY_value > 2900 && PUSSY_value < 3800)
// {
// sendData(4);
// } else {
// }
//
// if(PUSSY_value > 3800 && PUSSY_value < 4700)
// {
// sendData(5);
// } else {
// }
//
//}
// callback when data is received from Slave to Master
void onDataRecv(const uint8_t *mac_add, const uint8_t *data, int data_len)
{
char macStr[18];
snprintf(macStr, sizeof(macStr), "%02x:%02x:%02x:%02x:%02x:%02x",
mac_add[0], mac_add[1], mac_add[2], mac_add[3], mac_add[4], mac_add[5]);
Serial.print("Last Packet Recv from: ");
Serial.println(macStr);
Serial.print("Last Packet Recv Data: ");
Serial.println(*data);
Serial.println("");
PUSStatus = *data;
}
#include
#include
/*
<< This Device Slave >>
Sample Serial log:
AP Config Success. Broadcasting with AP: Slave:3C:71:BF:52:D1:14
AP MAC: 3C:71:BF:52:D1:15
ESPNow Init Success
Last Packet Recv from: 24:0a:c4:0a:6f:08
Last Packet Recv Data: 1
*/
#include
#include
#define CHANNEL 1
#define SENDCHANNEL 1
#define WIFI_DEFAULT_CHANNEL 3
int val = 0; // set base value of PIR to 0
int PUSState = 0;
int solenoidPin = 18;
uint8_t PUSStatus = 0;
esp_now_peer_info_t peer;
void initESPNow();
void configDeviceAP();
void addPeer(uint8_t *peerMacAddress);
void onDataSent(const uint8_t *mac_addr, esp_now_send_status_t status);
void onDataRecv(const uint8_t *mac_addr, const uint8_t *data, int data_len);
void initESPNow()
{
WiFi.disconnect();
if (esp_now_init() == ESP_OK) {
Serial.println("ESPNow Init Success");
}
else
{
Serial.println("ESPNow Init Failed");
ESP.restart();
}
}
// config AP SSID
void configDeviceAP()
{
String Prefix = "SlaveL1:";
String Mac = WiFi.macAddress();
String SSID = Prefix + Mac;
String Password = "123456789";
bool result = WiFi.softAP(SSID.c_str(), Password.c_str(), CHANNEL, 0);
if (!result)
{
Serial.println("AP Config failed.");
}
else
{
Serial.println("AP Config Success. Broadcasting with AP: " + String(SSID));
}
}
void setup()
{
Serial.begin(9600); // 9600
pinMode(solenoidPin, OUTPUT);
digitalWrite(solenoidPin, LOW);
WiFi.mode(WIFI_AP);
configDeviceAP();
Serial.print("AP MAC: ");
Serial.println(WiFi.softAPmacAddress());
initESPNow();
esp_now_register_send_cb(onDataSent);
esp_now_register_recv_cb(onDataRecv);
}
// callback when data is recv from Master
void onDataRecv(const uint8_t *mac_addr, const uint8_t *data, int data_len)
{
char macStr[18];
snprintf(macStr, sizeof(macStr), "%02x:%02x:%02x:%02x:%02x:%02x",
mac_addr[0], mac_addr[1], mac_addr[2], mac_addr[3], mac_addr[4], mac_addr[5]);
// Serial.print("Last Packet Recv from: ");
// Serial.println(macStr);
// Serial.print("Last Packet Recv Data: ");
// Serial.println(*data);
// Serial.println("");
PUSStatus = *data;
}
void loop()
{
Serial.write((byte)PUSStatus);
delay(20);
}
// Add Master as a peer
void addPeer(uint8_t *peerMacAddress)
{
peer.channel = SENDCHANNEL;
peer.ifidx = WIFI_IF_AP;
peer.encrypt = 0;
memcpy(peer.peer_addr, peerMacAddress, 6);
esp_err_t addStatus = esp_now_add_peer(&peer);
if (addStatus == ESP_OK)
{
// Pair success
Serial.println("Pair success");
}
else if (addStatus == ESP_ERR_ESPNOW_NOT_INIT)
{
// How did we get so far!!
Serial.println("ESPNOW Not Init");
}
else if (addStatus == ESP_ERR_ESPNOW_ARG)
{
Serial.println("Add Peer - Invalid Argument");
}
else if (addStatus == ESP_ERR_ESPNOW_FULL)
{
Serial.println("Peer list full");
}
else if (addStatus == ESP_ERR_ESPNOW_NO_MEM)
{
Serial.println("Out of memory");
}
else if (addStatus == ESP_ERR_ESPNOW_EXIST)
{
Serial.println("Peer Exists");
}
else
{
Serial.println("Not sure what WENT WRONG");
}
}
// callback when data is sent from Master to Slave
void onDataSent(const uint8_t *mac_addr, esp_now_send_status_t status)
{
char macStr[18];
snprintf(macStr, sizeof(macStr), "%02x:%02x:%02x:%02x:%02x:%02x",
mac_addr[0], mac_addr[1], mac_addr[2], mac_addr[3], mac_addr[4], mac_addr[5]);
Serial.print("Last Packet Sent to: ");
Serial.println(macStr);
Serial.print("Last Packet Send Status: ");
Serial.println(status == ESP_NOW_SEND_SUCCESS ? "Delivery Success" : "Delivery Fail");
}
#include
#include
/*
<< This Device Slave >>
Sample Serial log:
AP Config Success. Broadcasting with AP: Slave:3C:71:BF:52:D1:14
AP MAC: 3C:71:BF:52:D1:15
ESPNow Init Success
Last Packet Recv from: 24:0a:c4:0a:6f:08
Last Packet Recv Data: 1
*/
#include
#include
#define CHANNEL 1
#define SENDCHANNEL 1
#define WIFI_DEFAULT_CHANNEL 3
int val = 0; // set base value of PIR to 0
int PUSState = 0;
int solenoidPin = 18;
uint8_t PUSStatus = 0;
esp_now_peer_info_t peer;
void initESPNow();
void configDeviceAP();
void addPeer(uint8_t *peerMacAddress);
void onDataSent(const uint8_t *mac_addr, esp_now_send_status_t status);
void onDataRecv(const uint8_t *mac_addr, const uint8_t *data, int data_len);
void initESPNow()
{
WiFi.disconnect();
if (esp_now_init() == ESP_OK) {
Serial.println("ESPNow Init Success");
}
else
{
Serial.println("ESPNow Init Failed");
ESP.restart();
}
}
// config AP SSID
void configDeviceAP()
{
String Prefix = "SlaveL1:";
String Mac = WiFi.macAddress();
String SSID = Prefix + Mac;
String Password = "123456789";
bool result = WiFi.softAP(SSID.c_str(), Password.c_str(), CHANNEL, 0);
if (!result)
{
Serial.println("AP Config failed.");
}
else
{
Serial.println("AP Config Success. Broadcasting with AP: " + String(SSID));
}
}
void setup()
{
Serial.begin(9600);
pinMode(solenoidPin, OUTPUT);
digitalWrite(solenoidPin, LOW);
WiFi.mode(WIFI_AP);
configDeviceAP();
Serial.print("AP MAC: ");
Serial.println(WiFi.softAPmacAddress());
initESPNow();
esp_now_register_send_cb(onDataSent);
esp_now_register_recv_cb(onDataRecv);
}
// callback when data is recv from Master
void onDataRecv(const uint8_t *mac_addr, const uint8_t *data, int data_len)
{
char macStr[18];
snprintf(macStr, sizeof(macStr), "%02x:%02x:%02x:%02x:%02x:%02x",
mac_addr[0], mac_addr[1], mac_addr[2], mac_addr[3], mac_addr[4], mac_addr[5]);
Serial.print("Last Packet Recv from: ");
Serial.println(macStr);
Serial.print("Last Packet Recv Data: ");
Serial.println(*data);
Serial.println("");
PUSStatus = *data;
}
void loop()
{
if (PUSStatus > 0 && PUSStatus < 51) {
digitalWrite(solenoidPin, HIGH);
delay(2000);
// digitalWrite(LEDpin, HIGH);
digitalWrite(solenoidPin, LOW);
delay(1000);
}
// if (PUSStatus > 51 && PUSStatus < 102) { // if PUSStatus > 1000 and < 2000
//
// digitalWrite(solenoidPin, HIGH);
// delay(1000);
//
// digitalWrite(solenoidPin, LOW);
// delay(500);
//
// }
//
// if (PUSStatus > 102 && PUSStatus < 153) {
//
// digitalWrite(solenoidPin, HIGH);
// delay(2000);
//
// digitalWrite(solenoidPin, LOW);
// delay(1000);
//
// }
//
// if (PUSStatus > 153 && PUSStatus < 204) {
//
// digitalWrite(solenoidPin, HIGH);
// delay(2000);
//
// digitalWrite(solenoidPin, LOW);
// delay(1000);
//
// }
//
// if (PUSStatus > 204 && PUSStatus < 255) {
//
// digitalWrite(solenoidPin, HIGH);
// delay(2000);
//
// digitalWrite(solenoidPin, LOW);
// delay(1000);
//
// }
}
//void loop()
// {
//
// if (PUSStatus == 1) {
//
// digitalWrite(solenoidPin, HIGH);
// delay(2000);
//
// // digitalWrite(LEDpin, HIGH);
//
// digitalWrite(solenoidPin, LOW);
// delay(1000);
//
// }
//
// if (PUSStatus == 2) { // if PUSStatus > 1000 and < 2000
//
// digitalWrite(solenoidPin, HIGH);
// delay(1000);
//
// digitalWrite(solenoidPin, LOW);
// delay(500);
//
// }
//
// if (PUSStatus == 3) {
//
// digitalWrite(solenoidPin, HIGH);
// delay(2000);
//
// digitalWrite(solenoidPin, LOW);
// delay(1000);
//
// }
//
//// if (PUSStatus == 4) {
//// digitalWrite(solenoidPin, HIGH);
//// delay(2000);
////
//// digitalWrite(solenoidPin, LOW);
//// delay(1000);
////
//// }
//
//// if (PUSStatus == 5) {
////
//// digitalWrite(solenoidPin, HIGH);
//// delay(2000);
////
//// digitalWrite(solenoidPin, LOW);
//// delay(1000);
////
//// }
//
//}
// Add Master as a peer
void addPeer(uint8_t *peerMacAddress)
{
peer.channel = SENDCHANNEL;
peer.ifidx = WIFI_IF_AP;
peer.encrypt = 0;
memcpy(peer.peer_addr, peerMacAddress, 6);
esp_err_t addStatus = esp_now_add_peer(&peer);
if (addStatus == ESP_OK)
{
// Pair success
Serial.println("Pair success");
}
else if (addStatus == ESP_ERR_ESPNOW_NOT_INIT)
{
// How did we get so far!!
Serial.println("ESPNOW Not Init");
}
else if (addStatus == ESP_ERR_ESPNOW_ARG)
{
Serial.println("Add Peer - Invalid Argument");
}
else if (addStatus == ESP_ERR_ESPNOW_FULL)
{
Serial.println("Peer list full");
}
else if (addStatus == ESP_ERR_ESPNOW_NO_MEM)
{
Serial.println("Out of memory");
}
else if (addStatus == ESP_ERR_ESPNOW_EXIST)
{
Serial.println("Peer Exists");
}
else
{
Serial.println("Not sure what WENT WRONG");
}
}
// callback when data is sent from Master to Slave
void onDataSent(const uint8_t *mac_addr, esp_now_send_status_t status)
{
char macStr[18];
snprintf(macStr, sizeof(macStr), "%02x:%02x:%02x:%02x:%02x:%02x",
mac_addr[0], mac_addr[1], mac_addr[2], mac_addr[3], mac_addr[4], mac_addr[5]);
Serial.print("Last Packet Sent to: ");
Serial.println(macStr);
Serial.print("Last Packet Send Status: ");
Serial.println(status == ESP_NOW_SEND_SUCCESS ? "Delivery Success" : "Delivery Fail");
}