machinekit configuration crashes

175 views
Skip to first unread message

Rolf

unread,
Nov 6, 2019, 6:44:52 AM11/6/19
to Machinekit
I am new to machinekit and i have trouble getting it to work.
I have machinekit installed on a beaglebone black with a Probotix PBX-BB and debian 9. When i start up machinekit I get to the point where I can select a configuration and if i choose one under sim it works just fine, but if I choose one of the others it runs in to an error and then kills the task. it usually prints that the rt- demon is not running or that ./setup.sh failed, depending on which of the configurations i try to run. I have attached a log file from one of my attempts at running machinekit.

Have I done something wrong during installation?

Rolf
linuxcnc191104_2.log

Rolf

unread,
Nov 6, 2019, 8:16:17 AM11/6/19
to Machinekit
btw: I got my machinekit image from:https://elinux.org/Beagleboard:BeagleBoneBlack_Debian#BBW.2FBBB_.28All_Revs.29_Machinekit, however I also tried to just follow an installation guide (https://machinekoder.com/machinekit-debian-stretch-beaglebone-black/), but both gave me the same result.


Bas de Bruijn

unread,
Nov 6, 2019, 9:11:43 AM11/6/19
to Rolf, Machinekit
Hi Rolf,
I’m no Beaglebone expert, but I guess that you setup.sh script is the cause of your crashes. Iirc there was s somewhat recent pr that fixed permissions on a setup.sh script for another board.
Please try to execute the setup.sh script to see if that gives you meaningful info on why it crashes.

On 6 Nov 2019, at 14:16, Rolf <rolf...@gmail.com> wrote:

btw: I got my machinekit image from:https://elinux.org/Beagleboard:BeagleBoneBlack_Debian#BBW.2FBBB_.28All_Revs.29_Machinekit, however I also tried to just follow an installation guide (https://machinekoder.com/machinekit-debian-stretch-beaglebone-black/), but both gave me the same result.


--
website: http://www.machinekit.io blog: http://blog.machinekit.io github: https://github.com/machinekit
---
You received this message because you are subscribed to the Google Groups "Machinekit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to machinekit+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/machinekit/6ce223d9-f05e-4261-92e3-32c2762af965%40googlegroups.com.

Rolf

unread,
Nov 7, 2019, 10:35:00 AM11/7/19
to Machinekit

Hi,

 

Bas, you were right about the setup.sh. Following the findings in this thread:

 

https://groups.google.com/forum/?utm_medium=email&utm_source=footer#!searchin/machinekit/grep$3A$20$2Fsys$2Fdevices$2Fbone_capemgr.*$2Fslots$3A$20No$20such$20file$20or$20directory|sort:date/machinekit/_6nfova0Q9s/PoSZAHVBBQAJ

 

I found out that the loading of the /sys/devices/bone_capemgr.*/slots was the main reason for the error I had. We also updated CometNP_Metric.ini according to the findings in the mentioned thread.

 

However, I now have a new issue. It seems that the cape_universal is not correctly enabled during bootup. Setup.sh fails with the error:

 MACHINEKIT - 0.1
Machine configuration directory is '/home/machinekit/machinekit/configs/ARM.BeagleBone.Probotix'
Machine configuration file is 'CometNP.ini'
Starting Machinekit...
rtapi_msgd command:  /usr/libexec/linuxcnc/rtapi_msgd --instance=0 --rtmsglevel=1 --usrmsglevel=1 --debug=1 --halsize=524288
rtapi_app command:  /usr/libexec/linuxcnc/rtapi_app_rt-preempt --instance=0 --debug=1
io started
Unrecognized line skipped: POC     FMS     LEN     DIAM    COMMENT
halcmd loadusr io started
P8_08 pinmux file not found!
Pin has no cape: P8_08
Comet.hal:5: program './setup.sh' failed, returned 1
Shutting down and cleaning up Machinekit...
Cleanup done
Machinekit terminated with an error.  For simple cases more information
can be found in the following files:
    /home/machinekit/linuxcnc_debug.txt
    /home/machinekit/linuxcnc_print.txt

For other cases get more meaningfull information by restarting after
    export DEBUG=5

and look at the output of:
    /var/log/linuxcnc.log
    dmesg

When looking for errors, specifically look for libraries that fail to load
by looking for lines with 'insmod failed' as per example below.

insmod failed, returned -1:
do_load_cmd: dlopen: nonexistant-component.so: cannot open shared object file:
No such file or directory

For getting help, please have a look here: www.machinekit.io/docs/getting-help/



Running the version.sh script gives the following output:

git:/opt/scripts/:[90c549502ab96c2ca51aa7adfdd3a5ca384038ee]
eeprom:[A335BNLTEIA00419BBBK0F60]
model:[Octavo_Systems_OSD3358-SM-RED]
dogtag:[Machinekit Debian Image 2019-10-21]
bootloader:[microSD-(push-button)]:[/dev/mmcblk0]:[U-Boot 2019.04-00002-gf15b99f0b6]:[location: dd MBR]
bootloader:[eMMC-(default)]:[/dev/mmcblk1]:[U-Boot 2017.11-00002-g7b415acfc1]:[location: dd MBR]
UBOOT: Loaded Overlay:[AM335X-PRU-UIO-00A0]
UBOOT: Loaded Overlay:[BB-ADC-00A0]
UBOOT: Loaded Overlay:[BB-BONE-eMMC1-01-00A0]
UBOOT: Loaded Overlay:[BB-NHDMI-TDA998x-00A0]
UBOOT: Loaded Overlay:[M-BB-OSD3358-SM-RED-00A0]
UBOOT: Loaded Overlay:[OSD3358-00A0]
kernel:[4.19.72-bone-rt-r39]
/boot/uEnv.txt Settings:
uboot_overlay_options:[enable_uboot_overlays=1]
uboot_overlay_options:[disable_uboot_overlay_audio=1]
uboot_overlay_options:[disable_uboot_overlay_wireless=1]
uboot_overlay_options:[uboot_overlay_pru=/lib/firmware/AM335X-PRU-UIO-00A0.dtbo]
uboot_overlay_options:[enable_uboot_cape_universal=1]
pkg check: to individually upgrade run: [sudo apt install --only-upgrade <pkg>]
pkg:[bb-cape-overlays]:[4.14.20191102.0-0rcnee0~stretch+20191102]
pkg:[bb-wl18xx-firmware]:[1.20190227.1-0rcnee0~stretch+20190227]
pkg:[kmod]:[23-2rcnee1~stretch+20171005]
WARNING:pkg:[librobotcontrol]:[NOT_INSTALLED]
pkg:[firmware-ti-connectivity]:[20180825+dfsg-1rcnee1~stretch+20181217]
groups:[machinekit : machinekit adm kmem dialout cdrom floppy audio dip video plugdev users systemd-journal i2c bluetooth netdev gpio pwm eqep remoteproc admin spi tisdk weston-launch xenomai cloud9ide]
cmdline:[console=ttyO0,115200n8 root=/dev/mmcblk0p1 ro rootfstype=ext4 rootwait coherent_pool=1M net.ifnames=0 rng_core.default_quality=100 quiet]
dmesg | grep remote
[    0.884743] remoteproc remoteproc0: wkup_m3 is available
[    1.363767] remoteproc remoteproc0: powering up wkup_m3
[    1.363788] remoteproc remoteproc0: Booting fw image am335x-pm-firmware.elf, size 217168
[    1.365993] remoteproc remoteproc0: remote processor wkup_m3 is now up
dmesg | grep pru
dmesg | grep pinctrl-single
[    0.697809] pinctrl-single 44e10800.pinmux: 142 pins, size 568
dmesg | grep gpio-of-helper
lsusb
Bus 001 Device 002: ID 046d:c52b Logitech, Inc. Unifying Receiver
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
END


 

Attached is the uEnv.txt file.

 

What am I missing? Running config-pin P8.08 gpio gives the same error message as the setup.sh so I believe the error is not related to machinekit directly, but how the cape_universal is loaded. I am thankful for any advise I can get.



onsdag 6. november 2019 15.11.43 UTC+1 skrev Bas de Bruijn følgende:
Hi Rolf,
I’m no Beaglebone expert, but I guess that you setup.sh script is the cause of your crashes. Iirc there was s somewhat recent pr that fixed permissions on a setup.sh script for another board.
Please try to execute the setup.sh script to see if that gives you meaningful info on why it crashes.

On 6 Nov 2019, at 14:16, Rolf <rolf...@gmail.com> wrote:

btw: I got my machinekit image from:https://elinux.org/Beagleboard:BeagleBoneBlack_Debian#BBW.2FBBB_.28All_Revs.29_Machinekit, however I also tried to just follow an installation guide (https://machinekoder.com/machinekit-debian-stretch-beaglebone-black/), but both gave me the same result.


--
website: http://www.machinekit.io blog: http://blog.machinekit.io github: https://github.com/machinekit
---
You received this message because you are subscribed to the Google Groups "Machinekit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to machi...@googlegroups.com.
uEnv.txt

b...@basdebruijn.com

unread,
Nov 7, 2019, 1:10:25 PM11/7/19
to Rolf, Machinekit

Rolf,

 

I think that your board uses the bootloader on the EMMC, check with:

grep -c bone_capemgr.uboot_capemgr_enabled=1 /proc/cmdline

 

as per this comment and further https://github.com/machinekit/Machinekit-HAL/issues/17#issuecomment-324731662

(there’s some other link there too). Then disable the eMMC boot with:

 

sudo dd if=/dev/zero of=/dev/mmcblk1 count=1 seek=1 bs=128k

Rolf

unread,
Nov 12, 2019, 3:32:48 AM11/12/19
to Machinekit
Thanks for the response Bas

I tried running grep -c bone_capemgr.uboot_capemgr_enabled=1 /proc/cmdline as you suggested, however this returned 0.
It might be worth mentioning that I have a second beaglebone black board and, while none of them will run machinekit, the second one does not get the same error message as the first even when I use the exact same image. it  instead gives the following message:

MACHINEKIT - 0.1
Machine configuration directory is '/home/machinekit/machinekit/configs/ARM.BeagleBone.Probotix'
Machine configuration file is 'Comet_Metric.ini'

Starting Machinekit...
rtapi_msgd command:  /usr/libexec/linuxcnc/rtapi_msgd --instance=0 --rtmsglevel=1 --usrmsglevel=1 --debug=1 --halsize=524288
rtapi_app command:  /usr/libexec/linuxcnc/rtapi_app_rt-preempt --instance=0 --debug=1
io started
Unrecognized line skipped: POC     FMS     LEN     DIAM    COMMENT
halcmd loadusr io started
Comet.hal:20: insmod failed, returned -1:
rtapi_app_main(hal_pru_generic): -1 Operation not permitted


Shutting down and cleaning up Machinekit...
Cleanup done
Machinekit terminated with an error.  For simple cases more information
can be found in the following files:
    /home/machinekit/linuxcnc_debug.txt
    /home/machinekit/linuxcnc_print.txt

For other cases get more meaningfull information by restarting after
    export DEBUG=5

and look at the output of:
    /var/log/linuxcnc.log
    dmesg

When looking for errors, specifically look for libraries that fail to load
by looking for lines with 'insmod failed' as per example below.

insmod failed, returned -1:
do_load_cmd: dlopen: nonexistant-component.so: cannot open shared object file:
No such file or directory

For getting help, please have a look here: www.machinekit.io/docs/getting-help/


does this mean there is something wrong with one of the boards?

Bas de Bruijn

unread,
Nov 12, 2019, 3:51:18 AM11/12/19
to Rolf, Machinekit


On 12 Nov 2019, at 09:32, Rolf <rolf...@gmail.com> wrote:

Thanks for the response Bas

I tried running grep -c bone_capemgr.uboot_capemgr_enabled=1 /proc/cmdline as you suggested, however this returned 0.

Then you should probably disable the eMMC bootloader as per the instructions in previous mail and the links. Sudo dd if ... etcetera

It might be worth mentioning that I have a second beaglebone black board and, while none of them will run machinekit, the second one does not get the same error message as the first even when I use the exact same image. it  instead gives the following message:

MACHINEKIT - 0.1
Machine configuration directory is '/home/machinekit/machinekit/configs/ARM.BeagleBone.Probotix'
Machine configuration file is 'Comet_Metric.ini'
Starting Machinekit...
rtapi_msgd command:  /usr/libexec/linuxcnc/rtapi_msgd --instance=0 --rtmsglevel=1 --usrmsglevel=1 --debug=1 --halsize=524288
rtapi_app command:  /usr/libexec/linuxcnc/rtapi_app_rt-preempt --instance=0 --debug=1
io started
Unrecognized line skipped: POC     FMS     LEN     DIAM    COMMENT
halcmd loadusr io started
Comet.hal:20: insmod failed, returned -1:
rtapi_app_main(hal_pru_generic): -1 Operation not permitted

So what does Comet.hal line 20 say?
What does /var/log/linuxcnc.log say?

Shutting down and cleaning up Machinekit...
Cleanup done
Machinekit terminated with an error.  For simple cases more information
can be found in the following files:
    /home/machinekit/linuxcnc_debug.txt
    /home/machinekit/linuxcnc_print.txt

For other cases get more meaningfull information by restarting after
    export DEBUG=5

and look at the output of:
    /var/log/linuxcnc.log
    dmesg

When looking for errors, specifically look for libraries that fail to load
by looking for lines with 'insmod failed' as per example below.

insmod failed, returned -1:
do_load_cmd: dlopen: nonexistant-component.so: cannot open shared object file:
No such file or directory

For getting help, please have a look here: www.machinekit.io/docs/getting-help/


does this mean there is something wrong with one of the boards?

--
website: http://www.machinekit.io blog: http://blog.machinekit.io github: https://github.com/machinekit
---
You received this message because you are subscribed to the Google Groups "Machinekit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to machinekit+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/machinekit/1bce2ca3-764d-4808-883b-3da8956ad418%40googlegroups.com.

Rolf

unread,
Nov 12, 2019, 5:18:06 AM11/12/19
to Machinekit
Bas

I ran the commandline sudo dd if=/dev/zero of=/dev/mmcblk1 count=1 seek=1 bs=128k .The good news is that  running config-pin P8.08 gpio no longer gives an error, but now both of the beaglebone boards give the same error message (the one from my previous post).
the following is written in the log file:

Nov 12 09:14:40 beaglebone rtapi:0: 1:rtapi_app:5910:user halg_xinitfv:199 HAL error: duplicate component name 'hal_lib'
Nov 12 09:14:40 beaglebone rtapi:0: rtapi_app_main(hal_lib): -16 Device or resource busy
Nov 12 09:14:40 beaglebone rtapi:0: 1:rtapi_app:5910:user init_actions() failed
Nov 12 09:14:40 beaglebone msgd:0: rtapi_app exit detected - scheduled shutdown
Nov 12 09:14:41 beaglebone rtapi:0: 1:rtapi_app:5563:user hal_pru_generic: cant find /usr/lib/linuxcnc/xenomai/pru_generic.bin in /home/machinekit or /lib/firmware/pru/
Nov 12 09:14:41 beaglebone rtapi:0: 1:rtapi_app:5563:user hpg: ERROR: failed to initialize PRU
Nov 12 09:14:41 beaglebone rtapi:0: rtapi_app_main(hal_pru_generic): -1 Operation not permitted
Nov 12 09:14:41 beaglebone rtapi:0: 1:rtapi_app:5563:user rtapi_app_main(hal_pru_generic): -1 Operation not permitted
Nov 12 09:14:42 beaglebone msgd:0: msgd shutting down
Nov 12 09:14:42 beaglebone rtapi:0: rtapi_msgd went away, exiting



I attached the comet.hal file, as well as the logfile after I ran export DEBUG=5

To unsubscribe from this group and stop receiving emails from it, send an email to machi...@googlegroups.com.
Comet_bbb2.hal
linuxcnc.log

b...@basdebruijn.com

unread,
Nov 12, 2019, 7:04:55 AM11/12/19
to Rolf, Machinekit
> Bas

> I ran the commandline sudo dd if=/dev/zero of=/dev/mmcblk1 count=1 seek=1 bs=128k .The good news is that running config-pin P8.08 gpio no longer gives an error, but now both of the beaglebone boards give the same error message (the one from my previous post).
> the following is written in the log file:

> Nov 12 09:14:40 beaglebone rtapi:0: 1:rtapi_app:5910:user halg_xinitfv:199 HAL error: duplicate component name 'hal_lib'
> Nov 12 09:14:40 beaglebone rtapi:0: rtapi_app_main(hal_lib): -16 Device or resource busy
> Nov 12 09:14:40 beaglebone rtapi:0: 1:rtapi_app:5910:user init_actions() failed
> Nov 12 09:14:40 beaglebone msgd:0: rtapi_app exit detected - scheduled shutdown
> Nov 12 09:14:41 beaglebone rtapi:0: 1:rtapi_app:5563:user hal_pru_generic: cant find /usr/lib/linuxcnc/xenomai/pru_generic.bin in /home/machinekit or /lib/firmware/pru/
> Nov 12 09:14:41 beaglebone rtapi:0: 1:rtapi_app:5563:user hpg: ERROR: failed to initialize PRU
> Nov 12 09:14:41 beaglebone rtapi:0: rtapi_app_main(hal_pru_generic): -1 Operation not permitted
> Nov 12 09:14:41 beaglebone rtapi:0: 1:rtapi_app:5563:user rtapi_app_main(hal_pru_generic): -1 Operation not permitted
> Nov 12 09:14:42 beaglebone msgd:0: msgd shutting down
> Nov 12 09:14:42 beaglebone rtapi:0: rtapi_msgd went away, exiting

> I attached the comet.hal file, as well as the logfile after I ran export DEBUG=5

The 5th line in linuxcnc.log says exactly what’s happening.
You need to look at your INI file. Have a look at the line that says [PRUBIN]. Since you run a (probably) rt-preempt kernel the pru driver cannot find what it's looking for (xenomai). It should be like so: https://github.com/machinekit/machinekit/blob/master/configs/ARM/BeagleBone/CRAMPS/CRAMPS.ini#L5

Rolf

unread,
Nov 18, 2019, 9:15:12 AM11/18/19
to Machinekit

Thanks for your help Bas
machinekit is now up and running

Bas de Bruijn

unread,
Nov 18, 2019, 11:43:01 AM11/18/19
to Rolf, Machinekit


> On 18 Nov 2019, at 15:15, Rolf <rolf...@gmail.com> wrote:
>
> Thanks for your help Bas
> machinekit is now up and running

Glad you got it working.
Reply all
Reply to author
Forward
0 new messages