aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* heaters: Make sure set_temp() command wakes up the idle_timeoutKevin O'Connor2021-03-054-12/+14
| | | | | | | | | Introduce a heaters.set_temperature() command and call that from commands that set a heater temperature. This new function calls toolhead.register_lookahead_callback() so that the idle_timeout gets notification that activity has occurred. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* klippy: Fix check for duplicate objectsKevin O'Connor2021-03-051-1/+1
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Add support for STM32F1 I2C1 alternate pin mapping (#4012)Michael Kurz2021-03-022-5/+15
| | | | | | This adds support for the alternate pin mapping of I2C1 on PB8/9 in STM32F1 devices Signed-off-by: Michael Kurz <michi.kurz@gmail.com>
* console: Add option to enable debug output modeKevin O'Connor2021-03-021-1/+7
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* console: Make baud an optional parameterKevin O'Connor2021-03-022-4/+14
| | | | | | | Make the baud rate an optional parameter to the console.py tool. When not present, it will default to 250000. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* serialhdl: Update callers to decide serial fd typeKevin O'Connor2021-03-024-70/+89
| | | | | | | | Don't try to detect a "real serial port" in serialhdl.py. Instead, have the callers invoke either connect_uart(), connect_file(), or connect_pipe(). Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* st7920: Better support for emulated ST7920 displays (#3979)teeminus2021-03-013-47/+141
| | | | | Added new ST7920E display driver which is better suited for displays with emulated ST7920 Signed-off-by: Christian Kehe <teeminus@posteo.net>
* fan: Minor updates to tachometer handlingKevin O'Connor2021-03-013-5/+7
| | | | | | | | | | | Add new fields to Command_Templates.md. Remove unused self.rpm variable. Use an explicit get_frequency() method in keeping with Klipper's convention of not "peeking into member variables". Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* fan: Add tachometer supportAdrian Keet2021-03-015-2/+238
| | | | | | | | | | | | | | This adds new config options for fans: 'tachometer_pin' to specify the GPIO pin, and 'tachometer_ppr' (default 2) to specify the number of signal pulses per revolution. The rpm is also exposed by get_status for command templates and the API server. For fast fans (at least 10000 RPM), the polling interval can be shortened using the 'tachometer_poll_interval' option. There is a new mcu object for a generic edge counter, which repeatedly polls a GPIO pin and periodically reports the count to the host. Signed-off-by: Adrian Keet <arkeet@gmail.com>
* serialqueue: correctly report EOF errorsLasse Dalegaard2021-03-011-1/+4
| | | | | | | | | If `klippy` loses connection to a device, the next `read()` from the device file descriptor will result in a zero-byte result, i.e. an `EOF`. Right now this gives a confusing error message, so this simply handles the special case of `EOF` and outputs a better log message. Signed-off-by: Lasse Dalegaard <dalegaard@gmail.com>
* chelper: Move logging_callback() to global scopeKevin O'Connor2021-03-011-4/+6
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* serialhdl: prevent creation of controlling ttyLasse Dalegaard2021-03-011-2/+3
| | | | | | | | | | | | | | | | | | | | When `serialhdl` opens a terminal device it must prevent the device from becoming the controlling terminal of `klippy`, as such a terminal will send additional messages to the session leader, e.g. a SIGHUP, which would kill `klippy`. See e.g. #3981. pySerial already does this, but for e.g. `klipper_mcu` we were not doing this ourselves. On Linux a process must set `O_NOCTTY` when opening any file that could potentially be a terminal device, to avoid this. Earlier process daemonization tools prevent this from being an issue by double forking, but under `systemd` a process must take steps to avoid opening a controlling terminal. Signed-off-by: Lasse Dalegaard <dalegaard@gmail.com> Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* tmc: Fix order of init during sensorless homingKevin O'Connor2021-02-282-4/+11
| | | | | | | | | | | With commit 53b10d3a the setup of sensorless homing could occur before the driver was enabled which would cause the reinitialization of the driver settings to undo the sensorless homing setup. Use set_field() when setting the sensorless homing registers so that it wont conflict with a driver init. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* tmc: No need to delay init on a stepper enableKevin O'Connor2021-02-281-3/+2
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* logextract: Improve handling of TMC UART read/write register commandsKevin O'Connor2021-02-281-1/+3
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* tmc: Allow more retries on a TMC UART read error during background checksKevin O'Connor2021-02-281-1/+10
| | | | | | | Allow three retries if we can't contact the TMC driver at all when it is in UART mode. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* logextract: Add helper to decode tmcuart messagesKevin O'Connor2021-02-281-0/+104
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* config: fan pin number correction for Robin Nano 3 (#4005)Oleksii Zelivianskyi2021-02-281-1/+2
| | | | | | There are two fan pins on Robin Nano 3 and the fan1 pin is PC14, not PB1. PB1 pin that was in config example is used for the fan2 output. Signed-off-by: Oleksii Zelivianskyi <alexeyzel@gmail.com>
* confifg: Update printer-flsun-q5-2020.cfg (#4000)FrY Sennberg2021-02-281-1/+1
| | | | | we just found a small problem: Some people have slightly higher endstop positions, which caused them to have a move out of range during probe calibrate. Signed-off-by: Christoph Frei <fryakatkop@gmail.com>
* config: EXP2 header pin correction in Robin Nano 3 (#3997)Oleksii Zelivianskyi2021-02-281-1/+1
| | | | | | | According to Robin Nano v3 pinout the correct pins for: - EXP2_4 is PE10 - EXP2_6 is PA7 Signed-off-by: Oleksii Zelivianskyi <alexeyzel@gmail.com>
* tmc_uart: Minor change - make the baud rate setting more clearKevin O'Connor2021-02-271-1/+3
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* tmc: Add support for periodic checking of driver statusKevin O'Connor2021-02-273-2/+83
| | | | | | | | Check the status of all Trinamic stepper motor drivers once a second. If the driver reports an error then invoke a shutdown. Also log any serious warnings. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* tmc: Reinitialize on every driver enableKevin O'Connor2021-02-271-32/+36
| | | | | | | | | | | | | Send the full TMC stepper motor driver initialization sequence every time the driver is enabled. Don't raise an error on startup if unable to contact a tmc2208/tmc2209 driver. If the driver is still unavailable when it is enabled then a shutdown will be issued. This allows users to troubleshoot (and possibly bring up communication to the driver) prior to enabling the driver. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* tmc2660: Fix tmc register readingKevin O'Connor2021-02-271-30/+35
| | | | | | | | | The tmc2660 appears to send responses as soon as the clk starts toggling. That means the 20 bit response is at the top of the 24bit sent message. Also, this implies that RDSEL must already have the correct value in the prior message. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* tmc2660: Use common warning/error flag names and descriptionsKevin O'Connor2021-02-271-43/+30
| | | | | | | | Where the tmc2660 flags match other drivers, use lowercase so that the same monitoring code can be used for all the tmc drivers. Also, use the same field formatters where applicable. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* tmc5160: Merge field formatters into tmc2130.pyKevin O'Connor2021-02-272-5/+1
| | | | | | | | The tmc5160 field formatters were mostly duplicates of the tmc2130 - add the "reset" field to tmc2130.py so both drivers have similar reporting. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* tmc: Always report values after a SET_TMC_CURRENT commandKevin O'Connor2021-02-271-14/+15
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* tmc: Move SET_TMC_CURRENT command to TMCCommandHelper()Kevin O'Connor2021-02-276-68/+37
| | | | | | | Refactor the tmc driver implementations so that there is a single implementation of the SET_TMC_CURRENT command. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* tmc2660: Add set_current()/get_current() helpers to TMC2660CurrentHelperKevin O'Connor2021-02-271-9/+15
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* tmc5160: Add set_current()/get_current() helpers to TMC5160CurrentHelperKevin O'Connor2021-02-271-14/+18
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* tmc2130: Add set_current()/get_current() helper functions to TMCCurrentHelperKevin O'Connor2021-02-271-16/+20
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* mcu: Raise a command_error on a command timeout eventKevin O'Connor2021-02-271-4/+6
| | | | | | | | Raise a printer.command_error() instead of an mcu.error() if a query command does not succeed. That error is less likely to result in an unhandled exception error. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* virtual_sdcard: exact filename match before case insensitive oneAndre LeBlanc2021-02-261-1/+3
| | | | | | | | | currently, if there are 2 files on the virtual sd card whose names differ only in case (eg. MyFile.gcode vs myfile.gcode) the actual file that gets loaded is at best unpredictable. this patch checks for an exact match before attempting a case-insensitive one. Signed-off-by: Andre LeBlanc <andrepleblanc@gmail.com>
* extruder: Make sure to flush steps during sync_stepper()Kevin O'Connor2021-02-261-0/+2
| | | | | | | | The stepper positions will only be in sync after the step generation code has been flushed. This fixes an "internal error in stepcompress" error during a SYNC_STEPPER_TO_EXTRUDER command. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* tmc2130: Add spi daisy chain supportMarco D'Alessio2021-02-263-16/+73
| | | | | | | | This patch adds the ability to daisy-chain multiple tmc2130 and tmc5160 drivers. Signed-off-by: Marco D'Alessio <marco@wrecklab.com> Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* tmc: Improve error message on missing microsteps configKevin O'Connor2021-02-231-1/+2
| | | | | | | If microsteps is missing, warn about it in the stepper config section, not the tmc config section. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stepper: Improve error messages on missing rotation_distanceKevin O'Connor2021-02-231-5/+8
| | | | | | | | If neither rotation_distance nor step_distance is present, then generate an error saying rotation_distance is needed (instead of an error about step_distance). Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* docs: Use BME280 (uppercase) in Config_Reference.md (#3896)Stefan Dej2021-02-221-2/+2
| | | Signed-off-by: Stefan Dej <meteyou@gmail.com>
* test: Add printer-flsun-q5-2020.cfg to printers.test and minor changesKevin O'Connor2021-02-222-3/+2
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* config: add Flsun Q5 config (#3915)FrY Sennberg2021-02-221-0/+113
| | | | | In cooperation with chaosdrucker Signed-off-by: Christoph Frei <fryakatkop@gmail.com>
* Revert "bme280: Rename sensor_type from BME280 to bme280"Kevin O'Connor2021-02-202-4/+1
| | | | | | | | | This reverts commit ac61f8b72603e9d08832250026e48093dd66aec4. Many temperature sensors are capitalized, so don't make this chaneg to the bme280. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* menu: Default menu should check extruders have heaters (#3969)Janar Sööt2021-02-201-2/+2
| | | | | | For the hotend targets check also available heaters. It'll solve crash when using shared heaters. Signed-off-by: Janar Sööt <janar.soot@gmail.com>
* menu: redesigned name scroller & menu rendering (#3837)Janar Sööt2021-02-202-93/+95
| | | Signed-off-by: Janar Sööt <janar.soot@gmail.com>
* config: Rename generic-mks-robin-nano.cfg to generic-mks-robin-nano-v1.cfgKevin O'Connor2021-02-202-1/+1
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* config: Add example generic-mks-robin-nano-v2.cfg configKevin O'Connor2021-02-202-0/+113
| | | | | | Reported by @mks-viva. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* config: Add example generic-mks-robin-nano-v3.cfg configKevin O'Connor2021-02-202-0/+110
| | | | | | Reported by @mks-viva. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Add support for 48KiB bootloadersKevin O'Connor2021-02-201-0/+3
| | | | | | Reported by @mks-viva. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* scripts: Fix typo in install-centos.shKevin O'Connor2021-02-201-1/+1
| | | | | | Reported by @fishbone222. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* bme280: Rename sensor_type from BME280 to bme280Kevin O'Connor2021-02-202-1/+4
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* temperature_host: Rename "path" config to "sensor_path"Kevin O'Connor2021-02-203-5/+6
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>