Re: [Machinekit] Does machinekit have to run as root? pru-stepper example doesn't work

2018-04-04 Thread Rick Mann


> On Apr 4, 2018, at 00:31 , Bas de Bruijn  wrote:
> 
> 
>> On 04 Apr 2018, at 09:17, Rick Mann  wrote:
>> 
>> 
>> 
>>> On Apr 3, 2018, at 23:46 , Bas de Bruijn  wrote:
>>> 
>>> 
 On 04 Apr 2018, at 02:51, Rick Mann  wrote:
 
 
 
> On Apr 3, 2018, at 02:23 , Bas de Bruijn  wrote:
> 
> 
> 
> On 3 Apr 2018, at 10:29, Rick M  wrote:
> 
>> Bit of an update. I'm still stuck in the same issue. I re-flashed my BBB 
>> with the latest image:
>> 
>>  bone-debian-9.4-machinekit-armhf-2018-03-25-4gb
>> 
>> And I get the same problem. Either it can't insmod because it lacks 
>> permission, or if I run as root, I get:
> 
> You should not run as root. What is the error when you run normally?
> 
> export DEBUG=5
> machinekit 
> 
> What does /var/log/linuxcnc.log say?
> 
> Please pastebin that session.
 
 linuxcnc.log:  https://pastebin.com/fzc4zXuq
>>> 
>>> 
>>> line 452
>>> 
>>> Apr  3 17:43:12 beaglebone rtapi:0: 1:rtapi_app:6959:user hal_pru_generic: 
>>> cant find 
>>> /home/maker/machinekit-dev.arm/configs/pru-examples/pru_generic.bin in 
>>> /home/machinekit/machinekit/configs/pru-examples or /lib/firmware/pru/
>>> Apr  3 17:43:12 beaglebone rtapi:0: 1:rtapi_app:6959:user hpg: ERROR: 
>>> failed to initialize PRU
>>> 
>>> in this line 
>>> https://github.com/machinekit/machinekit/blob/master/configs/pru-examples/pru-stepper.ini#L4
>>>  the location is
>>> CONFIG=prucode=/home/maker/machinekit-dev.arm/configs/pru-examples/pru_generic.bin
>>>  pru=1 num_stepgens=3 num_pwmgens=1
>>> 
>>> I very strongly doubt that’s the correct location.
>>> 
>>> sudo find / -name pru_generic.bin
>>> 
>>> that will show where it’s located to the right location. So you probably 
>>> should have on the line above the following path 
>>> ”rt-preempt/pru_generic.bin” instead of 
>>> "/home/maker/machinekit-dev.arm/configs/pru-examples/pru_generic.bin"
>>> 
>>> similar (but not xenomai) to this:
>>> https://github.com/machinekit/machinekit/blob/master/configs/ARM/BeagleBone/CRAMPS/CRAMPS.ini#L4
>> 
>> Thanks, that gets things farther. I changed the line to:
>> 
>>   CONFIG=prucode=/usr/lib/linuxcnc/rt-preempt/pru_generic.bin pru=1 
>> num_stepgens=3 num_pwmgens=1
>> 
>> Now I've run into an issue that might be because I'm trying to run this over 
>> X windows instead of with a locally-connected display (so far that has 
>> worked):
> 
> try ssh -Y user@ipadress and see if that helps

Ah, I may have found an answer:

https://bugs.freedesktop.org/show_bug.cgi?id=99146

Seems XQuartz on macOS doesn't enable indirect GLX by default, and it must be 
enabled:

$ defaults write org.macosforge.xquartz.X11 enable_iglx -bool true

This got me farther, and I now see the AXIS display! I still got a few errors:

$ machinekit
MACHINEKIT - 0.1
Machine configuration directory is 
'/home/machinekit/machinekit/configs/pru-examples'
Machine configuration file is 'pru-stepper.ini'
Starting Machinekit...
io started
emc/iotask/ioControl.cc 768: can't load tool table.
halcmd loadusr io started
task pid=8491
emcTaskInit: using builtin interpreter
libGL error: No matching fbConfigs or visuals found
libGL error: failed to load driver: swrast

But this is a big step! Thank you.

Now I have to figure out how to configure for my unique servo setup.

-- 
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+unsubscr...@googlegroups.com.
Visit this group at https://groups.google.com/group/machinekit.
For more options, visit https://groups.google.com/d/optout.


Re: [Machinekit] Does machinekit have to run as root? pru-stepper example doesn't work

2018-04-04 Thread Rick Mann


> On Apr 4, 2018, at 00:31 , Bas de Bruijn  wrote:
> 
> 
>> On 04 Apr 2018, at 09:17, Rick Mann  wrote:
>> 
>> 
>> 
>>> On Apr 3, 2018, at 23:46 , Bas de Bruijn  wrote:
>>> 
>>> 
 On 04 Apr 2018, at 02:51, Rick Mann  wrote:
 
 
 
> On Apr 3, 2018, at 02:23 , Bas de Bruijn  wrote:
> 
> 
> 
> On 3 Apr 2018, at 10:29, Rick M  wrote:
> 
>> Bit of an update. I'm still stuck in the same issue. I re-flashed my BBB 
>> with the latest image:
>> 
>>  bone-debian-9.4-machinekit-armhf-2018-03-25-4gb
>> 
>> And I get the same problem. Either it can't insmod because it lacks 
>> permission, or if I run as root, I get:
> 
> You should not run as root. What is the error when you run normally?
> 
> export DEBUG=5
> machinekit 
> 
> What does /var/log/linuxcnc.log say?
> 
> Please pastebin that session.
 
 linuxcnc.log:  https://pastebin.com/fzc4zXuq
>>> 
>>> 
>>> line 452
>>> 
>>> Apr  3 17:43:12 beaglebone rtapi:0: 1:rtapi_app:6959:user hal_pru_generic: 
>>> cant find 
>>> /home/maker/machinekit-dev.arm/configs/pru-examples/pru_generic.bin in 
>>> /home/machinekit/machinekit/configs/pru-examples or /lib/firmware/pru/
>>> Apr  3 17:43:12 beaglebone rtapi:0: 1:rtapi_app:6959:user hpg: ERROR: 
>>> failed to initialize PRU
>>> 
>>> in this line 
>>> https://github.com/machinekit/machinekit/blob/master/configs/pru-examples/pru-stepper.ini#L4
>>>  the location is
>>> CONFIG=prucode=/home/maker/machinekit-dev.arm/configs/pru-examples/pru_generic.bin
>>>  pru=1 num_stepgens=3 num_pwmgens=1
>>> 
>>> I very strongly doubt that’s the correct location.
>>> 
>>> sudo find / -name pru_generic.bin
>>> 
>>> that will show where it’s located to the right location. So you probably 
>>> should have on the line above the following path 
>>> ”rt-preempt/pru_generic.bin” instead of 
>>> "/home/maker/machinekit-dev.arm/configs/pru-examples/pru_generic.bin"
>>> 
>>> similar (but not xenomai) to this:
>>> https://github.com/machinekit/machinekit/blob/master/configs/ARM/BeagleBone/CRAMPS/CRAMPS.ini#L4
>> 
>> Thanks, that gets things farther. I changed the line to:
>> 
>>   CONFIG=prucode=/usr/lib/linuxcnc/rt-preempt/pru_generic.bin pru=1 
>> num_stepgens=3 num_pwmgens=1
>> 
>> Now I've run into an issue that might be because I'm trying to run this over 
>> X windows instead of with a locally-connected display (so far that has 
>> worked):
> 
> try ssh -Y user@ipadress and see if that helps

Same problem, unfortunately. I'd connect it directly but it's 15 km away right 
now (and 0035). :/


-- 
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+unsubscr...@googlegroups.com.
Visit this group at https://groups.google.com/group/machinekit.
For more options, visit https://groups.google.com/d/optout.


Re: [Machinekit] Does machinekit have to run as root? pru-stepper example doesn't work

2018-04-04 Thread Bas de Bruijn

> On 04 Apr 2018, at 09:17, Rick Mann  wrote:
> 
> 
> 
>> On Apr 3, 2018, at 23:46 , Bas de Bruijn  wrote:
>> 
>> 
>>> On 04 Apr 2018, at 02:51, Rick Mann  wrote:
>>> 
>>> 
>>> 
 On Apr 3, 2018, at 02:23 , Bas de Bruijn  wrote:
 
 
 
 On 3 Apr 2018, at 10:29, Rick M  wrote:
 
> Bit of an update. I'm still stuck in the same issue. I re-flashed my BBB 
> with the latest image:
> 
>   bone-debian-9.4-machinekit-armhf-2018-03-25-4gb
> 
> And I get the same problem. Either it can't insmod because it lacks 
> permission, or if I run as root, I get:
 
 You should not run as root. What is the error when you run normally?
 
 export DEBUG=5
 machinekit 
 
 What does /var/log/linuxcnc.log say?
 
 Please pastebin that session.
>>> 
>>> linuxcnc.log:   https://pastebin.com/fzc4zXuq
>> 
>> 
>> line 452
>> 
>> Apr  3 17:43:12 beaglebone rtapi:0: 1:rtapi_app:6959:user hal_pru_generic: 
>> cant find 
>> /home/maker/machinekit-dev.arm/configs/pru-examples/pru_generic.bin in 
>> /home/machinekit/machinekit/configs/pru-examples or /lib/firmware/pru/
>> Apr  3 17:43:12 beaglebone rtapi:0: 1:rtapi_app:6959:user hpg: ERROR: failed 
>> to initialize PRU
>> 
>> in this line 
>> https://github.com/machinekit/machinekit/blob/master/configs/pru-examples/pru-stepper.ini#L4
>>  the location is
>> CONFIG=prucode=/home/maker/machinekit-dev.arm/configs/pru-examples/pru_generic.bin
>>  pru=1 num_stepgens=3 num_pwmgens=1
>> 
>> I very strongly doubt that’s the correct location.
>> 
>> sudo find / -name pru_generic.bin
>> 
>> that will show where it’s located to the right location. So you probably 
>> should have on the line above the following path 
>> ”rt-preempt/pru_generic.bin” instead of 
>> "/home/maker/machinekit-dev.arm/configs/pru-examples/pru_generic.bin"
>> 
>> similar (but not xenomai) to this:
>> https://github.com/machinekit/machinekit/blob/master/configs/ARM/BeagleBone/CRAMPS/CRAMPS.ini#L4
> 
> Thanks, that gets things farther. I changed the line to:
> 
>CONFIG=prucode=/usr/lib/linuxcnc/rt-preempt/pru_generic.bin pru=1 
> num_stepgens=3 num_pwmgens=1
> 
> Now I've run into an issue that might be because I'm trying to run this over 
> X windows instead of with a locally-connected display (so far that has 
> worked):

try ssh -Y user@ipadress and see if that helps

> 
> $ machinekit
> MACHINEKIT - 0.1
> Machine configuration directory is 
> '/home/machinekit/machinekit/configs/pru-examples'
> Machine configuration file is 'pru-stepper.ini'
> Starting Machinekit...
> io started
> emc/iotask/ioControl.cc 768: can't load tool table.
> halcmd loadusr io started
> task pid=7604
> emcTaskInit: using builtin interpreter
> No option 'tto_g11' in section: 'DEFAULT'
> No option 'show_program' in section: 'DEFAULT'
> No option 'show_rapids' in section: 'DEFAULT'
> No option 'program_alpha' in section: 'DEFAULT'
> No option 'show_live_plot' in section: 'DEFAULT'
> No option 'show_tool' in section: 'DEFAULT'
> No option 'show_extents' in section: 'DEFAULT'
> No option 'show_offsets' in section: 'DEFAULT'
> No option 'grid_size' in section: 'DEFAULT'
> No option 'show_machine_limits' in section: 'DEFAULT'
> No option 'show_machine_speed' in section: 'DEFAULT'
> No option 'show_distance_to_go' in section: 'DEFAULT'
> No option 'dro_large_font' in section: 'DEFAULT'
> No option 'block_delete' in section: 'DEFAULT'
> No option 'optional_stop' in section: 'DEFAULT'
> No option 'recentfiles' in section: 'DEFAULT'
> libGL error: No matching fbConfigs or visuals found
> libGL error: failed to load driver: swrast
> X Error of failed request:  BadValue (integer parameter out of range for 
> operation)
>  Major opcode of failed request:  149 (GLX)
>  Minor opcode of failed request:  3 (X_GLXCreateContext)
>  Value in failed request:  0x0
>  Serial number of failed request:  736
>  Current serial number in output stream:  737
> Shutting down and cleaning up Machinekit...
> Cleanup done
> Machinekit terminated with an error.  You can find more information in the 
> log:
>/home/machinekit/linuxcnc_debug.txt
> and
>/home/machinekit/linuxcnc_print.txt
> as well as in the output of the shell command 'dmesg' and in the terminal
> 
> There's a lot less in the log, too:
> 
> Apr  4 00:12:51 beaglebone msgd:0: startup pid=7574 flavor=rt-preempt 
> rtlevel=1 usrlevel=1 halsize=524288 shm=Posix cc=gcc 6.3.0 20170516  
> version=v0.1~-~b262b43
> Apr  4 00:12:51 beaglebone msgd:0: ØMQ=4.2.1 czmq=4.0.2 protobuf=3.0.0 
> atomics=gcc intrinsicslibwebsockets=2.0.3
> Apr  4 00:12:51 beaglebone msgd:0: configured: sha=b262b43
> Apr  4 00:12:51 beaglebone msgd:0: built:  Mar 27 2018 15:43:12 
> sha=b262b43
> Apr  4 00:12:51 beaglebone msgd:0: register_stuff: actual hostname as 
> announced by avahi='beaglebone.local'
> Apr  4 00:12:51 beaglebone msgd:0: zeroconf: registering: 'Log service on 
> beaglebone.local pid 7574'
> Apr  4 00:12:52 beaglebone 

Re: [Machinekit] Does machinekit have to run as root? pru-stepper example doesn't work

2018-04-04 Thread Rick Mann


> On Apr 3, 2018, at 23:46 , Bas de Bruijn  wrote:
> 
> 
>> On 04 Apr 2018, at 02:51, Rick Mann  wrote:
>> 
>> 
>> 
>>> On Apr 3, 2018, at 02:23 , Bas de Bruijn  wrote:
>>> 
>>> 
>>> 
>>> On 3 Apr 2018, at 10:29, Rick M  wrote:
>>> 
 Bit of an update. I'm still stuck in the same issue. I re-flashed my BBB 
 with the latest image:
 
bone-debian-9.4-machinekit-armhf-2018-03-25-4gb
 
 And I get the same problem. Either it can't insmod because it lacks 
 permission, or if I run as root, I get:
>>> 
>>> You should not run as root. What is the error when you run normally?
>>> 
>>> export DEBUG=5
>>> machinekit 
>>> 
>>> What does /var/log/linuxcnc.log say?
>>> 
>>> Please pastebin that session.
>> 
>> linuxcnc.log:https://pastebin.com/fzc4zXuq
> 
> 
> line 452
> 
> Apr  3 17:43:12 beaglebone rtapi:0: 1:rtapi_app:6959:user hal_pru_generic: 
> cant find /home/maker/machinekit-dev.arm/configs/pru-examples/pru_generic.bin 
> in /home/machinekit/machinekit/configs/pru-examples or /lib/firmware/pru/
> Apr  3 17:43:12 beaglebone rtapi:0: 1:rtapi_app:6959:user hpg: ERROR: failed 
> to initialize PRU
> 
> in this line 
> https://github.com/machinekit/machinekit/blob/master/configs/pru-examples/pru-stepper.ini#L4
>  the location is
> CONFIG=prucode=/home/maker/machinekit-dev.arm/configs/pru-examples/pru_generic.bin
>  pru=1 num_stepgens=3 num_pwmgens=1
> 
> I very strongly doubt that’s the correct location.
> 
> sudo find / -name pru_generic.bin
> 
> that will show where it’s located to the right location. So you probably 
> should have on the line above the following path ”rt-preempt/pru_generic.bin” 
> instead of 
> "/home/maker/machinekit-dev.arm/configs/pru-examples/pru_generic.bin"
> 
> similar (but not xenomai) to this:
> https://github.com/machinekit/machinekit/blob/master/configs/ARM/BeagleBone/CRAMPS/CRAMPS.ini#L4

Thanks, that gets things farther. I changed the line to:

CONFIG=prucode=/usr/lib/linuxcnc/rt-preempt/pru_generic.bin pru=1 
num_stepgens=3 num_pwmgens=1

Now I've run into an issue that might be because I'm trying to run this over X 
windows instead of with a locally-connected display (so far that has worked):

$ machinekit
MACHINEKIT - 0.1
Machine configuration directory is 
'/home/machinekit/machinekit/configs/pru-examples'
Machine configuration file is 'pru-stepper.ini'
Starting Machinekit...
io started
emc/iotask/ioControl.cc 768: can't load tool table.
halcmd loadusr io started
task pid=7604
emcTaskInit: using builtin interpreter
No option 'tto_g11' in section: 'DEFAULT'
No option 'show_program' in section: 'DEFAULT'
No option 'show_rapids' in section: 'DEFAULT'
No option 'program_alpha' in section: 'DEFAULT'
No option 'show_live_plot' in section: 'DEFAULT'
No option 'show_tool' in section: 'DEFAULT'
No option 'show_extents' in section: 'DEFAULT'
No option 'show_offsets' in section: 'DEFAULT'
No option 'grid_size' in section: 'DEFAULT'
No option 'show_machine_limits' in section: 'DEFAULT'
No option 'show_machine_speed' in section: 'DEFAULT'
No option 'show_distance_to_go' in section: 'DEFAULT'
No option 'dro_large_font' in section: 'DEFAULT'
No option 'block_delete' in section: 'DEFAULT'
No option 'optional_stop' in section: 'DEFAULT'
No option 'recentfiles' in section: 'DEFAULT'
libGL error: No matching fbConfigs or visuals found
libGL error: failed to load driver: swrast
X Error of failed request:  BadValue (integer parameter out of range for 
operation)
  Major opcode of failed request:  149 (GLX)
  Minor opcode of failed request:  3 (X_GLXCreateContext)
  Value in failed request:  0x0
  Serial number of failed request:  736
  Current serial number in output stream:  737
Shutting down and cleaning up Machinekit...
Cleanup done
Machinekit terminated with an error.  You can find more information in the log:
/home/machinekit/linuxcnc_debug.txt
and
/home/machinekit/linuxcnc_print.txt
as well as in the output of the shell command 'dmesg' and in the terminal

There's a lot less in the log, too:

Apr  4 00:12:51 beaglebone msgd:0: startup pid=7574 flavor=rt-preempt rtlevel=1 
usrlevel=1 halsize=524288 shm=Posix cc=gcc 6.3.0 20170516  
version=v0.1~-~b262b43
Apr  4 00:12:51 beaglebone msgd:0: ØMQ=4.2.1 czmq=4.0.2 protobuf=3.0.0 
atomics=gcc intrinsicslibwebsockets=2.0.3
Apr  4 00:12:51 beaglebone msgd:0: configured: sha=b262b43
Apr  4 00:12:51 beaglebone msgd:0: built:  Mar 27 2018 15:43:12 sha=b262b43
Apr  4 00:12:51 beaglebone msgd:0: register_stuff: actual hostname as announced 
by avahi='beaglebone.local'
Apr  4 00:12:51 beaglebone msgd:0: zeroconf: registering: 'Log service on 
beaglebone.local pid 7574'
Apr  4 00:12:52 beaglebone msgd:0: zeroconf: registered 'Log service on 
beaglebone.local pid 7574' _machinekit._tcp 0 TXT 
"uuid=a42c8c6b-4025-4f83-ba28-dad21114744a" 
"instance=96806544-37d7-11e8-92ac-38d269733d55" "service=log" 
"dsn=ipc:///tmp/0.log.a42c8c6b-4025-4f83-ba28-dad21114744a"
Apr  4 00:13:23 beaglebone rtapi:

Re: [Machinekit] Does machinekit have to run as root? pru-stepper example doesn't work

2018-04-03 Thread Bas de Bruijn

> On 04 Apr 2018, at 08:48, Rick Mann  wrote:
> 
> Good morning, and thank you! I'll see if I can track it down, and then I'll 
> let Robert Nelson know to fix it in the image.

I don’t think is has to do with the image. More like a configuration with the 
wrong path (looks like it’s a very old and rarely used configuration)

> 
>> On Apr 3, 2018, at 23:46 , Bas de Bruijn  wrote:
>> 
>> 
>>> On 04 Apr 2018, at 02:51, Rick Mann  wrote:
>>> 
>>> 
>>> 
 On Apr 3, 2018, at 02:23 , Bas de Bruijn  wrote:
 
 
 
 On 3 Apr 2018, at 10:29, Rick M  wrote:
 
> Bit of an update. I'm still stuck in the same issue. I re-flashed my BBB 
> with the latest image:
> 
>   bone-debian-9.4-machinekit-armhf-2018-03-25-4gb
> 
> And I get the same problem. Either it can't insmod because it lacks 
> permission, or if I run as root, I get:
 
 You should not run as root. What is the error when you run normally?
 
 export DEBUG=5
 machinekit 
 
 What does /var/log/linuxcnc.log say?
 
 Please pastebin that session.
>>> 
>>> linuxcnc.log:   https://pastebin.com/fzc4zXuq
>> 
>> 
>> line 452
>> 
>> Apr  3 17:43:12 beaglebone rtapi:0: 1:rtapi_app:6959:user hal_pru_generic: 
>> cant find 
>> /home/maker/machinekit-dev.arm/configs/pru-examples/pru_generic.bin in 
>> /home/machinekit/machinekit/configs/pru-examples or /lib/firmware/pru/
>> Apr  3 17:43:12 beaglebone rtapi:0: 1:rtapi_app:6959:user hpg: ERROR: failed 
>> to initialize PRU
>> 
>> in this line 
>> https://github.com/machinekit/machinekit/blob/master/configs/pru-examples/pru-stepper.ini#L4
>>  the location is
>> CONFIG=prucode=/home/maker/machinekit-dev.arm/configs/pru-examples/pru_generic.bin
>>  pru=1 num_stepgens=3 num_pwmgens=1
>> 
>> I very strongly doubt that’s the correct location.
>> 
>> sudo find / -name pru_generic.bin
>> 
>> that will show where it’s located to the right location. So you probably 
>> should have on the line above the following path 
>> ”rt-preempt/pru_generic.bin” instead of 
>> "/home/maker/machinekit-dev.arm/configs/pru-examples/pru_generic.bin"
>> 
>> similar (but not xenomai) to this:
>> https://github.com/machinekit/machinekit/blob/master/configs/ARM/BeagleBone/CRAMPS/CRAMPS.ini#L4
>> 
>> 
>>> linuxcnc_print.txt: https://pastebin.com/hrw78Hcp
>>> dmesg:  https://pastebin.com/q8ausFhr
>>> 
>>> machinekit@beaglebone:~$ machinekit
>>> MACHINEKIT - 0.1
>>> Machine configuration directory is 
>>> '/home/machinekit/machinekit/configs/pru-examples'
>>> Machine configuration file is 'pru-stepper.ini'
>>> Starting Machinekit...
>>> io started
>>> emc/iotask/ioControl.cc 768: can't load tool table.
>>> :0: Component 'iocontrol' ready
>>> :0: Program 'io' started
>>> halcmd loadusr io started
>>> pru-stepper.hal:29: Realtime module 'trivkins' loaded
>>> pru-stepper.hal:33: Realtime module 'tp' loaded
>>> pru-stepper.hal:34: Realtime module 'motmod' loaded
>>> pru-stepper.hal:37: insmod failed, returned -1:
>>> rtapi_app_main(hal_pru_generic): -1 Operation not permitted
>>> 
>>> See /var/log/linuxcnc.log for more information.
>>> Shutting down and cleaning up Machinekit...
>>> :0: Realtime threads stopped
>>> :0: Realtime module 'motmod' unloaded
>>> :0: Realtime module 'tp' unloaded
>>> :0: Realtime module 'trivkins' unloaded
>>> Cleanup done
>>> Machinekit terminated with an error.  You can find more information in the 
>>> log:
>>>   /home/machinekit/linuxcnc_debug.txt
>>> and
>>>   /home/machinekit/linuxcnc_print.txt
>>> as well as in the output of the shell command 'dmesg' and in the terminal
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
 Bas
 
> 
> Creating machinekit directory
> 
> MACHINEKIT - 0.1
> 
> Machine configuration directory is 
> '/usr/share/linuxcnc/examples/sample-configs/pru-examples'
> 
> Machine configuration file is 'pru-stepper.ini'
> 
> Starting Machinekit...
> 
> /usr/libexec/linuxcnc/rtapi_msgd: FATAL - will not run as root
> 
> rtapi_msgd startup failed - aborting
> 
> rtapi_app startup failed - aborting
> 
> halcmd: cant connect to rtapi_app: -1 (uri= 
> uuid=a42c8c6b-4025-4f83-ba28-dad21114744a): rtapi_rpc(): reply timeout
> 
> 
> Additional info:
> 
> # /opt/scripts/tools/version.sh 
> 
> git:/opt/scripts/:[70edebd65fe6ea7de16ea8efe3c48b2a4062034a]
> 
> eeprom:[A335BNLT00C04417BBBK0741]
> 
> model:[TI_AM335x_BeagleBone_Black]
> 
> dogtag:[Machinekit Debian Image 2018-03-25]
> 
> bootloader:[eMMC-(default)]:[/dev/mmcblk1]:[U-Boot 
> 2018.03-2-g254339602c]:[location: dd MBR]
> 
> kernel:[4.14.29-ti-rt-r40]
> 
> uboot_overlay_options:[enable_uboot_overlays=1]
> 
> uboot_overlay_options:[disable_uboot_overlay_adc=1]
> 
> uboot_overlay_options:[uboot_overlay_pru=/lib/firmware/AM335X-PRU-UIO-00A0.dtbo]
> 
> uboot_overlay_options:[enable_ub

Re: [Machinekit] Does machinekit have to run as root? pru-stepper example doesn't work

2018-04-03 Thread Rick Mann
Good morning, and thank you! I'll see if I can track it down, and then I'll let 
Robert Nelson know to fix it in the image.

> On Apr 3, 2018, at 23:46 , Bas de Bruijn  wrote:
> 
> 
>> On 04 Apr 2018, at 02:51, Rick Mann  wrote:
>> 
>> 
>> 
>>> On Apr 3, 2018, at 02:23 , Bas de Bruijn  wrote:
>>> 
>>> 
>>> 
>>> On 3 Apr 2018, at 10:29, Rick M  wrote:
>>> 
 Bit of an update. I'm still stuck in the same issue. I re-flashed my BBB 
 with the latest image:
 
bone-debian-9.4-machinekit-armhf-2018-03-25-4gb
 
 And I get the same problem. Either it can't insmod because it lacks 
 permission, or if I run as root, I get:
>>> 
>>> You should not run as root. What is the error when you run normally?
>>> 
>>> export DEBUG=5
>>> machinekit 
>>> 
>>> What does /var/log/linuxcnc.log say?
>>> 
>>> Please pastebin that session.
>> 
>> linuxcnc.log:https://pastebin.com/fzc4zXuq
> 
> 
> line 452
> 
> Apr  3 17:43:12 beaglebone rtapi:0: 1:rtapi_app:6959:user hal_pru_generic: 
> cant find /home/maker/machinekit-dev.arm/configs/pru-examples/pru_generic.bin 
> in /home/machinekit/machinekit/configs/pru-examples or /lib/firmware/pru/
> Apr  3 17:43:12 beaglebone rtapi:0: 1:rtapi_app:6959:user hpg: ERROR: failed 
> to initialize PRU
> 
> in this line 
> https://github.com/machinekit/machinekit/blob/master/configs/pru-examples/pru-stepper.ini#L4
>  the location is
> CONFIG=prucode=/home/maker/machinekit-dev.arm/configs/pru-examples/pru_generic.bin
>  pru=1 num_stepgens=3 num_pwmgens=1
> 
> I very strongly doubt that’s the correct location.
> 
> sudo find / -name pru_generic.bin
> 
> that will show where it’s located to the right location. So you probably 
> should have on the line above the following path ”rt-preempt/pru_generic.bin” 
> instead of 
> "/home/maker/machinekit-dev.arm/configs/pru-examples/pru_generic.bin"
> 
> similar (but not xenomai) to this:
> https://github.com/machinekit/machinekit/blob/master/configs/ARM/BeagleBone/CRAMPS/CRAMPS.ini#L4
> 
> 
>> linuxcnc_print.txt:  https://pastebin.com/hrw78Hcp
>> dmesg:   https://pastebin.com/q8ausFhr
>> 
>> machinekit@beaglebone:~$ machinekit
>> MACHINEKIT - 0.1
>> Machine configuration directory is 
>> '/home/machinekit/machinekit/configs/pru-examples'
>> Machine configuration file is 'pru-stepper.ini'
>> Starting Machinekit...
>> io started
>> emc/iotask/ioControl.cc 768: can't load tool table.
>> :0: Component 'iocontrol' ready
>> :0: Program 'io' started
>> halcmd loadusr io started
>> pru-stepper.hal:29: Realtime module 'trivkins' loaded
>> pru-stepper.hal:33: Realtime module 'tp' loaded
>> pru-stepper.hal:34: Realtime module 'motmod' loaded
>> pru-stepper.hal:37: insmod failed, returned -1:
>> rtapi_app_main(hal_pru_generic): -1 Operation not permitted
>> 
>> See /var/log/linuxcnc.log for more information.
>> Shutting down and cleaning up Machinekit...
>> :0: Realtime threads stopped
>> :0: Realtime module 'motmod' unloaded
>> :0: Realtime module 'tp' unloaded
>> :0: Realtime module 'trivkins' unloaded
>> Cleanup done
>> Machinekit terminated with an error.  You can find more information in the 
>> log:
>>/home/machinekit/linuxcnc_debug.txt
>> and
>>/home/machinekit/linuxcnc_print.txt
>> as well as in the output of the shell command 'dmesg' and in the terminal
>> 
>> 
>> 
>> 
>> 
>> 
>>> Bas
>>> 
 
 Creating machinekit directory
 
 MACHINEKIT - 0.1
 
 Machine configuration directory is 
 '/usr/share/linuxcnc/examples/sample-configs/pru-examples'
 
 Machine configuration file is 'pru-stepper.ini'
 
 Starting Machinekit...
 
 /usr/libexec/linuxcnc/rtapi_msgd: FATAL - will not run as root
 
 rtapi_msgd startup failed - aborting
 
 rtapi_app startup failed - aborting
 
 halcmd: cant connect to rtapi_app: -1 (uri= 
 uuid=a42c8c6b-4025-4f83-ba28-dad21114744a): rtapi_rpc(): reply timeout
 
 
 Additional info:
 
 # /opt/scripts/tools/version.sh 
 
 git:/opt/scripts/:[70edebd65fe6ea7de16ea8efe3c48b2a4062034a]
 
 eeprom:[A335BNLT00C04417BBBK0741]
 
 model:[TI_AM335x_BeagleBone_Black]
 
 dogtag:[Machinekit Debian Image 2018-03-25]
 
 bootloader:[eMMC-(default)]:[/dev/mmcblk1]:[U-Boot 
 2018.03-2-g254339602c]:[location: dd MBR]
 
 kernel:[4.14.29-ti-rt-r40]
 
 uboot_overlay_options:[enable_uboot_overlays=1]
 
 uboot_overlay_options:[disable_uboot_overlay_adc=1]
 
 uboot_overlay_options:[uboot_overlay_pru=/lib/firmware/AM335X-PRU-UIO-00A0.dtbo]
 
 uboot_overlay_options:[enable_uboot_cape_universal=1]
 
 pkg:[bb-cape-overlays]:[4.4.20180322.0-0rcnee0~stretch+20180322]
 
 pkg:[bb-wl18xx-firmware]:[1.20180328-0rcnee2~stretch+20180328]
 
 pkg:[firmware-ti-connectivity]:[20170823-1rcnee1~stretch+20180328]
 
 cmdline:[console=ttyO0,115200n8 bone_capemgr.uboot_capemgr_enabled=1 
 root=/dev/mmcblk

Re: [Machinekit] Does machinekit have to run as root? pru-stepper example doesn't work

2018-04-03 Thread Bas de Bruijn

> On 04 Apr 2018, at 02:51, Rick Mann  wrote:
> 
> 
> 
>> On Apr 3, 2018, at 02:23 , Bas de Bruijn  wrote:
>> 
>> 
>> 
>> On 3 Apr 2018, at 10:29, Rick M  wrote:
>> 
>>> Bit of an update. I'm still stuck in the same issue. I re-flashed my BBB 
>>> with the latest image:
>>> 
>>>bone-debian-9.4-machinekit-armhf-2018-03-25-4gb
>>> 
>>> And I get the same problem. Either it can't insmod because it lacks 
>>> permission, or if I run as root, I get:
>> 
>> You should not run as root. What is the error when you run normally?
>> 
>> export DEBUG=5
>> machinekit 
>> 
>> What does /var/log/linuxcnc.log say?
>> 
>> Please pastebin that session.
> 
> linuxcnc.log: https://pastebin.com/fzc4zXuq


line 452

Apr  3 17:43:12 beaglebone rtapi:0: 1:rtapi_app:6959:user hal_pru_generic: cant 
find /home/maker/machinekit-dev.arm/configs/pru-examples/pru_generic.bin in 
/home/machinekit/machinekit/configs/pru-examples or /lib/firmware/pru/
Apr  3 17:43:12 beaglebone rtapi:0: 1:rtapi_app:6959:user hpg: ERROR: failed to 
initialize PRU

in this line 
https://github.com/machinekit/machinekit/blob/master/configs/pru-examples/pru-stepper.ini#L4
 

 the location is
CONFIG=prucode=/home/maker/machinekit-dev.arm/configs/pru-examples/pru_generic.bin
 pru=1 num_stepgens=3 num_pwmgens=1

I very strongly doubt that’s the correct location.

sudo find / -name pru_generic.bin

that will show where it’s located to the right location. So you probably should 
have on the line above the following path ”rt-preempt/pru_generic.bin” instead 
of "/home/maker/machinekit-dev.arm/configs/pru-examples/pru_generic.bin"

similar (but not xenomai) to this:
https://github.com/machinekit/machinekit/blob/master/configs/ARM/BeagleBone/CRAMPS/CRAMPS.ini#L4
 



> linuxcnc_print.txt:   https://pastebin.com/hrw78Hcp
> dmesg:https://pastebin.com/q8ausFhr
> 
> machinekit@beaglebone:~$ machinekit
> MACHINEKIT - 0.1
> Machine configuration directory is 
> '/home/machinekit/machinekit/configs/pru-examples'
> Machine configuration file is 'pru-stepper.ini'
> Starting Machinekit...
> io started
> emc/iotask/ioControl.cc 768: can't load tool table.
> :0: Component 'iocontrol' ready
> :0: Program 'io' started
> halcmd loadusr io started
> pru-stepper.hal:29: Realtime module 'trivkins' loaded
> pru-stepper.hal:33: Realtime module 'tp' loaded
> pru-stepper.hal:34: Realtime module 'motmod' loaded
> pru-stepper.hal:37: insmod failed, returned -1:
> rtapi_app_main(hal_pru_generic): -1 Operation not permitted
> 
> See /var/log/linuxcnc.log for more information.
> Shutting down and cleaning up Machinekit...
> :0: Realtime threads stopped
> :0: Realtime module 'motmod' unloaded
> :0: Realtime module 'tp' unloaded
> :0: Realtime module 'trivkins' unloaded
> Cleanup done
> Machinekit terminated with an error.  You can find more information in the 
> log:
>/home/machinekit/linuxcnc_debug.txt
> and
>/home/machinekit/linuxcnc_print.txt
> as well as in the output of the shell command 'dmesg' and in the terminal
> 
> 
> 
> 
> 
> 
>> Bas
>> 
>>> 
>>> Creating machinekit directory
>>> 
>>> MACHINEKIT - 0.1
>>> 
>>> Machine configuration directory is 
>>> '/usr/share/linuxcnc/examples/sample-configs/pru-examples'
>>> 
>>> Machine configuration file is 'pru-stepper.ini'
>>> 
>>> Starting Machinekit...
>>> 
>>> /usr/libexec/linuxcnc/rtapi_msgd: FATAL - will not run as root
>>> 
>>> rtapi_msgd startup failed - aborting
>>> 
>>> rtapi_app startup failed - aborting
>>> 
>>> halcmd: cant connect to rtapi_app: -1 (uri= 
>>> uuid=a42c8c6b-4025-4f83-ba28-dad21114744a): rtapi_rpc(): reply timeout
>>> 
>>> 
>>> Additional info:
>>> 
>>> # /opt/scripts/tools/version.sh 
>>> 
>>> git:/opt/scripts/:[70edebd65fe6ea7de16ea8efe3c48b2a4062034a]
>>> 
>>> eeprom:[A335BNLT00C04417BBBK0741]
>>> 
>>> model:[TI_AM335x_BeagleBone_Black]
>>> 
>>> dogtag:[Machinekit Debian Image 2018-03-25]
>>> 
>>> bootloader:[eMMC-(default)]:[/dev/mmcblk1]:[U-Boot 
>>> 2018.03-2-g254339602c]:[location: dd MBR]
>>> 
>>> kernel:[4.14.29-ti-rt-r40]
>>> 
>>> uboot_overlay_options:[enable_uboot_overlays=1]
>>> 
>>> uboot_overlay_options:[disable_uboot_overlay_adc=1]
>>> 
>>> uboot_overlay_options:[uboot_overlay_pru=/lib/firmware/AM335X-PRU-UIO-00A0.dtbo]
>>> 
>>> uboot_overlay_options:[enable_uboot_cape_universal=1]
>>> 
>>> pkg:[bb-cape-overlays]:[4.4.20180322.0-0rcnee0~stretch+20180322]
>>> 
>>> pkg:[bb-wl18xx-firmware]:[1.20180328-0rcnee2~stretch+20180328]
>>> 
>>> pkg:[firmware-ti-connectivity]:[20170823-1rcnee1~stretch+20180328]
>>> 
>>> cmdline:[console=ttyO0,115200n8 bone_capemgr.uboot_capemgr_enabled=1 
>>> root=/dev/mmcblk1p1 ro rootfstype=ext4 rootwait coherent_pool=1M 
>>> net.ifnames=0 quiet]
>>> 
>>> dmesg | grep pinctrl-single
>>> 
>>> [1.468808] pinctrl-single 44e10800.pinmux: 142

Re: [Machinekit] Does machinekit have to run as root? pru-stepper example doesn't work

2018-04-03 Thread Rick Mann


> On Apr 3, 2018, at 02:23 , Bas de Bruijn  wrote:
> 
> 
> 
> On 3 Apr 2018, at 10:29, Rick M  wrote:
> 
>> Bit of an update. I'm still stuck in the same issue. I re-flashed my BBB 
>> with the latest image:
>> 
>> bone-debian-9.4-machinekit-armhf-2018-03-25-4gb
>> 
>> And I get the same problem. Either it can't insmod because it lacks 
>> permission, or if I run as root, I get:
> 
> You should not run as root. What is the error when you run normally?
> 
> export DEBUG=5
> machinekit 
> 
> What does /var/log/linuxcnc.log say?
> 
> Please pastebin that session.

linuxcnc.log:   https://pastebin.com/fzc4zXuq
linuxcnc_print.txt: https://pastebin.com/hrw78Hcp
dmesg:  https://pastebin.com/q8ausFhr

machinekit@beaglebone:~$ machinekit
MACHINEKIT - 0.1
Machine configuration directory is 
'/home/machinekit/machinekit/configs/pru-examples'
Machine configuration file is 'pru-stepper.ini'
Starting Machinekit...
io started
emc/iotask/ioControl.cc 768: can't load tool table.
:0: Component 'iocontrol' ready
:0: Program 'io' started
halcmd loadusr io started
pru-stepper.hal:29: Realtime module 'trivkins' loaded
pru-stepper.hal:33: Realtime module 'tp' loaded
pru-stepper.hal:34: Realtime module 'motmod' loaded
pru-stepper.hal:37: insmod failed, returned -1:
rtapi_app_main(hal_pru_generic): -1 Operation not permitted

See /var/log/linuxcnc.log for more information.
Shutting down and cleaning up Machinekit...
:0: Realtime threads stopped
:0: Realtime module 'motmod' unloaded
:0: Realtime module 'tp' unloaded
:0: Realtime module 'trivkins' unloaded
Cleanup done
Machinekit terminated with an error.  You can find more information in the log:
/home/machinekit/linuxcnc_debug.txt
and
/home/machinekit/linuxcnc_print.txt
as well as in the output of the shell command 'dmesg' and in the terminal






> Bas
> 
>> 
>> Creating machinekit directory
>> 
>> MACHINEKIT - 0.1
>> 
>> Machine configuration directory is 
>> '/usr/share/linuxcnc/examples/sample-configs/pru-examples'
>> 
>> Machine configuration file is 'pru-stepper.ini'
>> 
>> Starting Machinekit...
>> 
>> /usr/libexec/linuxcnc/rtapi_msgd: FATAL - will not run as root
>> 
>> rtapi_msgd startup failed - aborting
>> 
>> rtapi_app startup failed - aborting
>> 
>> halcmd: cant connect to rtapi_app: -1 (uri= 
>> uuid=a42c8c6b-4025-4f83-ba28-dad21114744a): rtapi_rpc(): reply timeout
>> 
>> 
>> Additional info:
>> 
>> # /opt/scripts/tools/version.sh 
>> 
>> git:/opt/scripts/:[70edebd65fe6ea7de16ea8efe3c48b2a4062034a]
>> 
>> eeprom:[A335BNLT00C04417BBBK0741]
>> 
>> model:[TI_AM335x_BeagleBone_Black]
>> 
>> dogtag:[Machinekit Debian Image 2018-03-25]
>> 
>> bootloader:[eMMC-(default)]:[/dev/mmcblk1]:[U-Boot 
>> 2018.03-2-g254339602c]:[location: dd MBR]
>> 
>> kernel:[4.14.29-ti-rt-r40]
>> 
>> uboot_overlay_options:[enable_uboot_overlays=1]
>> 
>> uboot_overlay_options:[disable_uboot_overlay_adc=1]
>> 
>> uboot_overlay_options:[uboot_overlay_pru=/lib/firmware/AM335X-PRU-UIO-00A0.dtbo]
>> 
>> uboot_overlay_options:[enable_uboot_cape_universal=1]
>> 
>> pkg:[bb-cape-overlays]:[4.4.20180322.0-0rcnee0~stretch+20180322]
>> 
>> pkg:[bb-wl18xx-firmware]:[1.20180328-0rcnee2~stretch+20180328]
>> 
>> pkg:[firmware-ti-connectivity]:[20170823-1rcnee1~stretch+20180328]
>> 
>> cmdline:[console=ttyO0,115200n8 bone_capemgr.uboot_capemgr_enabled=1 
>> root=/dev/mmcblk1p1 ro rootfstype=ext4 rootwait coherent_pool=1M 
>> net.ifnames=0 quiet]
>> 
>> dmesg | grep pinctrl-single
>> 
>> [1.468808] pinctrl-single 44e10800.pinmux: 142 pins at pa f9e10800 size 
>> 568
>> 
>> dmesg | grep gpio-of-helper
>> 
>> [1.481251] gpio-of-helper ocp:cape-universal: ready
>> 
>> END
>> 
>> 
>> 
>> On Monday, April 2, 2018 at 9:55:54 PM UTC-7, Rick M wrote:
>> I launched machinekit and selected the pru-stepper example, but it quit with 
>> this output: 
>> 
>> MACHINEKIT - 0.1 
>> Machine configuration directory is 
>> '/home/machinekit/machinekit/configs/pru-examples' 
>> Machine configuration file is 'pru-stepper.ini' 
>> Starting Machinekit... 
>> io started 
>> emc/iotask/ioControl.cc 768: can't load tool table. 
>> halcmd loadusr io started 
>> pru-stepper.hal:37: insmod failed, returned -1: 
>> rtapi_app_main(hal_pru_generic): -1 Operation not permitted 
>> 
>> See /var/log/linuxcnc.log for more information. 
>> Shutting down and cleaning up Machinekit... 
>> Cleanup done 
>> Machinekit terminated with an error.  You can find more information in the 
>> log: 
>> /home/machinekit/linuxcnc_debug.txt 
>> and 
>> /home/machinekit/linuxcnc_print.txt 
>> as well as in the output of the shell command 'dmesg' and in the terminal 
>> 
>> Does it have to run as root? 
>> 
>> $ sudo /opt/scripts/tools/version.sh 
>> git:/opt/scripts/:[e307a944e0be0610ff5296e0abe4ad31a6e70daa] 
>> eeprom:[A335BNLT00C04417BBBK0741] 
>> model:[TI_AM335x_BeagleBone_Black] 
>> dogtag:[Machinekit Debian Image 2018-03-05] 
>> bootloader:[eMMC-(default)]:[/dev/mmcblk1]:[U-Boot 
>> 2018.01-