{"id":13720366,"url":"https://github.com/koenvervloesem/send-my-sensor","last_synced_at":"2025-05-06T23:25:40.839Z","repository":{"id":49353352,"uuid":"390475617","full_name":"koenvervloesem/send-my-sensor","owner":"koenvervloesem","description":"Zephyr-based firmware to upload sensor data via Apple's Find My network","archived":false,"fork":false,"pushed_at":"2022-06-10T13:57:04.000Z","size":48,"stargazers_count":18,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-31T04:01:54.465Z","etag":null,"topics":["ble","bluetooth-low-energy","bme280","find-my","nrf52840","openhaystack","ruuvitag","ruuvitag-sensor","sensor","zephyr","zephyr-rtos"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/koenvervloesem.png","metadata":{"files":{"readme":"README.rst","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}},"created_at":"2021-07-28T19:17:23.000Z","updated_at":"2025-02-23T06:24:32.000Z","dependencies_parsed_at":"2022-08-31T16:31:21.792Z","dependency_job_id":null,"html_url":"https://github.com/koenvervloesem/send-my-sensor","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koenvervloesem%2Fsend-my-sensor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koenvervloesem%2Fsend-my-sensor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koenvervloesem%2Fsend-my-sensor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koenvervloesem%2Fsend-my-sensor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/koenvervloesem","download_url":"https://codeload.github.com/koenvervloesem/send-my-sensor/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252784640,"owners_count":21803723,"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":["ble","bluetooth-low-energy","bme280","find-my","nrf52840","openhaystack","ruuvitag","ruuvitag-sensor","sensor","zephyr","zephyr-rtos"],"created_at":"2024-08-03T01:01:02.990Z","updated_at":"2025-05-06T23:25:40.821Z","avatar_url":"https://github.com/koenvervloesem.png","language":"C","funding_links":[],"categories":["Libraries"],"sub_categories":["IoT \u0026 Cloud"],"readme":"Send My Sensor\n##############\n\nThis project uses `OpenHaystack \u003chttps://github.com/seemoo-lab/openhaystack\u003e`_ to upload sensor data from a device without internet connection by (ab)using Apple's `Find My \u003chttps://developer.apple.com/find-my/\u003e`_ network. The data is broadcasted via Bluetooth Low Energy and forwarded by nearby Apple devices.\n\nThe application is based on the `Send My \u003chttps://github.com/positive-security/send-my\u003e`_ project and runs on the real-time operating system `Zephyr \u003chttps://www.zephyrproject.org/\u003e`_. Because this firmware is based on Zephyr, you can create your own sensor boards with one of the many Bluetooth Low Energy devices that Zephyr supports.\n\nAfter flashing the firmware to your device, it sends out Bluetooth Low Energy advertisements with sensor data that will be visible in Send My's DataFetcher application in macOS.\n\nDisclaimer\n**********\n\nThe firmware is just a proof-of-concept and the messages that it sends can be read by anyone who knows the modem ID; there's no extra encryption or authentication.\n\nThere is also no power management yet. So if you're running this firmware on a battery-powered device, it won't be as energy-efficient as possible. If you want to improve this, all patches are welcome.\n\nThe proof of concept reads the temperature from a Bosch BME280 sensor, but it can be easily adapted to use any other sensor that Zephyr supports.\n\nRequirements\n************\n\n* A Bluetooth Low Energy device, supported by Zephyr\n* A BME280 sensor, built-in (as in the earlier versions of the RuuviTag) or on a breakout board connected to your board's I²C bus \n* A `Zephyr development environment \u003chttps://docs.zephyrproject.org/latest/getting_started/index.html\u003e`_\n* Send My's DataFetcher application on macOS to read the sensor data\n\nInitialization\n**************\n\nTo build this firmware, you first need the `OpenHaystack Zephyr module \u003chttps://github.com/koenvervloesem/openhaystack-zephyr\u003e`_. Install this by initializing a workspace folder (for instance ``zephyr-workspace``) where the application and all Zephyr modules will be cloned.\n\n.. code-block:: shell\n\n  # Initialize Zephyr workspace folder for the application (main branch)\n  west init -m https://github.com/koenvervloesem/openhaystack-zephyr --mr main zephyr-workspace\n  # Update Zephyr modules\n  cd zephyr-workspace\n  west update\n\nThen clone the Send My Sensor repository and enter its directory:\n\n.. code-block:: shell\n\n  git clone https://github.com/koenvervloesem/send-my-sensor\n  cd send-my-sensor\n\nBuild\n*****\n\nTo build the firmware, run:\n\n.. code-block:: shell\n\n   west build -p auto -b $BOARD -s app\n\nReplace ``$BOARD`` by your target board.\n\nA sample debug configuration to read logs from the USB UART is also provided. You can apply it by running:\n\n.. code-block:: shell\n\n  west build -p auto -b $BOARD -s app -- -DOVERLAY_CONFIG=debug-usb-uart.conf\n\nThis only works with boards that support this, such as Nordic Semiconductor's nRF52840 Dongle.\n\nOnce you have built the application, the firmware image is available in ``build/zephyr``.\n\nChange the modem ID\n*******************\n\nYou need to specify a modem ID in the firmware image. Change the 32-bit unsigned integer value ``modem_id`` in `main.c \u003chttps://github.com/koenvervloesem/send-my-sensor/blob/main/app/src/main.c\u003e`_) and then build the firmware.\n\nFlash\n*****\n\nHow to flash the image to a device depends on the device and its bootloader. For many devices, including the RuuviTag if you use the RuuviTag Development Kit, you can run:\n\n.. code-block:: shell\n\n   west flash\n\nRefer to your `board's documentation \u003chttps://docs.zephyrproject.org/latest/boards/index.html\u003e`_ for alternative flash instructions if your board doesn't support the ``flash`` target.\n\nFor the nRF52840 Dongle with the built-in bootloader, run:\n\n.. code-block:: shell\n\n  nrfutil pkg generate --hw-version 52 --sd-req=0x00 \\\n          --application build/zephyr/zephyr.hex \\\n          --application-version 1 send-my-sensor.zip\n\nThis packages the application in the file ``send-my-sensor.zip``. Now press the reset button and flash the package onto the board with:\n\n.. code-block:: shell\n\n  nrfutil dfu usb-serial -pkg send-my-sensor.zip -p /dev/ttyACM0\n\nHave a look at ``ls /dev/tty*`` for the right device on Linux and macOS. On Windows it should be something like ``COMx``.\n\nSupported devices\n*****************\n\nThis procedure has been tested with:\n\n* Nordic Semiconductor's `nRF52840 Dongle \u003chttps://docs.zephyrproject.org/latest/boards/arm/nrf52840dongle_nrf52840/doc/index.html\u003e`_ (board name ``nrf52840dongle_nrf52840``) with an I²C breakout board of the Bosch BME280 temperature/humidity/pressure sensor. Solder headers to the dongle and connect the BME280's SDA to pin 0.31, SCL to pin 0.29, GND to GND and VCC to VDD. If your BME280 sensor has another I²C address than 0x76, change this in the device overlay `nrf52840dongle_nrf52840.overlay \u003chttps://github.com/koenvervloesem/send-my-sensor/blob/main/app/nrf52840dongle_nrf52840.overlay\u003e`_.\n* Ruuvi's nRF52832-based `RuuviTag \u003chttps://docs.zephyrproject.org/latest/boards/arm/ruuvi_ruuvitag/doc/index.html\u003e`_ (board name ``ruuvi_ruuvitag``), which has a built-in BME280 in earlier versions. Use the `RuuviTag Development Kit \u003chttps://ruuvi.com/products/ruuvitag-development-kit/\u003e`_ to flash the firmware.\n\nOther Bluetooth Low Energy devices supported by Zephyr should work as well, as long as they have a built-in BME280 or you can connect one over I²C. You may need a custom device overlay. Please let me know if you manage to run this firmware on another board, or if you need assistance, so I can add it to the list of devices it has been tested with.\n\nLearn more about Bluetooth Low Energy development\n*************************************************\n\nIf you want to learn more about Bluetooth Low Energy development, read my book `Develop your own Bluetooth Low Energy Applications for Raspberry Pi, ESP32 and nRF52 with Python, Arduino and Zephyr \u003chttps://koen.vervloesem.eu/books/develop-your-own-bluetooth-low-energy-applications/\u003e`_ and the accompanying GitHub repository `koenvervloesem/bluetooth-low-energy-applications \u003chttps://github.com/koenvervloesem/bluetooth-low-energy-applications\u003e`_.\n\nAcknowledgments\n***************\n\nThis project is inspired by and has used code from:\n\n* the original `Send My firmware for ESP32 \u003chttps://github.com/positive-security/send-my/tree/main/Firmware/ESP32\u003e`_\n* the `Zephyr Example Application \u003chttps://github.com/zephyrproject-rtos/example-application\u003e`_ for the project structure\n\nLicense\n*******\n\nThis project is provided by `Koen Vervloesem \u003chttp://koen.vervloesem.eu\u003e`_ as open source software with the GNU Affero General Public License v3.0. See the `LICENSE file \u003cLICENSE\u003e`_ for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkoenvervloesem%2Fsend-my-sensor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkoenvervloesem%2Fsend-my-sensor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkoenvervloesem%2Fsend-my-sensor/lists"}