{"id":16971595,"url":"https://github.com/thomastjdev/nim_alarmsystem","last_synced_at":"2026-05-02T20:37:07.368Z","repository":{"id":87657428,"uuid":"99562971","full_name":"ThomasTJdev/nim_alarmsystem","owner":"ThomasTJdev","description":"Raspberry Pi alarm system with a main controller and a slave programmed in Nim","archived":false,"fork":false,"pushed_at":"2018-04-28T15:38:12.000Z","size":114,"stargazers_count":2,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-10-30T00:34:21.268Z","etag":null,"topics":["alarm","alarm-system","nim","nim-lang","raspberry-pi","rpi","rpi3","slack"],"latest_commit_sha":null,"homepage":null,"language":"Nim","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ThomasTJdev.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-08-07T09:49:05.000Z","updated_at":"2021-12-03T03:37:16.000Z","dependencies_parsed_at":"2023-03-12T09:30:58.342Z","dependency_job_id":null,"html_url":"https://github.com/ThomasTJdev/nim_alarmsystem","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ThomasTJdev/nim_alarmsystem","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThomasTJdev%2Fnim_alarmsystem","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThomasTJdev%2Fnim_alarmsystem/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThomasTJdev%2Fnim_alarmsystem/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThomasTJdev%2Fnim_alarmsystem/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ThomasTJdev","download_url":"https://codeload.github.com/ThomasTJdev/nim_alarmsystem/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThomasTJdev%2Fnim_alarmsystem/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32549384,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-02T19:18:06.202Z","status":"ssl_error","status_checked_at":"2026-05-02T19:16:21.335Z","response_time":132,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["alarm","alarm-system","nim","nim-lang","raspberry-pi","rpi","rpi3","slack"],"created_at":"2024-10-14T00:52:51.694Z","updated_at":"2026-05-02T20:37:07.342Z","avatar_url":"https://github.com/ThomasTJdev.png","language":"Nim","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# General\n__Program:__ Alarmsystem\n\n__Sub-program1:__ alarm\n\n__Sub-program2:__ alarm-slave\n\n\n# Description\nThis program is a alarm system for the Raspberry Pi programmed in Nim.\n\nThe program consist of 2 programs. 1 main program (the controller) and a slave. The controller package/folder is named 'alarm', while the slave package is named 'alarm-slave'. At the moment you have to manually add more slaves. Next release will include automatic adding of slaves.\n\n# Screenshots\n\n![log](screenshot/log.png)\n\n![arm](screenshot/arm.png)\n\n![disarm](screenshot/disarm.png)\n\n![users](screenshot/newuser.png)\n\n\n# Requirements\n## Install\n### Nim\nUse your packagemanager or visit https://nim-lang.org/install_unix.html and download the tarball with the newest Nim release.\n```\ncd into the unpacked Nim folder\nsh build.sh\nbin/nim c koch\n./koch tools\nln -s /home/pi/nim-0.17.0/bin/nim /usr/bin/nim\nln -s /home/pi/nim-0.17.0/bin/nimble /usr/bin/nimble\n```\n\n\n### Nimble\nNimble is part of the your newly installed Nim package. You need the following Nim libraries.\n- jester\n- bcrypt\n- slacklib\n- wiringPiNim\n\n```\ncd ~\nnimble install jester\nnimble install bcrypt\nnimble install slacklib\nnimble install wiringPiNim\n```\n ## Adjust\nAdjust `config-default.cfg` in __both__ the alarm-main and the alarm-slave folder.\n\nRename the `config-default.cfg` to `config.cfg`.\n\n## Raspberry Pi equipment\nRaspberry Pi:\n- Testet on Raspberry Pi 3\n- Raspbian Jessie 2017-07-05, kernel 4.9\n- WiFi connection\n- USB webcam\n\nThe controller (the pins is specified in the config):\n- Touchscreen (style.css uses 720x480)\n- PIR\n- Buzzer\n- LED (incl. 330 Ohm)\n\nThe slave (the pins is specified in the config):\n- Camera\n- Magnetic door contact\n\n## Optional\n\n### RPi-Cam-Web-Interface\nTo enable the camera for the slave 1 run:\n\n```\nssh pi@slave1(your local IP)\ncd ~\ngit clone https://github.com/silvanmelchior/RPi_Cam_Web_Interface.git\ncd RPi_Cam_Web_Interface\n./install.sh\n# If you choose another port than 8081, then adjust it in the config.cfg\n```\n\n### Slack integration\nThe alarm system is prepared for integration with a slack channel. You need to setup a slack app to communicate with and include your specifications in the `config.cfg`. \n\n#### Slack account\nGet a slack account (https://slack.com)\n\n#### Slack app\nYou need to build a slack app to communicate with.\n\n1) Create a new slack app (https://api.slack.com/apps/new)\n2) Add the permissions depending on your needs: Incoming webhooks, Slash commands, Permissions\n3) Install the app to your team\n4) Scopes: commands, incoming webhooks\n\nIn the command section, you need to add (text in the () is only information for you):\n* /arm (will arm the alarm)\n* /disarm (will disarm the alarm, if the correct password is provided. E.g. /disarm passwrod)\n* /log (return the last 10 entries in the log. You can specify the number of entries with /log 14)\n* /led (/led off = turns off the led, on:green = green is on, on:blue, on:red)\n* /buzzer (/buzzer on = turn on the buzzer, /buzzer off)\n* /pir (/pir password = turn the PIR off. For turning on again, disarm and arm)\n\n#### Router\nYou need to open the slackPort in your router to communicate with slack.\n\n### Remove mouse cursor\n\nOn the Raspberry pi:\n\n```\nsudo apt-get install unclutter\nnano ~/.config/lxsession/LXDE-pi/autostart\n# Add the line at the bottom:\n@unclutter -idle 0\n# Save and exit nano: Ctrl+o \u0026 Ctrl+x\n```\n\n### Chrome-browser\n- chromium (standard on the Raspbian Jessie)\n\nThe webpage on the main controller is loaded as a kiosk in the `main.nim`. Command for the chrome-browser is included in the config file. If another browser is prefeered, then remember to change the command. \n\nTo exit the kiosk with ssh `kill -9` or VNC with `Ctrl + W`.\n\n### Caddy \n- caddy\n\nWith caddy you can create a local webserver for jester (nim library). There is some GUI/loading problems, when accessing the alarm system on LAN network.\nRemember to adjust ressources/Caddyfile to your system.\n\n```\ncurl https://getcaddy.com | bash\nsudo caddy -conf ressouces/Caddyfile\n```\n\n### USB webcam\nE.g. PS EYE webcam.\n\nRun\n`arecord -l` and get the name. Change the alsa name in `startcamera.sh`.\n\n### Dashboard\nTo activated the twitter list view, go to https://dev.twitter.com/web/embedded-timelines and get your link. Insert them in `main.tmpl`.\n\n# How to run it\n\n## The controller\n\n1) Copy the folder `alarm-main` to the controller (your main raspberry pi)\n2) Open and adjust config-default.cfg and rename it to config.cfg (`nano config-default.cfg` \u0026 `mv config-default.cfg config.cfg`)\n3) Run `nim c -r compile.nim` to generate the sqlite database\n4) Run `nim c -d:ssl -d:release main.nim`\n5) To enable slack, compile with `-d:slackOn`\n6) To enable email notifications, compile with `-d:email`\nAccess interface over lan:\n7) Optional: Open and adjust the Caddyfile with the controllers LAN IP (`nano ressources/Caddyfile`)\n8) Run `./main` or `sudo ./main`\n\n## The slave\n\n1) Copy the folder `alarm-slave` to the slave\n2) Open and adjust config-default.cfg and rename it to config.cfg (`nano config-default.cfg` \u0026 `mv config-default.cfg config.cfg`)\n3) Run `nim c -d:release main.nim`\n4) Run `./main` or `sudo ./main`\n\n## Running\n\nIf kioskmode is disabled, then access the frontpage on the controllers touchscreen: `127.0.0.1:6001`\n\nIf kioskmode is on, chrome-browser will launch on the frontpage.\n\n# Auto run on boot\n\nTo enable auto run, include the following in .profile, crontab, init.d or somewhere else. Please notice, that Caddy needs sudo due to port assignment.\n\nBy using .profile as below, your Pi needs to autologin.\n```\nnano ~/.profile\n# Add the line below to the bottom of file on main controller\ncd /home/pi/Documents/rpi/alarm-main ; nohup ./main \u003e /dev/null 2\u003e\u00261\u0026\n```\n```\nnano ~/.profile\n# Add the line below to the bottom of file on slave\ncd /home/pi/Documents/rpi/alarm-slave ; nohup ./main \u003e /dev/null 2\u003e\u00261\u0026\n```\n\nCaddy (optional):\n```\nsudo nohup caddy -conf /home/user/rpi/alarm/ressources/Caddyfile \u003e /dev/null 2\u003e\u00261\u0026\n```\n\n## Errors on run on boot\n\nDue to import of config.cfg, you have to navigate to the folder before you can run the ./main.\n\n\n# Credit\n\nPassword hashing and salting - all credits to: https://github.com/nim-lang/nimforum","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthomastjdev%2Fnim_alarmsystem","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthomastjdev%2Fnim_alarmsystem","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthomastjdev%2Fnim_alarmsystem/lists"}