This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <WiFi.h> | |
| #include <WebServer.h> | |
| #include <DNSServer.h> | |
| #include <DHT.h> | |
| #include <math.h> | |
| // ─── Pin Definitions ─────────────────────────────────── | |
| #define DHTPIN 4 | |
| #define DHTTYPE DHT11 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // subscriber.js | |
| // Connects to AWS IoT Core and listens for messages on a topic. | |
| // | |
| // SETUP: | |
| // npm install aws-iot-device-sdk-v2 | |
| // Place your certs in ./certs/ and set ENDPOINT below. | |
| const { iot, mqtt } = require("aws-iot-device-sdk-v2"); | |
| const path = require("path"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // publisher.js | |
| // Connects to AWS IoT Core and publishes a simulated sensor message every 5 seconds. | |
| // | |
| // SETUP: | |
| // npm install aws-iot-device-sdk-v2 | |
| // Place your certs in ./certs/ and set ENDPOINT below. | |
| const { iot, mqtt } = require("aws-iot-device-sdk-v2"); | |
| const path = require("path"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // combined.js | |
| // Single connection that both publishes and subscribes to AWS IoT Core. | |
| // Useful for testing or bidirectional device communication. | |
| // | |
| // SETUP: | |
| // npm install aws-iot-device-sdk-v2 | |
| // Place your certs in ./certs/ and set ENDPOINT below. | |
| const { iot, mqtt } = require("aws-iot-device-sdk-v2"); | |
| const path = require("path"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from awsiot import mqtt5_client_builder | |
| from awscrt import mqtt5 | |
| import threading, time | |
| aws_endpoint = 'your-aws-endpoint' | |
| cert_path = r"C:\Users\ASUS\certs\Device-Certificate.crt" | |
| private_key = r"C:\Users\ASUS\certs\Private.key" | |
| client_id = 'node3-pc' | |
| TIMEOUT = 100 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import json | |
| import threading | |
| from awscrt import mqtt5 | |
| from awsiot import mqtt5_client_builder | |
| # --- Configuration --- | |
| ENDPOINT = "your-aws-endpoint" | |
| CLIENT_ID = "node3-pc" | |
| PATH_TO_CERT = r"C:\Users\ASUS\certs\Device-Certificate.crt" | |
| PATH_TO_KEY = r"C:\Users\ASUS\certs\Private.key" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include "secrets.h" | |
| #include <WiFiClientSecure.h> | |
| #include <PubSubClient.h> | |
| #include <ArduinoJson.h> | |
| #include "WiFi.h" | |
| #define AWS_IOT_PUBLISH_TOPIC "node1/pub" | |
| #define AWS_IOT_SUBSCRIBE_TOPIC "node3/pub" | |
| WiFiClientSecure net = WiFiClientSecure(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //inishalize all servo motor | |
| #include <Servo.h> | |
| Servo doorServo; // Declare door servo | |
| Servo fingerServo1; | |
| Servo fingerServo2; | |
| Servo fingerServo3; | |
| Servo fingerServo4; | |
| Servo fingerServo5; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* ESP32 BLE Client (Receiver) Example with Keypad Notification and LED Logic */ | |
| #include <BLEDevice.h> | |
| static BLEUUID serviceUUID("4fafc201-1fb5-459e-8fcc-c5c9c331914b"); | |
| static BLEUUID charUUID("beb5483e-36e1-4688-b7f5-ea07361b26a8"); | |
| static boolean doConnect = false; | |
| static boolean connected = false; | |
| static boolean doScan = false; | |
| static BLERemoteCharacteristic *pRemoteCharacteristic; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <BLEDevice.h> | |
| #include <BLEUtils.h> | |
| #include <BLEServer.h> | |
| #include <Keypad.h> | |
| #include <Wire.h> | |
| #include <LiquidCrystal_I2C.h> | |
| #define SERVICE_UUID "4fafc201-1fb5-459e-8fcc-c5c9c331914b" | |
| #define CHARACTERISTIC_UUID "beb5483e-36e1-4688-b7f5-ea07361b26a8" |
NewerOlder