# Send BLE air quality data to Cloudflare D1 with Python

DevFeed: [Send BLE air quality data to Cloudflare D1 with Python](<https://devfeed.tech/articles/send-ble-air-quality-data-to-cloudflare-d1-with-python-106866.md>)

Original publisher: [Read original article](<https://blog.adafruit.com/2026/10/29/send-ble-air-quality-data-to-cloudflare-d1-with-python/>)

Author: Anne Barela

Published: 2026-10-29T21:19:06Z

Content type: tutorial

Language: en

Sources: [Adafruit Industries](<https://devfeed.tech/sources/adafruit-industries-makers-hackers-artists-designers-and-engineers.md>)

Topics: [Cloudflare Workers](<https://devfeed.tech/topics/cloudflare-workers.md>), [Bluetooth LE](<https://devfeed.tech/topics/bluetooth-le.md>), [Python](<https://devfeed.tech/topics/python.md>), [data-engineering](<https://devfeed.tech/topics/data-engineering.md>)

Tags: [air-quality](<https://devfeed.tech/tags/air-quality.md>), [ble](<https://devfeed.tech/tags/ble.md>), [bluetooth](<https://devfeed.tech/tags/bluetooth.md>), [bluetooth-low-energy](<https://devfeed.tech/tags/bluetooth-low-energy.md>), [cloudflare](<https://devfeed.tech/tags/cloudflare.md>), [d1](<https://devfeed.tech/tags/d1.md>), [database](<https://devfeed.tech/tags/database.md>), [python](<https://devfeed.tech/tags/python.md>), [sensors](<https://devfeed.tech/tags/sensors.md>), [serverless](<https://devfeed.tech/tags/serverless.md>), [serverless-database](<https://devfeed.tech/tags/serverless-database.md>), [software](<https://devfeed.tech/tags/software.md>), [tutorial](<https://devfeed.tech/tags/tutorial.md>)

## AI overview

A HibouAir sensor broadcasts air-quality readings over BLE, and a USB-connected BleuIO dongle scans for its board ID and forwards the advertising data over serial to Python. The script decodes CO2, temperature, and humidity, prints them, and POSTs JSON to a Cloudflare Worker. The Worker checks an API key in the request header before storing readings in Cloudflare D1 (SQLite on Cloudflare's edge); a second endpoint returns the latest measurement. The excerpt says Python needs pyserial and requests, and BleuIO uses AT commands rather than the operating system's Bluetooth stack. Scan interval, serial port, board ID, Worker URL, and API key are kept in a configuration file excluded from version control.

## Source excerpt

sheikh shuhad has posted a tutorial on Hackster.io that moves Bluetooth Low Energy sensor readings into a serverless database. A HibouAir sensor advertises air quality data over BLE. A BleuIO dongle plugged into a computer's USB port scans for that specific board ID and passes the advertising data to a Python script over the serial [...]