I am using a SIM7100 module in a project which has a SIM card in it. I can send and receive texts with no problem until I send an AT+USD command to request the current balance on the SIM. If I use minicom to send the command, I get a (correct) response:
AT+CUSD: 0,"O2: Your balance is £10.84"
I'm using 'import serial' at the start of the program. When I send the same message via Python program, and try to read the answer, I get a decode error when the string has got as far as the '£' sign:
'can't decode byte Oxa3 in position 0. Invalid start byte.'
I've tried to decode in 2 ways, using code as follows:
while port.inWaiting()>0:
response+=str(port.read(1).decode())
and also:
while port.inWaiting()>0:
response+=str(port.read(1).decode(utf-8))
Neither method works and the error is the same. I don't know how to find what encoding method is used by the SIM7100 and I don't know any other options to try. Can anyone help please?