BTT Pi - GPIO Numbering

SOLVED !

Message form facebook BTT group

PG19 is definitely a GPIO pin. It may not be on the 40 pin GPIO header but any input / output pin on the BTT Pi and CB1 is GPIO.

The formula to convert from PG19 to GPIO is:

[(PG - PA)*32] + {Pin Number}

Where PA = 1, PB =2….so PG = 7

So [(7-1)*32] + 19 = 211

Try using GPIO211

The BTT documentation on this is rubbish and lacking.

result :

image

Thanks again and happy FAST printing

2 Likes

Push on GitHub with more explanation.

Is there any way to make that GPIO211 pin a PWM one rather than just voltage?

Each pin can work as software PWM pin which usually is the better choice anyway.
If you aim for hardware PWM then the answer is no.

I have btt pi v1.2 in the board connector that does not activate current or voltage. I have added the content to the print.cfg:

this added in file fanboard.cfg

[mcu host]
serial: /tmp/klipper_host_mcu
[temperature_fan raspberry_pi]
pin: host:gpio211
kick_start_time: 0.8
#shutdown_speed: 0
off_below: 0.1
max_power: 1.0
#fan_speed: 0.6
sensor_type: temperature_host
control: pid
min_temp: 0
max_temp: 85
#max_delta: 5.0
pid_kp: 1.0
pid_ki: 0.5
pid_kd: 2.0
min_speed: 0.1
max_speed: 0.6
target_temp: 38

but it doesn’t start anymore, it stays blue:

Klipper reports: STARTUP

Printer is not ready
The klippy host software is attempting to connect. por favor
retry in a few moments.

my config print.cfg

[include macros_config_pid.cfg]
[virtual_sdcard]

path: /home/biqu/printer_data/gcodes
on_error_gcode: CANCEL_PRINT

[stepper_x]
step_pin: PC2
pin_addr: PB9
enable_pin: !PC3
microsteps: 16
rotation_distance: 40
endstop_pin: ^PA5
position_endstop: 0
position_max: 247
homing_speed: 50

[stepper_y]
step_pin: PB8
pin_addr: PB7
enable_pin: !PC3
microsteps: 16
rotation_distance: 40
endstop_pin: ^PA6
position_endstop: 0
position_max: 217
homing_speed: 50

[stepper_z]
step_pin: PB6
pin_addr: !PB5
enable_pin: !PC3
microsteps: 16
rotation_distance: 8
# position_endstop: 0.0 # disable to use BLTouch
# endstop_pin: ^PA7 # disable to use BLTouch
endstop_pin: probe:z_virtual_endstop # enable to use BLTouch
position_min: -5 # enable to use BLTouch
position_max: 230

[safe_z_home] # enable for BLTouch
home_xy_position: 157.5, 121.5
speed: 200
z_hop: 10
z_hop_speed: 5

[bltouch]
sensor_pin: ^PB1
control_pin: PB0
x_offset: -46
y_offset: -7
#z_offset: 0

[bed_mesh]
speed: 120
horizontal_move_z: 5
mesh_min: 30,30 #18,18 #10,10
mesh_max: 189,189 #210,205
#mesh_pps: 2, 2
Probe_count: 5, 5
algorithm: bicubic
fade_start: 1
fade_end: 10
fade_target: 0

[screws_tilt_adjust]
screw1: 74, 42
screw1_name: Front left
screw2: 245, 42
screw2_name: Front right
screw3: 245, 208
screw3_name: Back right
screw4: 74, 208
screw4_name: Back left
screw_thread: CW-M4
horizontal_move_z: 10


[extruder] #test by my jfml
pressure_advance = 0.04

max_extrude_only_distance: 100.0
step_pin: PB4
pin_addr: PB3
enable_pin: !PC3
microsteps: 16
rotation_distance: 7.76
nozzle_diameter: 0.400
filament_diameter: 1,750
heater_pin: PA1
sensor_type: EPCOS 100K B57560G104F
sensor_pin: PC5
min_temp: 0
max_temp: 260


[heater_bed]
heater_pin: PA2
sensor_type: EPCOS 100K B57560G104F
sensor_pin: PC4
min_temp: 0
max_temp: 95

[fan] #cape fan
pin: PA0

[mcu] # ender board
serial: /dev/serial/by-id/usb-1a86_USB_Serial-if00-port0
restart_method: command





[filament_switch_sensor filament_sensor]
pause_on_runout: True
switch_pin: !PA4

[printer]
kinematics: cartesian
max_velocity: 300
max_accel: 3000
max_z_velocity: 5
max_z_accel: 100

[temperature_sensor btt_pi_host]
sensor_type: temperature_host
min_temp: 10
max_temp: 100

[temperature_sensor mcu_temp_ender]
sensor_type: temperature_mcu
min_temp: 0
max_temp: 100

[include fanboard.cfg] here I have added the pi 1.2 motherboard fan configuration
[include mainsail.cfg]
[include Btt_ADXL345.cfg] #configuration btt resonance btt pi jfml 

fanboard.cfg

[mcu host]
serial: /tmp/klipper_host_mcu


[temperature_fan raspberry_pi]
pin: host:gpio211
kick_start_time: 0.8
#shutdown_speed: 0
off_below: 0.1
max_power: 1.0
#fan_speed: 0.6
sensor_type: temperature_host
control: pid
min_temp: 0
max_temp: 85
#max_delta: 5.0
pid_kp: 1.0
pid_ki: 0.5
pid_kd: 2.0
min_speed: 0.1
max_speed: 0.6
target_temp: 38

I don’t know where I made the mistake but the pin or connector does not send voltage to the fan.

1 Like

@Jfml :

Could you please put your code snippet between code braces.

Format

The way you did it, information like spaces get lost.

1 Like

Any idea what the error could be?

Put inside printer.cfg

[mcu host]
serial: /tmp/klipper_host_mcu

Remove from fan…cfg

1 Like

thanks I will try

I have gotten it to work, I needed to create the MCU but I see that it spins slowly. I have measured voltage and it is approximately 3 v

If I set the value in klipperscreen to 0, the rest of the values ​​stop spinning very slowly with only 3 v and the fan It is 5v

4 posts were split to a new topic: Error “Unknown pin chip name host’.”

2 posts were split to a new topic: Printer object already created