I tried all the possible mavros commands to switch to offboard mode but I'm getting a timeout always. I'm also publishing setpoints in the mavros/setpoint_position/local topic every half a second, but I'm still getting a timeout.
Can you post any other commands or code which would switch to offboard mode without using the RC switch??