Quick jump:  What's new

 
Go to:
 
Weblog: korisničke kartice   
in KOHA
Printanje i programiranje kartica


Printanje u Beču

Beč = batch (eng.) - u jednom cugu, za razliku od po potrebi

Napisati postojeću proceduru printanja kartica (pokretanje skripte)

Naručivanje praznih kartica

Paziti da zadnja strana bude bijela, jer i tako moramo printati dvostrano, pa nam to daje veću fleksibilnost.

Plan

  • čitač postaviti ispod printer-a tako da programirana kartica padne na čitač i isprogramira se (možda malo alu-folije ako čitač bude hvatao kartice iz spremnika)
  • Linux stroj sa podrškom za pritanje kartica i barkoda na njima koji podatke sprema nazad direktno u Kohu

Workflow

  • link sa intranet-a na lokalnu mašinu (linux stroj) gdje se pokreće pitanje na printer (možda lokalno spojen, možda mrežom)
  • kartica pada na čitač koji je programira i šalje podatak u kohu sa postom na neki ssl cgi (možda sa svojim certifikatima?)

CUPS driver



Tehnical test card:

Firmware 0821 f:200 E
X-Y-Smart Offsets 16 - 20 - 409
Printed lines 994 L / 636 W

PageSize[243.84 155.52]

Upstream CUPS support

Programming guide

Encode the three tracks

Ss                                    // Sequence Start
Pmc;h                                 // Set the coercivity to Hico
Dm;1;EVOLISPEBBLE                     // Download EVOLISPEBBLE on track 1
Dm;2;1234567890                       // Download 12345679890 on track 2
Dm;3;0987654321                       // Download 9876543210 on track 3
Se                                    // Sequence eject

Use the internal font and rotate them

Wcb ;k                                // Clear Monochrome Panel
Ss                                    // Sequence Start
Pwr ;0                                // Set the text orientation to 0
Wt ;100 ;300 ;0 ;10 ;Test rotations   // Write the Text "Test Rotation"
Wt ;500 ;250 ;0 ;50 ;0                // Write the text "0"
Pwr;90                                // Set the Text orientation to zero
Wt ;500 ;250 ;0 ;50 ;90               // Write the text "90"
Pwr;180                               // Set the Text orientation to 180
Wt ;500 ;250 ;0 ;50 ;180              // Write the text "180"
Pwr;270                               // Set the Text orientation to 270
Wt ;500 ;250 ;0 ;50 ;270              // // Write the text "270"
Se                                    // Sequence eject

Pr;ymcko                              // Parameter ribbon ymcko
Pc;a;=;10                             // Set the contrast to 10 for all panel
Pl;a;=;10                             // Set the luminosity to 10 for all panel
Ps;k;=;0                              // Set the Speed for black panel to 0
Ss                                    // Sequence start
Db;y;32;xxxxxxxxxxxxxxx               // Download the data for yellow pannel
Db;m;32;xxxxxxxxxxxxxx                // Download the data for magenta pannel
Db;c;32;xxxxxxxxxxxxxxx               // Download the data for cyan pannel
Db;o;32;xxxxxxxxxxxxxxx               // Download the data for overlay pannel
Se

Network administration

Escape sequence Syntax Arguments
Read the printer's IP address Rip  
Set the IP address or DHCP Rip;value IP address in xxx.yyy.ttt.uuu format or dhcp
Read Hostname Rehn  
Set Hostname Pehn;value Hostname (16 characters max.)
Read Subnet mask Renm  
Set Subnet mask Penm;value Subnet mask in xxx.yyy.ttt.uuu format
Read the gateway address Regw  
Set the gateway address Pegw;value Gateway address in xxx.yyy.ttt.uuu format
Read the WINS server address Rews  
Read the WINS server address Pews;value WINS server address in xxx.yyy.ttt.uuu format

Debian

apt-cache show evolisprinter

Package: evolisprinter
Status: install ok installed
Priority: extra
Section: checkinstall
Installed-Size: 160
Maintainer: root@klin
Architecture: i386
Version: 3.0-2
Provides: evolisprinter
Depends: cups
Description: New Pebble Card Printer CUPS driver

Compilation

apt-get install libcups2-dev libcupsimage2-dev
make
sudo checkinstall

dmesg

[88415.288187] usb 2-4.3: new full speed USB device using ehci_hcd and address 10
[88415.381054] usb 2-4.3: New USB device found, idVendor=058f, idProduct=9254
[88415.381058] usb 2-4.3: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[88415.381061] usb 2-4.3: Product: Generic USB Hub
[88415.381063] usb 2-4.3: Manufacturer: ALCOR
[88415.381149] usb 2-4.3: configuration #1 chosen from 1 choice
[88415.381333] hub 2-4.3:1.0: USB hub found
[88415.381555] hub 2-4.3:1.0: 4 ports detected
[88415.652178] usb 2-4.3.1: new full speed USB device using ehci_hcd and address 11
[88415.745545] usb 2-4.3.1: New USB device found, idVendor=0f49, idProduct=0400
[88415.745549] usb 2-4.3.1: New USB device strings: Mfr=4, Product=18, SerialNumber=0
[88415.745552] usb 2-4.3.1: Product: Evolis Dualys
[88415.745554] usb 2-4.3.1: Manufacturer: EVOLIS
[88415.745639] usb 2-4.3.1: configuration #1 chosen from 1 choice
[88415.747080] usblp0: USB Bidirectional printer dev 11 if 0 alt 0 proto 2 vid 0x0F49 pid 0x0400

[90082.139083] rastertoevolis[8692]: segfault at 0 ip b7ddf657 sp bfd60bc8 error 6 in libc-2.9.so[b7d67000+158000]
[90122.522505] usb 2-4.3.1: USB disconnect, address 11
[90122.522690] usblp0: removed
[90133.216207] usb 2-4.3.1: new full speed USB device using ehci_hcd and address 13
[90133.309579] usb 2-4.3.1: New USB device found, idVendor=0f49, idProduct=0400
[90133.309582] usb 2-4.3.1: New USB device strings: Mfr=4, Product=18, SerialNumber=0
[90133.309585] usb 2-4.3.1: Product: Evolis Dualys
[90133.309587] usb 2-4.3.1: Manufacturer: EVOLIS
[90133.309676] usb 2-4.3.1: configuration #1 chosen from 1 choice
[90133.311236] usblp0: USB Bidirectional printer dev 13 if 0 alt 0 proto 2 vid 0x0F49 pid 0x0400
[94350.140355] gs[27363]: segfault at 197 ip b79fb9a6 sp bf9bf070 error 6 in libgs.so.8.70[b790d000+3fc000]
[94393.919251] gs[27502]: segfault at 197 ip b79be9a6 sp bfefe230 error 6 in libgs.so.8.70[b78d0000+3fc000]
[94459.139970] gs[27726]: segfault at 197 ip b78459a6 sp bfdbcb90 error 6 in libgs.so.8.70[b7757000+3fc000]

lsusb

Bus 002 Device 013: ID 0f49:0400  
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               1.00
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0         8
  idVendor           0x0f49 
  idProduct          0x0400 
  bcdDevice            6.02
  iManufacturer           4 EVOLIS
  iProduct               18 Evolis Dualys
  iSerial                 0 
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           32
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration         52 Standard Configuration
    bmAttributes         0x40
      (Missing must-be-set bit!)
      Self Powered
    MaxPower                0mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass         7 Printer
      bInterfaceSubClass      1 Printer
      bInterfaceProtocol      2 Bidirectional
      iInterface             98 Printer Interface
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x02  EP 2 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               0
Device Status:     0x0001
  Self Powered

CUPS

printer options

dpavlin@klin:~$ lpoptions -p EVOLIS_Dualys -l
ColorModel/Output Mode: *RGB
PageSize/Media Size: *Card
Collate/Collate: *True False
MediaType/Media Type: *Blank
InkType/Ink Type: YMCKO YMCKOS YMCKOK KO *Black Blue Gold Green Red Silver White Scratch BlackWax Hologram
Duplex/Two-sided Printing: None *DuplexNoTumble
Brightness/Luminosity: 0 1 2 3 4 5 6 7 8 9 *10 11 12 13 14 15 16 17 18 19 20
Contrast/Contrast: 0 1 2 3 4 5 6 7 8 9 *10 11 12 13 14 15 16 17 18 19 20
BlackIn/Black Panel : *N Y
TreatementK/Effect: *G L
SensibilityK/Intensity black panel: 0 1 2 3 4 5 6 7 8 9 *10 11 12 13 14 15 16 17 18 19 20
OverlayPannel/Define : *FO SCI SCA MS NO
SensibilityO/Intensity overlay panel: 0 1 2 3 4 5 6 7 8 9 *10 11 12 13 14 15 16 17 18 19 20
BrightnessV/Luminosity: 0 1 2 3 4 5 6 7 8 9 *10 11 12 13 14 15 16 17 18 19 20
ContrastV/Contrast: 0 1 2 3 4 5 6 7 8 9 *10 11 12 13 14 15 16 17 18 19 20
BlackInV/Black Back Panel : *N Y
TreatementKV/Effect: *G L
SensibilityKV/Intensity black panel: 0 1 2 3 4 5 6 7 8 9 *10 11 12 13 14 15 16 17 18 19 20
OverlayBackPannel/Define : FO SCI SCA MS NO
SensibilityOV/Intensity Overlay Back Panel: 0 1 2 3 4 5 6 7 8 9 *10 11 12 13 14 15 16 17 18 19 20
EjectCard/Specific Action : *None iSmart iCtless Eject Reject Test TestTech Clean
Coercivity/Coercivity: *None Hico Loco JIS
Track1/Track1 : *1 2 3 4 5 8 6 7
Track2/Track2 : 1 *2 3 4 5 8 6 7
Track3/Track3 : 1 2 *3 4 5 8 6 7

duplex printing

dpavlin@klin:~$ lpoptions -p EVOLIS_Dualys -l | grep Duplex
Duplex/Two-sided Printing: None *DuplexNoTumble

dpavlin@klin:~/klin/evolis-dualys-3$ lpr  -Pdualys3 -o Duplex=DuplexNoTumble out/200900000042.print-duplex.pdf 

cups raster

sudo apt-get install libfltk1.1-dev libcups2-dev libcupsimage2-dev


gs cups rasterizator

/usr/bin/gs -dQUIET -dPARANOIDSAFER -dNOPAUSE -dBATCH -sDEVICE=cups -sstdout=%stderr -sOutputFile=%stdout -I/usr/share/cups/fonts -sMediaColor=k -sMediaType=Card -r300x300 -dDEVICEWIDTHPOINTS=243 -dDEVICEHEIGHTPOINTS=155 -dcupsBitsPerColor=8 -dcupsColorOrder=0 -dcupsColorSpace=1 -scupsPageSizeName=Card -c -f -

evolis rasterizator

/usr/lib/cups/filter/rastertoevolis 42 dpavlin foobar 0 Duplex=DuplexNoTumble duplex.ras > foo.evolis

permalink
Podaci na korisničkim karticama

Ova stranica opisuje postupak koji prolaze podaci da bi novootvoreni korisnici preko Koha sučelja
a) dobili članski broj (broj kartice)
b) pojavili se u SafeQ sustavu.

SafeQ sustav povlači podatke o korisnicima iz Kohe preko LDAP-a. LDAP je implementiran direktno na podacima u Kohi (vidi SafeQ integration), ali SafeQ ne može pročitati broj korisnika sa kartice, nego samo serijski broj kartice koji koristi RFID protokol (SID).

Taj broj postoji jedino u log datotekama 3M sustava, a kako računalo na kojem se programiraju čipovi za sad nije spojeno na mrežu, cijela procedura ipak ovisi o povremenom presnimavanju podataka na server.

U razvoju je zamjena za cijelu ovu proceduru koja bi omogućila printanje novih isprogramiranih kartica odmah nakon što se korisnik prvi puta ulogira u Kohu (tj. odmah čim aktivira članstvo u knjižnici).

trenutno stanje

fetchrss: http://via.rot13.org/10.60.0.12/SQL2RSS/koha/
  • There was an error: 500 read failed: error:14094410:SSL routines:SSL3_READ_BYTES:sslv3 alert handshake failure | error:140940E5:SSL routines:SSL3_READ_BYTES:ssl handshake failure




Generiranje brojeva kartica

Prvi korak je dodjeljivanje brojeva kartica u obliku 200908240042 gdje su prve znamenke datum a zadnje četiri redni broj korisnika u tom danu. To je jedinstveni broj korisnika koji koriste svi ostali servisi (npr. 3M Selfcheck) ali ne i SafeQ-a!

Generiranje brojeva kartica

ovaj korak radi se na produkcijskoj bazi

dpavlin@koha:/srv/koha-rfid$ ./generate-cardnumber.pl --commit

provjeriti ispis i pokrenuti ponovo sa --commit da bi se promjene zapisale u bazu

generira također backup borrowers tablice

Ispisuje na kraju generirato ime log datoteke:

backup for borrowers table: backup/borrowers.2010-09-02T15:05:09.sql 3838484 bytes
generated print.2010-09-02T15:05:09.txt 41879 bytes

Format loga: cardnumber <tab> login <tab> ime <tab> prezime

dpavlin@klin:~/klin/Biblio-RFID$ head -1 print.2010-09-02T15\:05\:09.txt 
201007140004    kohatest@ffzg.hr        Koha    Testičić Probišić Đž

Printanje iskaznica

ovaj korak se radi na mašini sa koje se printaju iskaznice

Podaci za pritanje

dpavlin@klin:~/klin/Biblio-RFID$ rsync -v koha:/srv/koha-rfid/print*.*.txt .

Pokretanje printanja

Printanje čeka da se kartica makne na RFID čitača da bi nastavilo!

dpavlin@klin:~/klin/Biblio-RFID$ ./scripts/print.pl print.2010-09-02T15\:05\:09.txt

...

QUEUE EMPTY - printing finished
log.print/2010-08-17T16:36:27.txt 100 bytes created

Kopiranje SID-ova za Kohu

dpavlin@klin:~/klin/Biblio-RFID$ rsync -rav log.print/ koha.ffzg.hr:/srv/koha-rfid/log.print/

Import SID-ova u Kohu

dpavlin@koha-dev:/srv/koha-rfid$ ./rfid2koha-borrower-attribute.pl log.print/2010-08-17T16\:36\:27.txt


Import 3M log datoteka

ovaj korak je stara procedura i ne koristi se više

kopiranje novih logova na koha-dev

*.LOG datoteke iz 3M softwarera se kopiraju u /srv/koha-rfid/log

dpavlin@koha:~$ sudo mount /mnt/koncar/
dpavlin@koha:~$ cp -v /mnt/koncar/* /srv/koha-rfid/log/
dpavlin@koha:~$ sudo umount /mnt/koncar/

preimenovanje u intervale koje pokrivaju

dpavlin@koha:/srv/koha-rfid$ make rename
find log/ -name "*.LOG" | xargs -i ./rename-log.sh {}
chmod 644 log/*.log

dpavlin@koha:/srv/koha-rfid$ ls -al log | head
total 27860
drwxr-xr-x 4 dpavlin dpavlin   4096 2010-03-01 16:33 .
drwxrwxr-x 6 dpavlin dpavlin   4096 2010-02-25 15:18 ..
-rw-r--r-- 1 dpavlin dpavlin 524488 2010-02-21 02:10 20080922-20081111.log
-rw-r--r-- 1 dpavlin dpavlin 524334 2010-02-21 02:10 20081015-20081024.log
-rw-r--r-- 1 dpavlin dpavlin 524606 2010-02-21 02:10 20081024-20081103.log
-rw-r--r-- 1 dpavlin dpavlin 524322 2010-02-21 02:10 20081027-20081027.log
-rw-r--r-- 1 dpavlin dpavlin 524510 2010-02-21 02:10 20081027-20081029.log
-rw-r--r-- 1 dpavlin dpavlin 524296 2010-02-21 02:10 20081029-20081103.log
-rw-r--r-- 1 dpavlin dpavlin 524366 2010-02-21 02:10 20081103-20081106.log

provjera novih podataka

cd log
git status
git add *.log
git commit -m 'new data'

parse log

dpavlin@koha-dev:/srv/koha-rfid$ make rfid

...

wc -l rfid.txt
12196 rfid.txt
echo "`cat rfid.txt | cut -d, -f2 | sort -u | wc -l` different tags"
11243 different tags
echo "`cat rfid.txt | cut -d, -f2- | grep ',20' | sort -u | wc -l` card tags"
4151 card tags

Kopiranje borrowers tablice s produkcije na development

dpavlin@koha-dev:/srv/koha-rfid$ ./update-borrowers.sh

Ovo će stvoriti borrowers2 tablicu na developmentu i prekopirati sve nove korisnike u borrowers tablicu, a postojećim korisnicima upisati cardnumber ako je on u međuvremenu generiran na produkciji.

update kohe

(pokreće sam i parsanje log dataoteka)

dpavlin@koha-dev:/srv/koha-rfid$ make rfid2koha
permalink
Weblog Navigation
Loading...
Weblog Archives
  • Loading...