Skip to content

Commit

Permalink
sleep briefly and check for other urcs before getting status
Browse files Browse the repository at this point in the history
  • Loading branch information
DomAmato committed Mar 6, 2021
1 parent 53c5841 commit c504c79
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Hologram/Network/Modem/SIM7000.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ def _is_pdp_context_active(self):
if not self.is_registered():
return False

self.checkURC()
self.command('+CIPSTATUS')
self.checkURC()
return self.network_state is NetworkState.CONNECTED
Expand Down Expand Up @@ -185,6 +186,7 @@ def _set_up_pdp_context(self):

self.set('+CSTT', '\"hologram\"')
self.command('+CIICR', timeout=30)
time.sleep(1)
if not self._is_pdp_context_active():
self.logger.error('PDP Context setup failed')
raise NetworkError('Failed PDP context setup')
Expand Down

0 comments on commit c504c79

Please sign in to comment.