lte attachment
-
I've got a gpy in a wakeup-lteattach-connect-upload-disconnect-detach-deeplseep cycle. There is an lte modem reset cmd in the attachment routine
if not lte.isattached(): print('lte attaching ', end=''); lte.attach() for i in range (10): if lte.isattached(): print ('attached'); break if i==5: print('modem reset'); lte.send_at_cmd('AT^RESET') print(i, ' ', end='')it works OK with the reset in the middle of the 10 trys but if I remove the rest line then attachment failure can persist indefinitely. The reason the modem is sometimes not attaching & needs the modem reset is because it's already attached, which is possible if the previous deepsleep cycle ended without proper detachment. What I can't figure out is how an already attached modem gets past the if not lte.isattached() test?
-
@kjm haven’t checked the internals of those functions, but it’s quite possible the firmware maintains a state rather than checking what the modem says.
In that case, it would start considering (possibly incorrectly) that the modem is not attached.
One option could be to perform the reset in all cases to make sure the firmware and modem are in sync?
-
I think you're correct, seeing a register rather than the actual modem state. What complicates this issue further is that reading the register also seems to clear it. So that
print('checking LTE') c='connected' if lte.isconnected() else 'not connected'; print('modem is', c) a='attached' if lte.isattached() else 'not attached'; print('modem is', a) a='attached' if lte.isattached() else 'not attached'; print('modem is', a)produces
checking LTE modem is connected modem is attached modem is not attached
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login