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:
* -----------------------------------------------------------------------------------------
* MFRC522 ESP8266
* Reader/PCD Feather Huzzah
* MFRC522 ESP32C6
* Reader/PCD Feather
* Signal Pin Pin
* -----------------------------------------------------------------------------------------
* SPI SS 1 SDA(SS) SDA/4
* SPI SCK SCK 14 / SCK
* SPI MOSI MOSI 13 / MOSI
* SPI MISO MISO 12 / MISO
* SPI SCK SCK SCK
* SPI MOSI MOSI MOSI
* SPI MISO MISO MISO
*
*/
#include <WiFiManager.h> // https://github.com/tzapu/WiFiManager
#include <ESP8266WiFi.h> // https://arduino-esp8266.readthedocs.io/en/latest/esp8266wifi/readme.html
#include <ESP8266HTTPClient.h>
#include <WiFiClientSecureBearSSL.h>
// #include "certs.h"
#include <HTTPClient.h>
#include <MFRC522v2.h> // https://github.com/OSSLibraries/Arduino_MFRC522v2
#include <MFRC522DriverSPI.h>
#include <MFRC522DriverPinSimple.h>
#include <MFRC522Debug.h>
#define LED_PIN 15
#define SS_PIN 4
#define LED_PIN LED_BUILTIN
#define SS_PIN SDA
#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.
@ -76,13 +70,11 @@ void send_uid(char reader_uid[]) {
//if you get here you have connected to the WiFi
Serial.println("connected...yeey :)");
}
auto client = std::make_unique<BearSSL::WiFiClientSecure>();
client->setInsecure();
HTTPClient https;
Serial.print("[HTTPS] begin...\n");
// 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");
// start connection and send HTTP header and body