-
Notifications
You must be signed in to change notification settings - Fork 3
BLE Interface
Basic setup can be performed throug BLE interface:
- SSID name.
- Wifi password.
- Reset device.
- MH-Z19 Zero point calibration (see dedicated entry on sidebar).
- KY-012 Buzzer alarm level configuration.
Currently there is not dedicated application, but these configurations can be easily performed by using 3rd party app like BLE Scanner. Following examples will use BLE Scanner, but it is possible to use any BLE application able to read and write to BLE CHARACTERISTICS.
Open the BLE app on smartphone, place close to prototype, and scan for devices. Select diy-co2-monitor named device and click on connect:
Click on CUSTOM SERVICE with id "7b7e359a-f9b9-4c67-9a21-000000000000"; three CUSTOM CHARACTERISTIC will appear (defined in ble_module.h:
- "7b7e359a-f9b9-4c67-9a21-000000000001" => Reads or writes WiFi SSID name [R/W].
- "7b7e359a-f9b9-4c67-9a21-000000000002" => Reads or writes WiFi PASSWORD [R/W].
- "7b7e359a-f9b9-4c67-9a21-000000000003" => Performs a reset on device [W].
- "7b7e359a-f9b9-4c67-9a21-000000000004" => Performs a Zero point calibrartion on MH-Z19 [W].
- "7b7e359a-f9b9-4c67-9a21-000000000005" => Reads or writes the alarm level for Buzzer activation [R/W].
Each characteristic includes a blue 'R' and 'W' icons to allow to perform value Read and Write to the characteristic. [R/W] ones, as SSID or PASSWORD, allows to set and retrieve the values. [W] ones are just used to invoke a device function by writing any value, so in order to perform a reset on device just write a character on '-000000000003' characteristic (the same for zero point calibration).
Wifi setup only needs to write Wifi SSID name and PASSWORD to its respective characteristics '-000000000001' and '-000000000002':
Both configurations will be pesistent across device resets(note that currently the prototype does only support DHCP IP addressing). Once SSID and PASSWORD has been set, reset the device by writing anything to characteristic '-000000000004'
After reboot, if connection has been success, the IP Addres tail will appear in the upper right corner of the OLED display:
In case connection fails <W.OFF message will appear instead of IP Address.
MIT License.