use gsm_cmd_wait instead of the direct serialport access, though that was not the problem here...
handle the locks as in gsm.c, I have some issue with the GSM serial port sleep mode here as well...
set the interval if GPS is ready to use