That 10k resistor in the line to the LED of the first optocoupler ensures it won't light up properly if at all. Reduce that to something that provides 10-15 mA to that LED. Check data sheet for forward voltage, after that calculation of resistor value is like a regular LED.