Skip to content

CDMA@wifi

Sections
Personal tools
You are here: Home » Projekty » New CS Card Server

Zprovoznění Asus WL500GP a 2x USB Phoenix

Document Actions

Výchozí podmínky

Použité zařízení

  • Asus WL-500gP (firmware WL500gp-1.9.2.7-7f-pre7.trx Oleg nebo CDMA)
  • 2xUSB Phoenix (ZDK)
  • USB hub
  • flash disk

Software

Lokálaní IP adresa routru: 192.168.1.1, IP adresa PC: 192.168.1.60

Nastavení routeru Asus

Povolení Flash disku a nastavení uživatelů.

Na flash disku je vytvorena struktura adresaru ftp_pub a ftp_pvt. Ve ftp_pvt jsou dále adresáre podle uživatelských jmen a každý uživatel má prístup pouze do svého adresáre. Adresáre jsou vytvoreny podle práv, které jsou prideleny Private, Read/Write/Erese apod.

Povolení prístupu pres telnet

Syslog

Po prihlášení pres web rozhraní na router http://192.168.1.1 je v sekci Status & Log – System log.

Overení připojení flash disku v systémovém logu na routru:

Jan 1 01:00:05 kernel: Vendor: Kingston Model: DataTraveler 2.0 Rev: 5.00
Jan 1 01:00:05 kernel: Type: Direct-Access ANSI SCSI revision: 02
Jan 1 01:00:05 kernel: Attached scsi removable disk sda at scsi0, channel 0, id 0, lun 0
Jan 1 01:00:05 kernel: SCSI device sda: 1005568 512-byte hdwr sectors (515 MB)
Jan 1 01:00:05 kernel: sda: Write Protect is off
Jan 1 01:00:17 USB storage: vfat fs mounted to /tmp/harddisk

Nastavení FTP - Total Commander

Probíhá obdobne jako nastaveni prístupu do dreamboxu/Ipboxu

Po pripojení nakopírujete soubor na flash disk: newcs_Oleg.tar.gz Ja jsem ho mel napr. ve adresári ftp_pub.

Nastavení telnetu – Putty a instalace, start newcs

Po stažení programu Putty, není potreba nic speciálne nastavovat. Pouze doporucuji nastavit jednorázové ukládání logu do souboru. Prihlášení probíhá zadáním IP routru. Je zde možnost uložení.

Po prihlášení prejdete pomocí príkazu cd až k souboru newcs_Oleg.tar.gz.

Napr. cd .. (krok zpet), cd .. , cd harddisk , cd ftp_pub

Príkaz: ls –la slouží k zobrazení souboru v daném adrersáři.

Následne soubor rozbalíte príkazem:

tar zxf newcs_Oleg.tar.gz

Zastavení newcs lze provést príkazem:

killall newcs

Bežící procesy zobrazíte príkazem:

ps

Na flash disku vzniknou adresáre bin a lib. V adresári bin je konfiguracní soubor newcs.xml, který mužete prenést do PC pomocí Total Commanderu a zeditovat. Další možnost je použít napr. PsPad, nastavit FTP prístup a editovat prímo.
Pokud je nastavený newcs.xml, je možné pustit newcs. Tzn. prejít pomocí príkazu cd až do adresáre bin a napsat príkaz:

./start

V prípade požadavku na fungování i pres restartu routru se pouští:

 ./autostart

Zápis ze startu v putty.log s kartou CL a pripojením pres CCcam

[xxxx@(none) bin]$ ./start
insmod: A module named usbserial already exists
insmod: A module named ftdi_sio already exists
Reading Config file from newcs.xml
TCP-log password is disabled!

level: normal
type: init
output: all
logger config: level 1 type 3 output 255
Console log options: level 1 type 3
log file: /tmp/newcs.log
File log options: level 1 type 3
udp log: host 192.168.1.10 port 1000
UDP log options: level 1 type 3
tcp port: 3001
TCP log options: level 1 type 3
[ 15:58:35 ] [ Box detect ] Box type 1
[ 15:58:35 ] [ Config ] Option <Seca-PPV> for device 0 (phoenix) not present, defaulting to NO
[ 15:58:35 ] [ Config ] /dev/usb/tts/0 ECM priority: round
[ 15:58:35 ] [ Config ] Option <autosid> for device 0 (phoenix) not present, defaulting to NO
[ 15:58:35 ] [ Config ] No SIDFILTER is configured, disabling SidOverride for device 0 (phoenix)!
[ 15:58:35 ] [ Config ] Option <Seca-PPV> for device 1 (phoenix) not present, defaulting to NO
[ 15:58:35 ] [ Config ] /dev/usb/tts/1 ECM priority: round
[ 15:58:35 ] [ Config ] Option <autosid> for device 1 (phoenix) not present, defaulting to NO
[ 15:58:35 ] [ Config ] No SIDFILTER is configured, disabling SidOverride for device 1 (phoenix)!
[ 15:58:35 ] [ Config ] Option <Seca-PPV> for device 2 (phoenix) not present, defaulting to NO
[ 15:58:35 ] [ Config ] /dev/usb/tts/2 ECM priority: round
[ 15:58:35 ] [ Config ] Option <autosid> for device 2 (phoenix) not present, defaulting to NO
[ 15:58:35 ] [ Config ] No SIDFILTER is configured, disabling SidOverride for device 2 (phoenix)!
[ 15:58:35 ] [ Config ] Option <Seca-PPV> for device 3 (phoenix) not present, defaulting to NO
[ 15:58:35 ] [ Config ] /dev/usb/tts/3 ECM priority: round
[ 15:58:35 ] [ Config ] Option <autosid> for device 3 (phoenix) not present, defaulting to NO
[ 15:58:35 ] [ Config ] No SIDFILTER is configured, disabling SidOverride for device 3 (phoenix)!
[ 15:58:35 ] [ Config ] Option <spider> not present for User: dummy, defaulting to NO
[ 15:58:35 ] [ EMM Cache ] Initialising Cache with 10 entries
[ 15:58:35 ] [ ECM Cache ] Initialising Cache with 10 entries
[ NewCS ] Process ID is: 196
[ 15:58:35 ] [ Loader ] Reader type 2 on node /dev/usb/tts/0
[ 15:58:35 ] [ Phoenix ] Opening device /dev/usb/tts/0
[ 15:58:35 ] [ Phoenix ] Setting Parity to: EVEN
[ 15:58:35 ] [ Phoenix ] Setting Baud to standard 9600
[ 15:58:35 ] [ Phoenix ] Normal RESET on node /dev/usb/tts/0
[ 15:58:37 ] [ Loader ] Reset failed ...
[ 15:58:37 ] [ Loader ] Starting Newcamd Server on port 10110
[ 15:58:37 ] [ Loader ] Reader type 2 on node /dev/usb/tts/1
[ 15:58:37 ] [ Phoenix ] Opening device /dev/usb/tts/1
[ 15:58:37 ] [ Phoenix ] Setting Parity to: EVEN
[ 15:58:37 ] [ Phoenix ] Setting Baud to standard 9600
[ 15:58:37 ] [ Phoenix ] Normal RESET on node /dev/usb/tts/1
[ 15:58:39 ] [ Loader ] Reset failed ...
[ 15:58:39 ] [ Loader ] Starting Newcamd Server on port 10111
[ 15:58:39 ] [ Loader ] Reader type 2 on node /dev/usb/tts/2
[ 15:58:39 ] [ Phoenix ] Opening device /dev/usb/tts/2
[ 15:58:39 ] [ Phoenix ] Setting Parity to: EVEN
[ 15:58:39 ] [ Phoenix ] Setting Baud to standard 9600
[ 15:58:39 ] [ Phoenix ] Normal RESET on node /dev/usb/tts/2
[ 15:58:41 ] [ Loader ] Init Cryptoworks card
[ 15:58:41 ] [ Phoenix ] Setting Parity to: EVEN
[ 15:58:41 ] [ Phoenix ] Setting Baud to standard 9600
[ 15:58:42 ] [ Keyman ] Adding key 1101CA8D type 0 on Provider 0 for caid 0D03 ID=0
[ 15:58:42 ] [ Keyman ] Adding key 1101CA8D type 1 on Provider 4 for caid 0D03 ID=0
[ 15:58:42 ] [ Keyman ] Adding key 1101CA8D type 1 on Provider 8 for caid 0D03 ID=0
[ 15:58:43 ] [ Loader ] Card 0D03 on port /dev/usb/tts/2 ready
[ 15:58:43 ] [ Loader ] Starting Newcamd Server on port 10112
[ 15:58:43 ] [ Loader ] Reader type 2 on node /dev/usb/tts/3
[ 15:58:43 ] [ Phoenix ] Opening device /dev/usb/tts/3
[ 15:58:43 ] [ Phoenix ] Setting Parity to: EVEN
[ 15:58:43 ] [ Phoenix ] Setting Baud to standard 9600
[ 15:58:43 ] [ Phoenix ] Normal RESET on node /dev/usb/tts/3
[ 15:58:45 ] [ Loader ] Reset failed ...
[ 15:58:45 ] [ Loader ] Starting Newcamd Server on port 10113
[ 15:58:45 ] [ NewCS ] Ready to GO! :)
[xxx@(none) bin]$ [ 15:58:45 ] [ Newcamd:10112 ] User dummy logged in, client: CCcam

V sys logu v routru mužete overit instalaci driveru Phoenixe po startu newcs :


Nov 6 15:57:54 kernel: usb.c: registered new driver serial
Nov 6 15:57:54 kernel: usbserial.c: USB Serial support registered for Generic
Nov 6 15:57:54 kernel: usbserial.c: USB Serial Driver core v1.4
Nov 6 15:57:54 kernel: usbserial.c: USB Serial support registered for FTDI SIO
Nov 6 15:57:54 kernel: usbserial.c: USB Serial support registered for FTDI 8U232AM Compatible
Nov 6 15:57:54 kernel: usbserial.c: USB Serial support registered for FTDI FT232BM Compatible
Nov 6 15:57:54 kernel: usbserial.c: USB Serial support registered for FTDI FT2232C Compatible
Nov 6 15:57:54 kernel: usbserial.c: FTDI FT2232C Compatible converter detected
Nov 6 15:57:54 kernel: usbserial.c: FTDI FT2232C Compatible converter now attached to ttyUSB0 (or usb/tts/0 for devfs)
Nov 6 15:57:54 kernel: usbserial.c: FTDI FT2232C Compatible converter detected

Nov 6 15:57:54 kernel: usbserial.c: FTDI FT2232C Compatible converter now attached to ttyUSB1 (or usb/tts/1 for devfs)
Nov 6 15:57:54 kernel: usbserial.c: FTDI FT2232C Compatible converter detected
Nov 6 15:57:54 kernel: usbserial.c: FTDI FT2232C Compatible converter now attached to ttyUSB2 (or usb/tts/2 for devfs)
Nov 6 15:57:54 kernel: usbserial.c: FTDI FT2232C Compatible converter detected
Nov 6 15:57:54 kernel: usbserial.c: FTDI FT2232C Compatible converter now attached to ttyUSB3 (or usb/tts/3 for devfs)
Nov 6 15:57:54 kernel: usbserial.c: USB Serial support registered for FTDI FT232R Compatible
Nov 6 15:57:54 kernel: usbserial.c: USB Serial support registered for USB-UIRT Infrared Tranceiver
Nov 6 15:57:54 kernel: usbserial.c: USB Serial support registered for Home-Electronics TIRA-1 IR Transceiver
Nov 6 15:57:54 kernel: ftdi_sio.c: v1.3.5r1:USB FTDI Serial Converters Driver

Newcs – kontrola (putty, http), automaticky start, príklady konfigurace

Následne lze kontrolovat stav newcs pomocí http://192.168.1.1:3001

Nebo pomocí putty – nastavení protocol RAW , IP 192.168.1.1 port 3001 a zadávat prímo príkazy podle možnosti,
které jsou v souboru readme.txt u distribuce newcs.

Príkad konfigurace newcs.xml

<newCSconfig>
<readers name="Card Readers">
<device>
<name>phoenix</name>
<type>Phoenix</type>
<node>/dev/usb/tts/0</node>
<mhz>357</mhz> <!-- or 357 -->
<parity>even</parity>
<export>yes</export>
<enabled>yes</enabled>
<blocksa>no</blocksa>
<blockua>no</blockua>
<blockga>no</blockga>
<!-- <boxkey>0000000000</boxkey> -->
<PTShandshake>Yes</PTShandshake>
<crypto-special>no</crypto-special>
<carddetect>no</carddetect>
<newcamd_port>10110</newcamd_port>
<priority>round</priority> <!-- hard is default -->
<sid>
<allow>
<!-- valid value for id are: 4 numbers, if the service id is 3 numbers, add a 0 infront of it. -->
<id></id>
</allow>
<deny>
<!-- valid value for id are: 4 numbers, if the service id is 3 numbers, add a 0 infront of it. -->
<id></id>
</deny>
</sid>
</device>
<device>
<name>phoenix</name>
<type>Phoenix</type>
<node>/dev/usb/tts/1</node>
<mhz>357</mhz> <!-- or 357 -->
<parity>even</parity>
<export>yes</export>
<enabled>yes</enabled>
<blocksa>no</blocksa>
<blockua>no</blockua>
<blockga>no</blockga>
<!-- <boxkey>0000000000</boxkey> -->
<PTShandshake>Yes</PTShandshake>
<crypto-special>no</crypto-special>
<carddetect>no</carddetect>
<newcamd_port>10111</newcamd_port>
<priority>round</priority> <!-- hard is default -->
<sid>
<allow>
<!-- valid value for id are: 4 numbers, if the service id is 3 numbers, add a 0 infront of it. -->
<id></id>
</allow>
<deny>
<!-- valid value for id are: 4 numbers, if the service id is 3 numbers, add a 0 infront of it. -->
<id></id>
</deny>
</sid>
</device>
<device>
<name>phoenix</name>
<type>Phoenix</type>
<node>/dev/usb/tts/2</node>
<mhz>357</mhz> <!-- or 357 -->
<parity>even</parity>
<export>yes</export>
<enabled>yes</enabled>
<blocksa>no</blocksa>
<blockua>no</blockua>
<blockga>no</blockga>
<!-- <boxkey>0000000000</boxkey> -->
<PTShandshake>Yes</PTShandshake>
<crypto-special>no</crypto-special>
<carddetect>no</carddetect>
<newcamd_port>10112</newcamd_port>
<priority>round</priority> <!-- hard is default -->
<sid>
<allow>
<!-- valid value for id are: 4 numbers, if the service id is 3 numbers, add a 0 infront of it. -->
<id></id>
</allow>
<deny>
<!-- valid value for id are: 4 numbers, if the service id is 3 numbers, add a 0 infront of it. -->

<id></id>
</deny>
</sid>
</device>
<device>
<name>phoenix</name>
<type>Phoenix</type>
<node>/dev/usb/tts/3</node>
<mhz>357</mhz> <!-- or 357 -->
<parity>even</parity>
<export>yes</export>
<enabled>yes</enabled>
<blocksa>no</blocksa>
<blockua>no</blockua>
<blockga>no</blockga>
<!-- <boxkey>0000000000</boxkey> -->
<PTShandshake>Yes</PTShandshake>
<crypto-special>no</crypto-special>
<carddetect>no</carddetect>
<newcamd_port>10113</newcamd_port>
<priority>round</priority> <!-- hard is default -->
<sid>
<allow>
<!-- valid value for id are: 4 numbers, if the service id is 3 numbers, add a 0 infront of it. -->
<id></id>
</allow>
<deny>
<!-- valid value for id are: 4 numbers, if the service id is 3 numbers, add a 0 infront of it. -->
<id></id>
</deny>
</sid>
</device>
</readers>
<cache>
<emm>10</emm>
<ecm>10</ecm>
</cache>
<debug>
<password>passwd</password>
<level>normal</level>
<type>init</type>
<output>all</output>
<logfile>/tmp/harddisk/newcs.log</logfile>
<console_options></console_options>
<file_options></file_options>
<udp_host>192.168.1.10</udp_host>
<udp_port>1000</udp_port>
<udp_options></udp_options>
<tcp_port>3001</tcp_port>
<tcp_options></tcp_options>
</debug>
<newcamdserver>
<enabled>yes</enabled>
<name>bla</name>
<deskey>01 02 03 04 05 06 07 08 09 10 11 12 13 14</deskey>
<userfile></userfile>
<user>
<name>dummy</name>
<password>dummy</password>
<au>on</au>
</user>
</newcamdserver>
</newCSconfig>

Nastavení firewall – povolení prístupu z WAN

Povolit prístup ke kartám z WAN, pomocí putty zapsat povolené IP a porty, nebo pouze porty bez omezení pristupujících IP. Tuto konfiguraci lze provést i v souboru start v adresári bin.

Povolení

iptables -I INPUT -j ACCEPT -p tcp --dport <port newcs> -s <z jake IP adresy povolit>
príklad: iptables -I INPUT -j ACCEPT -p tcp --dport 10112 -s 212.212.212.212

Zákaz

iptables -D INPUT -j ACCEPT -p tcp --dport <port newcs> -s <z jake IP adresy zakázat>

Povolit všem prístup

iptables -I INPUT -j ACCEPT -p tcp --dport <port newcs>
príklad: iptables –I INPUT –j ACCEPT –p tcp –dport 10112

Zakázat

iptables -D INPUT -j ACCEPT -p tcp --dport <port newcs>

Výpis

iptables –L INPUT –vn

Uložení nastavení

flashfs enable

flashfs save
flashfs commit

Nastaveni firewall v souboru start v adresári bin

Odstranením znaku # je možné prímo urcit pri startu, které porty budou otevreny. Ukázkou souboru start – povolen port 10112 pro všechny uživatele.  Dále je prístup chránen des key a jméno, heslo v newcs.xml.

#!/bin/sh
RUNDIR=$(echo $(pwd)/$0|sed -e "s:[/][^/]*$::g" -e"s:.*[/][/]:/:")
export LD_LIBRARY_PATH=$RUNDIR/../lib
rmmod ftdi_sio
insmod usbserial
insmod $RUNDIR/ftdi_sio.o
$RUNDIR/newcs -C $RUNDIR/newcs.xml
#iptables -I INPUT -j ACCEPT -p tcp --dport 10110
iptables -I INPUT -j ACCEPT -p tcp --dport 10112

Odkazy

Created by administrator
Last modified 2006-11-09 12:35 AM
« July 2018 »
Su Mo Tu We Th Fr Sa
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31        
 
 

Powered by Plone

This site conforms to the following standards: