{"id":20256387,"url":"https://github.com/daskycodes/bird_app","last_synced_at":"2025-10-12T00:07:39.336Z","repository":{"id":136827720,"uuid":"389937977","full_name":"daskycodes/bird_app","owner":"daskycodes","description":"An IoT Birdhouse with Elixir Nerves \u0026 Phoenix LiveView Components ","archived":false,"fork":false,"pushed_at":"2021-07-27T10:18:11.000Z","size":218,"stargazers_count":7,"open_issues_count":2,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-22T10:44:42.364Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://dev.to/dasky/an-iot-birdhouse-with-elixir-nerves-phoenix-liveview-components-5cb2","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/daskycodes.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2021-07-27T10:17:57.000Z","updated_at":"2025-02-03T21:48:50.000Z","dependencies_parsed_at":null,"dependency_job_id":"6f6fc1ed-909f-43f9-88ab-80583635b26f","html_url":"https://github.com/daskycodes/bird_app","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/daskycodes/bird_app","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daskycodes%2Fbird_app","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daskycodes%2Fbird_app/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daskycodes%2Fbird_app/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daskycodes%2Fbird_app/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/daskycodes","download_url":"https://codeload.github.com/daskycodes/bird_app/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daskycodes%2Fbird_app/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279009475,"owners_count":26084609,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-11T02:00:06.511Z","response_time":55,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2024-11-14T10:46:30.462Z","updated_at":"2025-10-12T00:07:39.281Z","avatar_url":"https://github.com/daskycodes.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Birdhouse\n\n![Birdhouse dashboard in action](https://dev-to-uploads.s3.amazonaws.com/i/odorqq05xell588pnc0s.png)\n\n## Hardware needed\n\nWe are using the following hardware for our birdhouse:\n\n- Raspberry Pi 3\n- Raspberry Pi Camera V2\n- A simple LED connected to GPIO Pin 18 and GND\n- A simple Servo motor connected to GPIO Pin 23, 5V and GND\n- A DHT22 Temperature/Humidity sensor connected to GPIO Pin 4, 3.3V and GND\n\n\n|       | GND | 3.3V | 5V | GPIO |\n|-------|-----|------|----|------|\n| DHT22 | x   | x    |    | 4    |\n| Servo | x   |      | x  | 23   |\n| LED   | x   |      |    | 18   |\n\n## Setup Elixir\nTo setup your development environment on either Mac, Linux or Windows head over to the official nerves documentation.\n\n[Installation](https://hexdocs.pm/nerves/installation.html)\n\n## Setup node.js\n\nWe do also need node.js for our UI.\n\n[asdf-nodejs](https://github.com/asdf-vm/asdf-nodejs)\n\n## Setup Project\n\n1. Prepare your Phoenix project to build JavaScript and CSS assets:\n\nThese steps only need to be done once.\n```bash\ncd bird_app_ui\nmix deps.get\nnpm install --prefix assets\n```\n\n2. Build your assets and prepare them for deployment to the firmware:\n\n```bash\n# Still in ui directory from the prior step.\n# These steps need to be repeated when you change JS or CSS files.\nnpm install --prefix assets --production\nnpm run deploy --prefix assets\nmix phx.digest\n```\n\n3. Change to the firmware app directory\n\n```bash\ncd ../bird_app_firmware\n```\n\n4. Specify your target and other environment variables as needed:\n\n```bash\nexport MIX_TARGET=rpi3\nexport MIX_ENV=dev\n\n# For the telegram bot functions\n# export TELEGRAM_BOT_TOKEN=bot_token\n# export TELEGRAM_CHAT_ID=chat_id\n# export TELEGRAM_CHAT_URL=chat_url\n#\n# If you're using WiFi:\n# export NERVES_NETWORK_SSID=your_wifi_name\n# export NERVES_NETWORK_PSK=your_wifi_password\n```\n\n5. Set up the config\n\nConfigure the hardware pins and the ssh keys you want to use\n\n```elixir\n# bird_app/bird_app_firmware/config/target.exs\n\n# ...\nconfig :bird_app_hardware,\n  led_pin: 18,\n  dht_pin: 4,\n  servo_pin: 23\n# ...\n\n# ...\nkeys =\n  [\n    Path.join([System.user_home!(), \".ssh\", \"id_rsa.pub\"]),\n    Path.join([System.user_home!(), \".ssh\", \"id_ecdsa.pub\"]),\n    Path.join([System.user_home!(), \".ssh\", \"id_ed25519.pub\"])\n  ]\n# ...\n```\n\n6. Get dependencies, build firmware, and burn it to a SD card:\n\n```bash\nmix deps.get\nmix firmware\nmix firmware.burn\n```\n\n7. Insert the SD card into your target board and connect the USB cable or otherwise power it on\n\n8. Wait for it to finish booting (5-10 seconds)\n\n9. Open a browser window on your host computer to http://nerves.local/ or ssh to the raspberry with `ssh nerves.local`\n\n10. Now whenever you update the code you can also deploy the update via ssh\n\n```bash\n#create new firmware\ncd bird_app_firmware\nmix deps.get\nmix firmware\nmix upload\n```\n\n\n## Ready for production?\n\nIf you are ready to deploy to a production environment set your MIX_ENV environment variable to prod\n\n```bash\nexport MIX_ENV=prod\n```\n\nAnd configure the domain and SSL configuration accordingly like in the following example:\n\n```elixir\n# bird_app/bird_app_firmware/config/target.exs\n\n# ...\nconfig :bird_app_ui, BirdAppUiWeb.Endpoint,\n  # Nerves root filesystem is read-only, so disable the code reloader\n  code_reloader: false,\n  http: [port: 80, protocol_options: [idle_timeout: :infinity]],\n  # Use compile-time Mix config instead of runtime environment variables\n  load_from_system_env: false,\n  # Start the server since we're running in a release instead of through `mix`\n  server: true,\n  url: [host: \"birdhouse.cam\", port: 443]\n# ...\n```\n\n```elixir\n# bird_app/bird_app_ui/config/prod.exs\n\n# ...\nconfig :bird_app_ui, BirdAppUiWeb.Endpoint,\n  cache_static_manifest: \"priv/static/cache_manifest.json\",\n  check_origin: [\"//*.birdhouse.cam\"],\n  live_reload: [\n    patterns: [\n      ~r\"priv/static/.*(js|css|png|jpeg|jpg|gif|svg)$\",\n      ~r\"priv/gettext/.*(po)$\",\n      ~r\"lib/bird_app_ui_web/(live|views)/.*(ex)$\",\n      ~r\"lib/bird_app_ui_web/templates/.*(eex)$\"\n    ]\n  ],\n  https: [\n    port: 443,\n    cipher_suite: :strong,\n    otp_app: :bird_app_ui,\n    keyfile: \"priv/crt.key\",\n    certfile: \"priv/crt.crt\",\n    cacertfile: \"priv/crt.ca-bundle\",\n    transport_options: [socket_opts: [:inet6]]\n  ]\n\nconfig :bird_app_ui, BirdAppUiWeb.Endpoint,\n  force_ssl: [hsts: true]\n# ...\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdaskycodes%2Fbird_app","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdaskycodes%2Fbird_app","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdaskycodes%2Fbird_app/lists"}