From 8e2b8559d5447c87da2f6fbfc5048450d7b66a51 Mon Sep 17 00:00:00 2001 From: Leon Wright Date: Fri, 30 Apr 2021 10:54:13 +0800 Subject: [PATCH] fix: Long not connected message The 'Sensor Not Connected' message was both long and slightly inaccurate. Which lead to the interface jumping around whenever a string of bad readings came through. Shortened the error to 'NaN' and documented it in the README. --- README.md | 4 ++++ filament_scale_enhanced/static/js/filament_scale.js | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index fec55a4..f4687bf 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,10 @@ or manually using this URL: Once you have wired up the HX711, it must be calibrated. This is a pretty straightforward process, and all you will need is an object of known weight. Attach the load cell to your printer with the printed bracket, then follow the instructions on the plugin's settings page. +## Troubleshooting + +`NaN` may be occasionally displayed in the interface when the weight can't be read correctly. The cheap boards vary in quality and are a little sensitive to vibration/power stability. Ensure the cabling is secure, you have a sufficiently sized load cell, and a good power supply. + ## Development Python 3 + Python 3 Virtualenv recommended diff --git a/filament_scale_enhanced/static/js/filament_scale.js b/filament_scale_enhanced/static/js/filament_scale.js index ac702e0..5b67374 100644 --- a/filament_scale_enhanced/static/js/filament_scale.js +++ b/filament_scale_enhanced/static/js/filament_scale.js @@ -53,7 +53,7 @@ $(function() { self.last_raw_weight = parseInt(message) if (parseInt(message) == 8388608 || parseInt(message) == 8388607){ - self.printerState.filamentRemainingString("Sensor Not Connected") + self.printerState.filamentRemainingString("NaN") self.settings.settings.plugins.filament_scale.lastknownweight("Error") } else { weight = self.getWeight(message)