Skip to content

Commit 89d4026

Browse files
committed
rework macro BEEP description
1 parent 1318ded commit 89d4026

File tree

3 files changed

+32
-26
lines changed

3 files changed

+32
-26
lines changed

armbian-mkspi-mainline-setup-v25-2.md

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -272,17 +272,7 @@ cd
272272
wget https://torte71.github.io/tmteststuff/files/makerbase-beep-service.deb
273273
dpkg -i makerbase-beep-service.deb
274274
```
275-
* Fix access rights to gpio82:
276-
* Execute `nano /etc/rc.local`
277-
* Add following lines (before the `exit 0` line)
278-
```
279-
if [ ! -d "/sys/class/gpio/gpioi82" ]; then
280-
echo 82 > /sys/class/gpio/export
281-
fi
282-
chgrp mks /sys/class/gpio/gpio82/value
283-
chmod g+w /sys/class/gpio/gpio82/value
284-
```
285-
* Save and exit the editor
275+
* (Modifying `/etc/rc.local`, as stated in prior versions, is not required)
286276
* To uninstall:
287277
* Execute `sudo dpkg -r makerbase-beep-service`
288278

armbian-mkspi-setup-v24-2.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -150,11 +150,7 @@ Modifications from Sovol useful for this image:
150150
* Log into the device (ssh/putty/serial)
151151
* `sudo dpkg -i printer_data/gcodes/makerbase-beep-service.deb`
152152
* (change the path, if you've uploaded to a different location)
153-
* fix access rights to gpio82:
154-
* `sudo nano /etc/rc.local`
155-
* add following lines (before the `exit 0` line)
156-
* `chgrp mks /sys/class/gpio/gpio82/value`
157-
* `chmod g+w /sys/class/gpio/gpio82/value`
153+
* (Modifying `/etc/rc.local`, as stated in prior versions, is not required)
158154
* To uninstall:
159155
* `sudo dpkg -r makerbase-beep-service`
160156

beeper.md

Lines changed: 30 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,22 +12,37 @@ nav_order: 2
1212
{:toc}
1313
----
1414

15-
* Beeper script:
16-
* Based on solution by "Bastian" on <https://forum.sovol3d.com>
17-
* <https://forum.sovol3d.com/t/use-beeper-from-mks-sbc-which-pin/3606/5>
15+
## Description
16+
The "BEEP" macro allows Klipper to emit beeps, e.g. to signal filament change, cancelled prints and similar.
1817

19-
* Requires udev rule to change rights for gpio access
20-
* Based on solution by "MikeDK" on <https://forums.raspberrypi.com>
21-
* <https://forums.raspberrypi.com/viewtopic.php?t=9667>
18+
It is based on the solution by "Bastian" at <https://forum.sovol3d.com/t/use-beeper-from-mks-sbc-which-pin/3606/5>.
19+
20+
There are two slightly different approaches:
21+
* a) Klipper directly accesses the GPIO
22+
* b) GPIO is handled by shell script, which is called from Klipper via gcode-shell-command
23+
24+
Option a) does not depend on "gcode-shell-command", but it does not work together with "makerbase-beep-service", so touching the screen will not beep any longer. (The makerbase service requires the GPIO pin to be exported, but Klipper requires it to be unexported.)
2225

23-
* /etc/udev/rules.d/90-gpio.rules
26+
In order to not break the touchscreen beeps, I prefer option b) using the external shell script.
2427

28+
## System setup (set access rights, export gpio pin)
29+
* Requires udev rule to change rights for gpio access
30+
* Based on solution by "MikeDK" on <https://forums.raspberrypi.com/viewtopic.php?t=9667>
31+
* Create `/etc/udev/rules.d/90-gpio.rules`:
2532
```
2633
SUBSYSTEM=="gpio", KERNEL=="gpiochip*", ACTION=="add", PROGRAM="/bin/sh -c 'chown root:dialout /sys/class/gpio/export /sys/class/gpio/unexport ; chmod 220 /sys/class/gpio/export /sys/class/gpio/unexport'"
2734
SUBSYSTEM=="gpio", KERNEL=="gpio*", ACTION=="add", PROGRAM="/bin/sh -c 'chown root:dialout /sys%p/active_low /sys%p/direction /sys%p/edge /sys%p/value ; chmod 660 /sys%p/active_low /sys%p/direction /sys%p/edge /sys%p/value'"
35+
```
36+
* If you are **not** installing [makerbase-beep-service](makerbase-beep-files.html), then you need to set up gpio82 at boot time.
37+
Insert following code to `/etc/rc.local` (after the lines starting with '#', but before the 'exit 0' line):
38+
```
39+
echo 82 > /sys/class/gpio/export
40+
echo out > /sys/class/gpio/gpio82/direction
2841
```
2942

30-
* /home/mks/printer_data/config/printer.cfg:
43+
## Klipper setup (add macro "BEEP")
44+
* Requires [gcode-shell-command](https://github.com/dw-0/kiauh/blob/master/docs/gcode_shell_command.md)
45+
* Add BEEP macro to `/home/mks/printer_data/config/printer.cfg`:
3146

3247
{% raw %}
3348
```
@@ -39,14 +54,16 @@ gcode:
3954
RUN_SHELL_COMMAND CMD=beep PARAMS='{beep_count} {beep_duration} {pause_duration}'
4055
4156
[gcode_shell_command beep]
42-
command: bash /home/mks/printer_data/config/macro/macro-beep.sh
57+
command: bash /home/mks/printer_data/config/macros/macro-beep.sh
4358
timeout: 10
4459
verbose: False
4560
```
4661
{% endraw %}
4762

48-
* /home/mks/printer_data/config/macros/macro-beep.sh:
63+
## Add shell script ("macro-beep.sh")
64+
* Create `/home/mks/printer_data/config/macros/macro-beep.sh`:
4965

66+
{% raw %}
5067
```
5168
#!/bin/bash
5269
# usage: beep.sh [BEEPCOUNT] [BEEPDURATION] [PAUSEDURATION]
@@ -76,6 +93,9 @@ for (( i=0; i<BEEPCOUNT; i++ )); do
7693
sleep $PAUSEDURATION
7794
done
7895
```
96+
{% endraw %}
97+
* Make the shell script executable:
98+
* Execute `chmod +x /home/mks/printer_data/config/macros/macro-beep.sh`
7999

80100
----
81101
Back to [start](index.html)

0 commit comments

Comments
 (0)