Compare commits
14 commits
zigbee-ota
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5214f904f1 | ||
|
|
20693143ae | ||
|
|
2e5f89b228 | ||
|
|
2dc7144de1 | ||
|
|
5f671b0170 | ||
|
|
21dd14d7f3 | ||
|
|
f8c28cebd6 | ||
|
|
8ef2b5b748 | ||
|
|
4e0f3911bd | ||
|
|
20d98d02a0 | ||
|
|
ccdbaaf142 | ||
|
|
57cf5aa0e5 | ||
|
|
5d2b648b22 | ||
|
|
da1642514a |
7 changed files with 19 additions and 14 deletions
2
.github/workflows/b-parasite.yml
vendored
2
.github/workflows/b-parasite.yml
vendored
|
|
@ -86,7 +86,7 @@ jobs:
|
||||||
sample-dir: code/nrf-connect/samples/ble
|
sample-dir: code/nrf-connect/samples/ble
|
||||||
board: bparasite_${{ matrix.soc }}
|
board: bparasite_${{ matrix.soc }}
|
||||||
revision: ${{ matrix.revision }}
|
revision: ${{ matrix.revision }}
|
||||||
cmake-extra: -DCONFIG_PRST_BLE_ENCODING_BTHOME_V2=y -DCONFIG_PRST_SLEEP_DURATION_SEC=1 -DCONFIG_PRSTLIB_LOG_LEVEL_DBG=y
|
cmake-extra: -DCONFIG_PRST_BLE_ENCODING_BTHOME_V2=y -DCONFIG_PRST_SLEEP_DURATION_MSEC=1000 -DCONFIG_PRSTLIB_LOG_LEVEL_DBG=y
|
||||||
output-bin: ble_${{ matrix.soc }}_${{ matrix.revision }}_debug.hex
|
output-bin: ble_${{ matrix.soc }}_${{ matrix.revision }}_debug.hex
|
||||||
|
|
||||||
build-zigbee:
|
build-zigbee:
|
||||||
|
|
|
||||||
|
|
@ -49,6 +49,12 @@ We have three different 3D-printable cases:
|
||||||
1. Original snap-on case - [case/Top.stl](./case/Top.stl), [case/Bottom.stl](./case/Bottom.stl)
|
1. Original snap-on case - [case/Top.stl](./case/Top.stl), [case/Bottom.stl](./case/Bottom.stl)
|
||||||
2. High airflow - [case/b_parasite_case_high_airflow.stl](./case/b_parasite_case_high_airflow.stl)
|
2. High airflow - [case/b_parasite_case_high_airflow.stl](./case/b_parasite_case_high_airflow.stl)
|
||||||
3. Mushroom-style - available on [Printables](https://www.printables.com/model/456571-mushroomcap-for-b-parasite-soil-moisture-sensor)
|
3. Mushroom-style - available on [Printables](https://www.printables.com/model/456571-mushroomcap-for-b-parasite-soil-moisture-sensor)
|
||||||
|
4. b-parasite Hat - available on [Printables](https://www.printables.com/model/901220-waterproof-case-for-b-parasite-soil-moisture-air-s)
|
||||||
|
|
||||||
|
# Accessories
|
||||||
|
|
||||||
|
Designs and hardware to help you, when building your own:
|
||||||
|
1. Desk holder for b-parasites [Printables](https://www.printables.com/de/model/566974-b-parasite-holder)
|
||||||
|
|
||||||
# License
|
# License
|
||||||
The hardware and associated design files are released under the [Creative Commons CC BY-SA 4.0 license](https://creativecommons.org/licenses/by-sa/4.0/).
|
The hardware and associated design files are released under the [Creative Commons CC BY-SA 4.0 license](https://creativecommons.org/licenses/by-sa/4.0/).
|
||||||
|
|
|
||||||
|
|
@ -16,10 +16,9 @@ int prst_sensors_read_all(prst_sensors_t *sensors) {
|
||||||
|
|
||||||
LOG_DBG("Batt: %d mV (%.2f%%)", sensors->batt.adc_read.millivolts,
|
LOG_DBG("Batt: %d mV (%.2f%%)", sensors->batt.adc_read.millivolts,
|
||||||
100 * sensors->batt.percentage);
|
100 * sensors->batt.percentage);
|
||||||
LOG_DBG("Soil: %.0f %% (%d mV)", 100 * sensors->soil.percentage,
|
LOG_DBG("Soil: %.0f %%", 100 * sensors->soil.percentage);
|
||||||
sensors->soil.adc_read.millivolts);
|
|
||||||
LOG_DBG("Photo: %u lx (%d mV)", sensors->photo.brightness,
|
LOG_DBG("Photo: %u lx (%d mV)", sensors->photo.brightness,
|
||||||
sensors->soil.adc_read.millivolts);
|
sensors->photo.adc_read.millivolts);
|
||||||
LOG_DBG("Temp: %f oC", sensors->shtc3.temp_c);
|
LOG_DBG("Temp: %f oC", sensors->shtc3.temp_c);
|
||||||
LOG_DBG("Humi: %.0f %%", 100 * sensors->shtc3.rel_humi);
|
LOG_DBG("Humi: %.0f %%", 100 * sensors->shtc3.rel_humi);
|
||||||
LOG_DBG("--------------------------------------------------");
|
LOG_DBG("--------------------------------------------------");
|
||||||
|
|
|
||||||
|
|
@ -2,13 +2,13 @@
|
||||||
source "Kconfig.zephyr"
|
source "Kconfig.zephyr"
|
||||||
rsource "../../prstlib/Kconfig"
|
rsource "../../prstlib/Kconfig"
|
||||||
|
|
||||||
config PRST_SLEEP_DURATION_SEC
|
config PRST_SLEEP_DURATION_MSEC
|
||||||
int "Sleep duration in seconds"
|
int "Sleep duration in milliseconds"
|
||||||
default 600
|
default 600000
|
||||||
|
|
||||||
config PRST_BLE_ADV_DURATION_SEC
|
config PRST_BLE_ADV_DURATION_MSEC
|
||||||
int "Advertising duration in seconds"
|
int "Advertising duration in milliseconds"
|
||||||
default 1
|
default 1000
|
||||||
|
|
||||||
config PRST_BLE_MIN_ADV_INTERVAL
|
config PRST_BLE_MIN_ADV_INTERVAL
|
||||||
int "Minimum advertising interval in milliseconds"
|
int "Minimum advertising interval in milliseconds"
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ Available configurations and their default values are in [`Kconfig`](./Kconfig).
|
||||||
To save energy, the board spends most of the time in a "deep sleep" state, in which most peripherals and radio are completely turned off. The period of sleep is controlled by the `PRST_SLEEP_DURATION_SEC` config.
|
To save energy, the board spends most of the time in a "deep sleep" state, in which most peripherals and radio are completely turned off. The period of sleep is controlled by the `PRST_SLEEP_DURATION_SEC` config.
|
||||||
|
|
||||||
### Advertising Duration
|
### Advertising Duration
|
||||||
When it wakes up, the sample reads all sensors and keep broadcasting advertising packets for `PRST_BLE_ADV_DURATION_SEC` before going back to sleep.
|
When it wakes up, the sample reads all sensors and keep broadcasting advertising packets for `PRST_BLE_ADV_DURATION_MSEC` before going back to sleep.
|
||||||
|
|
||||||
### Advertising Packet Encoding
|
### Advertising Packet Encoding
|
||||||
There are different ways to encode the sensor data in a BLE advertising packet.
|
There are different ways to encode the sensor data in a BLE advertising packet.
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@ CONFIG_ASSERT=y
|
||||||
|
|
||||||
# Application config - see all options in Kconfig.
|
# Application config - see all options in Kconfig.
|
||||||
# CONFIG_PRST_BLE_ENCODING_BTHOME_V2=y
|
# CONFIG_PRST_BLE_ENCODING_BTHOME_V2=y
|
||||||
# CONFIG_PRST_SLEEP_DURATION_SEC=1
|
# CONFIG_PRST_SLEEP_DURATION_MSEC=1000
|
||||||
|
|
||||||
# prstlib config - ser all options in prstlib/Kconfig.
|
# prstlib config - ser all options in prstlib/Kconfig.
|
||||||
# CONFIG_PRSTLIB_LOG_LEVEL_DBG=y
|
# CONFIG_PRSTLIB_LOG_LEVEL_DBG=y
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ static int prst_loop(prst_sensors_t *sensors) {
|
||||||
RET_IF_ERR(prst_sensors_read_all(sensors));
|
RET_IF_ERR(prst_sensors_read_all(sensors));
|
||||||
RET_IF_ERR(prst_ble_adv_set_data(sensors));
|
RET_IF_ERR(prst_ble_adv_set_data(sensors));
|
||||||
RET_IF_ERR(prst_ble_adv_start());
|
RET_IF_ERR(prst_ble_adv_start());
|
||||||
k_sleep(K_SECONDS(CONFIG_PRST_BLE_ADV_DURATION_SEC));
|
k_msleep(CONFIG_PRST_BLE_ADV_DURATION_MSEC);
|
||||||
RET_IF_ERR(prst_ble_adv_stop());
|
RET_IF_ERR(prst_ble_adv_stop());
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
@ -37,6 +37,6 @@ int main(void) {
|
||||||
prst_sensors_t sensors;
|
prst_sensors_t sensors;
|
||||||
while (true) {
|
while (true) {
|
||||||
__ASSERT(!prst_loop(&sensors), "Error in prst_loop()");
|
__ASSERT(!prst_loop(&sensors), "Error in prst_loop()");
|
||||||
k_sleep(K_SECONDS(CONFIG_PRST_SLEEP_DURATION_SEC));
|
k_msleep(CONFIG_PRST_SLEEP_DURATION_MSEC);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue