M119 shows always triggered on optical endstops after initial homing

I have a Cerberus delta printer and I’m switching to a Smoothieboard. I’m using Sainsmart optical endstops that were working perfectly on an Azteeg X3. On the Smoothieboard, when I first power up the endstops behave as I would expect. That is, with the carriages no near the endstops, M119 show all three not triggered. If I manually move the carriages up to endstops, M119 shows triggered. If I manually move the carriages away, M119 shows not trigger again. If I home the printer, the carriages move as expected (up to endstops, stop, retract) but then M119 shows the endstops triggered even though they are not. These endstops have an LED showing triggered or not and I can see the LED turning off and on when manually trigger. It’s just that M119 shows always triggered after I home the first time. If I power cycle the board, M119 shows the proper state of the endstops until I do that first G28, the M119 shows everything triggered again and continues to do so until I power cycle.

What’s happening here? It doesn’t seem like a wiring issue since it works as expected before that first G28.

Imported from wikidot

I would still verify the wiring by measuring the voltage on the green signal wires when triggered and not.