Serial communication via optocouplers

After trying at least 25 different combinations of resistors i finally got it to work using the following setup: