Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rewrite Open Trickler w/ Python (#51)
* Drop JS files * First commit of python files -- not working * Drop more node files * Update README with python info * rename scale.py to scales.py * Code cleanups * Drop variables file. Not needed. * More progress. Ready to start testing. * Bug fixes, functional changes for logging and executable scripts * Break out motor control, add motor tests * Set memcache values on script startup to avoid conflicts from prior runs * Move memcache updates into appropriate files, such as scale and motor * Drop test serial file, replaced my scales.py * Make motors.py executable * Change motor test script, ramp up then down. * Fix commands to be sent as bytes. Fix CLI interface to use strings for scale units * Ignore DS_store files * Add PID tuning output option. * Update default PID values and new min PWM speed * Some code cleanups and fixes. Scale reading not working in main loop * Refactor loops for simplicity. Moved memcache client to be an arg. Fixed some pylint issues. * More cleanups. Unit changing on scale works. Prevent trickling in more cases. Verified some TODOs are fixed. * Remove TOOD about unit switching, confirmed working * Add grpcio req * Initial pass at v1 bluetooth module for compatibility. Still needs testing * Support config file, version scale status, lint cleanups, add helpers, update server.sh launcher. * Use config to enable pid tuner mode * Add OpenAPI definition * Update memcache for scale stability. Add comments * Add temporary new readme * Update scripts * Fix open file bug in main trickler. Update server script for ini file without flag. * Add manifest and setup files for proper python packaging * Update packaging script for creating local python zip package * use open when reading config files * Bluetooth bugfix, arg should be a dictionary * Daemonize bluetooth module. * Fix reading values over bluetoothe * Fix write from bluetooth functions * Add status LED control. * Define memcache strings in constants.py to avoid bugs and make typos easier to catch * Update newer ble script, still not ready to use * Remove quotes from config file, they get copied in * Make leds.py executable * Comment out led disable command * Fix bug in leds script * Fix bug in bluetooth write request for automode * Fix reference to scale units in ble module * Add reverse unit map to scales module * Set better default memcache values * Make trickler unit match correct type in memcache. Add logging * use default values to get values from memcache for leds script. * Switch gitignore from node to python * Reformat large conditional for readability * Add a second of sleep to allow scale to update when changing units * Reset the input buffer before reading serial device. * improve setup script and requirements file for non-arm machines * Lint fixes * Remove node variable from setup script * Add lint script * Improve bluetooth logging * Use percentages for PID controller * Change log setup to accept log level to correct verbosity * Change LED behavior. Don't change state in every loop cycle * Catch error from potential bad state and log. Don't default to False for auto_mode * Upgrade flutter and deps for mobile app. Build iOS app again to restore version in TestFlight. * Decrease font size in unit toggle button to avoid text being cut off. Update build number for iOS * Fix notifications for bluetooth. * Set generous timeouts for memcache client * Refactor for simplicity. Catch memcache exceptions. * Add sleep delay for led script. * Disable pylint import errors * Check memcache variables before starting LED script loop. Use try catch on memcache calls. Add timer delay in loop. * More logging in ble module. Change function name from update to all_mc_update, conflicts with exisiting function from parent class. * Less noisy logging for bluetooth * Rename config.ini to opentrickler_config.ini to avoid confusion with config.txt on the BOOT partition. * Allow verbose logging to be controlled from config file * No verbose flag for leds.py, copy paste typo * Set BLENO_DEVICE_NAME environment variable to ensure device name is properly set. * Update flutter and mobile package to reup to Apple. * Drop JS files * First commit of python files -- not working * Drop more node files * Update README with python info * rename scale.py to scales.py * Code cleanups * Drop variables file. Not needed. * More progress. Ready to start testing. * Bug fixes, functional changes for logging and executable scripts * Break out motor control, add motor tests * Set memcache values on script startup to avoid conflicts from prior runs * Move memcache updates into appropriate files, such as scale and motor * Drop test serial file, replaced my scales.py * Make motors.py executable * Change motor test script, ramp up then down. * Fix commands to be sent as bytes. Fix CLI interface to use strings for scale units * Ignore DS_store files * Add PID tuning output option. * Update default PID values and new min PWM speed * Some code cleanups and fixes. Scale reading not working in main loop * Refactor loops for simplicity. Moved memcache client to be an arg. Fixed some pylint issues. * More cleanups. Unit changing on scale works. Prevent trickling in more cases. Verified some TODOs are fixed. * Remove TOOD about unit switching, confirmed working * Add grpcio req * Initial pass at v1 bluetooth module for compatibility. Still needs testing * Support config file, version scale status, lint cleanups, add helpers, update server.sh launcher. * Use config to enable pid tuner mode * Add OpenAPI definition * Update memcache for scale stability. Add comments * Add temporary new readme * Update scripts * Fix open file bug in main trickler. Update server script for ini file without flag. * Add manifest and setup files for proper python packaging * Update packaging script for creating local python zip package * use open when reading config files * Bluetooth bugfix, arg should be a dictionary * Daemonize bluetooth module. * Fix reading values over bluetoothe * Fix write from bluetooth functions * Add status LED control. * Define memcache strings in constants.py to avoid bugs and make typos easier to catch * Update newer ble script, still not ready to use * Remove quotes from config file, they get copied in * Make leds.py executable * Comment out led disable command * Fix bug in leds script * Fix bug in bluetooth write request for automode * Fix reference to scale units in ble module * Add reverse unit map to scales module * Set better default memcache values * Make trickler unit match correct type in memcache. Add logging * use default values to get values from memcache for leds script. * Switch gitignore from node to python * Reformat large conditional for readability * Add a second of sleep to allow scale to update when changing units * Reset the input buffer before reading serial device. * improve setup script and requirements file for non-arm machines * Lint fixes * Remove node variable from setup script * Add lint script * Improve bluetooth logging * Use percentages for PID controller * Change log setup to accept log level to correct verbosity * Change LED behavior. Don't change state in every loop cycle * Catch error from potential bad state and log. Don't default to False for auto_mode * Fix notifications for bluetooth. * Set generous timeouts for memcache client * Refactor for simplicity. Catch memcache exceptions. * Add sleep delay for led script. * Disable pylint import errors * Check memcache variables before starting LED script loop. Use try catch on memcache calls. Add timer delay in loop. * More logging in ble module. Change function name from update to all_mc_update, conflicts with exisiting function from parent class. * Less noisy logging for bluetooth * Rename config.ini to opentrickler_config.ini to avoid confusion with config.txt on the BOOT partition. * Allow verbose logging to be controlled from config file * No verbose flag for leds.py, copy paste typo * Set BLENO_DEVICE_NAME environment variable to ensure device name is properly set. * Update READMEs * Update SD firmware links and checksums
- Loading branch information