Compare commits

...
Sign in to create a new pull request.

14 commits

Author SHA1 Message Date
rbaron
5214f904f1
Merge pull request #214 from ryanrolds/rolds/msec_sleep
Adjusting sleep durations to be milliseconds. Needed for FCC 15b testing.
2024-09-06 09:08:33 +02:00
Ryan R. Olds
20693143ae Fixing build failure 2024-09-05 13:27:16 -07:00
Ryan R. Olds
2e5f89b228 Adjusting code 2024-09-03 16:25:14 -07:00
Ryan R. Olds
2dc7144de1 Switching sleep to to msec. Will aid FCC 15b testing 2024-09-03 16:23:28 -07:00
rbaron
5f671b0170
Merge pull request #207 from seime/debug_log_photo
Log photo adc value, not soil adc
2024-06-04 19:02:55 +02:00
Arne Seime
21dd14d7f3 Remove obsolete logging of soil voltage (always 0) 2024-06-04 16:55:30 +02:00
rbaron
f8c28cebd6
Merge pull request #208 from mrred2k/main
Add link to new case from Printables to README.md
2024-06-04 09:19:08 +02:00
rbaron
8ef2b5b748
Update README.md
- Parasite -> b-parasite
- Link directly to English website instead of german
2024-06-04 09:08:42 +02:00
mrred2k
4e0f3911bd Added a new case 2024-06-03 21:30:17 +02:00
Arne Seime
20d98d02a0 Log photo adc value, not soil adc 2024-06-03 10:21:51 +02:00
rbaron
ccdbaaf142
Merge pull request #194 from mrred2k/main
Include Printables link to 3D printable holder in README.md
2024-04-30 08:02:30 +02:00
mrred2k
57cf5aa0e5 Fixed Typos, deleted model 2024-04-29 21:18:27 +02:00
mrred2k
5d2b648b22 Added the link to the holder
Added the 3d Printed holder from printables. Also available in "case"
2023-08-29 11:30:49 +02:00
mrred2k
da1642514a Created a holder for 10 b-parasides
Created a simple 3d printable holder for dealing with a bigger number of b-parasides.
2023-08-29 11:22:59 +02:00
7 changed files with 19 additions and 14 deletions

View file

@ -86,7 +86,7 @@ jobs:
sample-dir: code/nrf-connect/samples/ble
board: bparasite_${{ matrix.soc }}
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
build-zigbee:

View file

@ -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)
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)
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
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/).

View file

@ -16,10 +16,9 @@ int prst_sensors_read_all(prst_sensors_t *sensors) {
LOG_DBG("Batt: %d mV (%.2f%%)", sensors->batt.adc_read.millivolts,
100 * sensors->batt.percentage);
LOG_DBG("Soil: %.0f %% (%d mV)", 100 * sensors->soil.percentage,
sensors->soil.adc_read.millivolts);
LOG_DBG("Soil: %.0f %%", 100 * sensors->soil.percentage);
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("Humi: %.0f %%", 100 * sensors->shtc3.rel_humi);
LOG_DBG("--------------------------------------------------");

View file

@ -2,13 +2,13 @@
source "Kconfig.zephyr"
rsource "../../prstlib/Kconfig"
config PRST_SLEEP_DURATION_SEC
int "Sleep duration in seconds"
default 600
config PRST_SLEEP_DURATION_MSEC
int "Sleep duration in milliseconds"
default 600000
config PRST_BLE_ADV_DURATION_SEC
int "Advertising duration in seconds"
default 1
config PRST_BLE_ADV_DURATION_MSEC
int "Advertising duration in milliseconds"
default 1000
config PRST_BLE_MIN_ADV_INTERVAL
int "Minimum advertising interval in milliseconds"

View file

@ -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.
### 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
There are different ways to encode the sensor data in a BLE advertising packet.

View file

@ -21,7 +21,7 @@ CONFIG_ASSERT=y
# Application config - see all options in Kconfig.
# 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.
# CONFIG_PRSTLIB_LOG_LEVEL_DBG=y

View file

@ -26,7 +26,7 @@ static int prst_loop(prst_sensors_t *sensors) {
RET_IF_ERR(prst_sensors_read_all(sensors));
RET_IF_ERR(prst_ble_adv_set_data(sensors));
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());
return 0;
}
@ -37,6 +37,6 @@ int main(void) {
prst_sensors_t sensors;
while (true) {
__ASSERT(!prst_loop(&sensors), "Error in prst_loop()");
k_sleep(K_SECONDS(CONFIG_PRST_SLEEP_DURATION_SEC));
k_msleep(CONFIG_PRST_SLEEP_DURATION_MSEC);
}
}