maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Maemo 5 / Fremantle (https://talk.maemo.org/forumdisplay.php?f=40)
-   -   Missing USSD functionality: N900 can't dial numbers beginning with # or * (https://talk.maemo.org/showthread.php?t=32878)

KiberGus 2010-02-05 22:16

Re: Howto install ussd-pad and ussd-widget
 
Quote:

Originally Posted by patt2k (Post 512454)

Congratulations. Now you know how to use pnatd. Ise it, if you like it.
ARE THESE LETTERS BIG ENOUGH TO BE SEEN?

niqbal 2010-02-05 22:16

Re: Howto install ussd-pad and ussd-widget
 
Quote:

Originally Posted by KiberGus (Post 512408)
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.

fpp 2010-02-05 22:22

Re: Missing USSD functionality: N900 can't dial numbers beginning with # or *
 
Quote:

Originally Posted by KiberGus (Post 512452)
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 :-)

KiberGus 2010-02-05 22:36

Re: Howto install ussd-pad and ussd-widget
 
Quote:

Originally Posted by niqbal (Post 512478)
@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.

KiberGus 2010-02-05 22:38

Re: Missing USSD functionality: N900 can't dial numbers beginning with # or *
 
Quote:

Originally Posted by fpp (Post 512485)
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 2010-02-05 23:02

Re: Missing USSD functionality: N900 can't dial numbers beginning with # or *
 
1 Attachment(s)
Quote:

Originally Posted by KiberGus (Post 512452)
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 ! :-)

Quote:

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.

Attachment 6902

The missing character between "Remise" and "jour" is the "à" that causes the error.

patt2k 2010-02-06 01:07

Re: Howto install ussd-pad and ussd-widget
 
Quote:

Originally Posted by KiberGus (Post 512477)
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

Quote:

Originally Posted by niqbal (Post 512478)
@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 ?

Marshall Banana 2010-02-06 10:01

Re: Missing USSD functionality: N900 can't dial numbers beginning with # or *
 
Quote:

Originally Posted by KiberGus (Post 512452)
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")

KiberGus 2010-02-06 10:28

Re: Howto install ussd-pad and ussd-widget
 
First of all I must say, that yesterday I was tired and wanted to sleep, so I was inadequate.
Quote:

Originally Posted by fpp (Post 512538)
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.
Quote:

Originally Posted by patt2k (Post 512628)
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.
Quote:

Originally Posted by patt2k (Post 512628)
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.

KiberGus 2010-02-06 11:41

Re: Missing USSD functionality: N900 can't dial numbers beginning with # or *
 
1 Attachment(s)
2 Marshall Banana and fpp
Try this script.


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

vBulletin® Version 3.8.8