Reading gate positions with a smartphone