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.

38 lines
787 B

  1. #define LOG_ENABLED
  2. #include <Arduino.h>
  3. #include <derfunke.h>
  4. #include <easywifi.h>
  5. #include <ota.h>
  6. // i like to put these two in another file, so that it's
  7. // not checked in git commits
  8. #define SSID "some_ssid"
  9. #define PASSWD "some_password"
  10. void setup() {
  11. Serial.begin(115200);
  12. while(!Serial) ;
  13. // welcome serial output header
  14. df_header_print();
  15. // we need to be connected to wifi for OTA to
  16. // initialize properly
  17. if( wifi_connect_as_client(SSID, PASSWD) ) {
  18. wifi_print_mode();
  19. wifi_print_ip();
  20. } else {
  21. Serial.print("Failed to connect to wifi ");
  22. Serial.print( SSID );
  23. Serial.println();
  24. }
  25. // this is the name the device will take as an OTA port
  26. ota_init("racoon");
  27. }
  28. void loop() {
  29. ota_loop();
  30. delay(100); // chill for a bit
  31. }