From de2262f747cc0cef9d826fd8d656a5e5111f3050 Mon Sep 17 00:00:00 2001 From: John Poole Date: Tue, 26 May 2026 07:34:11 -0700 Subject: [PATCH] Preserving for posterity before update to 18 column --- .../scripts/create_exercise_26_ble_schema.sql | 28 ++++++++++++++++++ .../scripts/import_exercise_26_ble_log.pl | 29 +++++++++---------- 2 files changed, 42 insertions(+), 15 deletions(-) diff --git a/exercises/26_Bluetooth_discover/scripts/create_exercise_26_ble_schema.sql b/exercises/26_Bluetooth_discover/scripts/create_exercise_26_ble_schema.sql index 717441f..a9d1663 100644 --- a/exercises/26_Bluetooth_discover/scripts/create_exercise_26_ble_schema.sql +++ b/exercises/26_Bluetooth_discover/scripts/create_exercise_26_ble_schema.sql @@ -410,4 +410,32 @@ SELECT FROM ble_observation GROUP BY trial_id, receiver, heard; +-- +-- for mapping +-- +CREATE VIEW IF NOT EXISTS v_map_observation_points AS +SELECT + obs_id, + trial_id, + receiver, + heard, + rx_epoch_ms, + rx_epoch_s, + rx_lat, + rx_lon, + rx_gps_age_ms, + rssi, + avg_rssi, + payload_seq, + tx_epoch_ms, + rx_tx_delta_ms +FROM ble_observation +WHERE rx_lat IS NOT NULL + AND rx_lon IS NOT NULL; + +CREATE VIEW IF NOT EXISTS v_map_good_gps_points AS +SELECT * +FROM v_map_observation_points +WHERE rx_gps_age_ms <= 5000; + COMMIT; diff --git a/exercises/26_Bluetooth_discover/scripts/import_exercise_26_ble_log.pl b/exercises/26_Bluetooth_discover/scripts/import_exercise_26_ble_log.pl index 7d0feea..9cda509 100755 --- a/exercises/26_Bluetooth_discover/scripts/import_exercise_26_ble_log.pl +++ b/exercises/26_Bluetooth_discover/scripts/import_exercise_26_ble_log.pl @@ -24,22 +24,21 @@ # # Example: # flo/20260525_194537_FLO_ble_search.log.manifest -# -# Simple key=value format: -# -# trial_name=Peck Cottage ED FLO BLE walk test 20260525_1945 -# trial_label=peck_cottage_ed_flo_20260525_1945 -# firmware_exercise=26_Bluetooth_discover -# firmware_git_commit=unknown -# field_site=Peck Cottage steps -# operator=jlpoole -# receiver_role=moving -# receiver_start_description=upside-down plastic pot at Peck Cottage steps -# receiver_notes=FLO was hand-carried north and across the street, then returned to base. -# test_notes=Two-unit BLE discovery test. ED stationary, FLO moving. -# - =pod + Simple key=value format: + + trial_name=Peck Cottage ED FLO BLE walk test 20260525_1945 + trial_label=peck_cottage_ed_flo_20260525_1945 + firmware_exercise=26_Bluetooth_discover + firmware_git_commit=unknown + field_site=Peck Cottage steps + operator=jlpoole + receiver_role=moving + receiver_start_description=upside-down plastic pot at Peck Cottage steps + receiver_notes=FLO was hand-carried north and across the street, then returned to base. + test_notes=Two-unit BLE discovery test. ED stationary, FLO moving. + + An after import smoke test: sqlite3 -header -column ble_fieldtest_20260525_1945_ed_flo.sqlite \