pwitab / ublox

Python library for U-blox cellular modules
https://ublox.readthedocs.io
MIT License
9 stars 7 forks source link

ValueError: invalid literal for int() with base 10: ',' #6

Open nilpntr opened 4 years ago

nilpntr commented 4 years ago

I can't set the T-mobile PDP settings. Also when I try to use module._at_action('AT+CFUN=1') I get the same error as the title of this request.

Screenshot 2019-09-27 at 17 49 55
Krolken commented 4 years ago

Seems like you get an unexpected data sequence on URC: CEREG

What module are you using? What RAT? (NB-IoT, LTE-M). What board are you using?

Could you enable debug logging and send a complete log. I would like to see the data that is sent and received.

nilpntr commented 4 years ago

Hi Henrik, The full debug log: DEBUG:ublox.modules:Applying AT Command: AT+CSCON=1 DEBUG:ublox.modules:Sent: b'AT+CSCON=1\r\n' DEBUG:ublox.modules:Recieved ack: b'\r\n' DEBUG:ublox.modules:Received: [b'OK'] DEBUG:ublox.modules:AT Command response = [] DEBUG:ublox.modules:Applying AT Command: AT+CEREG=5 DEBUG:ublox.modules:Sent: b'AT+CEREG=5\r\n' DEBUG:ublox.modules:Recieved ack: b'\r\n' DEBUG:ublox.modules:Received: [b'OK'] DEBUG:ublox.modules:AT Command response = [] DEBUG:ublox.modules:Applying AT Command: AT+NPSMR=1 DEBUG:ublox.modules:Sent: b'AT+NPSMR=1\r\n' DEBUG:ublox.modules:Recieved ack: b'\r\n' DEBUG:ublox.modules:Received: [b'OK'] DEBUG:ublox.modules:AT Command response = [] DEBUG:ublox.modules:Applying AT Command: AT+NCONFIG="CR_0354_0338_SCRAMBLING","TRUE" DEBUG:ublox.modules:Sent: b'AT+NCONFIG="CR_0354_0338_SCRAMBLING","TRUE"\r\n' DEBUG:ublox.modules:Recieved ack: b'\r\n' DEBUG:ublox.modules:Received: [b'OK'] DEBUG:ublox.modules:AT Command response = [] DEBUG:ublox.modules:Applying AT Command: AT+NCONFIG="CR_0859_SI_AVOID","FALSE" DEBUG:ublox.modules:Sent: b'AT+NCONFIG="CR_0859_SI_AVOID","FALSE"\r\n' DEBUG:ublox.modules:Recieved ack: b'\r\n' DEBUG:ublox.modules:Received: [b'OK'] DEBUG:ublox.modules:AT Command response = [] DEBUG:ublox.modules:Applying AT Command: AT+CFUN=0 DEBUG:ublox.modules:Sent: b'AT+CFUN=0\r\n' DEBUG:ublox.modules:Recieved ack: b'\r\n' DEBUG:ublox.modules:Received: [b'OK'] DEBUG:ublox.modules:AT Command response = [] DEBUG:ublox.modules:Applying AT Command: AT+CGDCONT=0,"IP","cdp.iot.t-mobile.nlhttp://cdp.iot.t-mobile.nl" DEBUG:ublox.modules:Sent: b'AT+CGDCONT=0,"IP","cdp.iot.t-mobile.nlhttp://cdp.iot.t-mobile.nl"\r\n' DEBUG:ublox.modules:Recieved ack: b'\r\n' DEBUG:ublox.modules:Processing URC: +NPSMR: 0 DEBUG:ublox.modules:Unhandled urc: b'+NPSMR: 0' DEBUG:ublox.modules:Received: [b'+NPSMR: 0', b'OK'] DEBUG:ublox.modules:AT Command response = [] DEBUG:ublox.modules:Applying AT Command: AT+CFUN=1 DEBUG:ublox.modules:Sent: b'AT+CFUN=1\r\n' DEBUG:ublox.modules:Recieved ack: b'\r\n' DEBUG:ublox.modules:Processing URC: +CEREG: 0,"0000","0",7,,,, Traceback (most recent call last): File "test.py", line 37, in module._at_action('AT+CFUN=1') File "/Users/sammobach/PycharmProjects/nb_iot/venv/lib/python3.7/site-packages/ublox/modules.py", line 246, in _at_action capture_urc=capture_urc) File "/Users/sammobach/PycharmProjects/nb_iot/venv/lib/python3.7/site-packages/ublox/modules.py", line 330, in _read_line_until_contains self._process_urc(line) File "/Users/sammobach/PycharmProjects/nb_iot/venv/lib/python3.7/site-packages/ublox/modules.py", line 381, in _process_urc self._update_eps_reg_status_callback(urc) File "/Users/sammobach/PycharmProjects/nb_iot/venv/lib/python3.7/site-packages/ublox/modules.py", line 428, in _update_eps_reg_status_callback status = int(chr(urc[-1])) ValueError: invalid literal for int() with base 10: ','

The module: Ublox N211 RAT: NB-IoT Board: Arduino

On 28 Sep 2019, at 14:52, Henrik Wahlgren notifications@github.com<mailto:notifications@github.com> wrote:

Seems like you get an unexpected data sequence on URC: CEREG

What module are you using? What RAT? (NB-IoT, LTE-M). What board are you using?

Could you enable debug logging and send a complete log. I would like to see the data that is sent and received.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/pwitab/ublox/issues/6?email_source=notifications&email_token=AMYJQ2YV3HX7PYHFV4ONAX3QL5HRVA5CNFSM4I3IA2T2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD72ZDBI#issuecomment-536187269, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AMYJQ2YDAW4ORJENBYFTW7LQL5HRVANCNFSM4I3IA2TQ.

nilpntr commented 4 years ago

But the weird part is, when I use the same commands on the serial monitor on the Arduino application, then It works.

On 28 Sep 2019, at 14:52, Henrik Wahlgren notifications@github.com<mailto:notifications@github.com> wrote:

Seems like you get an unexpected data sequence on URC: CEREG

What module are you using? What RAT? (NB-IoT, LTE-M). What board are you using?

Could you enable debug logging and send a complete log. I would like to see the data that is sent and received.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/pwitab/ublox/issues/6?email_source=notifications&email_token=AMYJQ2YV3HX7PYHFV4ONAX3QL5HRVA5CNFSM4I3IA2T2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD72ZDBI#issuecomment-536187269, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AMYJQ2YDAW4ORJENBYFTW7LQL5HRVANCNFSM4I3IA2TQ.

Krolken commented 4 years ago

OK. Thanks for the logs.

You are sending CEREG=5 which enables the URC to send all available data. The program as of now cannot handle the full response URC, I didnt see the need for it in my use cases. (though I have a note that I propably should use regex to handle the URC :P )

Do you need all the info? Otherwise I would ask you to just send CEREG=1

Or you can use the enable_signaling_connection_urc() function.

You could also use the setup() function that will run most of the commands you have used.

Hope this helps

nilpntr commented 4 years ago

Thanks a lot I fixed it by removing the AT+CEREG=5.

On 28 Sep 2019, at 20:30, Henrik Wahlgren notifications@github.com<mailto:notifications@github.com> wrote:

OK. Thanks for the logs.

You are sending CEREG=5 which enables the URC to send all available data. The program as of now cannot handle the full response URC, I didnt see the need for it in my use cases. (though I have a note that I propably should use regex to handle the URC :P )

Do you need all the info? Otherwise I would ask you to just send CEREG=1

Or you can use the enable_signaling_connection_urc() function.

You could also use the setup() function that will run most of the commands you have used.

Hope this helps

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/pwitab/ublox/issues/6?email_source=notifications&email_token=AMYJQ25L74ANRX3G36RZHEDQL6PCZA5CNFSM4I3IA2T2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD727TXQ#issuecomment-536213982, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AMYJQ23ETEDDR2FZUTOEW5TQL6PCZANCNFSM4I3IA2TQ.