You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
573 B

2 years ago
  1. // Summer School 2022
  2. // ESP32 test code for MQTT protocol using
  3. // a free MQTT broker by emqx
  4. // Gerardo Marx
  5. #include <WiFi.h>
  6. #include <PubSubClient.h>
  7. // WiFi configuration
  8. const char *ssid = "sedeam"; // WiFi name
  9. const char *password = "Sede@m2025"; // WiFi password
  10. WiFiClient espClient;
  11. void setup(){
  12. //serial communication
  13. Serial.begin(115200);
  14. WiFi.begin(ssid, password);
  15. while(WiFi.status() != WL_CONNECTED){
  16. delay(500);
  17. Serial.print("Connecting to ");
  18. Serial.println(ssid);
  19. }
  20. Serial.println("Connection done.");
  21. }
  22. void loop(){
  23. }