{"id":20091267,"url":"https://github.com/supersimple/drizzle","last_synced_at":"2025-05-06T03:31:08.644Z","repository":{"id":140738873,"uuid":"150125735","full_name":"supersimple/drizzle","owner":"supersimple","description":"Nerves based sprinkler controller","archived":false,"fork":false,"pushed_at":"2024-05-28T14:39:24.000Z","size":655,"stargazers_count":38,"open_issues_count":0,"forks_count":8,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-05-29T06:21:20.657Z","etag":null,"topics":["elixir","nerves-project"],"latest_commit_sha":null,"homepage":null,"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/supersimple.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":"2018-09-24T15:34:05.000Z","updated_at":"2024-05-28T14:39:28.000Z","dependencies_parsed_at":"2024-05-28T17:53:39.867Z","dependency_job_id":null,"html_url":"https://github.com/supersimple/drizzle","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/supersimple%2Fdrizzle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/supersimple%2Fdrizzle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/supersimple%2Fdrizzle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/supersimple%2Fdrizzle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/supersimple","download_url":"https://codeload.github.com/supersimple/drizzle/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224484213,"owners_count":17318926,"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","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":["elixir","nerves-project"],"created_at":"2024-11-13T16:29:23.030Z","updated_at":"2024-11-13T16:29:23.785Z","avatar_url":"https://github.com/supersimple.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"![logo](https://i.imgur.com/6kYR90I.png)\n\nDrizzle is a Nerves-based home sprinkler system.\nIt is designed to support up to 8 zones, and will automatically adjust watering\ntimes given local weather data.\nBy default, the watering times will increase gradually as the temperature reaches\na predetermined threshold (90ºF) and will decrease gradually based on recent and\nupcoming precipitation.\nThe system will also shut down when the temperature drops below a predetermined\nthreshold (40ºF). You also have the option to set \"Winter months\", which are\nmonths where the system will not run regardless of temperature.\n\n## You should know...\nI talked about this project at [Lonestar Elixir](https://www.youtube.com/watch?v=qklciKp7sD8) in 2019.\n\nThis repo hasnt been maintained in a while, so some things might not work (I think the darksky API shutdown in 2023, for instance.)\n\n## Configuration\n\nFor the system to work properly, you need to export some ENV variables. For weather forecasts, set the following:\n- `LATITUDE=\u003cyour local latitude\u003e`\n- `LONGITUDE=\u003cyour local longitude\u003e`\n- `DARKSKY_API_KEY=\u003cyour 32 character API key\u003e`\n_Weather forecasts are retrieved from Dark Sky. You can get a free API key at:\n[https://darksky.net/dev](https://darksky.net/dev)._\n\n## First boot\nWhen your device starts up *for its first time* it will need to know the SSID and passphrase (aka PSK, pre-shared key) for the wireless SSID its going to connect to (for weather updates for example). This process is done using the [VintageNetWizard](https://hexdocs.pm/vintage_net_wizard/readme.html), so this means you have to temporarily connect your mobile or laptop to the wireless access point named \"nerves_xxxxx\" (where xxxxx is an automatically generated ID for your nerves machine) and access a basic web portal to select your home network and provide its password. \n\nOnce you select a wireless network and provide the credentials, just double-check your entered the correct passphrase and click on `Complete without validation` button (as validation involves the AP dropping the connection to test connecting to your home router's AP and then reconnecting it back to the temporary AP later - so I find it error-prone and inconvenient).\n\nAfter the process is complete, the WiFi card will be automatically configured with the SSID and passphrase upon next boot-ups.\nThe device is now discoverable as `drizzle.local` (try pinging it!) and exposes an SSH server into the Erlang VM console: \n```\n$ ping drizzle.local\nPING drizzle.local (192.168.8.111) 56(84) bytes of data.\n64 bytes from 192.168.8.111 (192.168.8.111): icmp_seq=1 ttl=64 time=12.2 ms\n64 bytes from 192.168.8.111 (192.168.8.111): icmp_seq=2 ttl=64 time=6.41 ms\n^C\n--- drizzle.local ping statistics ---\n2 packets transmitted, 2 received, 0% packet loss, time 1002ms\nrtt min/avg/max/mdev = 6.407/9.304/12.201/2.897 ms\nekarak@ekarak-Latitude-7400:~$ ssh drizzle.local\nThe authenticity of host 'drizzle.local (192.168.8.111)' can't be established.\nRSA key fingerprint is SHA256:s6rDEVL9YH3LaEDRxRX4qStknwY3560Vs5wkQ4wQMmA.\nAre you sure you want to continue connecting (yes/no/[fingerprint])? yes\nWarning: Permanently added 'drizzle.local' (RSA) to the list of known hosts.\nInteractive Elixir (1.10.3) - press Ctrl+C to exit (type h() ENTER for help)\nThe Nerves.Runtime.Helpers have been removed. Use https://hex.pm/packages/toolshed instead.\niex(1)\u003e \n```\n\n## OTA firmware upgrades\n\nOnce you've pinged it succesfully you can leverage nerves_firmware_ssh mechanism to do OTA (over-the-air) firmware upgrades (so that you don't need to swap the microSD card in and out from your RPi), as follows:\n```sh\n# write out the firmware upload script (upload.sh), you only need this done once\n$ mix firmware.gen.script\n# generate firmware file\n$ mix firmware\n# run the upload script\n$ ./upload.sh drizzle.local ./_build/rpi3/rpi3_dev/nerves/images/drizzle.fw\n```\n\n## How It Works\n\n- Starts the weather data agent, which stores state for the previous 12 hours and next 24 hours of weather. Until the system has been online for 12 hours, your previous 12 hours will not be set.\n- Registers each of your zones with a corresponding GPIO pin on your device.\n- Initializes a schedule of todays events. (This will happen at midnight each day or whenever the schedule for today is empty.) This means starting up a genserver and loading it with the schedule from your config file.\n- Starts a recurring genserver that checks the weather each hour and updates the weather data agent.\n- Each minute the scheduler checks if there is a scheduled event for the current time. Events are either to activate or deactivate a zone. If an event is scheduled, the GPIO sends the correct signal to the relay board to fulfill the request.  \n\n## Targets\n\nNerves applications produce images for hardware targets based on the\n`MIX_TARGET` environment variable. If `MIX_TARGET` is unset, `mix` builds an\nimage that runs on the host (e.g., your laptop). This is useful for executing\nlogic tests, running utilities, and debugging. Other targets are represented by\na short name like `rpi3` that maps to a Nerves system image for that platform.\nAll of this logic is in the generated `mix.exs` and may be customized. For more\ninformation about targets see:\n\nhttps://hexdocs.pm/nerves/targets.html#content\n\n## Testing\nGetting Circuits.GPIO to work in stub mode is tricky, as it needs recompilation. You only need to recompile when you switch mix targets though:\n```sh\n$ rm -rf _build/\n$ MIX_ENV=\"test\" MIX_TARGET=\"host\" CIRCUITS_MIX_ENV=\"test\" mix test\n...\n```\n\nwhen done with testing, clean all build artifacts and recompile:\n```sh\n$ rm -rf _build/\n$ MIX_TARGET=\"rpi3\" mix firmware\n```\n\n## Getting Started\n\nTo start your Nerves app:\n  * `export MIX_TARGET=my_target` or prefix every command with\n    `MIX_TARGET=my_target`. For example, `MIX_TARGET=rpi3`\n  * Install dependencies with `mix deps.get`\n  * Create firmware with `mix firmware`\n  * Burn to an SD card with `mix firmware.burn`\n\n## Learn more\n\n  * Official docs: https://hexdocs.pm/nerves/getting-started.html\n  * Official website: http://www.nerves-project.org/\n  * Discussion Slack elixir-lang #nerves ([Invite](https://elixir-slackin.herokuapp.com/))\n  * Source: https://github.com/nerves-project/nerves\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsupersimple%2Fdrizzle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsupersimple%2Fdrizzle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsupersimple%2Fdrizzle/lists"}