{"id":27245900,"url":"https://github.com/stargate01/smartpump-firmware","last_synced_at":"2026-05-15T18:33:41.185Z","repository":{"id":76774384,"uuid":"496169686","full_name":"StarGate01/smartpump-firmware","owner":"StarGate01","description":"Firmware for an off-grid water pumping system","archived":false,"fork":false,"pushed_at":"2022-05-31T14:05:28.000Z","size":43,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-11T13:03:06.167Z","etag":null,"topics":["arduino","lora","lorawan","smart-garden"],"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/StarGate01.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,"zenodo":null}},"created_at":"2022-05-25T09:42:40.000Z","updated_at":"2025-07-16T22:16:10.000Z","dependencies_parsed_at":null,"dependency_job_id":"9177af3f-0be9-4aef-b5fb-c45e811641c4","html_url":"https://github.com/StarGate01/smartpump-firmware","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/StarGate01/smartpump-firmware","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StarGate01%2Fsmartpump-firmware","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StarGate01%2Fsmartpump-firmware/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StarGate01%2Fsmartpump-firmware/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StarGate01%2Fsmartpump-firmware/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/StarGate01","download_url":"https://codeload.github.com/StarGate01/smartpump-firmware/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StarGate01%2Fsmartpump-firmware/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33074847,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-15T11:35:32.926Z","status":"ssl_error","status_checked_at":"2026-05-15T11:35:31.362Z","response_time":103,"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":["arduino","lora","lorawan","smart-garden"],"created_at":"2025-04-10T21:29:46.625Z","updated_at":"2026-05-15T18:33:41.161Z","avatar_url":"https://github.com/StarGate01.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# smartpump-firmware\n\nFirmware for an off-grid water pumping system\n\n## Hardware overview\n\n - Board: **CubeCell HTCC-AB02A ASR605x** (ARM Cortex M0+ \u0026 SX1262 LoRa)\n   - [Documentation](https://heltec.org/project/htcc-ab02a/)\n   - [Arduino implementation](https://github.com/HelTecAutomation/CubeCell-Arduino)\n\n - Pump and sensor interface: **CHRZ power-extender**\n   - [Documentation](https://github.com/StarGate01/power-extender)\n   - [Arduino library](https://registry.platformio.org/libraries/stargate01/power-extender)\n\n## Development setup\n\nInstall **Visual Studio Code** and the **PlatformIO** extension.\n\nCopy `include/NetworkConfiguration.h.example` to `include/NetworkConfiguration.h` and insert your [*The Things Network*](https://www.thethingsnetwork.org) configuration. \n\nEdit the `platformio.ini` file and change the `board_build.arduino.lorawan.region` to the correct frequency band for your country.\n\nAttach a serial monitor and read the Device EUI after a reset. Then set the device EUI in the TTN console, use OTAA and MAC 1.0.2 .\n\nUse the PlatformIO menu to compile and upload the code.\n\n## TTN configuration\n\n### Uplink Payload Formatter\n\n```javascript\nfunction decodeInt16(bytes, offset)\n{\n  return (((bytes[offset + 1] \u0026 0xFF) \u003c\u003c 8) | (bytes[offset] \u0026 0xFF));\n}\n\nfunction decodeFloat32(bytes, offset)\n{\n  var d = new DataView(new ArrayBuffer(4));\n  for(var i=0; i\u003c4; i++) d.setUint8(i, bytes[offset + i]);\n  return d.getFloat32(0, true);\n}\n\nfunction decodeUplink(input) \n{\n  return {\n    data: {\n      bytes: input.bytes,\n      id: input.bytes[0],\n      current: [\n        decodeFloat32(input.bytes, 1),\n        decodeFloat32(input.bytes, 5),\n        decodeFloat32(input.bytes, 9),\n        decodeFloat32(input.bytes, 13)\n      ],\n      adc: [\n        decodeFloat32(input.bytes, 17),\n        decodeFloat32(input.bytes, 21),\n        decodeFloat32(input.bytes, 25),\n        decodeFloat32(input.bytes, 29)\n      ]\n    },\n    warnings: [],\n    errors: []\n  };\n}\n```\n\n### Downlink Payload Formatter\n\n```javascript\nfunction encodeDownlink(input) {\n  var rel = 0;\n  if(input.data.relay[0] === true) rel |= 1;\n  if(input.data.relay[1] === true) rel |= 2;\n  if(input.data.relay[2] === true) rel |= 4;\n  if(input.data.relay[3] === true) rel |= 8;\n  return {\n    bytes: [ rel ],\n    fPort: 1,\n    warnings: [],\n    errors: []\n  };\n}\n\nfunction decodeDownlink(input) {\n  return {\n    data: {\n      bytes: input.bytes,\n      relay: [\n        input.bytes[0] \u0026 1, \n        input.bytes[0] \u0026 2,\n        input.bytes[0] \u0026 4,\n        input.bytes[0] \u0026 8\n      ]\n    },\n    warnings: [],\n    errors: []\n  };\n}\n```\n\n### Example uplink payload\n\n```json\n{\n  \"id\": 1,\n  \"current\": [1.0, 1.0, 1.0, 1.0],\n  \"adc\": [1.0, 1.0, 1.0, 1.0]\n}\n```\n\n### Example downlink payload\n\n```json\n{\n  \"relay\": [true, true, true, true]\n}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstargate01%2Fsmartpump-firmware","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstargate01%2Fsmartpump-firmware","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstargate01%2Fsmartpump-firmware/lists"}