{"id":22083194,"url":"https://github.com/refactor-group/ambi_client_cpp","last_synced_at":"2025-06-12T10:04:06.456Z","repository":{"id":43776271,"uuid":"453162757","full_name":"refactor-group/ambi_client_cpp","owner":"refactor-group","description":"A C++ implementation of the Edge IoT sensor framework for Particle Argon.","archived":false,"fork":false,"pushed_at":"2023-06-21T03:39:09.000Z","size":36,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-01-29T04:43:58.383Z","etag":null,"topics":["cpp","iot","iot-device"],"latest_commit_sha":null,"homepage":"","language":"C++","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/refactor-group.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":"2022-01-28T17:46:44.000Z","updated_at":"2022-02-20T19:31:19.000Z","dependencies_parsed_at":"2024-11-07T12:28:33.785Z","dependency_job_id":"7501f83a-28cd-44eb-83ca-5702143f6f1b","html_url":"https://github.com/refactor-group/ambi_client_cpp","commit_stats":null,"previous_names":["refactor-group/ambi_client_cpp"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/refactor-group%2Fambi_client_cpp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/refactor-group%2Fambi_client_cpp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/refactor-group%2Fambi_client_cpp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/refactor-group%2Fambi_client_cpp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/refactor-group","download_url":"https://codeload.github.com/refactor-group/ambi_client_cpp/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245170369,"owners_count":20572055,"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":["cpp","iot","iot-device"],"created_at":"2024-12-01T00:11:10.349Z","updated_at":"2025-03-23T21:23:45.027Z","avatar_url":"https://github.com/refactor-group.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Ambi Client (C++)\n\nAn Edge IoT ambient room environment sensor implementation for a [Particle Argon](https://docs.particle.io/argon/) based on the [Particle IoT Air Quality Monitoring Kit](https://store.particle.io/products/air-quality-monitoring-kit-wi-fi).\n\nThis client pairs with and pushes readings to a [Ambi web backend instance](https://github.com/Jim-Hodapp-Coaching/ambi).\n\n## Compiling this firmware using the Particle CLI\n\nWhen you're ready to compile this firmware, make sure you have the [Particle CLI installed](https://docs.particle.io/tutorials/developer-tools/cli/) and also make sure you have the Particle Argon device target selected and run `particle compile \u003cplatform\u003e` in the CLI. Note: if you're on an Arm-based Mac, the default Particle CLI install doesn't seem to work right. Work around this by doing a more manual install by running `sudo npm install -g particle-cli`.\n\nAlso make sure that you have an account registered with the Particle cloud and you've logged in using `particle setup`.\n\nTo build:\n`particle compile argon --saveTo ambi_client_cpp.bin`\n\nIf building succeeds, you'll see output similar to:\n\n```\nCompiling code for argon\n\nIncluding:\n    src/air_purity_sensor.h\n    src/base_sensor.h\n    src/dust_sensor.h\n    src/http_client.h\n    src/humidity_sensor.h\n    src/pressure_sensor.h\n    src/temperature_sensor.h\n    src/sensorchi.ino\n    src/air_purity_sensor.cpp\n    src/base_sensor.cpp\n    src/dust_sensor.cpp\n    src/http_client.cpp\n    src/humidity_sensor.cpp\n    src/pressure_sensor.cpp\n    src/sensorchi.cpp\n    src/temperature_sensor.cpp\n    project.properties\n\nattempting to compile firmware\ndownloading binary from: /v1/binaries/621006549bdb2a2cea6cc276\nsaving to: ambi_client_cpp.bin\nMemory use:\n   text    data     bss     dec     hex filename\n  34080     128    2324   36532    8eb4 /workspace/target/workspace.elf\n\nCompile succeeded.\nSaved firmware to: /Users/jhodapp/Projects/cpp/ambi_client_cpp/ambi_client_cpp.bin\n```\n\nThe following files in project folder will be sent to the cloud-hosted compile service:\n\n- Everything in the `/src` folder, including the `.ino` application file\n- The `project.properties` project definition file\n- All libraries stored under `lib/\u003clibraryname\u003e/src`\n\n## Flashing firmware onto Argon target device\n\nTo flash your intended Particle Argon target device with the built firmware, first identify the name of the device registered to the Particle cloud by listing all devices:\n\n`particle list`\n\nYou should see a list similar to:\n\n```\nambi1 [e00fce68834a01fd162abace] (Argon) is online\nambi2 [e00fce68d002c229a830d87f] (Argon) is offline\n  Functions:\n    int digitalread (String args) \n    int digitalwrite (String args) \n    int analogread (String args) \n    int analogwrite (String args) \n```\n\nNote: in this example each target already has a specific name (e.g. ambi1) because it was changed via the Particle mobile app. By default you'll have a more generic device target name if using a new Argon from the factory.\n\nNow flash the firmware to your particle device target like so:\n\n`particle flash ambi1 ambi_client_cpp.bin`\n\nNote: again, make sure you replace `ambi1` with your particular device name.\n\n*If for some reason over-the-air (OTA) flashing fails, you can flash over USB like so:*\n\n`particle flash --usb ambi_client_cpp.bin`\n\n# Changing the firmware to point to your Ambi instance\n\nAn important step is to make sure that the firmware points to the local IP address of your Ambi web backend. To do that, open the source file `src/sensorchi.ino` and change one or both of the byte arrays `dev_server` or `prod_server`. Note: at this time, full domain or hostnames are not supported and is future work to improve this firmware once Ambi is fully cloud-hosted.\n\nAlso make sure that if you're using a the `dev_server` IP address that `#define DEV` is left defined. If you want to use `prod_server`, then just comment out the line `#define DEV`.\n\nNow rebuild and reflash your firmware with it pointing to your local Ambi instance. One tip is to either dedicate a small computer like a Raspberry Pi to host the Ambi backend, or host it in a VM or bare on your development computer. Set your WiFi router to always issue your Ambi host the same IP address based on its MAC address. This way you won't have to keep changing the dev/prod IP address.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frefactor-group%2Fambi_client_cpp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frefactor-group%2Fambi_client_cpp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frefactor-group%2Fambi_client_cpp/lists"}