Quick Start
Prepare the APP
Create a file named hello.py
with the following content:
print("hello")
Upload the APP
First, go to the
Other
page and navigate to theMicro APP
section.Click the
Select file
button and choose thehello.py
file.Click the
Upload
button to upload the APP file.Wait for the prompt indicating that the upload was successful.

Run the APP
Click the
Start
button to run the APP.

View the Results
Check the
Results Box
to see the normal execution output.

Stop the APP
Click the
Stop
button to stop the APP.

Run on Startup
Set
Run at Startup
toYes
.Click the
Apply
button to save the configuration.Wait for the gateway to complete startup, then check the results.
Caution
The gateway will automatically restart for configuration changes to take effect.
The gateway will automatically run the APP 30 seconds after reboot.
Enable it only after completing the stability test in the app.

Call API
The following example demonstrates using the gateway to scan nearby BLE devices. For more examples and detailed explanations, please refer to the API section.
import asyncio
import cassiablue
async def main():
print("start scan")
ok, _ = await cassiablue.start_scan("active=1&filter_duplicates=1000")
print(type(ok), ok)
if not ok:
return
async for dev in cassiablue.scan_result():
print(type(dev), dev)
await asyncio.sleep_ms(5)
asyncio.run(main())