Support MA5671A SFP GPON

When I revisited the old posts yesterday, I saw the post about the OMCI protocol
Does anyone know how to intercept "raw" OMCI messages on MA5671A to get something like this?
After processing, ONT-OLT flow of messages could be conveniently displayed in the Wireshark.

OMCI_TX#   5@   1m: 5s: 831ms-85 A6 29 0A 00 07 00 01 00 F0 00 33 46 45 34 36 33 39 38 41 46 47 42 38 39 01 01 01 00 00 00 00 00 00 00 00 00 00 00 00 
OMCI_RX#   6@   1m: 5s: 847ms-85 A7 49 0A 01 75 00 00 00 04 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 28 EF 84 B2 52
OMCI_TX#   6@   1m: 5s: 877ms-85 A7 29 0A 01 75 00 00 04 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
OMCI_RX#   7@   1m: 5s: 882ms-85 A8 49 0A 01 00 00 00 80 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 28 46 B9 33 2D
OMCI_TX#   7@   1m: 5s: 951ms-85 A8 29 0A 01 00 00 00 00 80 00 48 57 54 43 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
OMCI_RX#   8@   1m: 5s: 962ms-85 A9 49 0A 01 5E 00 00 02 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 28 93 C0 F0 3A

I tried many options, I started by changing one line in the /etc/init.d/omcid.sh script. I made couple mistakes in my first attempts. The module stopped responding. Keep the backups and have the break-out board ready to revive the module.

${OMCID_BIN} -d1 -p$mib_file -o$omcc_version -i$omci_iop_mask ${lct} -l /tmp/omci.log > /dev/console 2> /dev/console &

root@SFP:/tmp/log# omcid -h
OMCI daemon v7.5.1 (compiled on Oct 25 2016 17:15:59)
Usage: omcid [options]

Options:
-l, --log                            Specify log file
-o, --omcc                           Select OMCC version
-p, --config-path                    Specify custom config path
-c, --console                        Start console
-t, --trace-ioctl                    Trace onu driver ioctls
-d, --debug_level <number>           Default debug level for all modules
                                     (0 - max level .. 4 - no output)
-i, --iop-mask                       IOP option mask
-g, --lct-port                       Specify UNI index to be used as local debug port (1..4)
-m, --model                          Specify ONU layout model
-h, --help                           Print help (this message) and exit
-v, --version                        Print version information and exit

I tried with two levels of debugging.

d0 - after one minute, it created a 2.7MB file

[omcid] 22:53:40 CORE  MSG: IN  - timeout_init(0xbba0c8)
[omcid] 22:53:40 CORE  MSG: IN  - list_init(0xbba71c, 28)
[omcid] 22:53:40 CORE  MSG: Lock init 0xbba728
[omcid] 22:53:40 CORE  MSG: OUT - list_init(0)
[omcid] 22:53:40 CORE  MSG: OUT - timeout_init(0)
[omcid] 22:53:40 CORE  MSG: IN  - timeout_thread_main(0xbba7f8)
[omcid] 22:53:40 CORE  MSG: TimeoutThread (tid 1056)
[omcid] 22:53:40 CORE  MSG: Timeout - Waiting for timeout event...
[omcid] 22:53:42 MIB   MSG: IN  - mib_create(0xbba0c8)
[omcid] 22:53:42 MIB   PRN: Classes correctness check...
[omcid] Reading MIB configuration from '/etc/mibs/data_1g_8q.ini'...
[omcid] 22:53:43 ME    MSG: IN  - omci_me_is_supported(0xbba0c8, 256)
[omcid] 22:53:43 ME    MSG: OUT - omci_me_is_supported(0)
[omcid] 22:53:43 ME    MSG: IN  - omci_me_attr_version_get(0xbba0c8, 256, 1, 0x7fc1e3b0)
[omcid] 22:53:43 ME    MSG: OUT - omci_me_attr_version_get(0)
[omcid] 22:53:43 ME    MSG: IN  - omci_me_attr_size_get(0xbba0c8, 256, 1, 0x7fc1e3bc)
[omcid] 22:53:43 ME    MSG: OUT - omci_me_attr_size_get(0)
[omcid] 22:53:43 ME    MSG: IN  - omci_me_attr_offset_get(0xbba0c8, 256, 1, 0x7fc1e3b8)
[omcid] 22:53:43 ME    MSG: OUT - omci_me_attr_offset_get(0)
[omcid] 22:53:43 ME    MSG: IN  - omci_me_attr_type_get(0xbba0c8, 256, 1, 0x7fc1e3b4)


d1- looks more relevant to our needs and the file after a minute is about 210kB

[omcid] 23:09:15 MIB PRN: Classes correctness check...
[omcid] Reading MIB configuration from '/etc/mibs/data_1g_8q.ini'...
[omcid] 23:09:15 MIB PRN: Create "ONU-G" (256) with instance id = 0
[omcid] 23:09:15 CORE PRN: 256@0 set Vendor id = 48 57 54 43 "HWTC"
[omcid] 23:09:15 CORE PRN: 256@0 set Version = 43 43 34 2e 41 00 00 00 00 00 00 00 00 00 "CC4.A\00\00\00\00\00\00\00\00\00"
[omcid] 23:09:15 CORE PRN: 256@0 set Traffic management opt = 0x02 (2)
[omcid] 23:09:15 CORE PRN: 256@0 set VP/VC cc function option = 0x00 (0)
[omcid] 23:09:15 CORE PRN: 256@0 set Battery backup = 0x00 (0)
[omcid] 23:09:15 CORE PRN: 256@0 set Administrative state = 0x00 (0)
[omcid] 23:09:15 CORE PRN: 256@0 set Operational state = 0x00 (0)
[omcid] 23:09:15 CORE PRN: 256@0 set ONU survival time = 0x00 (0)
[omcid] 23:09:15 MIB PRN: Create "ONU2-G" (257) with instance id = 0
[omcid] 23:09:15 CORE PRN: 257@0 set Equipment id = 4d 41 35 36 37 31 41 2d 47 31 00 00 00 00 00 00 00 00 00 00 "MA5671A-G1\00\00\00\00\00\00\00\00\00\00"
[omcid] 23:09:15 CORE PRN: 257@0 set Vendor product code = 0x00cc (204)
[omcid] 23:09:15 CORE PRN: 257@0 set Security capability = 0x01 (1)
[omcid] 23:09:15 CORE PRN: 257@0 set Security mode = 0x01 (1)
[omcid] 23:09:15 CORE PRN: 257@0 set Total priority queue num = 0x0040 (64)
[omcid] 23:09:15 CORE PRN: 257@0 set Total traffic scheduler = 0x40 (64)
[omcid] 23:09:15 CORE PRN: 257@0 set Mode = 0x01 (1)
[omcid] 23:09:15 CORE PRN: 257@0 set Total GEM port-ID number = 0x0040 (64)
[omcid] 23:09:15 CORE PRN: 257@0 set Connectivity capability = 0x007f (127)
[omcid] 23:09:15 CORE PRN: 257@0 set Current connect. mode = 0x00 (0)
[omcid] 23:09:15 CORE PRN: 257@0 set QoS configuration flex = 0x0018 (24)
[omcid] 23:09:15 CORE PRN: 257@0 set Prio queue scale factor = 0x0030 (48)
[omcid] 23:09:15 MIB PRN: Create "ONU data" (2) with instance id = 0
[omcid] 23:09:15 CORE PRN: 2@0 set MIB data sync = 0x00 (0)
[omcid] 23:09:15 MIB PRN: Create "ONU dyn pwr mngmt ctrl" (336) with instance id = 0
[omcid] 23:09:15 CORE PRN: 336@0 set Pwr reduction mngmt cap = 0x03 (3)
[omcid] 23:09:15 MIB PRN: Create "Software image" (7) with instance id = 0
[omcid] 23:09:15 CORE PRN: 7@0 set Version = 56 38 52 30 31 37 43 30 30 53 32 30 31 00 "V8R017C00S201\00"
[omcid] 23:09:15 CORE PRN: 7@0 set Is committed = 0x01 (1)
[omcid] 23:09:15 CORE PRN: 7@0 set Is active = 0x01 (1)
[omcid] 23:09:15 CORE PRN: 7@0 set Is valid = 0x01 (1)



omcid -c, --console
CLI management interface
Enter 'help' for a list of built-in commands.
#[0]>help
== Group: <CLI commands (misc)> ===
   aas,           attr_avc_send
   ac,            attr_change
   acoff,         ac_power_off
   acon,          ac_power_on
   almd,          al_mapper_dump
   asnr,          alarm_seq_num_reset
   atg,           action_timeout_get
   ats,           action_timeout_set
   cda,           class_dump_all
   cdx,           class_dump_xml
   cg,            class_get
   cpg,           class_prop_get
   dlg,           dbg_level_get
   dls,           dbg_level_set
   dmlg,          dbg_module_level_get
   dmls,          dbg_module_level_set
   fe,            failsafe_enable
   ie,            interval_end
   img,           iop_mask_get
   ims,           iop_mask_set
   md,            mib_dump
   mda,           mib_dump_all
   mdx,           mib_dump_xml
   meadg,         managed_entity_attr_data_get
   meads,         managed_entity_attr_data_set
   meag,          managed_entity_alarm_get
   meaog,         managed_entity_attr_offset_get
   meapg,         managed_entity_attr_prop_get
   meas,          managed_entity_alarm_set
   measg,         managed_entity_attr_size_get
   meatg,         managed_entity_attr_type_get
   meavg,         managed_entity_attr_version_get
   mec,           managed_entity_create
   mecg,          managed_entity_count_get
   med,           managed_entity_delete
   meg,           managed_entity_get
   meis,          managed_entity_is_supported
   mng,           msg_num_get
   mps,           msg_pool_size
   mr,            mib_reset
   omcivg,        omci_current_version_get
   pe,            processing_enable
   rmr,           raw_message_recv
   rms,           raw_message_send
   swiu,          sw_image_upgrade
   vig,           version_information_get
== Group: <CLI built-in commands> ===
   help,          Help
   quit,          Quit
   what,          what_string
#[0]>