Leonardo upload fix

Reset leonardo and wait for the connection
to be established.