{"id":20118019,"url":"https://github.com/sifis-home/wp6_mobile_application_api","last_synced_at":"2026-05-13T03:02:31.402Z","repository":{"id":64832100,"uuid":"558226586","full_name":"sifis-home/wp6_mobile_application_api","owner":"sifis-home","description":"This repository is for a service application that allows the mobile application to initialize SIFIS-Home Smart Device. In addition, the repository is planned to have documentation for setting up demonstration Raspberry Pi.","archived":false,"fork":false,"pushed_at":"2023-06-22T13:04:49.000Z","size":690,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-02T19:49:35.938Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","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/sifis-home.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-10-27T06:07:56.000Z","updated_at":"2022-10-28T13:44:39.000Z","dependencies_parsed_at":"2025-03-02T19:41:54.680Z","dependency_job_id":"f1b21479-bdbe-4fc2-9c6a-1e7e46ea263f","html_url":"https://github.com/sifis-home/wp6_mobile_application_api","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/sifis-home/wp6_mobile_application_api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sifis-home%2Fwp6_mobile_application_api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sifis-home%2Fwp6_mobile_application_api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sifis-home%2Fwp6_mobile_application_api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sifis-home%2Fwp6_mobile_application_api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sifis-home","download_url":"https://codeload.github.com/sifis-home/wp6_mobile_application_api/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sifis-home%2Fwp6_mobile_application_api/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32965783,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-12T23:30:32.555Z","status":"online","status_checked_at":"2026-05-13T02:00:07.132Z","response_time":115,"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-13T19:09:10.816Z","updated_at":"2026-05-13T03:02:31.387Z","avatar_url":"https://github.com/sifis-home.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Smart Device Mobile API\n\n[![LICENSE][license badge]][license] [![Actions Status][actions badge]][actions] [![CodeCov][codecov badge]][codecov]\n\nThis repository is for a service application that allows the mobile application to initialize SIFIS-Home Smart Device. In addition, the repository is planned to have documentation for setting up demonstration Raspberry Pi.\n\n## Project folders\n\n* `debian` – Extra files for the Debian package\n* `docs` – Documentation, instructions, plans\n  * [Smart Device Mobile API](docs/Smart%20Device%20Mobile%20API.md) – Plans for Mobile API service and demo setup\n* `scripts` – Example scripts for each server command\n* `src` – Source files for the Mobile API library\n  * `bin` – Source files for server and device information generator\n\n* `static` – Static files served by the server\n* `tests` – Integration tests\n  * `scripts` – Testing scripts for checking that server runs them\n\n\n## Building\n\n**Note:** Server works only in Linux, and probably with the macOS.\n\nInstall [Rust](https://www.rust-lang.org/tools/install) development environment.\n\n```bash\n$ cd project_folder\n$ cargo build\n```\n\n## Run server\n\nServer requires `device.json` file to start. We can use `create_device_info` tool to do that. The tool can also create Qr code for the Mobile Application to know authorization key.\n\n```bash\n$ cargo run --bin=create_device_info -- --save-qr-code-svg code.svg \"Product name\"\n```\n\nWe can now start the server:\n\n```bash\n$ cargo run\n```\n\nThe API documentation is available from the server by opening the URL http://127.0.0.1:8000 with the web browser.\n\n# Cross Compiling\n\nFor users of Debian-based distributions, an alternative guide after the generic Linux guide.\n\n## Building for Raspberry Pi OS (64-bit) on any Linux\n\nWe have already added the following to the `.cargo/config.toml`\n\n```toml\n[build]\n\n# Raspberry Pi 4 64-bit\n[target.aarch64-unknown-linux-gnu]\nlinker = \"aarch64-none-linux-gnu-gcc\"\nstrip = { path = \"aarch64-none-linux-gnu-strip\" }\n```\n\nThis allows cross-compiling project for the 64-bit version of the Raspberry Pi OS. \n\n### Install standard library\n\nAssuming you already have a Rust development environment for the host system. Installing a standard library for our target system is easy as\n\n```bash\n$ rustup target add aarch64-unknown-linux-gnu\n```\n\n### Download GNU Toolchain\n\nWe need to install the correct version of the toolchain, which we can check by running the following command on Raspberry Pi:\n\n```bash\n$ gcc --version\ngcc (Debian 10.2.1-6) 10.2.1 20210110\nCopyright (C) 2020 Free Software Foundation, Inc.\nThis is free software; see the source for copying conditions.  There is NO\nwarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n```\n\nGo to [https://developer.arm.com/downloads/-/gnu-a](https://developer.arm.com/downloads/-/gnu-a) and download the toolchain that matches your host system and target system.\n\nFor us, the host system was **x86_64 Linux** and target system needed **10.2** version of the toolchain. Therefore we downloaded:\n `gcc-arm-10.2-2020.11-x86_64-aarch64-none-linux-gnu.tar.xz`\n\nDownload and uncompress the toolchain at the location of your choice.\n\n### Making package for Raspberry Pi OS\n\nWe use *cargo-deb* to create a Debian package for the Raspberry Pi OS. Install it with the following command, or skip it if you have it already.\n\n```bash\n$ cargo install cargo-deb\n```\n\nGive the following commands,  but change the first PATH to match your setup:\n\n```bash\n$ export PATH=$HOME/toolchains/gcc-arm-10.2-2020.11-x86_64-aarch64-none-linux-gnu/bin:$PATH\n$ export TARGET_CC=aarch64-none-linux-gnu-gcc\n$ export TARGET_AR=aarch64-none-linux-gnu-ar\n$ cargo deb --target=aarch64-unknown-linux-gnu\n```\n\nSee deploying instructions after Debian cross-compiling instructions\n\n\n\n\n----\n\n\n\n## Building for Raspberry Pi OS (64-bit) on Debian-based Distributions\n\n### Install standard library\n\nAssuming you already have a Rust development environment for the host system. Installing a standard library for our target system is easy as\n\n```bash\n$ rustup target add aarch64-unknown-linux-gnu\n```\n\n### Install cross building tools\n\nWe can install required tools with the command:\n\n```bash\n$ sudo apt install crossbuild-essential-arm64\n```\n\nWe need to modify the `.cargo/config.toml` file to match tool names.  We need to remove `none` from the *linker* and *strip* names.\n\n```toml\n[build]\n\n# Raspberry Pi 4 64-bit\n[target.aarch64-unknown-linux-gnu]\nlinker = \"aarch64-linux-gnu-gcc\"\nstrip = { path = \"aarch64-linux-gnu-strip\" }\n```\n\n### Making package for Raspberry Pi OS\n\nWe use *cargo-deb* to create a Debian package for the Raspberry Pi OS. Install it with the following command, or skip it if you have it already.\n\n```bash\n$ cargo install cargo-deb\n```\n\nGive the following commands,  but change the first PATH to match your setup:\n\n```bash\n$ export TARGET_CC=aarch64-linux-gnu-gcc\n$ export TARGET_AR=aarch64-linux-gnu-ar\n$ cargo deb --target=aarch64-unknown-linux-gnu\n```\n\n\n\n\n----\n\n\n\n## Deploying to Raspberry Pi\n\nCopy the Mobile API Server Debian package to the device, for example with scp:\n\n```bash\n$ scp target/aarch64-unknown-linux-gnu/debian/sifis-home-mobile-api_0.1.0_arm64.deb TARGET_DEVICE_ADDRESS:/home/developer\n```\n\nOn the target device run the following command to install the package:\n\n```bash\n$ sudo dpkg -i sifis-home-mobile-api_0.1.0_arm64.deb\n```\n\nCreate required device info with the command:\n\n```bash\n$ sudo create_device_info -s /home/developer/qr.svg \"My Device Name\"\n```\n\nThe command above also creates QR code image, which allows the mobile application to scan it for API key needed to use server endpoints.\n\nFinally start and enable the Mobile API Service:\n\n```bash\n$ sudo systemctl start mobile-api-server.service\n$ sudo systemctl enable mobile-api-server.service\n```\n\n\n\n\u003c!-- Links --\u003e\n\n[actions]: https://github.com/sifis-home/wp6_mobile_application_api/actions\n[codecov]: https://codecov.io/gh/sifis-home/wp6_mobile_application_api\n[license]: LICENSE\n\n\u003c!-- Badges --\u003e\n\n[actions badge]: https://github.com/sifis-home/wp6_mobile_application_api/workflows/mobile_api-ubuntu/badge.svg\n[codecov badge]: https://codecov.io/gh/sifis-home/wp6_mobile_application_api/branch/master/graph/badge.svg\n[license badge]: https://img.shields.io/badge/license-MIT-blue.svg\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsifis-home%2Fwp6_mobile_application_api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsifis-home%2Fwp6_mobile_application_api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsifis-home%2Fwp6_mobile_application_api/lists"}