#How to G-Code Shell Commands

25 messages · Page 1 of 1 (latest)

cinder rune
#

Servus,

I use a python-scripts, that controlls my RGB-LEDs, because I don't have a Neopixel plug. Now I want to do it in klipper with the shell commands, but I have no clue how to program it.
Is it even possible with shell to turn on/of and to change color?

#

Thats the python script:

import time
import board
import neopixel
import random

#Initialise two strips variables, provide the GPIO Data Pin
#utilised and the amount of LED Nodes and brightness (0 to 1 value)
pixels1 = neopixel.NeoPixel(board.D10, 39, brightness=1)
num = random.randint(0, 255)
num1 = random.randint(0, 255)
num2 = random.randint(0, 255)

#Focusing on a particular strip, use the command Fill to make it all a single colour
#based on decimal code R, G, B. Number can be anything from 255 - 0. Use a RGB Colour
#Code Chart Website to quickly identify a desired fill colour.
pixels1.fill((num, num1, num2))

lavish haloBOT
#

Ahoi @cinder rune!
It looks like you did not provide all the necessary information we need to help you.
Please upload your logfiles and a detailed description of your problem.
For further information see: https://docs.mainsail.xyz/faq/getting-help/discord#provide-information
Note: We only accept .log and .txt files as log files.
This is an automated message

We are glad to help and chat with you on our Community Discord, but if you need help and want the best support possible you should, follow a few simple rules:

slow seal
#

What do you mean with "gow to program it"?
And also specify which shell you mean

cinder rune
slow seal
#

I mean which shell. Not the language...
Do you mean the shell thing in Mainsail? Do you mean the ssh shell?

cinder rune
#

mainsail

#

the g-code shell command

proud shadow
#

There is a reason whr the this is an unsupported klipper module

#

there is no mainsail gcode shell comand

cinder rune
#

but I could with KIAUH

proud shadow
#

you can install the unofficial and unsupported klipper module gcode_shell

cinder rune
proud shadow
#

you than can use it to start a shell scripts within a klipper macro

cinder rune
proud shadow
#

currently you only shared the klipper side telling us that you want execute the following line sh -c "/home/pi/PythonCode/rgb_light/random_rgb_lights.sh"

#

honestly saying I am not google!!!

#

opr https://en.wikipedia.org/wiki/Shell_script or one of the other 1000 hits

A shell script is a computer program designed to be run by a Unix shell, a command-line interpreter. The various dialects of shell scripts are considered to be scripting languages. Typical operations performed by shell scripts include file manipulation, program execution, and printing text. A script which sets up the environment, runs the progra...

cinder rune
#

so is it not possible to turn my python code in a shell script?
I cannot find any guids how to use the gpio pins and hto controll the rgb-leds

proud shadow
#

takes me a minute to google ...

serene pumice
#

i also changed the tag from mainsail to klipper, because this post has nothing todo with mainsail...

cinder rune
#

i did it

#

now i can open a python script in klipper