Author Topic: Smargo Smartreader+CCcam.itd..  (Read 2043 times)

0 Members and 1 Guest are viewing this topic.

Offline antox

  • Ferengi
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 16798
Smargo Smartreader+CCcam.itd..
« on: January 03, 2010, 10:53:26 AM »
I will try to compile in one thread what I found related to Smargo, compiled from different sources.
I'm not the author, I will just add comments from what I discovered testing this amazing device.

First of all, a short presentation of this device.

- Powerfull ARM® 91 Thumb® Processor

- High-performance 32-bit RISC Architecture

- High-density 16-bit Instruction Set

- 64 Kbytes, organized in 512 Pages of 128 Bytes (Single Plane)

- 16 Kbytes Internal High-speed SRAM, Single-cycle Access at Maximum Speed

- Low-power RC Oscillator, 3 to 20 MHz On-chip Oscillator and one PLL

- Supports 3.20, 3.43, 3.69, 4.00, 4.36, 4.80, 5.34, 6.00, 6.86, 8.00, 9.61, 12.0 and 16.0 MHz for smartcards

- Supports standard ftdi_sio driver for Windows and Linux applications

- Developer guide available.

- Works on all Dreambox Models with USB connection

- Works with most softcams (e.g. Newcs, CCcam ect.)

- Can be cascaded with more SmartReaders using a USB Hub.

- No power supply required






developer/ manual

Smartreader+ integraters manual

* Smartreader modes

The Smartreader+ had two modes, command mode and data mode.
Till the CMD mode is entered the smartreader+ is working as a phoenix device at 3,57Mhz.
After entering CMD mode and returning to DATA mode the reader is configured as Smartreader+
and will probably not work as a phoenix till the next time it's cold started by removing the device from the USB port.
In the CMD mode it's possible to program the settings like frequency, protocol, etu, N and inversion.

* Mode selection

To enter the CMD mode set the reader to 5 databits.

example:

/* set smartreader in CMD mode */
struct termios term;
tcgetattr(deviceFd, &term);
term.c_cflag &= ~CSIZE;
term.c_cflag |= CS5;
tcsetattr(deviceFd, TCSANOW, &term);

To enter the DATA mode set the reader to 8 databits.

example:

/* set smartreader in DATA mode */
struct termios term;
tcgetattr(deviceFd, &term);
term.c_cflag &= ~CSIZE;
term.c_cflag |= CS8;
tcsetattr(deviceFd, TCSANOW, &term);

The Smartreader+ doesn't switch by itself so it's to the user to make sure that setting all the right values
you exit CMD mode and enter DATA mode for receiving/sending data to the smartcard.

note: Settings are activated by leaving CMD mode!

* Settings

setting nr payload response
1 FF FF DD sets Fi and Di factors
2 FR EQ sets the frequency
3 NN sets the N value
4 PR sets the protocol
5 IN sets inversion on(1)/off(0)

there is no response from the Smartreader+ after accepting the settings.

Example: Smartreader+ settings for ISO7816 t=0 smartcards:

sr+ <-- CMD MODE
sr+ <-- 01 01 74 01
sr+ <-- 02 0D FB
sr+ <-- 03 00
sr+ <-- 04 00
sr+ <-- 05 00
sr+ <-- DATA MODE
sr+ <-- toggle reset
sr+ --> ATR

* Available frequencies

3.20, 3.43, 3.69, 4.00, 4.36, 4.80, 5.34, 6.00, 6.86, 8.00, 9.61, 12.0 and 16.0 MHz

The user can selected any freqency. The Smartreader+ will selected the nearest available.

Second Part

This tutorial assumes the user has a DM7020 or a DM800. The tutorial can be used as is, or adapted easily for a standard Linux setup.


How to set smartreader operating mode using Windows

1: Install the windows drivers found here Smartreaderplus Drivers
2: Open smartreader.exe
3: Plug the smartreader into a usb port
4: Select Autoswitch or fixed mode
5: Select Normal or Dreambox kernel
6: Make sure it returns with "writing settings successful"
7: Done


DM7020 dreambox installation with PLI Iolite/Jade

1: Telnet to your dreambox run "ipkg update"
2: Run "ipkg install kernel-module-ftdi-sio"
3: Exit
4: Rename your original bootup file in /etc/init.d/ incase you have a problem*
5: Replace the bootup file in /etc/init.d/ with this one Smartreaderplus Drivers the bootup file is in the zipfile.
6: Reboot
7: Plug in the smartreader
8: Insert your card. Make sure the chip on the card faces the same direction as the lights on the reader.
9: Done

* The latest PLi Jade Final image appears to already have the usbtoserial configured in the bootup file. So no need to replace the bootup file.


DM800 dreambox installation with PLI Iolite/Jade
1: Enter the download menu
2: Search for USBtoSerial drivers
3: Download
4: Reboot
5: Plug in the smartreader
6: Insert your card. Make sure the chip on the card faces the same direction as the lights on the reader.
7: Done


DM7020/cccam.cfg
CCcam configuration sample:

SERIAL READER : /dev/usb/tts/0 smartreader+
SMARTCARD CLOCK FREQUENCY: /dev/usb/tts/0 6860002
SERVER LISTEN PORT : 20000
WEBINFO LISTEN PORT : 21000
WEBINFO USERNAME : username
WEBINFO PASSWORD : password
SHOW TIMING : yes

It is possible to add a usb hub to the DM7020. To incorporate a 4 port hub into the config insert the following:

SERIAL READER : /dev/usb/tts/0 smartreader+
SMARTCARD CLOCK FREQUENCY: /dev/usb/tts/0 6860002
SERIAL READER : /dev/usb/tts/1 smartreader+
SMARTCARD CLOCK FREQUENCY: /dev/usb/tts/1 6860002
SERIAL READER : /dev/usb/tts/2 smartreader+
SMARTCARD CLOCK FREQUENCY: /dev/usb/tts/2 6860002
SERIAL READER : /dev/usb/tts/3 smartreader+
SMARTCARD CLOCK FREQUENCY: /dev/usb/tts/3 6860002


DM800/cccam.cfg
CCcam configuration sample:

SERIAL READER : /dev/ttyUSB0 smartreader+
SMARTCARD CLOCK FREQUENCY: /dev/ttyUSB0 6860002
SERVER LISTEN PORT : 20000
WEBINFO LISTEN PORT : 21000
WEBINFO USERNAME : username
WEBINFO PASSWORD : password
SHOW TIMING : yes

The DM800 comes with 2 USB ports already. However if you wish to add a usb hub you can.

The above cfg's assume that the reader is set to autoswitch mode and dreambox kernel.

You can choose any of the following frequencies: 3.20, 3.43, 3.69, 4.00, 4.36, 4.80, 5.34, 6.00, 6.86, 8.00, 9.61, 12.0 and 16.0

Examples:
SMARTCARD CLOCK FREQUENCY: /dev/usb/tts/0 6000002 runs the card at 6mhz.
SMARTCARD CLOCK FREQUENCY: /dev/usb/tts/0 6860002 runs the card at 6.86mhz.
SMARTCARD CLOCK FREQUENCY: /dev/usb/tts/0 8000002 runs the card at 8mhz.
SMARTCARD CLOCK FREQUENCY: /dev/usb/tts/0 9610002 runs the card at 9.61mhz.

Most cards run at 6000002 or 6860002.

Ofcourse the reader can be used with other images such as Gemini etc. Feel free to experiment