"RuntimeError: Could not change volumes" when listing dir on USB drive

Good day,

I’ve got an X4 setup to receive all the information of the XBee nodes; this process then spools the data onto a USB drive. Because of the limited memory of the device, I only keep the data that was sent in corresponding timeslots together, files never exceed 200KB.

Another process runs a python webserver (BaseHTTPServer.HTTPServer); this can list the contents of the USB drive, and makes it able to download them through a web browser.

Now, I’ve made the webserver multithreaded by also inheriting ThreadingMixIn to it, but then the problems started:

Sometimes, a directory seems to get ‘locked’ and the os.listdir() function will return a “RuntimeError: Could not change volumes”. Tried googling it, after finding nothing about it in the documentation, but to no avail!

Who can suggest me the reason why this error keeps popping up, locking up my directories? It’s becoming a PITA for me.

Thanks in advance!

Hi,

This seems something, that Digi Technical Support can answer. By the way, I hope if you upgrade the firmware version on you CPX4 and upgrade the python.zip to latest release from the Digi Website, then your problem should be resolved.

Other thing, for using threading, there are tips given on Python wiki at the URL : www.digi.com/wiki/developer. That also need to be taken care while using threading.