Parallel port only works once (2.4.5)

More
09 Nov 2010 08:11 #5172 by Drmn4ea
Hi,
I'm running into a strange behavior after updating to EMC2 2.4.5 / Ubuntu 10.04 via fresh install from the LiveCD. I have got my CNC mill set up and working over the parallel port, but EMC (or any related process, e.g. the axis tests in stepconf) seemingly can open the parallel port exactly once per reboot. That is, after testing an axis via stepconf or running EMC2 and closing, any subsequent runs of stepconf/EMC2 will fail silently trying to drive the port (i.e. reports no error messages and thinks it is working, but no pulses are generated). Changing the parallel port type in the BIOS (SPP, ECP, ECP+EPP) has no effect.

Has anyone come across this before, or can suggest a fix?

The tail end of the messages log is pasted below showing the output generated by 2 consecutive runs (first works, 2nd does not). My machine's current .ini file is attached to this post (.hal coming in the next one)

Nov 9 02:05:54 razor kernel: [ 18.761301] eth0: setting full-duplex.
Nov 9 02:05:56 razor kernel: [ 20.372976] [drm] nouveau 0000:01:00.0: Allocating FIFO number 1
Nov 9 02:05:56 razor kernel: [ 20.380217] [drm] nouveau 0000:01:00.0: nouveau_channel_alloc: initialised FIFO 1
Nov 9 02:06:28 razor kernel: [ 53.115104] I-pipe: Domain RTAI registered.
Nov 9 02:06:28 razor kernel: [ 53.115133] RTAI[hal]: <3.8.1> mounted over IPIPE-NOTHREADS 2.6-03.
Nov 9 02:06:28 razor kernel: [ 53.115141] RTAI[hal]: compiled with gcc version 4.4.3 (Ubuntu 4.4.3-4ubuntu5) .
Nov 9 02:06:28 razor kernel: [ 53.115158] RTAI[hal]: mounted (IPIPE-NOTHREADS, IMMEDIATE (INTERNAL IRQs DISPATCHED), ISOL_CPUS_MASK: 0).
Nov 9 02:06:28 razor kernel: [ 53.115165] PIPELINE layers:
Nov 9 02:06:28 razor kernel: [ 53.115174] d1cb4e20 9ac15d93 RTAI 200
Nov 9 02:06:28 razor kernel: [ 53.115181] c085cb20 0 Linux 100
Nov 9 02:06:28 razor kernel: [ 53.222942] RTAI[malloc]: global heap size = 2097152 bytes, <BSD>.
Nov 9 02:06:28 razor kernel: [ 53.223344] RTAI[sched]: IMMEDIATE, MP, USER/KERNEL SPACE: <with RTAI OWN KTASKs>, kstacks pool size = 524288 bytes.
Nov 9 02:06:28 razor kernel: [ 53.223359] RTAI[sched]: hard timer type/freq = APIC/12612231(Hz); default timing: periodic; linear timed lists.
Nov 9 02:06:28 razor kernel: [ 53.223369] RTAI[sched]: Linux timer freq = 250 (Hz), TimeBase freq = 807191000 hz.
Nov 9 02:06:28 razor kernel: [ 53.223377] RTAI[sched]: timer setup = 999 ns, resched latency = 2943 ns.
Nov 9 02:06:28 razor kernel: [ 53.223658] RTAI[usi]: enabled.
Nov 9 02:06:28 razor kernel: [ 53.541109] RTAI[math]: loaded.
Nov 9 02:06:29 razor kernel: [ 53.935942] config string '0x378 out '
Nov 9 02:44:23 razor sudo: pam_sm_authenticate: Called
Nov 9 02:44:23 razor sudo: pam_sm_authenticate: username = [cnc]
Nov 9 03:02:30 razor kernel: [ 3414.919344] probe_parport 00:00: disabled
Nov 9 03:02:32 razor kernel: [ 3417.305883] RTAI[math]: unloaded.
Nov 9 03:02:33 razor kernel: [ 3417.604324] SCHED releases registered named ALIEN RTGLBH
Nov 9 03:02:33 razor kernel: [ 3417.618349] RTAI[malloc]: unloaded.
Nov 9 03:02:33 razor kernel: [ 3417.717593] RTAI[sched]: unloaded (forced hard/soft/hard transitions: traps 0, syscalls 0).
Nov 9 03:02:33 razor kernel: [ 3417.754829] I-pipe: Domain RTAI unregistered.
Nov 9 03:02:33 razor kernel: [ 3417.754856] RTAI[hal]: unmounted.
Nov 9 03:04:15 razor kernel: [ 3519.889526] I-pipe: Domain RTAI registered.
Nov 9 03:04:15 razor kernel: [ 3519.889555] RTAI[hal]: <3.8.1> mounted over IPIPE-NOTHREADS 2.6-03.
Nov 9 03:04:15 razor kernel: [ 3519.889563] RTAI[hal]: compiled with gcc version 4.4.3 (Ubuntu 4.4.3-4ubuntu5) .
Nov 9 03:04:15 razor kernel: [ 3519.889580] RTAI[hal]: mounted (IPIPE-NOTHREADS, IMMEDIATE (INTERNAL IRQs DISPATCHED), ISOL_CPUS_MASK: 0).
Nov 9 03:04:15 razor kernel: [ 3519.889588] PIPELINE layers:
Nov 9 03:04:15 razor kernel: [ 3519.889596] d4ad9e20 9ac15d93 RTAI 200
Nov 9 03:04:15 razor kernel: [ 3519.889603] c085cb20 0 Linux 100
Nov 9 03:04:15 razor kernel: [ 3519.987085] RTAI[malloc]: global heap size = 2097152 bytes, <BSD>.
Nov 9 03:04:15 razor kernel: [ 3519.990705] RTAI[sched]: IMMEDIATE, MP, USER/KERNEL SPACE: <with RTAI OWN KTASKs>, kstacks pool size = 524288 bytes.
Nov 9 03:04:15 razor kernel: [ 3519.990723] RTAI[sched]: hard timer type/freq = APIC/12612231(Hz); default timing: periodic; linear timed lists.
Nov 9 03:04:15 razor kernel: [ 3519.990733] RTAI[sched]: Linux timer freq = 250 (Hz), TimeBase freq = 807191000 hz.
Nov 9 03:04:15 razor kernel: [ 3519.990741] RTAI[sched]: timer setup = 999 ns, resched latency = 2943 ns.
Nov 9 03:04:15 razor kernel: [ 3519.991195] RTAI[usi]: enabled.
Nov 9 03:04:19 razor kernel: [ 3523.712404] probe_parport 00:00: activated
Nov 9 03:06:22 razor kernel: [ 3646.578584] probe_parport 00:00: disabled
Nov 9 03:06:23 razor kernel: [ 3647.805211] RTAI[math]: unloaded.
Nov 9 03:06:23 razor kernel: [ 3648.109336] SCHED releases registered named ALIEN RTGLBH
Nov 9 03:06:23 razor kernel: [ 3648.126503] RTAI[malloc]: unloaded.
Nov 9 03:06:23 razor kernel: [ 3648.224911] RTAI[sched]: unloaded (forced hard/soft/hard transitions: traps 0, syscalls 0).
Nov 9 03:06:23 razor kernel: [ 3648.264133] I-pipe: Domain RTAI unregistered.
Nov 9 03:06:23 razor kernel: [ 3648.264159] RTAI[hal]: unmounted.

File Attachment:

File Name: ghettofab2.ini
File Size:2 KB
Attachments:

Please Log in or Create an account to join the conversation.

More
09 Nov 2010 08:13 #5173 by Drmn4ea
My current HAL configuration file attached to this post. Please let me know if there are other files / info that would be helpful to post. Thanks!

File Attachment:

File Name: ghettofab2.hal
File Size:3 KB
Attachments:

Please Log in or Create an account to join the conversation.

More
09 Nov 2010 12:37 #5174 by andypugh
One suggestion would be to edit your ini file, in the [EMC] section set
DEBUG = 0x7FFFFFFF

That will turn on all debugging (hopefully) and you might get a clue what is going on.

To debug config-only it would be DEBUG=0x02 but your initialisation is failing so quickly that it seems best to try to catch everything.

Please Log in or Create an account to join the conversation.

More
11 Nov 2010 02:56 #5207 by Drmn4ea
I've got DEBUG = 0x7FFFFFFF set in my .ini now, but there doesn't seem to be new information in the system-level logs (messages, dmesg, etc.), although the same RTAI messages are duplicated across several of them. Where is the 'official' destination of EMC2 log messages? Does it write its own non-system log file(s) somewhere?

Thanks!

Please Log in or Create an account to join the conversation.

More
11 Nov 2010 11:09 #5221 by andypugh
Drmn4ea wrote:

Where is the 'official' destination of EMC2 log messages? Does it write its own non-system log file(s) somewhere?!


dmesg is where nearly everything ends up. There are files created in the emc directory (one level up from the configs, I think) called something like emc.err and emc.log but my experience has been that they tend to be quite uninformative.

Please Log in or Create an account to join the conversation.

More
11 Nov 2010 11:12 #5222 by andypugh
One other thing to try. After you have quit emc2 the first time, run lsmod and see if trtapi is not cleaning up properly after itself. I have had problems on occasion (though only with my own homebrew kernels) where rtapi has left modules loaded and then can't reload them.

Please Log in or Create an account to join the conversation.

More
13 Nov 2010 05:16 #5284 by Drmn4ea
I can't seem to find any debug files - nothing in the config directory or its parents (while running or after), or in /var/log. If I add an intentional error in the .ini file EMC pops up a screenful of very detailed messages (gibberish), but that is probably at too early a stage in loading to provide meaningful parallel port diagnostics. Oddly, dmesg has almost nothing EMC-related after arbitrarily many runs. The only relevant section in dmesg is:

...snip...
[ 9.963561] lp: driver loaded but no devices found
[ 10.294148] cfg80211: Calling CRDA to update world regulatory domain
[ 10.319373] parport_pc: VIA 686A/8231 detected
[ 10.319389] parport_pc: probing current configuration
[ 10.319413] parport_pc: Current parallel port base: 0x378
[ 10.319475] parport0: PC-style at 0x378, irq 7 [PCSPP,EPP]
[ 10.417171] lp0: using parport0 (interrupt-driven).
[ 10.417185] parport_pc: VIA parallel port: io=0x378, irq=7
[ 10.524446] psmouse serio1: ID: 10 00 64
...snip...
[ 16.670722] eth0: setting full-duplex.

The more detailed e.g. RTAI messages appear identically in messages, kern.log and syslog.

The lsmod output seems consistent with expectations. Before starting EMC2, the relevant (parallel-related) entries are:

parport_pc 25637 1
ppdev 5259 0
parport 30764 3 ppdev,lp,parport_pc



A running EMC2 adds:
Module Size Used by
stepgen 7433 0
hal_parport 6908 0
probe_parport 1480 0
motmod 139099 0
trivkins 1274 1 motmod
hal_lib 30885 5 stepgen,hal_parport,probe_parport,motmod,trivkins
rtapi 27693 5 stepgen,hal_parport,probe_parport,motmod,hal_lib
rtai_math 21406 1 motmod
rtai_sem 21551 1 rtapi
rtai_fifos 20988 1 rtapi
rtai_sched 156719 3 rtapi,rtai_sem,rtai_fifos
rtai_hal 186236 4 rtapi,rtai_sem,rtai_fifos,rtai_sched

Modifies:
parport_pc 25637 2
parport 30764 4 hal_parport,ppdev,lp,parport_pc


But after closing, the output is identical to before running, and subsequent runs are identical to the first.

The kern.log messages occasionally report a "spurious 8259A interrupt: IRQ7." immediately after "config string '0x378 out ' ", but this seems to occur at random (on either the first or a later run) and doesn't affect operation if it occurs on the first run.


Anywhere else I can look for clues? Or would I be better off to wipe this machine and roll back to Ubuntu 8.10 / EMC 2.3.x? I know the easiest answer in my case is "just don't ever close EMC2" :-) but I'm trying to use it as the backend to an optical pick-and-place system still in very early development, and expect to be messing with the configuration and restarting it a lot!

Please Log in or Create an account to join the conversation.

More
13 Nov 2010 05:20 #5285 by Drmn4ea
One other thing to mention: I had to tweak the boot options a bit to get this machine working: had to add "acpi=off" (to avoid blinking-cursor hang at boot) and "-lapic" for EMC. Unlikely, but could either of these be related?

Please Log in or Create an account to join the conversation.

More
09 Jan 2011 20:06 #6580 by Drmn4ea
UPDATE: This problem has been 'solved' by an el-cheapo PCI parallel port card from eBay - EMC2 reliably uses this port again and again. Looks like it is just a quirk with the ASUS A7V (VIA KT133 chipset) motherboard!

Incidentally, lspci reports the card ("Hexin" noname brand; PCI ID 4348:5053) as a "Serial controller" and assigned to the 'serial' kernel driver, but it seems to work anyway.

Please Log in or Create an account to join the conversation.

More
09 Jan 2011 20:19 #6581 by BigJohnT
Glad you got it figured out.

John

Please Log in or Create an account to join the conversation.

Time to create page: 0.268 seconds
Powered by Kunena Forum