On-chip spectroscopy of the 4π periodic Josephson effect in InAs nanowires