Code structure: setup { set sotfware serial with GSM set hardware serial with GPS set button interrupt } loop { listen for sms commands setting emergency number } on_activation { enable recording pin loop (arbitrary time) { get gps coordinates send with sms } } # Todo Test button interrupt sending message Test GPS fix Test GPS fix on button interrupt Combine both