Example #1
0
os.environ["MACHINEKIT_INI"] = c.MACHINEKIT_INI

parser = argparse.ArgumentParser(
    description='This is the Prusa-i3-soc run script '
    'it demonstrates how a run script could look like '
    'and of course starts the Prusa-i3 config')

parser.add_argument('-v',
                    '--video',
                    help='Starts the video server',
                    action='store_true')

args = parser.parse_args()

try:
    launcher.check_installation()
    launcher.cleanup_session()
    launcher.register_exit_handler()  # needs to executed after HAL files
    launcher.install_comp('thermistor_check.comp')
    launcher.install_comp('reset.comp')
    nc_path = os.path.expanduser('~/nc_files')
    if not os.path.exists(nc_path):
        os.mkdir(nc_path)

    if not check_mklaucher(
    ):  # start mklauncher if not running to make things easier
        launcher.start_process('mklauncher .')
    launcher.start_process("configserver -n Prusa-i3 ~/Machineface ")
    if args.video:
        launcher.start_process('videoserver --ini video.ini Webcam1')
    launcher.start_process('linuxcnc Prusa-i3.ini')
Example #2
0
#!/usr/bin/python

import sys
import os
import subprocess
import importlib
import argparse
from time import *
from machinekit import launcher

launcher.register_exit_handler()
#launcher.set_debug_level(5)
os.chdir(os.path.dirname(os.path.realpath(__file__)))

try:
    launcher.check_installation()
    launcher.cleanup_session()
    launcher.install_comp('thermistor_check.comp')
    launcher.install_comp('reset.comp')
    # Video Streaming: you might need to create your own config
    # launcher.start_process("videoserver --ini ~/video.ini Webcam1")
    # Remote Control: Get a Machineface at ARM.Replicape.A4A.vel/
    launcher.start_process("configserver -n Replicape ~/Machineface/")
    launcher.start_process('linuxcnc replicape.ini')
except subprocess.CalledProcessError:
    launcher.end_session()
    sys.exit(1)

while True:
    sleep(1)
    launcher.check_processes()
Example #3
0
#!/usr/bin/python

import sys
import os
import subprocess
import importlib
from machinekit import launcher
from time import *


launcher.register_exit_handler()
launcher.set_debug_level(5)
os.chdir(os.path.dirname(os.path.realpath(__file__)))

try:
    launcher.check_installation()  # make sure the Machinekit installation is sane
    launcher.cleanup_session()  # cleanup a previous session
    # Uncomment and modify the following line if you create a configuration for the BeagleBone Black
    #launcher.load_bbio_file('cape-universal')
    launcher.load_bbio_file('cramps_cape.bbio')  # load a BeagleBone Black universal overlay file
    # Uncomment and modify the following line of you have custom HAL components
    # launcher.install_comp('gantry.comp')  # install a comp HAL component if not already installed
    launcher.start_process("configserver ~/Machineface")  # start the configserver with Machineface an Cetus user interfaces
    launcher.start_process('machinekit -k ~/machinekit/configs/ARM.BeagleBone.CRAMPS/CRAMPS.ini')  # start linuxcnc
except subprocess.CalledProcessError:
    launcher.end_session()
    sys.exit(1)

# loop until script receives exit signal
# or one of the started applications exited incorrectly
# cleanup is done automatically
Example #4
0
import sys
import os
import subprocess
import importlib
from machinekit import launcher
from machinekit import config
from time import *

launcher.register_exit_handler()
launcher.set_debug_level(5)
os.chdir(os.path.dirname(os.path.realpath(__file__)))
c = config.Config()
os.environ["MACHINEKIT_INI"] = c.MACHINEKIT_INI

try:
    launcher.check_installation(
    )  # make sure the Machinekit installation is sane
    launcher.cleanup_session()  # cleanup a previous session
    # Uncomment and modify the following line if you create a configuration for the BeagleBone Black
    # launcher.load_bbio_file('myoverlay.bbio')  # load a BeagleBone Black universal overlay file
    # Uncomment and modify the following line of you have custom HAL components
    # launcher.install_comp('gantry.comp')  # install a comp HAL component if not already installed
    #    launcher.install_comp('lineardeltajointscartesian.comp')
    launcher.start_process(
        "configserver  ~/Machineface ~/Cetus/"
    )  # start the configserver with Machineface or an Cetus user interfaces
    launcher.start_process('linuxcnc prusa-i3_dev.ini')  # start linuxcnc
except subprocess.CalledProcessError:
    launcher.end_session()
    sys.exit(1)

# loop until script receives exit signal