Hi,
great project, many thanks. I was working on this a while ago also with the rocrail community, but never got that far.
Have you considered RFID Sensors?
RFID reader on the train, RFID tags on the track, unique IDs to identify the sensor by rocrail.
In case that works relaible, this would improve deployment, since the RIFD tags on the tracks do not need any cabling.
Lothar