Open receive socket exception: Failed to listen socket

Nova modem with uBlox u-201 (AT&T) running on Pi Zero 1.3 with 3 Amp power supply on V10 of Buster and most recent Hologram Python API as of April 24 2020

For the past 9 months I have successfully been running this pseudo code in python 2.7 and python 3:

loop until message comes in
process message
hologram.sendMessage( json, topics)
send response
loop until message comes in

over the past 2 months I am suddenly getting a “Failed to listen socket” when opening the receive socket again. The only way around it is to tear down the stack, reset the modem via command line and re init the Hologram API.

If I keep trying to open the receive socket without a modem reset it will open in about five attempts but then receiving a message is hit or miss. The socket seems to be unstable at this point and the only fix is to do a command line reset to fix the issue.

Has anyone else seen this? If yes, do you have a better algorithm that does not involve calling a command line reset of the modem?

Upon further investigation, it would appear that sleeping for 12 seconds after closing the receive socket will allow the socket to reopen again without getting an exception. This is about the same time it takes to reset the modem and verify good signal. I do not see an advantage on waiting the 12 seconds other than suggesting this is an API issue that showed up in an update from or Raspian and not the application code. :slight_smile:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.