The default setuptools installed by virtaulenv has dropped support for
python2. Explicitly remove it from the installation.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Replace the custom encoding with a hex encoding. This makes it a
little easier to inspect the CTR conversions.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Store the CTR requests in compile_time_request.txt with the null
characters removed. This makes it slightly easier to inspect the CTR
conversions.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Add basic ARM Cortex-M C init code and build linker scripts to
src/generic/ code. This can be used to simplify the various ARM board
code.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Use /tmp/klippy.log in the install script - all the documentation
currently uses that file location.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
There's a security bulletin for Jinja2 v2.10 (CVE-2019-10906). This
wont impact Klipper, but best to upgrade the package requirements to
avoid getting security alerts.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Place all of the host software python requirements into a config file.
This makes it easier to update the python requirements without having
to update several installation scripts.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Instead of waiting one second after entering bootloader mode, wait for
the device file to reappear. This should make the flashing more
resilient to slight timing difference in the OS.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Avoid transmitting lists of message ids for commands and responses -
gzip doesn't do a good job of compressing them.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Default to running dfu-util via sudo as most machines will not have
the user setup with permissions to access the raw usb device.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Add a script to help flash Klipper over USB. This tool can instruct
Klipper to enter into bootloader mode and it can help track changes in
device name during that transition.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
These two options don't provide any value and it is causing confustion
with some users. Remove the buttons.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
The gitdir previously could be absent and produce a version of "" in
spite of checks for it. Fixed.
Parent directories with shlex-interpreted characters in their names
could be misinterpreted. Removed shlex parsing.
Packagers may want to remove the git history to slim down the package
size, so add an option for using a file 'version' in the klippy
directory to set version without using git.
Signed-Off-By: Lucas Fink <software@lfcode.ca>
Now that there is a local copy of bossac in the lib directory, there's
no reason to require a system version of it.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Dockerfile: Add a basic reference Dockerfile
This is a sample of how to get Klipper running in Docker, because of the
virtual serial port, the user will have to modify things to include
something to send the GCode. I have included a link to my repo which has
OctoPrint up and running as an example.
Signed-off-by: Trent Davis <tgh@sillyfrog.com>
No need to include all the test preparation in the verbose output - as
that can make the output more confusing.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
The purpose of this PR is to add an installation script to klipper for use on Centos. Several packages names are different from debian based installs, and the system service is handled via systemd rather than LSB.
Signed-off-by: Alan Weinstock <pyroballpcs@gmail.com>
Add virtualenv, build-essential, gcc-arm-none-eabi, and
binutils-arm-none-eabi packages - just in case they aren't already
installed. Reported by @AxMod3DPrint.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
The python-dev package is usually already installed, but there's no
harm in stating it explicitly. Reported by @yschroeder.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Add --always flag to "git describe" command to get a build identifier
even if one checks out the repo with a depth parameter that prunes out
the last tagged version.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Move the travis installation steps from the travis-build.sh script to
a new script (scripts/travis-install.sh). Move the travis-build.sh
script to the scripts/ directory as well.
The data dictionaries built in the compile tests are useful during
host software testing, so run all the compile tests sequentially in a
single VM and save the data dictionaries after each build. Also,
build all the config files found in the test/configs/ directory.
Create the python virtualenv environment during the install phase and
invoke the klippy.py host software in the build phase to perform a
basic host software sanity check.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
The mcu stats (that contain a prefix) may occur before some other
stats - make sure to only apply the stats prefix to those stats that
need it.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
The print_stall logic could cause large portions of the graph to show
up as 100% host utilized. Rework the logic to avoid that.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Use an alpha transparency on each of the stats, so that it is possible
to see how the values overlap.
Also, always enable the "awake time" stat - just use a lower alpha
transparency for it.
Also, explicitly set the graph size as some version of matplotlib have
a different default.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Update the mechanism to filter out cases where buffer_time is below
MAXBUFFER so that it works with the statistics currently generated.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Matplotlib will try to open a display by default - tell it not to do
that so that it can run in batch mode on headless machines.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Store the gcc and binutils versions used in the compilation of the
firmware in the firmware data dictionary. Forward that information to
the log so it is available during debugging.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Add initial support for extracting out shutdown information from a
klippy.log file. The shutdown dump will be reordered into the
sequence that they occurred, and timestamps/sequence numbers in the
mcu message dump will be expanded.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Update the graphstats.py graphing script so that it works with recent
stats changes - the stats can now contain groups that end with a ':'
and the print_time is no longer reset to zero on a new print.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Make sure the ADC module gets loaded during startup - it's normally
loaded by the cape manager eeprom, but there's no harm in requesting
it explicitly.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
It appears some versions of Debian will load the PRU with firmware on
boot, so make sure to always deactivate the PRU before attempting to
activate it with new firmware.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Update the scripts used to install and "flash" the pru
micro-controller code. Also, add a "flash" script for the linux
micro-controller code. This makes it easier to install Klipper on a
Beaglebone board that uses a Replicape.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Now that tasks are only run when needed it's common for there to be a
larger variation in task execution time. When graphing load, consider
a 99-percentile task duration of 2.5ms to be 100% loaded (up from
1ms).
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Don't use the sendf() macro for ack and nak messages - directly call
the command_sendf() code instead.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Some systems point python to python3 instead of python2 - explicitly
request python2 to avoid conflicts.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Add python-virtualdev to the list of system packages to be installed -
it's usually already installed, but it doesn't hurt to add it to the
list in case it isn't already installed.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Avoid using linker magic to define the init, task, and shutdown
functions. Instead, use the compile_time_request system. This
simplifies the build and produces more efficient code.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Avoid generating unique ids via memory locations and linker scripts.
Instead, generate them using code produced by buildcommands.py.
Utilize gcc's ability to perform static string comparisons at compile
time to produce a unique id for each unique string.
This fixes a build failure on ARM introduced in 142b92b8. It also
reduces the complexity of the build.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Add __visible to generated code in compile_time_request.c so that the
main code can be compiled with -fwhole-program.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Add a system startup script so that Klipper can automatically start at
boot time. Create an installation script that will install the system
dependencies and the startup script.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Support timing the simulation scaled to the system clock. This can be
used to make the host estimation of the mcu clock more accurate.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Don't start/stop the simulavr simulation loop to do IO - instead
implement the IO directly in the serial callback handlers. This
improves the speed and consistency of the simulation.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Change the lookahead queue so that it attempts to buffer at least
buffer_time_high amount of moves when first starting a print. This
helps ensure the buffer is normally always full.
If the buffer falls below buffer_time_low then it is either due to the
end of a print or because octoprint/klippy is unable to keep up.
Change the code so that in this case the lookahead queue will attempt
to gather buffer_time_high amount of moves before restarting movement.
Update the default buffer_time_low to 1 second and buffer_time_high to
2 seconds. With the above changes a smaller buffer_time_high and a
larger buffer_time_low are more practical.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Add a DECL_CONSTANT macro to allow the firmware to define constants
that are to be exported to the host during the "identify" phase. This
replaces the existing hardcoded mechanism of scanning the Kconfig
header file for certain constants.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Commit afecf7ce inverted the direction of the direction pin in
queue_step commands - update the stepstats script to conform.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>