huawei-modem-python-api-client icon indicating copy to clipboard operation
huawei-modem-python-api-client copied to clipboard

Error while working with USSD Code

Open VauseDio opened this issue 4 years ago • 4 comments

Hello,

Firstly, congrats you created awesome library. FYI: Connection to wingle, sending sms and reboot functions work great but USSD code doesn't work. No matter what I changed in the code so May I ask you?

Lately I found an Error while working with USSD code: Heres the code:

import huaweisms.api.user
import huaweisms.api.wlan
import huaweisms.api.sms
import huaweisms.api.ussd
import huaweisms.api.device

ctx = huaweisms.api.user.quick_login("admin", "admin123")
print(ctx)
#Till this line it works Great



#This ussd code is to check balance: *101#
#This code doesn't work, no matter what I changed:
r = huaweisms.api.ussd.send(ctx, "*101#")
print(r)

print("\n........................\n")

r = huaweisms.api.ussd.get(ctx)
print(r)


#connected devices
device_list = huaweisms.api.wlan.get_connected_hosts(ctx)

When I execute this code it gives following error:

c:\python_codes>py ussd.py
<ApiCtx modem_host=192.168.8.1>
{'type': 'error', 'error': {'code': '1001', 'message': ''}}

........................

{'type': 'error', 'error': {'code': '100002', 'message': ''}}

VauseDio avatar Jun 10 '20 04:06 VauseDio

Perhaps this is your decision. https://github.com/pablo/huawei-modem-python-api-client/issues/15#issuecomment-705694751

Wegazz avatar Oct 08 '20 16:10 Wegazz

I'm getting the same error, It's something about dongle not supporting USSD operation?!

Pezhvak avatar Apr 11 '21 12:04 Pezhvak

yapp, I was right: https://github.com/MartijnBraam/huawei-3g/blob/master/huawei_3g/huawei_e303.py

Pezhvak avatar Apr 11 '21 12:04 Pezhvak

Perhaps this is your decision. #15 (comment)

how to edit code for read ussd encod utf-8 (thai language)

Fil2ST avatar Feb 08 '23 04:02 Fil2ST