Sim Reader, Assistance Required

Talk about the videos and projects (SIM reader, payphones...)

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
grenhac
 
Posts: 7
Joined: Sat Sep 13, 2008 4:47 pm

Sim Reader, Assistance Required

Post by grenhac »

Just got around to building the Sim Reader kit I got at HOPE back in July. Must say that I'm impressed by the board layout, compact whilst leaving enough space to solder with ease.

Unfortunately, I'm having some difficulties communicating with the reader.

I've tried both on a Windows 2000 machine and a Debian 4.0 (Etch) Linux machine, with Administrator/root account with the necessary rights for raw serial access. I'm plugging the serial connector straight into the serial port on the PC. After selecting the appropriate port (COM1 for Windows, /dev/ttyS0 for Linux) the message displayed is "Unable to connect to reader". I've tried various other port combinations such as COM3, without success.

I've double checked the component locations and polarity and everything appears correct. I've had a good look at the soldering and checked the connections with a multimeter. The voltage across GND and 5V is 4.91V with a battery connected so it looks like the power stuff is doing it's job. I'm using a UK BANNED Mobile SIM.

I've done some digging in the code and adding of debug print statements. It appears that the first value being read from the serial port after the setRTS(1), sleep 10ms, flushInput(), setRTS(0) is 3. This doesn't match the ATR byte 0x3B hence the error.

Please can anyone offer any advise as to what might be wrong or what I should try next.

Thanks

adafruit
 
Posts: 12151
Joined: Thu Apr 06, 2006 4:21 pm

Post by adafruit »

post a screenshot of the debug window

grenhac
 
Posts: 7
Joined: Sat Sep 13, 2008 4:47 pm

Post by grenhac »

Unfortunately the error dialog "Unable to connect to reader" error happens before the debug window appears. After clicking "OK" to the error I am returned to the main application window. The pySimReader.log file is empty.

I added print statements to the raw python version on linux to output various variables. I could tidy that up a bit and supply those if that might help.

Thanks

adafruit
 
Posts: 12151
Joined: Thu Apr 06, 2006 4:21 pm

Post by adafruit »

it sounds like you cant even open the COM port
triple check that you can do so, perhaps check which port the serial cable is coming out of, as well as the device manager and/or what the serial ports are called on your distro (each distro is different :( )

grenhac
 
Posts: 7
Joined: Sat Sep 13, 2008 4:47 pm

Post by grenhac »

I think the serial port is being read okay.

If I plug in the reader (battery connected) without the SIM inserted the following message is output to the console:

Code: Select all

Traceback (most recent call last):
  File "pySimReader.py", line 267, in buttonConnectReader
    self.SIM.connectReader()
  File "/home/peter/simcardread/pySimReader-Serial-src/pySIMserial.py", line 121, in connectReader
    res = self.openSession(self.getReaderName())
  File "/home/peter/simcardread/pySimReader-Serial-src/pySIMserial.py", line 170, in openSession
    print "ord(ts) 0x%x)" % ord(ts)
TypeError: ord() expected a character, but string of length 0 found
Doing the same with the SIM inserted results in the "Unable to connect to reader" error. If there was a problem reading the serial port I would expect the same result if the SIM is present or not.

The same thing happens on a separate Windows 2000 machine.

I'm thinking this is looking more like a hardware problem. I'll try to get my hands on another SIM card to give that a go, although the SIM I'm using works fine in a phone.

From http://www.electronicrepairguide.com/ho ... ystal.html
Crystals are quite fragile components because of their construction and designed. Unlike a resistor or a capacitor, if you drop one on the ground from a decent height, it’s a 50-50 chances whether it will function again.
I'm sure the airline wouldn't have done anything like that to my checked BANNED :)

adafruit
 
Posts: 12151
Joined: Thu Apr 06, 2006 4:21 pm

Post by adafruit »

post a photo of the board, that would help a LOT
do you have the sim holder in backwards?

grenhac
 
Posts: 7
Joined: Sat Sep 13, 2008 4:47 pm

Post by grenhac »

Some photos: I used a IC socket instead of soldering the 74HC04N directly into the board. I also haven't soldered in the FTDI header pins, leaving my options open between future cable or breadboard use.

Thanks

adafruit
 
Posts: 12151
Joined: Thu Apr 06, 2006 4:21 pm

Post by adafruit »

hmm i am stumped. it looks good to me, i would try another sim just in case

grenhac
 
Posts: 7
Joined: Sat Sep 13, 2008 4:47 pm

Post by grenhac »

Tried another SIM card, this time a UK O2. Worked no problems :D

I tried the "bad" SIM in a different phone from normal and it reminded me of some behaviour I'd seen in the past with that SIM. For a short period (about 50 seconds) after switching the phone on any attempt to access the address book results in a "SIM not Ready" error. This doesn't happen with the "good" SIM , access to the address book is available immediately.

A bit of searching on the interweb suggests other people have experienced similar issues. I think my "bad" SIM card is from circa 1999

I'll try adding various sleep statements to the initialisation steps of the software to see if I can persuade the "bad" SIM to play nice.

Locked
Please be positive and constructive with your questions and comments.

Return to “Citizen Engineer (closed)”