{"id":18604779,"url":"https://github.com/avsystem/anjay-pico-client","last_synced_at":"2025-11-02T11:30:24.322Z","repository":{"id":64782476,"uuid":"549022093","full_name":"AVSystem/Anjay-pico-client","owner":"AVSystem","description":"Anjay Raspberry Pi Pico W samples and integration layer","archived":false,"fork":false,"pushed_at":"2024-05-24T09:36:47.000Z","size":1210,"stargazers_count":2,"open_issues_count":0,"forks_count":2,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-12-26T23:41:50.591Z","etag":null,"topics":["cloud","embedded","iot","lwm2m-client","pico-w","raspberry-pi","raspberry-pi-pico-w"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AVSystem.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-10-10T14:51:36.000Z","updated_at":"2024-11-28T14:11:25.000Z","dependencies_parsed_at":"2022-12-15T00:02:17.081Z","dependency_job_id":null,"html_url":"https://github.com/AVSystem/Anjay-pico-client","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AVSystem%2FAnjay-pico-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AVSystem%2FAnjay-pico-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AVSystem%2FAnjay-pico-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AVSystem%2FAnjay-pico-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AVSystem","download_url":"https://codeload.github.com/AVSystem/Anjay-pico-client/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239394720,"owners_count":19631121,"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":["cloud","embedded","iot","lwm2m-client","pico-w","raspberry-pi","raspberry-pi-pico-w"],"created_at":"2024-11-07T02:18:58.360Z","updated_at":"2025-11-02T11:30:24.266Z","avatar_url":"https://github.com/AVSystem.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Anjay Raspberry Pico W Client\n## Overview\nThis repository contains a LwM2M Client application example for Raspberry Pico devices, based on the open-source [Anjay](https://github.com/AVSystem/Anjay) library and [Raspberry Pi Pico SDK](https://github.com/raspberrypi/pico-sdk).\n\n## Examples\n\nExample applications refer to [Anjay Basic Client Tutorial](https://avsystem.github.io/Anjay-doc/BasicClient.html) and can guide through the creation of a basic LwM2M Client based on Anjay library step by step.\n\nApplication|Description|Reference\n---|---|---\n[Anjay Initialization](anjay_init)|A minimum build environment for example client|[doc link](https://avsystem.github.io/Anjay-doc/BasicClient/BC-Initialization.html)\n[Firmware Update](firmware_update)|Firmware Update object implementation. See [firmware update README](firmware_update/README.md) for more information|[doc link](https://avsystem.github.io/Anjay-doc/FirmwareUpdateTutorial.html)\n[Mandatory Objects](mandatory_objects)|Mandatory LwM2M Objects necessary for setting up a connection with a server and an implementation of custom Anjay event loop|[doc link](https://avsystem.github.io/Anjay-doc/BasicClient/BC-MandatoryObjects.html)\n[Secure Communication](secure_communication)|Secure communication using PSK mode\u003cbr\u003eNote: randomness source does not meet requirements of security systems, see [comments in the code](secure_communication/main.c#L2)|[doc link](https://avsystem.github.io/Anjay-doc/BasicClient/BC-Security.html)\n[Temperature Object with DS18B20](temperature_object_ds18b20)|Example Temperature Sensor object implementation using DS18B20|[doc link](https://avsystem.github.io/Anjay-doc/AdvancedTopics/AT-IpsoObjects.html)\n[Temperature Object with MPL3115A2](temperature_object_mpl3115a2)|Example Temperature Sensor object implementation using Adafruit MPL3115A2|[doc link](https://avsystem.github.io/Anjay-doc/AdvancedTopics/AT-IpsoObjects.html)\n\n## Compiling and launching\n\n### Required tools\n\nTo compile and use the application, you will need some tools.\n\n#### Ubuntu\n\n```\nsudo apt install python3 cmake minicom gcc-arm-none-eabi libnewlib-arm-none-eabi libstdc++-arm-none-eabi-newlib\n```\n\n#### macOS\n\n```\nbrew install python3 cmake minicom armmbed/formulae/arm-none-eabi-gcc\n```\n\n#### Fedora\n\n```\nsudo dnf install python3 cmake minicom arm-none-eabi-newlib arm-none-eabi-gcc-cs-c++ arm-none-eabi-gcc-cs arm-none-eabi-binutils-cs gcc-arm-linux-gnu gcc-c++-arm-linux-gnu gcc gcc-c++\n```\n\n#### Windows\nDownload and install the following tools and programs:\n * [git for Windows](https://gitforwindows.org/) preferably with git Bash for unix-like shell and commands compatibility\n * [GNU Arm Embedded Toolchain](https://developer.arm.com/downloads/-/gnu-rm)\n * [MinGW](https://sourceforge.net/projects/mingw/) with `mingw32-base` and `mingw32-gcc-g++` packages\n * [CMake](https://cmake.org/download/)\n * [Python](https://www.python.org/downloads/windows/)\n\n### Aditional dependencies\n\n[Firmware Update](firmware_update) application requires the following `python`\npackages for the SHA256 calculation and AES ECB image encryption: `argparse`,\n`pycryptodome`.\n\n### Setting up the workspace\n\nIn order to successfully build the client, you need Raspberry Pi Pico SDK and FreeRTOS kernel cloned into a base directory, parallel to this repository. Creating a workspace from scratch could look like this:\n```\nmkdir pico\ncd pico\ngit clone -b 1.5.1 https://github.com/raspberrypi/pico-sdk.git\ncd pico-sdk/ \ngit submodule update --init \ncd ..\ngit clone -b V10.5.0 https://github.com/FreeRTOS/FreeRTOS-Kernel.git\ngit clone https://github.com/AVSystem/Anjay-pico-client.git --recursive\n```\nYour final working tree should look like this:\n```\n$ ls -1\nAnjay-pico-client\nFreeRTOS-Kernel\npico-sdk\n```\n\n### Compiling\n\nGo to the `Anjay-pico-client` repository and build the project with `\u003cssid\u003e` and `\u003cpass\u003e` replaced with your WiFi name and password respectively. LwM2M Client Endpoint Name is also configured by `\u003cendpoint_name\u003e` parameter.\n* **NOTE:** If you're using Windows, add `-G \"MinGW Makefiles\"` at the end of the first cmake command. It will help generate the proper files.\n```\ncd Anjay-pico-client\nmkdir build\ncd build\ncmake -DCMAKE_BUILD_TYPE=Debug -DWIFI_SSID=\"\u003cssid\u003e\" -DWIFI_PASSWORD=\"\u003cpass\u003e\" -DENDPOINT_NAME=\"\u003cendpoint_name\u003e\" ..\ncmake --build . -j\n```\n\nWhen building examples with security enabled (Secure Communication and Temperature Object), you need to provide PSK Identity and Key (by replacing `\u003cidentity\u003e` and `\u003cpsk\u003e` respectively with values entered in [Coiote LwM2M Server](#connecting-to-the-lwm2m-server)).\n```\ncmake -DCMAKE_BUILD_TYPE=Debug -DWIFI_SSID=\"\u003cssid\u003e\" -DWIFI_PASSWORD=\"\u003cpass\u003e\" -DENDPOINT_NAME=\"\u003cendpoint_name\u003e\" -DPSK_IDENTITY=\"\u003cidentity\u003e\" -DPSK_KEY=\"\u003cpsk\u003e\" .. \ncmake --build . -j\n```\n\nThis should generate directories named after examples that contain, among others, files with `.uf2` and `.hex` extensions. `.uf2` files can be programmed through the bootloader and `.hex` are for programming using a debugger and SWD connection.\n\n### GitHub Codespaces\nA [Codespaces](https://docs.github.com/en/codespaces/overview) is a development\nenvironment that's hosted in the cloud which allows you to work on your project\nusing a browser-based IDE on any computer. The repository is already set up to\nbe run on GitHub Codespaces. To run codespaces on this repository click the\n`Create codespace on master` options.\n\n![Codespaces button](.devcontainer/Codespaces_button.png)\n\nThe first startup usually takes a few\nminutes during which the Docker container with the required dependencies is\ninstalled (check the `.devcontainer/Docker` file). After the first system\ninitialization, the `.devcontainer/post_create.sh` script is run, which\ninstalls the dependent repositories (section [Setting up the\nworkspace](#setting-up-the-workspace)).\n\nOnce the system is ready, we can proceed to build the project according to the\n[Compiling](#compiling) section. We can download the resulting `.uf2` file to\nour computer by right-clicking on it and selecting `Download`. Codespaces\nimages created by you are visible from the project space and from your GitHub\naccount (`Codespaces` tab). All changes you make while working on the code are\nsaved.\n\n### Flashing\nTo program using the bootloader, press `BOOTSEL` button while connecting Raspberry Pi Pico W through a USB cable. It should be recognized then as a Mass Storage device, where you can copy the `.uf2` file, Pico will be programmed, reset and start running the code.\n\n### Serial output\nSerial port output is directed to the USB interface. Once a flashed Pico W board is connected to the computer, it should appear as `/dev/tty` (Unix) or as a `COM` (Windows) serial device. Logs can be seen by opening any serial communication program (e.g. `minicom` or `PuTTy`) and connecting to the device with baudrate 115200. On Unix system it can be done e.g. by executing\n```\nminicom -b 115200 -D /dev/ttyACM0\n```\nwith `/dev/ttyACM0` used as an example, but set according to how the device is recognized and named in your setup.\n\n## Connecting to the LwM2M Server\nPre-configured LwM2M Server to connect to is [Coiote IoT Device Management](https://www.avsystem.com/products/coiote-iot-device-management-platform/). Server URIs are set in project files (_`security_instance.server_uri`_  in `main.c`) as:\n * `coap://eu.iot.avsystem.cloud:5683` for NoSec mode,\n * `coaps://eu.iot.avsystem.cloud:5684` for secure communication.\n\nTo get access to the platform and add the device on the server side, please register at [https://eu.iot.avsystem.cloud/](https://eu.iot.avsystem.cloud/). There is a [guide showing basic usage of Coiote DM](https://iotdevzone.avsystem.com/docs/Coiote_IoT_DM/Quick_Start/Connect_device_quickstart/)\navailable on IoT Developer Zone. For the [Mandatory Objects](mandatory_objects) example that has no connection security enabled, simply select `NoSec` as `Security Mode` in the Guide step 3.\n\n## Links\n* [Anjay source repository](https://github.com/AVSystem/Anjay)\n* [Anjay documentation](https://avsystem.github.io/Anjay-doc/index.html)\n* [Doxygen-generated API documentation](https://avsystem.github.io/Anjay-doc/api/index.html)\n* [AVSystem IoT Devzone](https://iotdevzone.avsystem.com/)\n* [AVSystem Discord server](https://discord.avsystem.com)\n* [Raspberry Pico Documentation](https://www.raspberrypi.com/documentation/microcontrollers/raspberry-pi-pico.html)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Favsystem%2Fanjay-pico-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Favsystem%2Fanjay-pico-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Favsystem%2Fanjay-pico-client/lists"}