Reply
Thread Tools
Posts: 254 | Thanked: 122 times | Joined on Nov 2009
#231
Originally Posted by patt2k View Post
Congratulations. Now you know how to use pnatd. Ise it, if you like it.
ARE THESE LETTERS BIG ENOUGH TO BE SEEN?
 
niqbal's Avatar
Posts: 474 | Thanked: 368 times | Joined on Jan 2010
#232
Originally Posted by KiberGus View Post
I can only repeat one more time. Launch widget from command line. This would give more information, about why it doesn't work.
@kilbergus why do you always think Error means a diagnostic Error, what if its a response Error from the Operator. Being a programmer you should know these things. Running through widget (terminal) will only tell you if its a diagnostic error or not, which you can easily run through terminal modem and see if it is or not. Either way you are pinning down the problem.

so cut some slack to newbies.

Last edited by niqbal; 2010-02-05 at 22:22.
 
fpp's Avatar
Posts: 2,853 | Thanked: 968 times | Joined on Nov 2005
#233
Originally Posted by KiberGus View Post
OK. We were looking on a wrong documentation, a bit. As far as we use AT commands, we need GSM 07.07 - Main AT commands and Annex A from GSM 07.05 - Additional AT commands (SMS and CBS). Can be downloaded from http://wiki.openmoko.org/wiki/GSM#GS...in_AT_commands
I didn't understood how decoding should be done correctly and where did we made mistakes, but now I know how to check, if user has left ussd menu.
Sorry, but you kind of totally lost me there :-)
__________________
maemo blog
 
Posts: 254 | Thanked: 122 times | Joined on Nov 2009
#234
Originally Posted by niqbal View Post
@kilbergus why do you always think Error means a diagnostic Error, what if its a response Error from the Operator. Being a programmer you should know these things. Running through widget (terminal) will only tell you if its a diagnostic error or not, which you can easily run through terminal modem and see if it is or not. Either way you are pinning down the problem.

so cut some slack to newbies.
I also know, that the only place, where my code echoes "Error" is string, which appears on screen, because it is short. I know, that I tried to make reasonable and understandable diagnostics messages in iwdget and ussdquery.py. I know, that if error occurred operator would return error code (not a normal reply) to phone. I know, that modem returns ERROR, not Error if case of error.
So I know, that running widget from command line would give needed information with quite high level of possibility and making manual queries would probably give nothing.
And I know, that I've written dozen of times, what to do, if widget shows "Error".
And the last thing: it is 1:35 here and I'm not in a good mood.
 
Posts: 254 | Thanked: 122 times | Joined on Nov 2009
#235
Originally Posted by fpp View Post
Sorry, but you kind of totally lost me there :-)
I've edited that post. I think, that n900 doesn't follow standards. Can you please try making AT commands, added to that post.
 
fpp's Avatar
Posts: 2,853 | Thanked: 968 times | Joined on Nov 2005
#236
Originally Posted by KiberGus View Post
Update: According to documentation cp850 can not be used in ussd reply (at least with dsc field 15). On the other hand, our implementation shouldn't work at all, because we expect (and we get!) 8 bit encoding, while we should get 7 bit encoding. I would appreciate, if you try running these commands in pnatd:
at+cmgf=1
at+cscs="IRA"
at+cusd=1,"<your USSD number>",15
Ah, this I understand better, now I can help, thanks ! :-)

They should produce a lot of digits instead of human readable reply.
Sorry, no: just the normal text output from that number, as when I type only the "at+cusd" part.

Name:  ussd-test.jpg
Views: 1133
Size:  20.5 KB

The missing character between "Remise" and "jour" is the "à" that causes the error.
__________________
maemo blog
 
Posts: 84 | Thanked: 3 times | Joined on Jan 2010
#237
Originally Posted by KiberGus View Post
Congratulations. Now you know how to use pnatd. Ise it, if you like it.
ARE THESE LETTERS BIG ENOUGH TO BE SEEN?
Wow you're a douche im not a linux expert I learned a lot here so if you dont want to help just ignore what im saying kay? thx

Originally Posted by niqbal View Post
@kilbergus why do you always think Error means a diagnostic Error, what if its a response Error from the Operator. Being a programmer you should know these things. Running through widget (terminal) will only tell you if its a diagnostic error or not, which you can easily run through terminal modem and see if it is or not. Either way you are pinning down the problem.

so cut some slack to newbies.
So for now only way to see is via terminal? what about those extra reg options in ussd widget ?

Last edited by patt2k; 2010-02-06 at 01:09.
 
Marshall Banana's Avatar
Posts: 94 | Thanked: 209 times | Joined on Oct 2009 @ Germany
#238
Originally Posted by KiberGus View Post
OK. We were looking on a wrong documentation, a bit. As far as we use AT commands, we need GSM 07.07 - Main AT commands and Annex A from GSM 07.05 - Additional AT commands (SMS and CBS). Can be downloaded from http://wiki.openmoko.org/wiki/GSM#GS...in_AT_commands

I didn't understood how decoding should be done correctly and where did we made mistakes, but now I know how to check, if user has left ussd menu.

Update: According to documentation cp850 can not be used in ussd reply (at least with dsc field 15). On the other hand, our implementation shouldn't work at all, because we expect (and we get!) 8 bit encoding, while we should get 7 bit encoding. I would appreciate, if you try running these commands in pnatd:
at+cmgf=1
at+cscs="IRA"
at+cusd=1,"<your USSD number>",15

They should produce a lot of digits instead of human readable reply.
For me
at+cmgf=1
at+cscs="IRA"
at+cusd=1,"*100#",15

gives the same output like:
at
at+cusd=1,"*100#",15

+CUSD: 0,"Ihr Guthaben f\x81r die Nr.491234567890 betr\x84gt 13.53 Euro",15

Btw. i don't know if it is really cp850 encoded, that was just my guess.

Possible solution for the problem:
Before using gsmdecode on the reply remove all non-ascii characters from the reply:
Code:
strip_unicode = re.compile("([^-_a-zA-Z0-9!@#%&=,/'\";:~`\$\^\*\(\)\+\[\]\.\{\}\|\?\<\>\\]+|[^\s]+)")
reply=strip_unicode.sub('', reply)
This prevents gsmdecode from failing and properly encoded replys can still be decoded. My reply looks like this after that:
Ihr Guthaben fr die Nr.491234567890 betrgt 13.53 Euro

Second problem with ussdquery.py:
If the decoding of gsmdecode.py produces non ascii characters (Is this possible? i didn't look at gsmdecode.py) ussdquery.py will fail when writing the decoded reply to stdout as it trys to encode it to ascii.
This (python trying to encode the reply to ascii) will only happen if ussdquery.py is called by ussd-widget or ussd-pad. If you execute ussdquery.py directly in the terminal python will encode the output to the standard encoding of your terminal and the problem will probably not show.

Possible solution: Open stdout as binary file.
Code:
sys.stdout=file("/dev/stdout", "wb")

Last edited by Marshall Banana; 2010-02-06 at 10:03. Reason: Typo
 

The Following User Says Thank You to Marshall Banana For This Useful Post:
Posts: 254 | Thanked: 122 times | Joined on Nov 2009
#239
First of all I must say, that yesterday I was tired and wanted to sleep, so I was inadequate.
Originally Posted by fpp View Post
Sorry, no: just the normal text output from that number, as when I type only the "at+cusd" part.
Today I understood, that everything is done according to standards, but Marshall Banana was wrong about charset. If reply is in HEX or UCS2, then it is printed hex encoded without any conversion. If it was coded in default GSM alphabet n900 automatically decodes it to current terminal equipment charset.
By default CP437 is used, not CP850. I don't think it is a good choice, because it doesn't contain greek characters, so not all characters present in GSM encoding can be coded in CP437. But we can switch terminal equipment to GSm encoding with
at+cscs="GSM"
command. Then our code for decoding would work correctly. I'll make special version us ussdquery.py which does this trick and ask you to test it.
Originally Posted by patt2k View Post
Wow you're a douche im not a linux expert I learned a lot here so if you dont want to help just ignore what im saying kay? thx
extra reg options in ussd widget ?
I was too nerwous yesterday.
Originally Posted by patt2k View Post
So for now only way to see is via terminal? what about those extra reg options in ussd widget ?
There are many ways to debug. Of course you can try blindly switch options in widget or making low level queries. But the fastest an easiest way is to run widget from console. In most cases this will be enough to find out, where definitely error
occurred. I tried to say this many times.
 

The Following User Says Thank You to KiberGus For This Useful Post:
Posts: 254 | Thanked: 122 times | Joined on Nov 2009
#240
2 Marshall Banana and fpp
Try this script.
Attached Files
File Type: txt ussdquery.py.txt (6.9 KB, 338 views)
 

The Following 2 Users Say Thank You to KiberGus For This Useful Post:
Reply

Tags
dial, dialing, lack of phone features, lack of quality control, sms, telephony, ussd


 
Forum Jump


All times are GMT. The time now is 02:39.