It seems as though the USB ports are assigned differently if the XBee is unplugged, or the PI is rebooted. In the serial module, we must specifiy exactly the port being used, in this fashion: "/dev/ttyUSB#", and # seems to change from 1 to 0 and back to 1 depending on if the pi is rebooted or the XBee is unplugged. A possible fix is to use setserial module ($ sudo apt install setserial) to test to see which is plugged in. Needs to be fixed so code doesnt change every time we run the logger. relevant article: https://www.cyberciti.biz/faq/find-out-linux-serial-ports-with-setserial/
It seems as though the USB ports are assigned differently if the XBee is unplugged, or the PI is rebooted. In the serial module, we must specifiy exactly the port being used, in this fashion: "/dev/ttyUSB#", and # seems to change from 1 to 0 and back to 1 depending on if the pi is rebooted or the XBee is unplugged. A possible fix is to use setserial module ($ sudo apt install setserial) to test to see which is plugged in. Needs to be fixed so code doesnt change every time we run the logger. relevant article: https://www.cyberciti.biz/faq/find-out-linux-serial-ports-with-setserial/