Error when install Machinekit on Raspberry Pi 3, Raspian Stretch

323 views
Skip to first unread message

Tac Huynh

unread,
Sep 14, 2018, 10:41:29 AM9/14/18
to Machinekit
Please help:
How do I fix this installation error?
Thanks,
Tac.

I tried to install Machinekit on Raspberry Pi 3, Raspian Stretch, got following errors:

sudo apt-get install machinekit-rt-preempt

....
Setting up xdot (0.7-2) ...
Setting up machinekit-rt-preempt (0.1.1536747208.git041712d-1~stretch) ...
ln: failed to create symbolic link '/usr/lib/linuxcnc/rt-preempt/pru_generic.bin': No such file or directory
ln: failed to create symbolic link '/usr/lib/linuxcnc/rt-preempt/pru_generic.dbg': No such file or directory
ln: failed to create symbolic link '/usr/lib/linuxcnc/rt-preempt/pru_decamux.bin': No such file or directory
ln: failed to create symbolic link '/usr/lib/linuxcnc/rt-preempt/pru_decamux.dbg': No such file or directory
dpkg: error processing package machinekit-rt-preempt (--configure):
subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of machinekit:
machinekit depends on machinekit-rt-threads; however:
Package machinekit-rt-threads is not installed.
Package machinekit-rt-preempt which provides machinekit-rt-threads is not configured yet.

dpkg: error processing package machinekit (--configure):
dependency problems - leaving unconfigured
Processing triggers for libc-bin (2.24-11+deb9u3) ...
Processing triggers for systemd (232-25+deb9u2) ...
Errors were encountered while processing:
machinekit-rt-preempt
machinekit
E: Sub-process /usr/bin/dpkg returned an error code (1)

schoo...@gmail.com

unread,
Sep 14, 2018, 11:53:38 AM9/14/18
to machi...@googlegroups.com
See my reply on this thread Re: RT demon is not running. rtapi_app_main(rtapi): -22 Invalid argument ???
for how to install an earlier package

I would go back to machinekit_0.1.1532446277.git5d86a7e-1~stretch_armhf.deb and  machinekit-rt-preempt_0.1.1532446277.git5d86a7e-1~stretch_armhf.deb
to be sure

I think I know what it is, but won't have tome to fix until tomorrow
--
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.
Visit this group at https://groups.google.com/group/machinekit.
For more options, visit https://groups.google.com/d/optout.

schoo...@gmail.com

unread,
Sep 14, 2018, 12:42:16 PM9/14/18
to machi...@googlegroups.com
Apologies for that, a knock on effect from another change.

I have now made a fix but it will take a while to filter through.

If you are in a position to test the new packages,  say and I will let you know when they are in the repository package lists
to be pulled.

Tac Huynh

unread,
Sep 14, 2018, 3:59:57 PM9/14/18
to Machinekit
Thanks Schooner,
Your help fix the problem for now. I will test the new packages whenerver it available.
Tac.

schoo...@gmail.com

unread,
Sep 15, 2018, 6:03:23 AM9/15/18
to machi...@googlegroups.com
The packages are built (git version 1536946578)

I have just installed the Stretch versions onto an armv7 server and they look to install everything that they should.
The symlinks that errored in your original report are created as they should be.

Give it a run and let me know

regards

Tac Huynh

unread,
Sep 15, 2018, 3:20:36 PM9/15/18
to Machinekit
Using
sudo apt-get install machinekit-rt-preempt

Installation went OK.
But when trying to run machinekit, there is error of realtime is not running.


Tac.


pi@realtimepi:~ $ machinekit
Creating machinekit directory
MACHINEKIT - 0.1
Machine configuration directory is '/home/pi/machinekit/configs/sim.tklinuxcnc'
Machine configuration file is 'servo_sim.ini'
Starting Machinekit...
rtapi_msgd command:  /usr/libexec/linuxcnc/rtapi_msgd --instance=0 --rtmsglevel=1 --usrmsglevel=1 --halsize=524288
rtapi_app command:  /usr/libexec/linuxcnc/rtapi_app_rt-preempt --instance=0
halcmd: cant connect to rtapi_app: -1 (uri= uuid=a42c8c6b-4025-4f83-ba28-dad21114744a): rtapi_rpc(): reply timeout

halcmd: the rtapi:0 RT demon is not running - please investigate /var/log/linuxcnc.log
halcmd: the msgd:0 logger demon is not running - please investigate /var/log/linuxcnc.log
E: 18-09-15 19:13:53 dangling 'DEALER' socket created at hal/utils/halcmd_rtapiapp.cc:281
io started
halcmd: cant connect to rtapi_app: -1 (uri= uuid=a42c8c6b-4025-4f83-ba28-dad21114744a): rtapi_rpc(): reply timeout


On Friday, September 14, 2018 at 7:41:29 AM UTC-7, Tac Huynh wrote:

schoo...@gmail.com

unread,
Sep 16, 2018, 5:14:48 AM9/16/18
to machi...@googlegroups.com

On 15/09/18 20:20, Tac Huynh wrote:
Using
sudo apt-get install machinekit-rt-preempt

Installation went OK.
But when trying to run machinekit, there is error of realtime is not running.

Unfortunately the errors do not tell me anything, you will get those whatever the problem is

I have installed and run the new packages on amd64 Stretch without any problem
(see attached screen grab)

Unless you can run with DEBUG=5 exported and send me the resulting /var/log/linuxcnc.log I am going to have
to try and find an arm machine with non root user access to test them.

Hopefully the tklinuxcnc sim you were trying to run was the stock one from configs, so I can test like for like?

Selection_005.png

schoo...@gmail.com

unread,
Sep 16, 2018, 5:58:44 AM9/16/18
to machi...@googlegroups.com
I have now installed the machinekit and machinekit-posix packages on an armv7 server
and run machinekit via a normal user account.
I cannot change the kernel to a rt-preempt one, but that should not matter as all the modules are the same.

It works fine as per the screen grab attached

To help you further:

You will need to remove the existing packages and re-install the new packages,
empty the /var/log/linuxcnc.log (`> /var/log/linuxcnc.log` as root, sudo often does not work)
`export DEBUG=5`
then run machinekit and select the sim.tklinuxcnc config

If it errors, the specific fault should be in the log, so attach that in its entirety.
Selection_078.png

Tac Huynh

unread,
Sep 16, 2018, 8:58:30 AM9/16/18
to Machinekit
I followed your instruction with export DEBUG=5, Here is the contect of /var/log/linuxcnc.log
Thanks for looking into this.
Tac.


Sep 16 12:52:22 realtimepi msgd:0: startup pid=1509 flavor=rt-preempt rtlevel=5 usrlevel=5 halsize=524288 shm=Posix cc=gcc 6.3.0 20170516  version=v0.1~-----~e656585
Sep 16 12:52:22 realtimepi msgd:0: ØMQ=4.2.1 czmq=4.0.2 protobuf=3.0.0 atomics=gcc intrinsics    libwebsockets=2.0.3
Sep 16 12:52:22 realtimepi msgd:0: configured: sha=e656585
Sep 16 12:52:22 realtimepi msgd:0: built:      Sep 14 2018 18:01:19 sha=e656585
Sep 16 12:52:22 realtimepi msgd:0: register_stuff: actual hostname as announced by avahi='realtimepi.local'
Sep 16 12:52:22 realtimepi msgd:0: zeroconf: registering: 'Log service on realtimepi.local pid 1509'
Sep 16 12:52:22 realtimepi rtapi:0: 2:rtapi_app:1514:user rtapi:0: cannot create core dumps - /proc/sys/fs/suid_dumpable contains 0
Sep 16 12:52:22 realtimepi rtapi:0: 2:rtapi_app:1514:user you might have to run 'echo 1 > /proc/sys/fs/suid_dumpable' as root to enable rtapi_app core dumps
Sep 16 12:52:23 realtimepi rtapi:0: 4:rtapi_app:1514:user rtapi.so default iparms: ''
Sep 16 12:52:23 realtimepi rtapi:0: 4:rtapi_app:1514:user RTAPI:0  posix v0.1~-----~e656585 init
Sep 16 12:52:23 realtimepi rtapi:0: 1:rtapi_app:1514:user RTAPI:0 BUG: thread flavors dont match: global 1 rtapi 0
Sep 16 12:52:23 realtimepi rtapi:0: rtapi_app_main(rtapi): -22 Invalid argument
Sep 16 12:52:23 realtimepi rtapi:0: 1:rtapi_app:1514:user init_actions() failed
Sep 16 12:52:23 realtimepi msgd:0: rtapi_app exit detected - scheduled shutdown
Sep 16 12:52:23 realtimepi msgd:0: zeroconf: registered 'Log service on realtimepi.local pid 1509' _machinekit._tcp 0 TXT "uuid=a42c8c6b-4025-4f83-ba28-dad21114744a" "instance=5ada4000-b9af-11e8-a129-b827eb77141b" "service=log" "dsn=ipc:///tmp/0.log.a42c8c6b-4025-4f83-ba28-dad21114744a"
Sep 16 12:52:25 realtimepi msgd:0: msgd shutting down
Sep 16 12:52:25 realtimepi msgd:0: zeroconf: unregistering 'Log service on realtimepi.local pid 1509'
Sep 16 12:52:25 realtimepi msgd:0: log buffer hwm: 0% (0 msgs, 0 bytes out of 524288)
Sep 16 12:52:25 realtimepi msgd:0: normal shutdown - global segment detached


On Friday, September 14, 2018 at 7:41:29 AM UTC-7, Tac Huynh wrote:
linuxcnc.log

schoo...@gmail.com

unread,
Sep 16, 2018, 9:40:13 AM9/16/18
to machi...@googlegroups.com
This is the same error as in this thread
Re: [Machinekit] Re: RT demon is not running. rtapi_app_main(rtapi): -22
Invalid argument ???

Looks like the rt-preempt is reported as being posix, at a guess.
Probably why it does not cause an issue when it IS a posix install like
mine.

Thanks, I will look at it again and see if I can find a way to install a
rt-preempt kernel for testing on arm.
Perhaps test on amd64 rt-preempt first, if it fails on that it will be
much easier to work on.

mngr

unread,
Sep 16, 2018, 10:28:31 AM9/16/18
to Machinekit
Same issue here, I am on jessie, debian 8.0

Linux raspberrypi 4.4.4-rt9-v7+ #7 SMP PREEMPT RT Mon Mar 7 14:53:11 UTC 2016 armv7l GNU/Linux

here is the console output, maybe it helps

MACHINEKIT - 0.1
Machine configuration directory is '/home/pi/machinekit/configs/ARM.BeagleBone.CRAMPS'
Machine configuration file is 'CRAMPS.ini'
Starting Machinekit...
Warning - /usr/libexec/linuxcnc/rtapi_app_posix not setuid
'sudo make setuid' missing?
rtapi_msgd command:  /usr/libexec/linuxcnc/rtapi_msgd --instance=0 --rtmsglevel=5 --usrmsglevel=5 --halsize=524288
rtapi_app command:  /usr/libexec/linuxcnc/rtapi_app_posix --instance=0
/usr/bin/realtime: line 237: /usr/libexec/linuxcnc/rtapi_app_posix: No such file or directory
rtapi_app startup failed; aborting

halcmd: cant connect to rtapi_app: -1 (uri= uuid=a42c8c6b-4025-4f83-ba28-dad21114744a): rtapi_rpc(): reply timeout
E: 18-09-16 14:25:25 dangling 'DEALER' socket created at hal/utils/halcmd_rtapiapp.cc:281

mngr

unread,
Sep 16, 2018, 10:29:26 AM9/16/18
to Machinekit
I installed the old machinekit version, taken from you comment, and the upgraded

schoo...@gmail.com

unread,
Sep 16, 2018, 10:56:48 AM9/16/18
to machi...@googlegroups.com
Thanks

I have found the error, the problem was that a variable was not getting set, but because it was then 0,
if you tested on a posix thread, because posix is enumerated to 0, there was no problem :-P

mngr

unread,
Sep 16, 2018, 12:08:02 PM9/16/18
to Machinekit
Wow, you have been fast!
is there a way for us to manually set this variable? or will you release a new package?

Tac Huynh

unread,
Sep 17, 2018, 11:56:28 AM9/17/18
to Machinekit
I can installed and run
sudo apt-get install machinekit-posix
not a problem.

sudo apt-get install machinekit-rt-preempt
still a problem.

How do I fix it?
Thanks,
Tac.

 
MACHINEKIT - 0.1

Machine configuration directory is '/home/pi/machinekit/configs/sim.tklinuxcnc'
Machine configuration file is 'servo_sim.ini'
Starting Machinekit...
rtapi_msgd command: /usr/libexec/linuxcnc/rtapi_msgd --instance=0 --rtmsglevel=1 --usrmsglevel=1 --halsize=524288
rtapi_app command: /usr/libexec/linuxcnc/rtapi_app_rt-preempt --instance=0
halcmd: cant connect to rtapi_app: -1 (uri= uuid=a42c8c6b-4025-4f83-ba28-dad21114744a): rtapi_rpc(): reply timeout

halcmd: the rtapi:0 RT demon is not running - please investigate /var/log/linuxcnc.log
halcmd: the msgd:0 logger demon is not running - please investigate /var/log/linuxcnc.log
E: 18-09-17 15:17:07 dangling 'DEALER' socket created at hal/utils/halcmd_rtapiapp.cc:281
io started

halcmd: cant connect to rtapi_app: -1 (uri= uuid=a42c8c6b-4025-4f83-ba28-dad21114744a): rtapi_rpc(): reply timeout


On Friday, September 14, 2018 at 7:41:29 AM UTC-7, Tac Huynh wrote:

schoo...@gmail.com

unread,
Sep 17, 2018, 12:05:11 PM9/17/18
to machi...@googlegroups.com
It is being fixed, I will advise when done and the repo reset

schoo...@gmail.com

unread,
Sep 17, 2018, 12:45:37 PM9/17/18
to machi...@googlegroups.com
OK, there is a new set of machinekit packages, I have just tested them on a rt-preempt kernel and they work. >:o

Tac Huynh

unread,
Sep 17, 2018, 1:54:18 PM9/17/18
to Machinekit
Thanks Schooner.
Latest update worked.

For other people using the raspberry pi. I used the ready made image from RealtimePi.


saving a lot of time for patching the preEmpt realtime kernel
Tac.

On Friday, September 14, 2018 at 7:41:29 AM UTC-7, Tac Huynh wrote:

mngr

unread,
Sep 18, 2018, 8:40:20 AM9/18/18
to Machinekit
Thanks Tac!!
i was just about to ask how did you make a debian stretch real-time image for the Pi, thank you very much!

mngr

unread,
Sep 21, 2018, 9:40:05 AM9/21/18
to Machinekit
I compiled from source, using
./ configure --with-platform-raspberry
and machinekit works.


I randomly gave a look in the /var/log/linuxcnc.log file and I found that
Sep 21 13:24:10 realtimepi msgd:0: startup pid=4467 flavor=posix rtlevel=1 usrlevel=1 halsize=524288 shm=Posix cc=gcc 6.3.0 20170516  version=unknown
even if
pi@realtimepi:~ $ uname -a
Linux realtimepi 4.14.69-v7+ #1141 SMP Mon Sep 10 15:26:29 BST 2018 armv7l GNU/Linux

should'nt flavor be preempt-rt?

did I missed something while compiling?

schoo...@gmail.com

unread,
Sep 21, 2018, 9:58:25 AM9/21/18
to machi...@googlegroups.com
I have just done a fresh clone of machinekit, built on a rt-preempt kernel (with a posix) one also installed and I get

Sep 21 14:52:00 INTEL-i7 msgd:0: startup pid=14733 flavor=rt-preempt rtlevel=5 usrlevel=5 halsize=524288 shm=Posix cc=gcc 8.2.0  version=unknown
Sep 21 14:52:00 INTEL-i7 msgd:0: ØMQ=4.2.5 czmq=4.1.1 protobuf=3.0.0 atomics=gcc intrinsics    libwebsockets=2.0.3.
Sep 21 14:52:00 INTEL-i7 msgd:0: configured: sha=f63b8a215
Sep 21 14:52:00 INTEL-i7 msgd:0: built:      Sep 21 2018 14:50:29 sha=f63b8a215

uname -a

Linux INTEL-i7 4.18.0-1-rt-amd64 #1 SMP PREEMPT RT Debian 4.18.8-1 (2018-09-18) x86_64 GNU/Linux

If your kernel does not say it is RT and PREEMPT, then it probably isn't.
Reply all
Reply to author
Forward
0 new messages