Cactus Micro r2 data exchange

Hello.
As I wrote in other topics and I’m just starting with Arduino (and Cactus Micro) and I’d like to have some help.
Struggling a lot, I could connect CactusMicro to my network with this code:

#include < espduino.h >

#define PIN_ENABLE_ESP 13
#define SSID  "*****"
#define PASS  "******"

ESP esp(&Serial1, &Serial, PIN_ENABLE_ESP);

boolean wifiConnected = false;

void setup() {
  Serial1.begin(19200);
  Serial.begin(19200);
  esp.enable();
  delay(500);
  esp.reset();
  delay(500);
  while(!esp.ready());


  /*setup wifi*/
  Serial.println("ARDUINO: setup wifi");
  esp.wifiConnect(SSID, PASS);

  Serial.println("ARDUINO: system started");
}

void loop() {
  esp.process();
  
  if(wifiConnected) {
  }
}

I’d like to use the CactusMicro board as a wifi door-sensor (a switch connected to a digital pin) and the idea is to send an email when the door state changes. I tried with IFTTT with no result. I don’t like anyway to use an external service and I’d like to use a Window10 tablet to send the email (through a VB program). Is it possible to send the state of the switch (when it changes) from the CactusMicro to Win10? Does anybody have an idea?

Thanks a lot

I think you can try the sketch mqtt.ino. A basic idea is,

  • Install a MQTT broker service at your win10
  • Cactus Micro publish the state of the switch to MQTT broker
  • You write a mqtt client script to get the state and send email

Very nice idea, thank you! I don’t know what you are talking about but I’ll search informations on google and I’ll try to understand it. Thanks again