LINUXCNC i dodatkowy port LPT

Dyskusje dotyczące działania obsługi programu LinuxCNC

szatri
Specjalista poziom 1 (min. 100)
Specjalista poziom 1 (min. 100)
Posty w temacie: 15
Posty: 235
Rejestracja: 23 lut 2011, 15:12
Lokalizacja: PL

Re: LINUXCNC i dodatkowy port LPT

#51

Post napisał: szatri » 01 sie 2021, 16:25

szatri pisze:KONTROLER DIGITUS PCI EXPRESS DS-33010-1
Sterowniki jakoś zmęczyłem według instrukcji
po wpisaniu w terminal: lspci -v

01:08.0 Parallel controller: SUNIX Co., Ltd. Multiport serial controller (prog-if 03 [IEEE1284])
Subsystem: SUNIX Co., Ltd. Device 0100
Flags: medium devsel, IRQ 16
I/O ports at a000 size=8
I/O ports at a400 size=8
I/O ports at a800 size=16
Capabilities: <access denied>
Kernel driver in use: snx

Witajcie, zmieniłem płytę główna na nowszą i sam sobie nie wierze ze mi się nie udaje zainstalować sterowników.
Ale pokoleji:

Kod: Zaznacz cały

cnc@CNC:~$ cat /etc/*-release
PRETTY_NAME="Debian GNU/Linux 10 (buster)"
NAME="Debian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
lspci -v

Kod: Zaznacz cały

01:06.0 Parallel controller: SUNIX Co., Ltd. Multiport serial controller (prog-if 03 [IEEE1284])
	Subsystem: SUNIX Co., Ltd. Multiport serial controller
	Control: I/O+ Mem- BusMaster- SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR+ FastB2B- DisINTx-
	Status: Cap+ 66MHz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
	Interrupt: pin A routed to IRQ 10
	NUMA node: 0
	Region 1: I/O ports at ec00 [size=8]
	Region 2: I/O ports at e880 [size=8]
	Region 3: I/O ports at e800 [size=16]
	Capabilities: <access denied>
Juz widać inne adresy oraz brak drivera.
stery są tutaj:
https://www.digitus.info/en/products/co ... s-33010-1/
sciagnołem, rozpakowałem
instrukcja:

Kod: Zaznacz cały

==========================================================================================
=                                                                                        =
=                  SUNIX Multi-I/O Board Driver Installation Guide                       =
=                                                                                        =
=                           For Kernel 2.4 & 2.6 & 3.x & 4.x                             =
=             Copyright 2006 - 2015  SUNIX Co., Ltd. all right reserved                  =
=                                                                   Version: 2.0.4.2     =
=                                                                   Date: 2016/06/20     =
==========================================================================================

Item

A. Release note

B. Introduction

C. Installation

   C.1 Driver install
   C.2 Device node creation
	
D. Loading driver automatic after system bootup
   
   D.1 
    RedHat 8
    Fedora Core 1
    Fedora Core 8
    Fedora Core 10
    Fedora Core 11
    Mandriva 2008
       		
   D.2 
    Suse 9.3
    SuSE 11.2 Milestone 4
    
   D.3 
    Ubutu 8.04 Destop
    Ubutun 11.10
		debian 6.0.3
		
   D.4 
    Turbo Liunx 10
    Red Hat Enterprise Liunx 4.0 	
       
   D.5 
    Others	

E. Utility

   E.1  snxdump
   E.2	snxterm

F. Troubleshooting   

==========================================================================================

A. Release note
	
	2006/07/10 - Ver:1.0.2.0
		1) Add snxterm program into driver package
		2) Fix read fcr register in driver and backup a fcr register value in struct
		3) Test RedHat Enterprise Linux AS 4.0 and ES 4.0
		
	2006/10/02 - Ver:1.0.3.0
		1) Add GNU information in driver
		2) Test SlackWare 10.2 (kernel 2.6.13)
		3) Support 4027D, 4037D and 4056D

	2006/10/12 - Ver:1.0.4.0
		1) Fix system hanged. Modem interrupt can't be cleared by reading iir and msr
		   register for SUN1699 chip

	2006/12/01 - Ver:1.0.5.0
		1) Fix system hanged. Data coming but device node didn't opened, when open, system 
		   maybe crash
		2) Add version information in /var/log/messages
		3) Test TurboLinux 10
	
	2007/03/31 - Ver:1.0.6.0
		1) Fix data receiving function
		2) Modify ioctl function for dump port informations

	2007/08/08 - Ver:1.0.7.0
		1) Support kernel up to 2.6.22
		2) Add driver version information in snxdump
		3) snxterm upgrade to V1.0.1.0, make snxterm simply

	2007/09/14 - Ver:1.0.8.0
		1) Support kernel 2.6 and 2.4 both
		2) snxterm upgrade to V1.0.2.0
		
	2008/05/12 - Ver:1.0.9.0
		1) Fix setserial command fail
		2) Support sunix series multi I/O board
		
	2008/09/05 - Ver:1.1.0.0
		1) snxdump upgrade to V1.0.2.0
	
	2009/03/24 - Ver:1.1.1.0
		1) Support kernel up to 2.6.27		

	2009/04/03 - Ver:1.2.0.0
		1) Support both golden and matrix series
		2) Support kernel up to 2.6.28 and 2.4.37
		3) snxdump upgrade to V1.2.0.0	
		4) snxmknod upgrade to V1.2.0.0
		
	2009/04/06 - Ver:1.2.1.0
		1) snxdump upgrade to V1.2.1.0	
		2) snxterm upgrade to V1.0.3.0		
		
	2009/08/30 - Ver:1.3.0.0
		1) Support golden / matrix / sun1999 series
		2) Support kernel up to 2.6.30 and 2.4.37
    		3) Delete #include<form.h> in /snxterm/snxterm.c 
  
  	2009/12/01 - Ver:1.3.1.0
		1) Support kernel up to 2.6.31 
		
	2010/12/15 - Ver:1.3.2.0
		1) Support Cash Drawer / 3-in-1 / DIO series   
		2) snxmknod upgrade to V1.3.1.0
		3) snxdump upgrade to Version: 1.2.2.0
		4) Support kernel up to 2.6.36 
		
	2011/07/29 - Ver:1.3.3.0
		1) Support kernel up to 2.6.38  
		2) Upgrade SNX_UART_GET_TYPE function
		3) Upgrade SNX_UART_SET_TYPE function
		4) Support SNX_UART_GET_ACS function	
		4) Support SNX_UART_SET_ACS function 
		
	2011/12/28 - Ver:2.0.0.0
		1) Support kernel up to 2.6.39 
		2) Support kernel up to 3.1.0  
		
	2012/03/28 - Ver:2.0.1.0
		1) Fix statserial command errors. statserial command does not display CTS & DSR status.

	2012/08/17 - Ver:2.0.1.1
		1) Add requirement package information in README file

	2013/01/25 - Ver:2.0.2.0
		1) Support kernel up to 3.6.10	
		
	2013/09/15 - Ver:2.0.3.0
		1) Support kernel up to 3.11.x	
		2) snxdump upgrade to V1.2.3.0
		
	2015/06/09 - Ver:2.0.4.0
		1) Support kernel up to 3.19.x	

    2015/07/24 - Ver:2.0.4.1
		1) Support Kernel up to 3.19.8 	

	2016/06/20 - Ver:2.0.4.2
		1) Support Kernel up to 4.6.x	
------------------------------------------------------------------------------------------

B. Introduction

	Maximum 4 boards can be installed in combination(up to 32 serial port and 2 parallel port), 
	support sunix multi i/o boards as list below.

	(S - serial port, P - parallel port)

	Golden series
	
	1S -
		4027T
		4027A
		4027AL
		4027D
		4027DL
		4027P

	2S -
		4037T
		4037A
		4037AL
		4037D
		4037U
		4037P
		4037PL	
		
	4S -
		4056A
		4056A3
		4056A4
		4056AL
		4056D
		4056J
		4056U
		4056UE
		4056P
		4056PL
		4056PM		
		4055WN
		
		4056DW
		4056AM
		4056LM
		4056LL
		4056JM
		4056LV
		4000A
		4000AL
		4000P
		4000PL	

	8S -
		4066R
		4066U
		4066UE

		4066WM
		4066RM
		4066JM
		8000A
		8000AL		
		
	2S1P -
		4079AT		
				
				
	2S2P -
		4089AM
		
		
	4S2P - 
		4096A
				
	
	Matrix series
	
	2S -
		P1002
		P2002
		
	4S -
		P1004
		P2004
		P3004
		
	8S -
		P1008
		P2008
		P3008								
		
	16S -
		P1016

	
	SUN1999 series 
		
	1S -
		5027A
		5027AL
		5027H
		5027HL
		5027P
		5027PL
		5027PH
		5027PHL
	
	2S -
		5037A
		5037H
		5037AL
		5037HL
		5037P
		5037PH
		5037PL
		5037PHL
		
	4S -
		5056A
		5056AL
		5056H
		5056HL
		5056P
		5056PL
		5056PH
		5056PHL
		5056U
		5056UL
		5056UH
		5056UHL
		
	8S -
		5066A
		5066H
		5066AL
		5066HL
		5066U
		5066UL
		5066UH
		5066UHL
		
	16S -	
		5016H		
					
	1P -
		5008A	
	
	1S1P -
		5069A
		5069H
		5069P
		5069PH
		
	2S1P -
		5079A
		5079H
		5079AL
				
	4S1P - 
		5099A
		5099H	
	
	2S -
		IPC-P2102
		IPC-P2102SI
	
	4S -
		IPC-P2104
		IPC-P2104SI
		IPC-P3104
	
	8S -
		IPC-P2108
		IPC-P2108SI
		IPC-P3108
	
	16S -	
		IPC-P2116			
		
	Cash Drawer -
		
		CDK1037A
		CDK1037P
		CDK1037H
		CDK1037L
		
		CDK1056A
		CDK1056P
		CDK1056H
		CDK1056L
		
	DIO -
		DIO0802
		DIO1604
		DIO3204

------------------------------------------------------------------------------------------

C. Installation

	NOTE :	Support kernel 2.4/2.6/3.x on x86 machine only.  
		Before driver installation. Make sure system with c compiler/kernel development/ncurses package.
	
	C.1 Driver install
		Please create a directory under root directory,  e.g /temp, do commands:

		# cd /
		# mkdir temp

		After get driver file "snx_Vx.x.x.x.tar.gz". Copy file to /temp
		directory, then extract and install, do commands:

		# cp snx_Vx.x.x.x.tar.gz /temp 
		# cd /temp
		# tar xvf snx_Vx.x.x.x.tar.gz
		# cd /temp/snx
		# make clean ; make install

		*************************************************************
		* If system is Suse 9.0 and errors occur when               *
		* "make clean ; make install", do commands:                 *
		*                                                           *
		* # cd /usr/src/linux/                                      *
		* # make cloneconfig                                        *
		* # make dep                                                * 
		*                                                           *
		* then do "make clean ; make install" again in /temp/snx    *
		*************************************************************

		Load driver module, do command:

		# modprobe snx
		or
		# insmod /temp/snx/driver/snx.ko (snx.o for kernel 2.4)


		Check driver module, do command:
		# lsmod | grep snx


		Unload driver, do command:
		# rmmod snx


	C.2 Device node creation 
		Each serial port has one device node which is named "ttySNX?",
		maximum up to 32 serial ports.
		
		Each parallel port has two device node which is name "lp?" and
		"parport?". This step will backup lp2~lp3 and parport2~parport3 
		to lp?.bak and parport?.bak in /dev for your system first. Then,
		create lp2~lp3 and parport2~parport3 in /dev for sunix driver,
		maximum up tp 2 parallel ports.
		
		This setp will be done when do "make clean ; make install", if
		device nodes aren't in /dev, do commands:
				
		# cd /temp/snx/snxmknod
		# ./snxmknod

		This will create device nodes in /dev.

		If there are more than two boards installed, serial port device
		nameing convention please refer to E1.

------------------------------------------------------------------------------------------

D. Loading driver automatic after system bootup

  	
	D.1 
	    After finish item C. Edit /etc/rc.d/rc.local for loading driver 
	    automatic after system bootup. Use vi or other editor to open rc.local, 
	    and add "modprobe snx" in last line.


	D.2 
	    After finish item C.
	    Edit /etc/rc.d/boot.local for loading driver automatic after system bootup. 
	    Use vi or other	editor to open boot.local, and add "modprobe snx" in last line.
	    Edit /etc/rc.d/halt.lAfter finish item D. Edit /etc/rc.d/rc.local for loading driver 
	    automatic after system bootup. Use vi or other editor to open rc.local, 
	    and add "modprobe snx" in last line.ocal for unloading driver when system halt. 
	    Use vi or other editor to open halt.local, and add "rmmod snx" in last line.
	    
	    
	D.3 
	    After finish item C. Edit /etc/init.d/rc.local for loading driver 
	    automatic after system bootup. Use vi or other editor to open rc.local, 
	    and add words as below in last line.

			mv /dev/lp2 /dev/lp2.bak
			mv /dev/lp3 /dev/lp3.bak
			mknod /dev/lp2 c 246 2
			mknod /dev/lp3 c 246 3
			chmod a+w /dev/lp2
			chmod a+w /dev/lp3
	
			mv /dev/parport2 /dev/parport2.bak
			mv /dev/parport3 /dev/parport3.bak
			mknod /dev/parport2 c 247 2
			mknod /dev/parport3 c 247 3
			chmod a+w /dev/parport2
			chmod a+w /dev/parport3
				
			modprobe snx

		
	D.4 
	    After finish item C. Edit /etc/rc.d/rc.local for loading driver 
	    automatic after system bootup. Use vi or other editor to open rc.local, 
	    and add words as below in last line. 

			
			mv /dev/lp2 /dev/lp2.bak
			mv /dev/lp3 /dev/lp3.bak
			mknod /dev/lp2 c 246 2
			mknod /dev/lp3 c 246 3
			
			mv /dev/parport2 /dev/parport2.bak
			mv /dev/parport3 /dev/parport3.bak
			mknod /dev/parport2 c 247 2
			mknod /dev/parport3 c 247 3
		
			modprobe snx
		
		
	D.5 
	    In general, other distributions will loading driver automatic after system bootup.		
	    If it doesn't, please refer to item D.1 or D.2. or D.3 or D.4
				
				
------------------------------------------------------------------------------------------

E. Utility

	E1. snxdump - dump port informations, do command:

		# snxdump

		the informations should be like this

		================ Found  2 SUNIX port , list informations ====================
        		                                     SUNIX driver ver -- 2.0.4.2

		ttySNX0 --
		SUNIX 5037 Series (bus:2 device: 1) , base address = a000,    irq = 21

		ttySNX1 --
		SUNIX 5037 Series (bus:2 device: 1) , base address = a008,    irq = 21
		

		=============================================================================


		In this case, 

		Driver version is 2.0.4.2

		ttySNX0 is the 1st serial port on sunix 5037 series board, 
		base address is 0xa000 and irq is 21.

		ttySNX1 is the 2nd serial port on sunix 5037 series board, 
		base address is 0xa008 and irq is 21.		

		bus:2 means the bus number of board is 2.
		
		device:1 means the device number of board is 1.


		If no information print on screen. Make sure the device node
		exist in /dev and driver module loaded.
		
		
	E2. snxterm - dumb terminal for test tty device node data transmitting and receiving
		      , do command:

		# snxterm

------------------------------------------------------------------------------------------

F.Troubleshooting

	Q1:I Plug in the parallel port card and installed the device driver, I dumped the parallel port
  	   iformation make sure the module was loaded, but I couldn't find the device by device list 
	   when adding a new printer.

	A:Following these step:

  	  1.remove IO Card Driver:

    		# rmmod snx
				
  	  2.remove device node lpX and parportX(X = the device node which mapping with IO Card): 
    		
		# rm /dev/lpX 
 		# rm /dev/parportX

  	  3.reinstall IO Card Driver:
    		
		# make clean
		# make install
		
  	  4.load the snx module:

    	# modprobe snx

  	  5.dump IO Card Information:
		
		# snxdump

  	  6.Add new printer
Robie to według C1

Kod: Zaznacz cały

cnc@CNC:~/Pobrane/snx/driver$ make clean ; make install
rm -f *~
rm -f *.o
rm -rf ./.tmp_versions
rm -f *.mod*
rm -f *.ko
rm -f .snx*
rm -f snx
rm -f Module*
rm -f module*
rm -f /lib/modules/4.19.0-17-rt-amd64/kernel/drivers/char/snx_golden.ko
rm -f /lib/modules/4.19.0-17-rt-amd64/misc/snx_golden.ko
rm -f /lib/modules/4.19.0-17-rt-amd64/kernel/drivers/char/snx_matrix.ko
rm -f /lib/modules/4.19.0-17-rt-amd64/misc/snx_matrix.ko
rm -f /lib/modules/4.19.0-17-rt-amd64/kernel/drivers/char/snx.ko
rm -f /lib/modules/4.19.0-17-rt-amd64/misc/snx.ko
make -C /lib/modules/4.19.0-17-rt-amd64/build SUBDIRS=/home/cnc/Pobrane/snx/driver modules
make[1]: *** /lib/modules/4.19.0-17-rt-amd64/build: Nie ma takiego pliku ani katalogu. Stop.
make: *** [Makefile:83: modules] Błąd 2
Co to za błąd?

PS. nie mam nic w katalogu /usr/src/



Tagi:

Awatar użytkownika

tuxcnc
Lider FORUM (min. 2000)
Lider FORUM (min. 2000)
Posty w temacie: 8
Posty: 7781
Rejestracja: 26 lut 2011, 23:24
Lokalizacja: mazowieckie

Re: LINUXCNC i dodatkowy port LPT

#52

Post napisał: tuxcnc » 01 sie 2021, 20:48

szatri pisze:
01 sie 2021, 16:25
Co to za błąd?
Gapisz się w monitor jak sroka w gnat i nic nie widzisz, a przecież masz wyraźnie napisane:

Kod: Zaznacz cały

/lib/modules/4.19.0-17-rt-amd64/build: Nie ma takiego pliku ani katalogu.
W ogóle to pojęcia nie mam co robisz i po jasną cholerę.
Drukarkę chcesz podłączyć?

Do testowania portu LPT w Linuxcnc jest odpowiednie narzędzie: http://wiki.linuxcnc.org/cgi-bin/wiki.p ... ort_Tester
Musisz w pliku ptest.hal zmienić w pierwszej linii adres portu na właściwy (któryś z lspci), potem uruchamiasz program a w gnieździe LPT zwierasz drutem piny 1 i 13, co jest wyjątkowo łatwe bo to skrajne piny w dłuższym rzędzie.
Jeśli klikanie w "pin1" zmienia kolor "pin13", to port działa.

Natomiast miałem zupełnie inny problem w nowoczesnej płycie głównej, zupełnie nie związany z Linuxcnc.
Otóż BIOS widział adapter, ale go blokował z nieznanej przyczyny. Wszystkie lspci i inne programy diagnostyczne port pokazywały, ale był on całkowicie martwy. Pomogło zakupienie innej karty (nie Sunix, bo te pracować nie chciały). Pisałem nawet do producenta płyty, ale rżnęli głupa, najwyraźniej sami nie wiedzieli o co chodzi i na koniec wykręcili się sianem, że jak nie Windows to oni nie wiedzą...
U mnie zadziałała taka: https://www.aliexpress.com/item/32978007767.html, ale nie mogę zagwarantować ani tego że będzie działać u Ciebie, ani tego że Chińczyk wyśle Ci ten model, a nie inny bo jemu z zasady jest wszystko jedno.
No ale 30 PLN to nie majątek...


szatri
Specjalista poziom 1 (min. 100)
Specjalista poziom 1 (min. 100)
Posty w temacie: 15
Posty: 235
Rejestracja: 23 lut 2011, 15:12
Lokalizacja: PL

Re: LINUXCNC i dodatkowy port LPT

#53

Post napisał: szatri » 02 sie 2021, 09:23

tuxcnc pisze:Pisałem nawet do producenta płyty,

Pamientasz co to za płyta?
Moja to Asus M4N68T V2
tuxcnc pisze:U mnie zadziałała taka:

Czy możesz zobaczyć na jakim to chipsecie?

Dodane 1 godzina 19 minuty 57 sekundy:

Kod: Zaznacz cały

cnc@CNC:~$ dmesg | grep par
dmesg: read kernel buffer failed: Operacja niedozwolona
o uj tu teraz z tym byforem mu nie pasuje?

Dodane 30 minuty 19 sekundy:
Jaka to dziwna jest przypadłość z tymi kompami, kupiłem na ali kiedyś pierwsza karte z LPT, oczywiście nie działała pod whrezzy, rzuciłem ja w szufladę, kupiłem polecana sunix, ta poszła, teraz zmieniłem płytę (i debiana) to sytuacja się odwróciła, sunix nie działa, a wch ch351l działa.

ODPOWIEDZ Poprzedni tematNastępny temat

Wróć do „LinuxCNC (dawniej EMC2)”