Thanks, after your suggestion I was able to use also the shoot_full function that is much better for my project (the shoot i seems bugged in chdkptp.py when the time is longer than 30 seconds on the M10).
I attach here the first version of the code I wrote for astrophotography.
It contains the control of the camera, the control of a motor with GPIO (on a Pine64, it should work also on Raspberry PI if the gpios numbers are modified) that I use for the focuser and the integration with astrometry.net to solve the image, extract the coordinates and send them to a mount that uses the MEADE protocol.
The code is not easily reusable (it is strongly adapted to my needs and I didn't put a decent error handling) but I am available to help someone else if he/she wants to run it.