Problems with pySimReader software

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
User avatar
akonkol
 
Posts: 2
Joined: Wed Jul 30, 2008 10:34 pm

Problems with pySimReader software

Post by akonkol »

I just built the kit and im anxious to get the software working. Im using Mac OS X leopard.

upon running python pySIMserial....

$ python pySIMserial.py

File "pySIMserial.py", line 76
s += "/dev/"+f+"\t"
^
IndentationError: expected an indented block


please bear with me, I am not very experienced in python. Is there something obvious that I need to do?

niksun
 
Posts: 202
Joined: Sun Jul 27, 2008 9:59 pm

Post by niksun »

Yeah, sometimes python is picky. Just add about 8 spaces in front of this line:

s += "/dev/"+f+"\t"

becomes:

.........s += "/dev/"+f+"\t"

It should work fine then.
Last edited by niksun on Wed Jul 30, 2008 11:43 pm, edited 1 time in total.

User avatar
akonkol
 
Posts: 2
Joined: Wed Jul 30, 2008 10:34 pm

gah!

Post by akonkol »

I didn't think white space mattered, and I neglected to read "expected indented.." clearly.

thanks!.. .works.

niksun
 
Posts: 202
Joined: Sun Jul 27, 2008 9:59 pm

Post by niksun »

Well, at least you're not programming in "whitespace!"

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

Post by adafruit »

sorry, have been making little fixes
please redownload and try again!

jestin
 
Posts: 1
Joined: Fri Aug 01, 2008 12:28 pm

Post by jestin »

I'm not sure what this:

if f.find('cu.') == 0: #f begins with "cu."

is supposed to be looking for. Can anyone fill me in?

Anyways, I've replaced it with this:

if f.find('ttyS') == 0 or f.find('ttyUSB') == 0:

and gotten everything to work fine. This should list the serial devices (ttyS0, ttyS1, ...) including any USB to serial converters (ttyUSB0, ttyUSB1, ...). Of course, the ttyUSB* devices will not show up if brltty is running, so uninstall it (unless you need to use a braille terminal).

==EDIT== I see this is OS X specific code. I'll see if I can find a way to determine linux from other posix systems.

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

Post by adafruit »

yah, i dont know of a good way of differentiating. if you have a suggestion ill add it in. the problem is every linux distro puts the serial port devices in a different place :(

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

Return to “Citizen Engineer (closed)”