esp32 lora sensor
1.0.0
ESP32, LORA 라디오가 장착 된 고대 고무 메이드 사서함 및 Closure Sensor가 장착 할 수 있습니다.
내 사서함이 그다지 가깝지 않아서 언제 열렸는지 알 수있는 방법을 원했습니다. 이 프로젝트는 사서함 도어가 열려/ 닫히는시기를 감지하기 위해 ESP32 W/ Contact 센서를 사용하고, LORA 라디오는 빠른 JSON 버스트를 보내고 문이 다시 열릴 때까지 깊게 잠을 자게됩니다.
메시지를 집어 들고 맨 끝에 무언가를 수행하려면 수신기가 필요합니다. 완료되면 여기에 링크 할 것입니다.
그것은 Acbrandao의 ESP32_mailbox 프로젝트에서 도어 상태 논리를 크게 빌리며 문지는 문 조건을 감지하기위한 약간의 개선 사항이 있습니다.
몇 가지만 필요합니다.
Platformio + VScode는 모든 라이브러리 종속성을 처리하므로 빌드 할 수 있어야합니다.
컴퓨터가 ESP32에서 칩셋을 인식하도록 CP210X 드라이버를 설치해야 할 것입니다.
선택적 으로이 설정을 조정하여 요구에 더 잘 어울릴 수 있습니다.
#define IS_DEBUG false // enable Serial.println statements
...
#define SYNCWORD 0xF3 // used to make sure our receiver only listens to our packets
...
// Mailbox config
#define PROJECT_NAME "rad-esp32-lora-sender" // What do we call this thing?
#define LED_ENABLED true // Turn on the on-board LED when transmitting status
#define MAX_OPENDOOR_TIME 30000 // default 30s in milliseconds how long to wait while door is open to consider it stuck open
#define MAX_STUCK_BOOT_COUNT 5 // If the door is stuck for more than x times let's switch to timer interrupt to save battery
#define TIMER_SLEEP_MICROSECS 1800 * 1000000 // when on timer interrupt how long to sleep in seconds * microseconds
// Define the contact closure input pin and initial state (Depends on your sensor - N/C or N/O )
gpio_num_t doorSensorPIN = GPIO_NUM_34; // GPIO for the contact closure
const int GPIO_DOOR_CLOSED_STATE = HIGH; // Default state when the reed and magnet are next to each other
저장, 빌드 및 배포. ?
나는 prs를 좋아한다 :)
이 프로젝트는 MIT 라이센스에 따라 라이센스가 부여됩니다. 자세한 내용은 License.md 파일을 참조하십시오.