connect and send commands