diabetic-insights
How to Safely Update and Maintain Your Openaps Software
Table of Contents
Understanding OpenAPS Software Updates and Why They Matter
OpenAPS (Open Artificial Pancreas System) is an open‑source, community‑driven project that enables automated insulin delivery for people with diabetes. The software runs on small, low‑power computers (like the Intel Edison or Raspberry Pi) and communicates with a continuous glucose monitor (CGM) and an insulin pump to adjust insulin delivery in real time. Because OpenAPS directly affects a user’s blood glucose levels and safety, keeping the software up to date is not optional — it is a critical responsibility.
Software updates for OpenAPS typically bring new algorithms, improved safety checks, bug fixes, and compatibility updates for newer pump models or CGM sensors. However, updating a medical‑grade system demands caution. A poorly executed update could introduce errors, cause communication failures, or lead to incorrect insulin dosing. The goal of this article is to provide a thorough, step‑by‑step guide to safely updating and maintaining your OpenAPS system, drawing on best practices from the active community and the official documentation.
The Risks of Skipping Updates
Running outdated OpenAPS software exposes you to known bugs that have been resolved in later releases. For example, older versions may have less robust safety limits, delayed response to hypoglycemia, or incompatibility with newer pump firmware. Community‑reported issues are often fixed rapidly, and the release notes accompanying each update explain exactly what has been addressed. By staying current, you benefit from the collective troubleshooting of hundreds of users and developers.
Conversely, a hasty update without proper preparation can result in a non‑functional loop, requiring you to revert to manual therapy. This guide will help you avoid that scenario by covering backup procedures, environment testing, step‑by‑step update execution, and post‑update validation.
Preparing for the Update: Backup Your Entire System
Before making any changes, create a complete backup of your current OpenAPS installation. This includes configuration files, preferences, personal settings, and any custom scripts you have added. A backup ensures you can restore your working system if the update fails or introduces unexpected behavior.
- Back up configuration files: Copy your
oref0settings profile, pump profile, carb ratios, and basal schedules. On most systems, these are located in the~/myopenaps/directory. Usetar -czvf openaps-config-$(date +%Y%m%d).tar.gz ~/myopenaps/settings/to create a compressed archive. - Back up log files: Recent logs can be invaluable for troubleshooting after an update. Compress and save the
~/myopenaps/monitor/folder. The loop log, in particular, contains a record of every insulin delivery decision and can help you compare pre‑ and post‑update behavior. - Back up custom scripts: If you have added your own automation or notification scripts (e.g., for Nightscout or IFTTT), back them up separately. Many users create a
~/custom-scripts/directory; copy that entire folder. - Snapshot the operating system (optional): If you are comfortable with disk imaging, create a full SD card or eMMC image using tools like
ddorWin32 Disk Imager. This is the most complete restoration option. For Raspberry Pi, you can usesudo dd if=/dev/mmcblk0 of=~/openaps-backup.imgand then compress the image.
Store your backups on a separate computer, an external drive, or a cloud service. Label each backup with the date and the version of OpenAPS it was taken from. For example: openaps-backup-2025-07-01-v0.7.0.tar.gz.
Review the Official Release Notes
Visit the official OpenAPS documentation to find the latest stable release. Read the release notes carefully — they list new features, bug fixes, and any breaking changes that may require modifications to your configuration. Pay special attention to sections labelled “Migration notes” or “Upgrade paths.”
If you are running a custom fork (many users maintain modified versions of OpenAPS), check the corresponding repository for updates. Avoid downloading updates from unofficial sources, as they may contain malicious code or unstable modifications. Always verify the SHA‑256 checksums published by the maintainers.
Test the Update in a Sandbox Environment
If possible, set up a secondary device with the same hardware configuration as your primary rig. Flash the new software onto this test rig and run it in simulation mode (or with a dummy pump profile) for 24–48 hours. This allows you to validate that the update boots correctly, that all communication protocols work, and that no unexpected errors appear in the logs.
For users who cannot build a second physical rig, consider using a virtual machine or a Raspberry Pi emulator. While this will not test physical pump/CGM communication, it can still verify the software logic and any config file changes. The OpenAPS community often shares feedback about new releases on the official forum, which is a valuable resource for learning about common pitfalls. If you encounter any show‑stopper issues in the sandbox, you can hold off updating your primary rig until a fix is released.
Performing the Update: Step‑by‑Step Instructions
Once you have confirmed your backup is complete and you have reviewed the release notes, you are ready to update. Follow the official upgrade procedure for your release. The steps below are typical for most OpenAPS builds running on a Linux‑based system.
Prerequisites Before Running Update Commands
- Connect to a stable power source: An interrupted update can corrupt the file system. Ensure your rig is plugged into mains power or has a fully charged battery. A UPS for your rig or a power bank with sufficient capacity can prevent disaster during a lengthy update.
- Verify internet connection: The update process often downloads new packages from GitHub or other repositories. Use a wired Ethernet connection if possible, or ensure your Wi‑Fi signal is strong. Run
ping github.comfrom the rig to confirm connectivity before starting. - Close unnecessary applications: On your computer, close all non‑essential programs to avoid conflicts with the terminal session. If you are SSH’d into the rig, do not close the SSH client during the update. Consider using
screenortmuxto keep the session alive even if your local connection drops.
Executing the Update Process
- Open a terminal on your computer and establish an SSH connection to your rig:
ssh [email protected] - Navigate to the main OpenAPS directory (usually
~/myopenaps). - Stop the loop service to prevent conflicts during the update:
sudo systemctl stop openapsorpm2 stop alldepending on your process manager. - Pull the latest code from the repository. For a default install, run:
cd ~/src/openapsand thengit pull origin master(or the appropriate branch name from the release notes). If you have local modifications, stash them first:git stash. - If your release uses
oref0, update the submodules as well:cd ~/src/oref0andgit pull origin master. - Run the update script provided in the documentation. Common commands include:
npm installorsudo setup.sh. Follow the exact sequence published for your build. Some releases require you to runnpm updatefirst to refresh dependencies. - When prompted, review and merge configuration file changes. If you see conflicts, manually resolve them using
git mergetoolor by copying your backed‑up configs into the new files. Usegit diffto see what changed before merging. - Restart the OpenAPS service:
sudo systemctl restart openapsorpm2 restart all. - Watch the logs for any errors. Use:
tail -f ~/myopenaps/monitor/loop.logto see real‑time output. Look for messages likeEnacted,TempBasal, orError. A healthy loop should show a new cycle every five minutes.
If the update script fails at any point, do not panic. Note the error message and search for it on the OpenAPS forum or GitHub issues. You can always restore your previous environment from the backup you created.
Common Update Errors and Quick Fixes
- Error: “Package version mismatch” – Often resolved by updating npm packages with
npm updateor clearing node_modules and reinstalling:rm -rf node_modules && npm install. - Error: “Git merge conflict” – Manually edit the conflicting files using
nanoorvim. Compare the two versions and keep the lines that match your custom settings. Then commit the merge withgit commit. - Error: “Device not found” – After the update, the rig may need to be rebooted to re‑initialize the pump or CGM connection. Try
sudo reboot. If the problem persists, check that the radio stick (e.g., CareLink USB or TI stick) is properly seated and its drivers are loaded. - Error: “Loop stuck in closed loop” or “MaxIOB exceeded” – Sometimes a fresh update resets your “max iob” or “override” settings. Double‑check your preferences file (
~/myopenaps/settings/preferences.json) and ensure all safety limits are restored. The update may also have changed default thresholds; adjust them to match your previous values.
Post‑Update Verification: Safety Checks You Must Perform
Updating is only half the battle. After the software is installed, you must verify that the entire loop is working correctly before relying on it for automated insulin delivery. The following checks should be performed in a controlled setting — ideally when you are able to monitor your blood glucose frequently and have backup supplies on hand.
Validate System Communication
Ensure the rig can still communicate with your pump and CGM. Issue a temporary basal rate manually through your rig’s interface (e.g., using oref0-pump-temp-basal or the Loop app’s test commands). Confirm that the pump executes the command and reports back accurately. Also verify that CGM readings are being received and displayed correctly in your loop dashboard. Run oref0-dexcom-raw (or the appropriate command for your CGM) to see the raw sensor values.
Review Logs for Errors
Examine the loop.log file for any unexpected entries. Look for repeated “Retry” or “Timeout” messages, which indicate communication issues. A healthy loop will show consistent enactment cycles every five minutes. Check that the “predicted” glucose values look reasonable compared to actual CGM data. Use grep -i "error\|fail\|timeout" ~/myopenaps/monitor/loop.log to quickly spot anomalies.
Log Analysis Checklist
- Ensure no cycle reports “pump not responding” more than twice consecutively.
- Verify that the “IOB” and “COB” calculations match your manual estimates.
- Check that the system does not enter “open loop” mode (indicated by a warning in the log) unless you intentionally set it.
Test Safety Limits
Your update may have altered the default safety thresholds. Confirm that values such as max_iob, max_daily_safety_multiplier, and min_bg are still set to appropriate levels for your therapy. A small error here could lead to over‑delivery or under‑delivery of insulin. Compare the output of oref0-get-profile --settings against your pre‑update notes.
Observe Overnight or Low‑Activity Periods
If possible, let the updated loop run through one full night while you are awake or have a backup caretaker monitoring you. This will reveal subtle bugs that only appear during periods of low activity or changing insulin sensitivity. Many OpenAPS users report that the first 24 hours after an update are the most critical for catching issues. Keep a log of your blood glucose values every hour during this period.
Keep a Detailed Log of the Update
Record the following information in a dedicated update journal:
- Date and time of the update
- Previous version number and new version number
- Any configuration changes you made (e.g., updated basal rates, new safety thresholds)
- Issues encountered and resolved
- Post‑update glucose readings (time range and average)
- Any Nightscout or IFTTT integrations that needed re‑authentication
This log will help you troubleshoot future updates and can be invaluable if you need to revert to a known good state.
Ongoing Maintenance to Keep Your OpenAPS Reliable
Software updates are just one part of a comprehensive maintenance plan. Regularly caring for your OpenAPS rig will extend its lifespan and ensure consistent performance.
Schedule Periodic Updates
Set a recurring reminder to check for new OpenAPS releases every 4–6 weeks. Even if you do not update immediately, reviewing release notes will keep you informed of important changes. The oref0 releases page on GitHub is the authoritative source for update announcements. Subscribe to the RSS feed or use a tool like GitHub notifications to stay up to date.
Monitor Hardware Health
The physical rig components (Raspberry Pi, battery, radio stick, cables) degrade over time. Inspect connections monthly, clean dust from vents, and verify that the battery holds a sufficient charge. Replace any component that shows signs of wear — a failing SD card is a common cause of data corruption. Run dmesg | grep "mmc0" periodically to check for SD card errors. If you see CRC errors, consider migrating to a more reliable storage medium like a USB‑booted SSD.
Keep Firmware Current
Your insulin pump and CGM receiver may receive firmware updates from their manufacturers. While OpenAPS often maintains compatibility, check the community forum before installing pump firmware updates. Some updates may change communication protocols, requiring a corresponding OpenAPS patch. After any pump firmware update, run a full communication test as described in the verification section above.
Engage with the Community
The OpenAPS community is one of the most active and supportive open‑source health groups. By participating in the OpenAPS Discourse forum, you can learn about upcoming changes, share your experiences, and get help with tricky updates. Many experienced users post detailed upgrade walkthroughs for each release. Also consider joining the #openaps channel on the community Slack or Discord for real‑time troubleshooting.
Automate Health Checks with Scripts
Advanced users can write simple cron jobs that email you a daily summary of loop performance — including number of enactments, pump alerts, and system uptime. A drop in performance often signals the need for an update or hardware check. Example scripts are available in the OpenAPS documentation repository. For instance, a cron job could run every morning at 7 AM:
0 7 * * * ~/custom-scripts/daily-health-check.sh
Within the script, you can parse the loop log for warnings, check disk space, and verify that the process manager is running. If any value falls outside healthy thresholds, the script can send an email or text via a service like Twilio.
Concluding Thoughts: Safety Through Diligence
Updating your OpenAPS software is a task that should be approached with the same seriousness as any medical device maintenance. By following a disciplined process — backing up, testing, verifying, and logging — you can harness the latest improvements while minimizing risk. The open‑source nature of OpenAPS means that thousands of eyes review every change, but the ultimate responsibility for your safety rests with you.
Remember that the decision to update should always be weighed against your current therapy stability. If your existing system is working flawlessly and the update introduces only minor improvements, you may choose to wait until a more critical update is released. The key is to stay informed and prepared. With the steps outlined in this article, you will be able to safely update and maintain your OpenAPS system, keeping your automated insulin delivery reliable and effective.