Cannot Recover Connection after loss of Connection

In my continued effort to use the Python SDK for my project I have tracked my issue down to the root cause. In summary what is occurring is that while I maintain a good connection to the network everything works great. I am able to sendMessage and route these messages through the platform to my WebHook Service. However, when I have an error occur, the service breaks down and will not recover the connection. I am done until the program is completely torn down and restarted.

I am using the Berry-GPSGSM board which has the SARA-U201 modem module. I am using the network=cellular connection which as you know uses pppd to support the network connection.

credentials = {‘devicekey’: device_key}
self.__hologram = HologramCloud(credentials, network=‘cellular’)

The issue I am encountering is in sendMessage() method in that when I encounter an IOError exception it is then invoking the __enforce_network_disconnected() method but it is not cleaning up the ppp session leaving it hanging as a defunct process. So when an attempt is made to reestablish a connection you cannot as it will prevent it within the PPP class in its __enforce_no_existing_ppp_session() method.

You cannot eliminate the pppd process without killing the parent process which is the main application. How do you prevent this error and enable recovery when cellular connection is lost temporarily?

Its a known issue in the current release and is fixed in the upcoming one. If you want to install the develop branch it should solve that problem. I talk about how to do that in this post

1 Like

Thank you so much! I will read the post and deploy the new version from the development branch. Thank you so much for the assist!!!

That corrected the issue for me. I also noted that the return code provided is also now a valid integer and the result string is now found in getResultString() where before I was getting a 48 on successful transmission and this code was not in the defined result strings. Now I get a 0 for successful result and -1 for failure. It recovered beautifully from a failed send request when connection was restored it estabished the ppp session and took off again. Fantastic work! Thank you.

1 Like

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