Beispiel #1
0
import os
import subprocess
import time
from machinekit import launcher
from machinekit import config

launcher.register_exit_handler()
#launcher.set_debug_level(9)
os.chdir(os.path.dirname(os.path.realpath(__file__)))
launcher.set_machinekit_ini(config.MACHINEKIT_INI)

try:
    launcher.check_installation()
    launcher.cleanup_session()
    launcher.register_exit_handler()  # needs to executed after HAL files
    launcher.load_bbio_file('bebopr_cape.bbio')

    nc_path = os.path.expanduser('~/nc_files')
    if not os.path.exists(nc_path):
        os.mkdir(nc_path)

    launcher.ensure_mklauncher()  # ensure mklauncher is started

    launcher.start_process("configserver -n 'Arcus-3D-C1' ~/Machineface")
    launcher.start_process('machinekit arcus-3d-c1.ini')
    while True:
        launcher.check_processes()
        time.sleep(1)
except subprocess.CalledProcessError:
    launcher.end_session()
    sys.exit(1)
Beispiel #2
0
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
while True:
    sleep(1)
    launcher.check_processes()
Beispiel #3
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.load_bbio_file("paralell_cape3.bbio")
    launcher.install_comp("thermistor_check.comp")
    launcher.install_comp("led_dim.comp")
    launcher.start_process("configserver -n Uni-print-3D ~/Machineface")
    launcher.start_process("linuxcnc UNIPRINT-3D.ini")
except subprocess.CalledProcessError:
    launcher.end_session()
    sys.exit(1)

while True:
    sleep(1)
    launcher.check_processes()
Beispiel #4
0
parser.add_argument('-w', '--webtalk', help='Starts webtalk', action='store_true')
parser.add_argument('-d', '--debug', help='Enable debug mode', action='store_true')

args = parser.parse_args()

if args.debug:
    launcher.set_debug_level(5)

if not args.local:
    # override default $MACHINEKIT_INI with a version which was REMOTE=1
    launcher.set_machinekit_ini('/etc/linuxcnc/machinekit.ini')

try:
    launcher.check_installation()
    launcher.cleanup_session()
    launcher.load_bbio_file('led-demo.bbio')
    if args.config:
        # the point-of-contact for QtQUickVCP
        launcher.start_process('configserver -n Motorctrl-Demo .')
    if args.webtalk:
        # the Websockets/JSON bridge into Machinetalk
        launcher.start_process('webtalk --ini led-demo.ini')
    if args.video:
        launcher.start_process('videoserver --ini video.ini Webcam1')
    launcher.start_realtime()

#    launcher.load_hal_file('hardware.hal',  'hardware.ini')
    command = 'halcmd -i hardware.ini -f hardware.hal'
    subprocess.check_call(command, shell=True)

#    launcher.load_hal_file('hardware.hal',  'led-demo.ini')
parser = argparse.ArgumentParser(description='Testing the PRU encoder')
parser.add_argument('-d', '--debug', help='Enable debug mode', action='store_true')

args = parser.parse_args()

if args.debug:
    launcher.set_debug_level(5)

if 'MACHINEKIT_INI' not in os.environ:  # export for package installs
    mkconfig = config.Config()
    os.environ['MACHINEKIT_INI'] = mkconfig.MACHINEKIT_INI

try:
    launcher.check_installation()
    launcher.cleanup_session()  # kill any running Machinekit instances
    launcher.load_bbio_file('parallel_cape_io_test.bbio')  # load the BBIO pin overlay
    launcher.start_realtime()  # start Machinekit realtime environment
    launcher.load_hal_file(MAIN_HAL)  # load the main HAL file
    launcher.register_exit_handler()  # enable on ctrl-C, needs to executed after HAL files

    launcher.ensure_mklauncher()  # ensure mklauncher is started

    launcher.start_process('configserver -n {} .'.format(NAME))

    while True:
        launcher.check_processes()
        time.sleep(1)

except subprocess.CalledProcessError:
    launcher.end_session()
    sys.exit(1)
Beispiel #6
0
#!/usr/bin/python

import sys
import os
import subprocess
import time
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.ensure_mklauncher()
    launcher.load_bbio_file('cramps2_cape.bbio')
    launcher.start_process("configserver -n MendelMax ~/Machineface")
    launcher.start_process('linuxcnc fabrikator-mini.ini')
    while True:
        launcher.check_processes()
        time.sleep(1)
except subprocess.CalledProcessError:
    launcher.end_session()
    sys.exit(1)

sys.exit(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
    launcher.load_bbio_file('MendelMax.bbio')                         # load a BBB universal overlay
#   launcher.install_comp('gantry.comp')                              # install a comp HAL component of not already installed
    launcher.start_process("configserver ../Machineface ../Cetus/")   # start the configserver
    launcher.start_process('linuxcnc MendelMax.Remote.ini')           # start linuxcnc
except subprocess.CalledProcessError:
    launcher.end_session()
    sys.exit(1)

while True:
    sleep(1)
    launcher.check_processes()
Beispiel #8
0
sourceIni.close()
if mtEnabled:
    lines = lines[:-3]  # remove intro graphic
    lines.append('DISPLAY = mkwrapper\n')
else:
    lines.append('DISPLAY = axis\n')
startupIni = open(startupIniName, 'w')
startupIni.writelines(lines)  # copy file contents
startupIni.close()

try:
    launcher.check_installation()
    launcher.cleanup_session()

    if robotEnabled:  # consider the special robot case
        launcher.load_bbio_file('paralell_cape2_robot.bbio')
    else:
        launcher.load_bbio_file('paralell_cape2.bbio')

    if mtEnabled:  # load Machinetalk services
        cfg = configparser.ConfigParser({'NAME': ''})
        cfg.read(startupIniName)
        machineName = cfg.get('EMC', 'NAME')

        command = 'configserver'
        if machineName is not '':
            command += ' -n %s' % machineName
        if machineface:
            command += ' ~/Machineface'
        if cetus:
            command += ' ~/Cetus'
Beispiel #9
0
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
    launcher.load_bbio_file('cramps2_cape.bbio')                         # load a BBB universal overlay
    launcher.start_process("configserver -n SmartCore ~/Machineface ~/Cetus/")  # start the configserver with Machineface an Cetus user interfaces
    launcher.start_process('linuxcnc 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
while True:
    sleep(1)
    launcher.check_processes()

Beispiel #10
0
parser.add_argument('-v', '--video', help='Starts the video server', action='store_true')
parser.add_argument('-d', '--debug', help='debug level', type=int, choices=[0 , 1, 2, 3, 4, 5])

args = parser.parse_args()

try:
    launcher.check_installation()                                     # make sure the Machinekit installation is sane
    launcher.cleanup_session()                                        # cleanup a previous session

    # set debug level
    if args.debug:
        launcher.set_debug_level(args.debug)


    launcher.load_bbio_file('cramps.bbio')                    # load a BBB universal overlay
    launcher.install_comp('thermistor_check.comp')
    launcher.start_process('configserver -d -n RIGIDBOT ~/ui')   # start the configserver

#    if args.video:
#        launcher.start_process('videoserver --ini video.ini Webcam1')

    launcher.start_process('machinekit -vd CRAMPS.ini')                        # start linuxcnc

except subprocess.CalledProcessError:
    launcher.end_session()
    sys.exit(1)

while True:
    sleep(1)
    launcher.check_processes()
Beispiel #11
0
startupIniName = 'startup.ini'
sourceIni = open(configName)  # open ini
lines = sourceIni.readlines()
sourceIni.close()
lines.append('NUM_EXTRUDERS = %i\n' % numExtruders)
lines.append('NUM_FANS = %i\n' % numExtruders)
if withAbp:
    lines.append('ABP = 1\n')
startupIni = open(startupIniName, 'w')
startupIni.writelines(lines)  # copy file contents
startupIni.close()

try:
    launcher.check_installation()
    launcher.cleanup_session()
    launcher.load_bbio_file('paralell_cape3.bbio')
    # launcher.install_comp('thermistor_check.icomp')
    cfg = configparser.ConfigParser({'NAME': ''})
    cfg.read(startupIniName)
    machineName = cfg.get('EMC', 'NAME')
    command = 'configserver'
    if machineName is not '':
        command += ' -n %s' % machineName
    command += ' ~/Machineface'
    launcher.start_process(command)
    if os.path.exists('/dev/video0'):  # automatically start videoserver
        launcher.start_process('videoserver -i video.ini Webcam1')
    launcher.start_process('linuxcnc %s' % startupIniName)
    while True:
        launcher.check_processes()
        sleep(1)
Beispiel #12
0
parser.add_argument('-w', '--webtalk', help='Starts webtalk', action='store_true')
parser.add_argument('-d', '--debug', help='Enable debug mode', action='store_true')

args = parser.parse_args()

if args.debug:
    launcher.set_debug_level(5)

#if not args.local:
#    # override default $MACHINEKIT_INI with a version which was REMOTE=1
#    launcher.set_machinekit_ini('machinekit.ini')

try:
    launcher.check_installation()
    launcher.cleanup_session()
    launcher.load_bbio_file('halanduino.bbio')
    launcher.install_comp('kalman.comp')
    launcher.install_comp('hbridge.icomp')
    if args.config:
        # the point-of-contact for QtQUickVCP
        launcher.start_process('configserver -n Motorctrl-Demo .')
    if args.webtalk:
        # the Websockets/JSON bridge into Machinetalk
        launcher.start_process('webtalk --ini motorctrl.ini')
    if args.video:
        launcher.start_process('videoserver --ini video.ini Webcam1')
    launcher.start_realtime()
#    launcher.load_hal_file('hardware.hal',  'hardware.ini')
#    launcher.load_hal_file('halanduino.hal', 'halanduino.ini')
#    launcher.load_hal_file('threading.hal', 'halanduino.ini')
    import hardware
Beispiel #13
0
parser = argparse.ArgumentParser(description='Linear axis motion with Machinekit')
parser.add_argument('-d', '--debug', help='Enable debug mode', action='store_true')

args = parser.parse_args()

if args.debug:
    launcher.set_debug_level(5)

if 'MACHINEKIT_INI' not in os.environ:  # export for package installs
    mkconfig = config.Config()
    os.environ['MACHINEKIT_INI'] = mkconfig.MACHINEKIT_INI

try:
    launcher.check_installation()
    launcher.cleanup_session()  # kill any running Machinekit instances
    launcher.load_bbio_file('paralell_cape2.bbio')  # load the BBIO pin overlay
    launcher.start_realtime()  # start Machinekit realtime environment
    launcher.load_hal_file('main.py')  # load the main HAL file
    launcher.register_exit_handler()  # enable on ctrl-C, needs to executed after HAL files

    launcher.ensure_mklauncher()  # ensure mklauncher is started

    launcher.start_process('configserver -n "Linear Axis" .')

    while True:
        launcher.check_processes()
        time.sleep(1)

except subprocess.CalledProcessError:
    launcher.end_session()
    sys.exit(1)
Beispiel #14
0
                    help='Enable debug mode',
                    action='store_true')

args = parser.parse_args()

if args.debug:
    launcher.set_debug_level(5)

if 'MACHINEKIT_INI' not in os.environ:  # export for package installs
    mkconfig = config.Config()
    os.environ['MACHINEKIT_INI'] = mkconfig.MACHINEKIT_INI

try:
    launcher.check_installation()
    launcher.cleanup_session()  # kill any running Machinekit instances
    launcher.load_bbio_file('alex-Bridge.bbio')
    launcher.start_realtime()  # start Machinekit realtime environment
    launcher.load_hal_file('main.py')  # load the main HAL file
    launcher.register_exit_handler(
    )  # enable on ctrl-C, needs to executed after HAL files

    launcher.ensure_mklauncher()  # ensure mklauncher is started

    launcher.start_process('configserver -n "Stepper-Test" .')

    while True:
        launcher.check_processes()
        time.sleep(1)

except subprocess.CalledProcessError:
    launcher.end_session()
Beispiel #15
0
parser.add_argument('-w', '--webtalk', help='Starts webtalk', action='store_true')
parser.add_argument('-d', '--debug', help='Enable debug mode', action='store_true')

args = parser.parse_args()

if args.debug:
    launcher.set_debug_level(5)

if not args.local:
    # override default $MACHINEKIT_INI with a version which was REMOTE=1
    launcher.set_machinekit_ini('/etc/linuxcnc/machinekit.ini')

try:
    launcher.check_installation()
    launcher.cleanup_session()
    launcher.load_bbio_file('motorctrl.bbio')
    if args.config:
        # the point-of-contact for QtQUickVCP
        launcher.start_process('configserver -n Motorctrl-Demo .')
    if args.webtalk:
        # the Websockets/JSON bridge into Machinetalk
        launcher.start_process('webtalk --ini motorctrl.ini')
    if args.video:
        launcher.start_process('videoserver --ini video.ini Webcam1')
    launcher.start_realtime()

#    launcher.load_hal_file('hardware.hal',  'hardware.ini')
    command = 'halcmd -i hardware.ini -f hardware.hal'
    subprocess.check_call(command, shell=True)

#    launcher.load_hal_file('hardware.hal',  'motorctrl.ini')