Skip to content

Commit 754cd51

Browse files
need to restart mqtt to db since we are changing a struct defintion
1 parent ea8ab0b commit 754cd51

File tree

5 files changed

+40
-7
lines changed

5 files changed

+40
-7
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ rate_std=0.25
1616
- New image installs only:
1717
- updated base OS to the latest 25-05-06 Raspberry Pi OS. The big change is using Linux kernel 6.12.
1818
- Added the column `hours_since_experiment_created` to dataset exports that details hours since experiment was created.
19+
- A running pump now fires off an incremental dosing event every N seconds (N=0.5 currently) to tell the software its progress. Previously, we would fire off a single event that represented the total amount moved. This is most noticeable when watching the vial volume change over time (looks more accurate over a short period).
1920
- When a pump runs, it _first_ fires off a dosing_event, which stores information about how much liquid is moved. However, if the pump is stopped early, there was no correction issued to the amount of liquid actually moved. Now, when a pump is stopped early, a _negative_ volume is sent s.t. the delta between the initial amount and new amount is equal to the dosed amount (so when you sum up the volume changes, you get the actual change, as expected).
2021
- Performance optimizations
2122

pioreactor/actions/pump.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ def _get_pump_action(pump_device: PumpCalibrationDevices) -> str:
310310
with PWMPump(
311311
unit, experiment, pin, calibration=calibration, mqtt_client=mqtt_client, logger=logger
312312
) as pump:
313-
sub_duration = 1.0
313+
sub_duration = 0.5
314314
volume_moved_ml = 0.0
315315

316316
pump_start_time = time.monotonic()

pioreactor/background_jobs/dosing_automation.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -264,12 +264,6 @@ def __init__(
264264
"It's recommended to have stirring on to improve mixing during dosing events."
265265
)
266266

267-
if self.max_volume >= self.MAX_VIAL_VOLUME_TO_STOP:
268-
# possibly the user messed up their configuration. We warn them.
269-
self.logger.warning(
270-
"The parameter max_volume_ml should be less than max_volume_to_stop (otherwise your pumping will stop too soon)."
271-
)
272-
273267
def set_duration(self, duration: Optional[float]) -> None:
274268
if duration:
275269
self.duration = float(duration)
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/bash
2+
3+
set -xeu
4+
5+
6+
export LC_ALL=C
7+
8+
LEADER_HOSTNAME=$(crudini --get /home/pioreactor/.pioreactor/config.ini cluster.topology leader_hostname)
9+
10+
# if leader
11+
if [ "$HOSTNAME" = "$LEADER_HOSTNAME" ]; then
12+
13+
# restart mqtt to db
14+
sudo systemctl restart pioreactor_startup_run@mqtt_to_db_streaming.service || :
15+
fi
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/bin/bash
2+
3+
set -xeu
4+
5+
6+
export LC_ALL=C
7+
8+
# Lower bound version
9+
min_version="25.4.11"
10+
11+
# Get the current version of pio
12+
current_version=$(sudo -u pioreactor pio version)
13+
14+
# Use sorting to determine if the current version is less than the minimum version
15+
is_valid=$(printf "%s\n%s" "$current_version" "$min_version" | sort -V | head -n1)
16+
17+
# If the smallest version isn't the minimum version, then current version is too low
18+
if [ "$is_valid" != "$min_version" ]; then
19+
sudo -u pioreactor pio log -l ERROR -m "Version error: installed version $current_version is lower than the minimum required version $min_version."
20+
exit 1
21+
fi
22+
23+
echo "Version check passed: $current_version"

0 commit comments

Comments
 (0)