use now esp32-C6

This commit is contained in:
Christophe Robillard 2025-12-18 18:21:09 +01:00
parent 9174987477
commit 352c005763

View file

@ -1,32 +1,26 @@
/* Pin layout used: /* Pin layout used:
* ----------------------------------------------------------------------------------------- * -----------------------------------------------------------------------------------------
* MFRC522 ESP8266 * MFRC522 ESP32C6
* Reader/PCD Feather Huzzah * Reader/PCD Feather
* Signal Pin Pin * Signal Pin Pin
* ----------------------------------------------------------------------------------------- * -----------------------------------------------------------------------------------------
* SPI SS 1 SDA(SS) SDA/4 * SPI SS 1 SDA(SS) SDA/4
* SPI SCK SCK 14 / SCK * SPI SCK SCK SCK
* SPI MOSI MOSI 13 / MOSI * SPI MOSI MOSI MOSI
* SPI MISO MISO 12 / MISO * SPI MISO MISO MISO
* *
*/ */
#include <WiFiManager.h> // https://github.com/tzapu/WiFiManager #include <WiFiManager.h> // https://github.com/tzapu/WiFiManager
#include <HTTPClient.h>
#include <ESP8266WiFi.h> // https://arduino-esp8266.readthedocs.io/en/latest/esp8266wifi/readme.html
#include <ESP8266HTTPClient.h>
#include <WiFiClientSecureBearSSL.h>
// #include "certs.h"
#include <MFRC522v2.h> // https://github.com/OSSLibraries/Arduino_MFRC522v2 #include <MFRC522v2.h> // https://github.com/OSSLibraries/Arduino_MFRC522v2
#include <MFRC522DriverSPI.h> #include <MFRC522DriverSPI.h>
#include <MFRC522DriverPinSimple.h> #include <MFRC522DriverPinSimple.h>
#include <MFRC522Debug.h> #include <MFRC522Debug.h>
#define LED_PIN 15 #define LED_PIN LED_BUILTIN
#define SS_PIN 4 #define SS_PIN SDA
#define SLEEP_DURATION 1 #define SLEEP_DURATION 1
MFRC522DriverPinSimple ss_1_pin(SS_PIN); // Configurable, take an unused pin, only HIGH/LOW required, must be different to SS 2. MFRC522DriverPinSimple ss_1_pin(SS_PIN); // Configurable, take an unused pin, only HIGH/LOW required, must be different to SS 2.
@ -76,13 +70,11 @@ void send_uid(char reader_uid[]) {
//if you get here you have connected to the WiFi //if you get here you have connected to the WiFi
Serial.println("connected...yeey :)"); Serial.println("connected...yeey :)");
} }
auto client = std::make_unique<BearSSL::WiFiClientSecure>();
client->setInsecure();
HTTPClient https; HTTPClient https;
Serial.print("[HTTPS] begin...\n"); Serial.print("[HTTPS] begin...\n");
// configure traged server and url // configure traged server and url
https.begin(*client, "https://mood.robiweb.net/rfid_tags"); // HTTP https.begin("https://mood.robiweb.net/rfid_tags"); // HTTP
https.addHeader("Content-Type", "application/json"); https.addHeader("Content-Type", "application/json");
// start connection and send HTTP header and body // start connection and send HTTP header and body