I've created a python3 script that runs fine on command line but when I try to run as a daemon in MacosX gives error 'EOFError: EOF when reading a line'. Basically code is as follows:
(...)
def main():
# Connect
port, speed = connect_port()
device = XBeeDevice(port, speed)
try:
device.open()
# print("Waiting for data...\n")
(...)
device.add_packet_received_callback(packet_received_callback)
input()
finally:
if device is not None and device.is_open():
device.close()
if __name__ == '__main__':
main()
plist seems to be fine as script starts and runs once before to give error:
Traceback (most recent call last):
File "/maslestorres.cat/jardiNet_datalogger.py", line 214, in <module>
main()
File "/maslestorres.cat/jardiNet_datalogger.py", line 206, in main
input()
EOFError: EOF when reading a line
So basically I don't know how to adapt the input() line to allow to run as a daemon. Python is version 3.7.2 and MacOSX is 10.8.5.