Dear Lex,
Thanks for your answer, I did not try your solution yet... because I rewrote what I needed... :)
As I did not understand why I was loosing the COM port, I read all your code and I wrote an API that is slightly different from yours. Let me explain this :)
My main constraint is to drive several FED3 for an experiment where mice can go in different locations. So the logic is moved from the individual FED3 to a python program that manages all the FEDs and other third-party devices. Therefore all the FEDs are always connected in USB.
By reading your API, I saw that you are using "blocking logic" (that is very cool and very stable for most cases as you are not in concurrent state) such as when an animal is nose poking in a hole, then the system is waiting thanks to a "while" block and waits for this poke to stop. But as we have several animals, I wanted non-blocking logic to be able to monitor what is happening in the other hole at the same time. So I removed all the "while" to continuously monitor the device (so I rewrote a minimal API for that:).
I also added a very simple layer to control and receive data from the COM port.
I found a very little bug if you perform a nose poke while the system is trying to feed, then for the next try, the system may only perform one sector-turn of the motor, and if no pellet is delivered, it just does not deliver. I will try to give you the exact pattern to reproduce it.
I added an event "pellet picked by animal" that I did not find in the original API but I am pretty sure it exists somewhere :)
thanks ***A LOT*** for your device ! This is a super-great beast, I have it in my backpack and I keep telling to people I met how great this is ! You should see more orders placed soon :) And I did not advertise yet the live mouse tracker community with it until the system is not 100% done, but I am sure this will be a success !
Best
Fabrice