'Listing screen sessions cause errors - Raspberry Pi

I am connected to a Raspberry Pi through SSH on my MacBook. Within the SSH, I have used the screen command to create two detached instances of the shell, one instance to monitor sensors, and instance one to stream a webcam. Currently, the sensor program takes temperature and humidity readings, displaying this on a 1602 LCD, along with the time.

For some reason there are occasions when the sensor program crashes, and this has only occurred since utilising the screen command, with multiple instances. The screens run fine and can be detached, renamed, and re-attached, and issues do not occur until I list screens, at which point the sensor program encounters an error - however, the webcam program seems to continue running.

The specific error code is:

TypeError: float() argument must be a string or a number, not 'NoneType'

I assume this error occurs when the sensor (DHT22) has not picked up a successful reading, thus cannot modify the null data. However, I do not understand why this error only occurs when using the screen and list command?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source