How get the raw binary stream from a fiber ? Assuming we have a SFP (ethernet, FC, GPON, other), this transceiver is not protocol independant, and will treat and interpret the binary stream received following the protocol design it implement, then transmit the binary flow corrected and treated to the upper layers. Do a classical transceiver could get and display the raw binary stream received ? (I doubt about this) In this case, how can we get the binary stream of an optical fiber ?
The optical signal is a binary stream. I assume you mean to diagnose the equivalent electrical signal.
SFP transceivers are ignorant to the actual L1 protocol in use. Their main job is to convert an electrical signal (e.g. 1000BASE-X) to an optical signal (1000BASE-SX) and vice versa. You could use the TD+/- and RD+/- pins to extract the raw, differential signals (see INF-8074i at snia.org for details). Those signals are still PCS and PMA encoded.
If you're trying to run a transceiver in stand-alone mode, without a suitable device slot, you'll need to make sure that the protocol is initialized correctly which may not be trivial (in addition to the xcvr initialization, obviously). In a PON environment you must make sure that the transmitter side is only active in its allocated time slot.