Skip to content

Commit d57cddd

Browse files
Update README.md
1 parent 1c403ea commit d57cddd

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

README.md

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,26 @@ While many popular Bluetooth devices can have their stock firmware flashed to us
1313
You could, but do you really want a device containing your WiFi credentials in an unsecured location outside your home? I don't. I'd rather broadcast BLE advertisements I can read from indoors. If the device sending them is lost or stolen, I'm out a few dollars, but no data is compromised.
1414

1515
## How can I use it?
16-
Currently, you'll need to copy bthome.py to your microcontroller's /lib directory. (In the future I will create an mpy bytecode module capable of MIP installation.) Once you have bthome.py in /lib, use MIP to install aioble. Then have a look at the code sample in main.py here in this repository.
16+
Copy bthome.py to your microcontroller's /lib directory and install MicroPython's aioble module.
1717

18-
It boils down to this...
18+
With mip, it's like this:
19+
20+
```
21+
mpremote connect PORT mip install github:DavesCodeMusings/thimble
22+
mpremote connect PORT mip install aioble
23+
```
24+
25+
Once you've got the modules installed, have a look at the code sample in [main.py](main.py) here in this repository.
26+
27+
Building your own sensor beacon boils down to this...
1928
1. Import the bthome module
2029
2. Set the device name you want
21-
3. Write the sensor readings to the bthome variables
30+
3. Write the sensor readings to the bthome variables you're using
2231
4. Call bthome.pack_advertisement() with parameters to indicate which data to broadcast
2332
5. Send that advertising data to `aioble.advertise()`
2433

34+
As MicroPython statements, those steps are:
35+
2536
```
2637
import bthome
2738
bthome.device_name = "myBeacon"

0 commit comments

Comments
 (0)