{"id":16533961,"url":"https://github.com/martindisch/weatherpi","last_synced_at":"2026-04-07T23:31:42.966Z","repository":{"id":75443233,"uuid":"115728977","full_name":"martindisch/WeatherPi","owner":"martindisch","description":"Basic weather station with AM2302 sensor, Raspberry Pi and Android app","archived":false,"fork":false,"pushed_at":"2018-09-13T11:44:30.000Z","size":364,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-12T07:58:04.958Z","etag":null,"topics":["am2302","android-app","erlang","python","raspberry-pi"],"latest_commit_sha":null,"homepage":"","language":"Erlang","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/martindisch.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-12-29T14:32:08.000Z","updated_at":"2024-05-31T00:40:19.000Z","dependencies_parsed_at":"2023-06-03T04:09:14.299Z","dependency_job_id":null,"html_url":"https://github.com/martindisch/WeatherPi","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/martindisch/WeatherPi","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/martindisch%2FWeatherPi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/martindisch%2FWeatherPi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/martindisch%2FWeatherPi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/martindisch%2FWeatherPi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/martindisch","download_url":"https://codeload.github.com/martindisch/WeatherPi/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/martindisch%2FWeatherPi/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31533823,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-07T16:28:08.000Z","status":"ssl_error","status_checked_at":"2026-04-07T16:28:06.951Z","response_time":105,"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":["am2302","android-app","erlang","python","raspberry-pi"],"created_at":"2024-10-11T18:16:18.139Z","updated_at":"2026-04-07T23:31:42.948Z","avatar_url":"https://github.com/martindisch.png","language":"Erlang","funding_links":[],"categories":[],"sub_categories":[],"readme":"# WeatherPi\nA simple weather station with the AM2302 temperature and humidity sensor, the\nRaspberry Pi and an Android app.\n\n## Description\nSome of the code is very specific to the particular use case it was written\nfor, but other parts can work independently and may be useful for other\nprojects.\n\nThe physical setup consists of two Raspberry Pi computers:\n* The sender is positioned in a relatively sheltered location outdoors and has\nthe sensor connected to its GPIO pins\n* The receiver, which is the base station and also acts as the server for the\nAndroid app\n\nThe receiver can be located anywhere, as long as it's also connected to the\nlocal area network. In the situation this was developed for, this connection is\nonly established via WiFi, which may not be turned on all the time. Therefore,\na significant portion of the code is dedicated to gracefully handling this\ncase.\n\nHow the different components of the system work together can be visualized\nlike this:\n![System architecture diagram](architecture.png)\n\nThe sender runs one process, which measures temperature and humidity every 5\nminutes and sends the data to the receiver. It expects an acknowledgement and\nif it doesn't receive it because the network broke, it will keep the\nmeasurements in a queue, to be sent again when the network is available.\n\nThe receiver runs three processes. One of them is the inets httpd server that\nis contacted by the Android app to receive measurements. When receiving a\nrequest, its ESI functions message the server process to get the requested\ndata. This process has the responsibility of holding an up-to-date collection\nof measurements at all times. As such, it reads previous measurements from file\non startup and receives new measurements from the receiver process. This final\nprocess is messaged new measurements by the sender, writes them to file and\nsends them to the server.\n\n## Installation\nFirst, you need to install a Python module by Adafruit that allows easy reading\nof values from the AM2302 sensor on the sender.\n```\n# Make sure you have all build tools\nsudo apt-get install build-essential python-dev\n# Get code\ngit clone https://github.com/adafruit/Adafruit_Python_DHT.git\ncd Adafruit_Python_DHT\n# Install module\nsudo python setup.py install\n# Run a test (with sensor connected to GPIO data pin 4)\npython examples/AdafruitDHT.py 2302 4\n# Delete no longer needed code\ncd ..\nsudo rm -r Adafruit_Python_DHT\n```\n\nAfter that, install Erlang on both machines if you don't have it already.\nOn a headless Pi, you might be interested in only installing the basics,\nwithout any GUI bloat.\n```\nsudo apt-get install erlang-base\n```\n\nProvided you also have the code of this project on both machines, you're good\nto go now.\n\n## Usage\nOn both the sender and receiver, inside the `WeatherPi/pi/` directory, run\n`make` to compile the Erlang code.\n\nOn the sender, run\n```\nerl -name sender@IPSENDER -setcookie 'weatherstation' -noshell\n```\nto start the Erlang node where the sender process will be spawned.\n\nOn the receiver, run\n```\nerl -name receiver@IPRECEIVER -setcookie 'weatherstation' -noshell -eval \\\n\"weather:start('sender@IPSENDER', \\\"4\\\").\"\n```\nto start the Erlang node for the receiver processes and begin execution.\n\nRemember to replace the placeholders with the internal IP addresses of the two\nmachines. You might want to start the nodes inside a terminal multiplexer to\nkeep them running in the background even if you close your session.\n\n## License\n[MIT License](LICENSE)\n\n## Libraries\nThis project was built with the following libraries, whose licenses can be\nfound in [LICENSE-3RD-PARTY](LICENSE-3RD-PARTY).\n* [Android Async Http Client](http://loopj.com/android-async-http/)\n* [MPAndroidChart](https://github.com/PhilJay/MPAndroidChart)\n* [Android Support Library](  \nhttps://developer.android.com/topic/libraries/support-library/index.html)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmartindisch%2Fweatherpi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmartindisch%2Fweatherpi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmartindisch%2Fweatherpi/lists"}