Menu

Tree [r400] /
 History

HTTPS access


File Date Author Commit
 components 2021-09-14 dannybackx [r396] Local changes to
 libraries 2020-10-19 dannybackx [r338] Remove Arduino String from Oled as well.
 main 2021-10-03 dannybackx [r400] Add partitions file, required for large code pa...
 mobile 2020-04-10 dannybackx [r300] Add directory
 pcb 2018-08-19 dannybackx [r49] Add v1 of the PCB
 CMakeLists.txt 2021-10-03 dannybackx [r399] Replace legacy build configuration
 LICENSE 2018-08-19 dannybackx [r47] Add license file, remove pubsubclient
 Readme.md 2021-10-03 dannybackx [r398] Upgrade to esp-idf-v4.3 .
 config.json.sample 2020-10-24 dannybackx [r348] Add sample json configuration file (to be uploa...
 partitions-mine.csv 2021-10-03 dannybackx [r400] Add partitions file, required for large code pa...

Read Me

House alarm system based on ESP32

Copyright (c) 2017, 2018, 2019, 2020, 2021 by Danny Backx

This alarm system is designed to work with a bunch of similar controllers.
You can choose which hardware and capabilities go in each individual controller, and configure them accordingly.

The software needs a small amount of configuration to talk to the hardware.
With no configuration, the software will format a LittleFS partition, start an FTP server,
and you can use that to upload a file into /fs/config.json .

A sample content :

{ "name" : "prototype",
"haveOled" : true, "oledLedPin" : 5, "oledCSPin" : 17, "oledDCPin" : 16,
"run_ftp" : true, "ftp_user" : "me", "ftp_pass" : "myself",
"radioPin" : 22,
"sensors" :
{ "name" : "Hall motion", "id" : 0x00CD4FAA, "zone" : "secure" },
{ "name" : "Kitchen smoke", "id" : 0x004F55E8, "zone" : "always" },
{ "name" : "Upstairs smoke", "id" : 0x007DF9E8, "zone" : "always" }

}

It's obviously possible to turn off FTP to make the system less hackable, the flip side is that
recovery is harder.

This software should be built with ESP-IDF, the build environment recommended by Espressif.
Note : currently in the process of upgrading my environment to esp-idf-v4.3

Components required (you need to put these in components/) :
- arduino (https://github.com/espressif/arduino-esp32.git)
- littlefs (a simple filesystem superior to the well known spiffs, https://github.com/ARMmbed/littlefs.git)
- esp_littlefs (esp-idf integration for littlefs https://github.com/joltwallet/esp_littlefs.git)

Arduino libraries (these are already copied in libraries/) :
- TFT_eSPI (Bodmer's stuff with small changes)
- arduinojson
- rcswitch (optional, needed for radio hardware, e.g. for 433MHz sensors)
- rfid (optional)
- my own acmeclient (https://esp32-acme-client.sourceforge.io) (optional)
- QR code generation with the C version of https://www.nayuki.io/page/qr-code-generator-library (optional)

In the "make menuconfig -> Arduino", only the Arduino libraries ESP32, Wire and SPI are needed. Hence advice
to select "Include only specific Arduino libraries".

Hardware platform :
- ESP32 (esp8266 not supported any more)
- Some sensors with wireless RF communication
* https://www.aliexpress.com/item/Kerui-433MHz-Wireless-Intelligent-PIR-Sensor-Motion-Detector-For-GSM-PSTN-Security-Alarm-System-Auto-Dial/32566190623.html?spm=a2g0
s.9042311.0.0.04PnSB
* https://www.aliexpress.com/item/433MHz-Portable-Alarm-Sensors-Wireless-Fire-Smoke-Detector/32593947430.html?spm=a2g0s.9042311.0.0.04PnSB
- Keypads with touch displays
* https://www.aliexpress.com/item/1pcs-J34-F85-240x320-2-8-SPI-TFT-LCD-Touch-Panel-Serial-Port-Module-with-PCB/32795636902.html?spm=a2g0s.9042311.0.0.04PnSB
- RF receivers
* https://www.aliexpress.com/item/1set-2pcs-RF-wireless-receiver-module-transmitter-module-board-Ordinary-super-regeneration-433MHZ-DC5V-ASK-OOK/32606396563.html?spm
=a2g0s.9042311.0.0.04PnSB
- RFID card readers
* https://www.aliexpress.com/item/2pcs-lot-MFRC-522-RC522-RFID-Kits-S50-13-56-Mhz-With-Tags-SPI-Write-Read/32620671237.html?spm=a2g0s.9042311.0.0.tm7J7e
* https://www.aliexpress.com/item/PN532-NFC-RFID-Module-V3-Kits-Reader-Writer/32452824672.html?spm=a2g0s.9042311.0.0.XugjzW

I have a PCB design that can be used to build a controller module with minimal wiring.
See my project on easyeda.com, or the copy in pcb .
The v1 has one known bug : the radio data line should go to esp32 pin 27 instead of pin 22.

Note : you may need to set some parameters in "make menuconfig" to make this work
- CONFIG_SYSTEM_EVENT_TASK_STACK_SIZE=4304 (was 2304)
to prevent eventTask from running out of stack space
- CONFIG_FREERTOS_USE_TRACE_FACILITY=y if you want to be able to list the ESP32 tasks,
or their memory/stack usage
(menuconfig->Component config->FreeRTOS->Enable FreeRTOS trace facility)
- For mutual authentication to work (in WebServer.cpp and JsonServer.cpp) we need a patch
on esp-idf which is not yet in v4.3 at this time.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.