Alrighty lets get back at it and continue our journey into the bowels of the Creality’s file system and see what we can find.
First though for those unfamiliar with how to navigate the file system I should give a basic overview of how the file system is setup so that some of the directory names are not such a mystery. Basically you start at the root level signified by the forward slash ‘/’. For those using windows you might be familiar with the backslash. So starting at root level you will then descend into the lower directories, while they are not really leveled this way of thinking will help you later when moving through directories.
Here is a quick overview of the general linux directory structure, our minimal busy box installation may not have all of these directories.
#SUB-DIRECTORY PURPOSE
/bin common binary executables used by all users
/boot files associated with boot loader
/dev attached devices (usb, cdrom, mouse, keyboard)
/etc configuration files
/home personal directories for each user account
/lib shared system libraries
/media directory for mounting removable devices (floppy drive, cdrom)
/mnt directory for mounting filesystems (nfs, smb)
/opt optional vendor add-on software
/proc virtual filesystem for system processes/resources information
/root home directory for administrator account
/run storage for runtime information
/sbin binary executables used by administrator
/srv data for server services
/sys virtual filesystem for hardware/driver information
/tmp temporary files purged on reboot
/usr utilities and read-only user data/programs
/var variable and log files
Couple of quick commands we need first
cd The cd command is ‘Change Directory’, should be self explanatory.
ls The ls command is ‘List’ or list directory contents, there are several ‘switches’ available for it but the most common is going to the -l for ‘long’ format. Normally a linux system has what are called ‘man’ pages, man standing for manual. I will provide one of the longest living linux links I know of, I have been using this link since the 90’s and it never goes down.
So you have logged in as root in the root users directory, or if you set-up a user account you will be logged into that users directory. So lets start exploring and seeing what trouble we can get ourselves into, lets get Deep and Dirty!
My first commands are to go to the root directory and list the file structure.
jester@Ender3V3KE-95B8 /home/jester [$] cd /
jester@Ender3V3KE-95B8 / [$] ls
bin home linuxrc module_driver proc run tmp
dev lib media opt rom sbin usr
etc lib32 mnt overlay root sys var
jester@Ender3V3KE-95B8 / [$]
That’s nice but I’m a detailed orientated geek and I need more information, ok, I got you…
jester@Ender3V3KE-95B8 / [$] ls -l
total 6
drwxr-xr-x 2 root root 1079 Apr 12 18:01 bin
drwxr-xr-x 11 root root 2960 Mar 1 2020 dev
drwxr-xr-x 1 root root 1024 Jul 28 02:18 etc
drwxr-xr-x 3 root root 1024 Jul 28 02:30 home
drwxr-xr-x 5 root root 882 Apr 12 18:01 lib
lrwxrwxrwx 1 root root 3 Mar 4 17:32 lib32 -> lib
lrwxrwxrwx 1 root root 11 Mar 4 17:46 linuxrc -> bin/busybox
drwxr-xr-x 2 root root 3 Aug 14 2023 media
drwxr-xr-x 2 root root 3 Aug 14 2023 mnt
drwxrwxr-x 2 root root 884 Apr 12 18:01 module_driver
drwxr-xr-x 2 root root 3 Aug 14 2023 opt
drwxr-xr-x 5 root root 1024 Mar 1 2020 overlay
dr-xr-xr-x 98 root root 0 Jan 1 1970 proc
drwxr-xr-x 20 root root 296 Mar 4 17:57 rom
drwx------ 1 root root 1024 Jul 26 12:30 root
drwxr-xr-x 8 root root 480 Mar 1 2020 run
drwxr-xr-x 2 root root 1581 Apr 12 18:01 sbin
dr-xr-xr-x 12 root root 0 Mar 1 2020 sys
drwxrwxrwt 5 root root 500 Jul 28 07:11 tmp
drwxr-xr-x 1 root root 1024 Apr 12 18:01 usr
drwxr-xr-x 1 root root 1024 Apr 12 18:01 var
jester@Ender3V3KE-95B8 / [$]
What you see here are the file attributes, number of links to file, owner, group, size in bytes, last modified date/time and the file itself. Keep in mind that everything is a file, a directory is a file with more files.
Now at the beginning of each entry we see some letters such as drwxr-xr-x. This is file type and permissions, so in this example we see it is a directory, owner root has read, write, execute, group root has read and execute and same for others. So file type, owner, group, other is the format. I am not going to get into file permissions here as that gets a little deep.
Real quick edit, I just noticed a historical tid bit in the listing, on the proc folder you will see a date of Jan 1 1970. That my friends is what is known as the starting point of Unix time, the ‘Epoch’ time, the time long long ago when a new era of computing was unleashed upon mankind! But really it is a key part of time keeping in the Unix/Linux systems and it is listed in seconds since the ‘Epoch’ date. The Unix timestamp is often used in computing for timekeeping because it’s a simple, continuous count of seconds. For example…
jester@Ender3V3KE-95B8 /usr/data/printer_data/config [$] date +%s
1722125992
If you do some mathematics on that number you will get about 54 years and some change. Anyways just a little bit of historical computing knowledge.
Moving on lets find out how much space we are dealing with on this embedded printer and where it exists… We will use the disk free command df with the -h switch for ‘human readable’.
jester@Ender3V3KE-95B8 / [$] df -h
Filesystem Size Used Available Use% Mounted on
/dev/root 109.9M 109.9M 0 100% /rom
devtmpfs 98.4M 0 98.4M 0% /dev
tmpfs 98.5M 4.0K 98.5M 0% /dev/shm
tmpfs 98.5M 288.0K 98.2M 0% /tmp
tmpfs 98.5M 192.0K 98.3M 0% /run
/dev/mmcblk0p9 290.5M 2.6M 272.9M 1% /overlay
overlayfs:/overlay 290.5M 2.6M 272.9M 1% /
/dev/mmcblk0p10 5.9G 655.4M 5.0G 11% /usr/data
jester@Ender3V3KE-95B8 / [$]
Well this is very interesting data indeed. Two things that stand out to me is that the /dev/root file system is 100% read only memory and that /usr/data is a whopping 6 Gigabytes! That’s massive for an embedded system, I am assuming that is a eMMC storage chip either on the firmware board or the display console. That’s the beautiful thing about linux/unix, you can have your file system spread across multiple locations and operating system sees it all as one cohesive ‘drive’.
So this makes me wonder if we should create a folder in /usr/data and link our /home/your_user_name to so that we can upload and save files to it. Hmmm, can we print directly from the command line, now that would be cool.
Lets bounce over to /usr/data real quick and see what we find shall we…
jester@Ender3V3KE-95B8 / [$] cd /usr/data/
jester@Ender3V3KE-95B8 /usr/data [$] ls
creality lost+found printer_data wpa_supplicant.conf
factory_test_result macaddr.txt swap
jester@Ender3V3KE-95B8 /usr/data [$]
Oh, looky there, we got a Creality and a printer_data folder, lets dive in and look see shall we
Oh ya, I should tell that the system has ‘tab complete’, so if you start typing a file name and hit tab it should complete it for you. There is more to that but that is the basic gist of it. So if you start with cd cre and hit the tab key it will complete the file name creality.
jester@Ender3V3KE-95B8 /usr/data [$] cd creality/
jester@Ender3V3KE-95B8 /usr/data/creality [$] ls
tmp upgrade userdata
jester@Ender3V3KE-95B8 /usr/data/creality [$] cd upgrade/
jester@Ender3V3KE-95B8 /usr/data/creality/upgrade [$] ls
Ender-3_V3_KE_F005_ota_img_V1.1.0.14.img
jester@Ender3V3KE-95B8 /usr/data/creality/upgrade [$]
So here we see that in the folder Creality/upgrade we find the latest firmware update image 1.1.0.14. This is the entire system image, basically it’s the entire operating system we are currently rooting around in. When there is a new firmware update it will place the image here. Also notice the ota which means it was ‘over the air’, I did this upgrade from the control panel when I first got the printer.
Ok let’s go back up the ladder a couple rungs to get back to that printer_data folder. We can do this a couple ways, the fastest is to simply type cd …/… or cd /usr/data/ Now lets see what’s in the printer data folder…
jester@Ender3V3KE-95B8 /usr/data/creality/upgrade [$] cd ../..
jester@Ender3V3KE-95B8 /usr/data [$] ls
creality lost+found printer_data wpa_supplicant.conf
factory_test_result macaddr.txt swap
jester@Ender3V3KE-95B8 /usr/data [$] cd printer_data/
jester@Ender3V3KE-95B8 /usr/data/printer_data [$] ls
config gcodes logs
jester@Ender3V3KE-95B8 /usr/data/printer_data [$] cd config/
jester@Ender3V3KE-95B8 /usr/data/printer_data/config [$] ls
factory_printer.cfg printer-20240716_114112.cfg printer-20240719_084129.cfg printer-20240721_105301.cfg
gcode_macro.cfg printer-20240716_114230.cfg printer-20240719_084130.cfg printer-20240721_105427.cfg
printer-20240715_003930.cfg printer-20240716_121658.cfg printer-20240720_045317.cfg printer-20240722_103855.cfg
printer-20240715_004050.cfg printer-20240716_121817.cfg printer-20240720_045436.cfg printer-20240722_104020.cfg
printer-20240715_090534.cfg printer-20240717_120039.cfg printer-20240720_082700.cfg printer.cfg
printer-20240715_090653.cfg printer-20240717_120204.cfg printer-20240720_082826.cfg printer.cfg.1
printer-20240715_110611.cfg printer-20240717_121126.cfg printer-20240720_084519.cfg printer_params.cfg
printer-20240715_110736.cfg printer-20240717_122446.cfg printer-20240720_084644.cfg sensorless.cfg
printer-20240715_110737.cfg printer-20240717_123552.cfg printer-20240720_084645.cfg
printer-20240715_120625.cfg printer-20240717_124451.cfg printer-20240720_085131.cfg
printer-20240715_120751.cfg printer-20240719_084004.cfg printer-20240720_085250.cfg
jester@Ender3V3KE-95B8 /usr/data/printer_data/config [$]
Woozers look at all the fun stuff but the file we are interested in here is the factory printer configuration file, so let’s print that to the screen so we can have a quick look at it. We will use the cat command meow, no we not going to meow at it, unless you want to The cat command is…well go to that website I linked earlier and look at the man page for it. Basically we are going to print to the standard output which is the things your staring into right now, the monitor.
jester@Ender3V3KE-95B8 /usr/data/printer_data/config [$] cat factory_printer.cfg
# Ender-3V3KE
# Printer_size: 220x220x240
# Version: v1.2.4
# CreateDate: 2023/08/30
# mcu: chip: GD32F303RET6
# version: CR4NS200323C10
[include sensorless.cfg]
[include gcode_macro.cfg]
[include printer_params.cfg]
[mcu]
serial:/dev/ttyS1
baud:230400
restart_method: command
[force_move]
enable_force_move: True
[mcu rpi]
serial: /tmp/klipper_host_mcu
[bl24c16f]
i2c_mcu: rpi
i2c_bus: i2c.2
i2c_speed: 400000
######################################################
[prtouch_v2]
pres_cnt: 1 #探点次数
pres0_clk_pins: PA4 #压力检测时钟引脚配置
pres0_sdo_pins: PC6 #压力检测数据引脚配置
step_swap_pin: PA15
pres_swap_pin: PA15
step_base:2
# show_msg: True
tri_min_hold: 1000
tri_max_hold: 1500 #压力检测信息展示
speed: 1
# tri_wave_ip: 172.22.30.204
#####################################################
[z_compensate]
tri_min_hold: 1400
tri_max_hold: 2000 #压力检测信息展示
tri_expand_mm = 0.13
# tri_min_hold: 3
speed: 5
hot_start_temp: 180#擦喷嘴是最小温度
hot_rub_temp: 200#擦喷嘴是最小温度
hot_end_temp: 140#擦喷嘴是最小温度
bed_add_temp: 60#调平时的热床温度
clr_noz_start_x: -3 #擦喷头区域的起始x坐标(默认在热床后方正中心位置)
clr_noz_start_y: 20 #擦喷头区域的起始y坐标
clr_noz_len_x: 3 #擦喷头区域的x方向的长度
clr_noz_len_y: 50 #擦喷头区域的y方向的长度
pa_clr_dis_mm_x = 0
pa_clr_dis_mm_y =30
# show_msg = True
bl_offset: 0,27
noz_pos_center: 20,25
noz_pos_offset: 3,7
pumpback_mm: 10
vs_start_z_pos: 3
pr_probe_cnt: 3
pr_clear_probe_cnt: 3
type_nozz = 0
[printer]
kinematics: cartesian
max_velocity: 500
max_accel: 8000
max_accel_to_decel: 2500
max_z_velocity: 30
square_corner_velocity: 5.0
max_z_accel: 300
[idle_timeout]
timeout: 99999999
[stepper_x]
step_pin: PC2
dir_pin: !PB9
enable_pin: !PC3
microsteps: 16
rotation_distance: 40
endstop_pin: !PA5
position_endstop: -13
position_min: -13
position_max: 220
homing_speed: 30
homing_retract_dist:0 #10
[tmc2208 stepper_x]
uart_pin:PB12
interpolate: True
run_current:0.75
sense_resistor: 0.150
stealthchop_threshold: 0
[stepper_y]
step_pin: PB8
dir_pin: PB7
enable_pin: !PC3
microsteps: 16
rotation_distance: 60
endstop_pin: !PA6
position_endstop: -20
position_min: -20
position_max: 225
homing_speed: 30
homing_retract_dist:0
[tmc2208 stepper_y]
uart_pin:PB13
interpolate: True
run_current:0.8
sense_resistor: 0.150
stealthchop_threshold: 0
[stepper_z]
step_pin: PB6
dir_pin: !PB5
enable_pin: !PC3
microsteps: 16
rotation_distance:8
endstop_pin:probe:z_virtual_endstop#PA15 #probe:z_virtual_endstop
position_max: 245
position_min: -5
[tmc2208 stepper_z]
uart_pin: PB14
interpolate: True
run_current: 0.8
stealthchop_threshold: 0
sense_resistor: 0.150
[bltouch]
sensor_pin:PC14
control_pin: PC13
x_offset: 0
y_offset: 27
z_offset: 0
probe_with_touch_mode: true
stow_on_each_sample: false
speed:5
lift_speed:20
[filament_switch_sensor filament_sensor]
switch_pin: !PC15
pause_on_runout: true
[output_pin MainBoardFan]
pin: !PB1
[extruder]
max_extrude_only_distance:1000
max_extrude_cross_section:80
pressure_advance = 0.036
step_pin: PB4
dir_pin: PB3
enable_pin: !PC3
microsteps: 16
rotation_distance: 7.53
nozzle_diameter: 0.400
filament_diameter: 1.750
heater_pin: PA1
sensor_type: EPCOS 100K B57560G104F
sensor_pin: PC5
control = pid
pid_Kp=20.584
pid_Ki=1.737
pid_Kd=60.981
min_temp: 0
max_temp: 320 # Set to 300 for S1 Pro
[heater_bed]
heater_pin: PB2
sensor_type: EPCOS 100K B57560G104F
sensor_pin: PC4
control = pid
pid_kp = 70.652
pid_ki = 1.798
pid_kd = 694.157
min_temp: 0
max_temp: 120 #
temp_offset_flag = True
[verify_heater extruder]
[verify_heater heater_bed]
check_gain_time: 120
heating_gain: 1.0
hysteresis: 10
[temperature_sensor mcu_temp]
sensor_type: temperature_mcu
min_temp: 0
max_temp: 100
[output_pin fan0]
pin:PA0
pwm: True
cycle_time: 0.0100
hardware_pwm: false
value: 0.00
scale: 255
shutdown_value: 0.0
[heater_fan nozzle_fan]
pin: PC1
max_power: 1.0
shutdown_speed: 0
cycle_time: 0.010
hardware_pwm: False
kick_start_time: 0.100
off_below: 0.0
heater: extruder
fan_speed: 1.0
heater_temp: 60.0
[bed_mesh]
speed: 350
mesh_min: 5,10 #need to handle head distance with bl_touch
mesh_max: 215,215 #max probe range
probe_count: 5,5
fade_start: 1
fade_end: 10
fade_target: 0
horizontal_move_z: 8
[input_shaper]
shaper_type_y = mzv
shaper_freq_y = 32.0
shaper_type_x = mzv
shaper_freq_x = 27.5
[mcu rpi]
serial: /tmp/klipper_host_mcu
[adxl345]
cs_pin: rpi:None
spi_speed: 2000000
spi_bus: spidev2.0
axes_map: z,y,x
[resonance_tester]
accel_chip: adxl345
accel_per_hz: 70
probe_points: 117.5,117.5,100
max_freq: 90
jester@Ender3V3KE-95B8 /usr/data/printer_data/config [$]
Bingo…Jackpot!
I think that is enough for this session. I will be back after I investigate creating a user directory in the usr/data directory and linking that to our users home directory
Until then Sasha Cat says Meow!