Support MA5671A SFP GPON

Dear friends. Thanks for the topic.
The module is good. It has a lot of possibilities and keeps the temperature low. I've struggled a lot to run it with my internet provider. The password, GPON serial number and MAC are encoded using base64 and stored into sfp_a2_info variable. "@" is used as a new line delimiter "\n"

PART 1. BACKUP
Before you start, save your crucial data to backup files.
root@SFP:~# fw_printenv

Save mtd1 partition
user@ubuntu:~$ nc -l -p 1234 > mtd1.bin (listen on the linux PC, port 1234@ 192.168.1.11)
root@SFP:~# cat /dev/mtd1 | nc 192.168.1.11 1234 (execute on MA5671A)

PART 2. PREPARATIONS
Existing data of my module.
Serial Number = HWTC11223344
gpon Password = 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
MAC = 48:57:02:da:be:ef

I will be changing to:
Serial Number = ZTEG87654321
gpon Password = 0xde 0xad 0x11 0x22 0x33 0x44 0x55 0x66 0xbe 0xef
MAC = 49:f2:02:33:7f:11
root@SFP:~# fw_printenv sfp_a2_info

sfp_a2_info=begin-base64 644 sfp_a2_info @XwDOAFoA0wCMoHUwiLh5GK/IAACIuAAAm4Ii0HuGK9QJzwANB8sAEAAAAAAA@AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/gAAAAAAAAAEAAAABAAAAAQAAAAEA@AAAAAABMIzZ9gwxeAAEAAf////8CAAFA//8BQAAAcAAAAAAAEGD/////////@////////////MDMwMzJDVVcAAAAAAAD+GP//////////////////////////@//////////8AAhQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA@AAAAAAAAAAJIV1RDESIzRP///////////////////wAAAAAAAAAAAAAAAAAA@AAAAAAAAAAAAAAAAAAAAAAAAhCXp6S3bWnEE46bzNVgwCzEoIM19H2ZIJqDn@C97inzKY4ssTj9LUDzY4tOppNIJ4I1ZuuUWBOqfOL6dRnac7HCvCAAAAAAAA@AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAASFcC2r7vAAAAAAAAAAAAAAAAAAAA@AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA@AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA@AAAAAAAAAAAAAAAAAAAAAAAAD/0P/gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA@AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA@AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA@AAAAAAAAAAAAAA==@====@

To display sfp_a2_info in friendly format

root@SFP:/tmp# fw_printenv sfp_a2_info | sed "s/^sfp_a2_info=//" | tr '@' '\n'

begin-base64 644 sfp_a2_info 
XwDOAFoA0wCMoHUwiLh5GK/IAACIuAAAm4Ii0HuGK9QJzwANB8sAEAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/gAAAAAAAAAEAAAABAAAAAQAAAAEA
AAAAAABMIzZ9gwxeAAEAAf////8CAAFA//8BQAAAcAAAAAAAEGD/////////
////////////MDMwMzJDVVcAAAAAAAD+GP//////////////////////////
//////////8AAhQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAJIV1RDESIzRP///////////////////wAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAhCXp6S3bWnEE46bzNVgwCzEoIM19H2ZIJqDn
C97inzKY4ssTj9LUDzY4tOppNIJ4I1ZuuUWBOqfOL6dRnac7HCvCAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAASFcC2r7vAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAD/0P/gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAA==
====

PART 3. MODIFICATIONS

Transfer sfp_a2_info into temporary file
root@SFP:~# fw_printenv sfp_a2_info | sed "s/^sfp_a2_info=//" > /tmp/sfp_a2.txt

Example of changing serial number (6th line) using online decoder
AAAAAAAAAAJIV1RDESIzRP///////////////////wAAAAAAAAAAAAAAAAAA
https://base64.guru/converter/decode/hex
00000000000000024857544311223344ffffffffffffffffffffffffffffff0000000000000000000000000000

change SN to ZTEG87654321 5a54454787654321
00000000000000025a54454787654321ffffffffffffffffffffffffffffff0000000000000000000000000000
https://base64.guru/converter/encode/hex
AAAAAAAAAAJaVEVHh2VDIf///////////////////wAAAAAAAAAAAAAAAAAA

replace the modified line number 6 using vi editor
root@SFP:~# vi /tmp/sfp_a2.txt

repeat these steps for password(line 5)
//////////8AAhQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
ffffffffffffffff0002140000000000000000000000000000000000000000000000000000000000000000000
ffffffffffffffff000214dead112233445566beef000000000000000000000000000000000000000000000000
//////////8AAhTerREiM0RVZr7vAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA

and MAC address(line 9)
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAASFcC2r7vAAAAAAAAAAAAAAAAAAAA
000000000000000000000000000000000000000000000000485702dabeef000000000000000000000000000000
00000000000000000000000000000000000000000000000049F202337F11000000000000000000000000000000
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAASfICM38RAAAAAAAAAAAAAAAAAAAA

Transfer modified sfp_a2.txt file back into variable sfp_a2_info
root@SFP:~# fw_setenv sfp_a2_info `cat /tmp/sfp_a2.txt`

PART 4. REVIEW AND TESTING
After reboot I check for new variables
root@SFP:~# fw_printenv sfp_a2_info

sfp_a2_info=begin-base64 644 sfp_a2_info @XwDOAFoA0wCMoHUwiLh5GK/IAACIuAAAm4Ii0HuGK9QJzwANB8sAEAAAAAAA@AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/gAAAAAAAAAEAAAABAAAAAQAAAAEA@AAAAAABMIzZ9gwxeAAEAAf////8CAAFA//8BQAAAcAAAAAAAEGD/////////@////////////MDMwMzJDVVcAAAAAAAD+GP//////////////////////////@//////////8AAhTerREiM0RVZr7vAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA@AAAAAAAAAAJaVEVHh2VDIf///////////////////wAAAAAAAAAAAAAAAAAA@AAAAAAAAAAAAAAAAAAAAAAAAhCXp6S3bWnEE46bzNVgwCzEoIM19H2ZIJqDn@C97inzKY4ssTj9LUDzY4tOppNIJ4I1ZuuUWBOqfOL6dRnac7HCvCAAAAAAAA@AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAASfICM38RAAAAAAAAAAAAAAAAAAAA@AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA@AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA@AAAAAAAAAAAAAAAAAAAAAAAAD/0P/gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA@AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA@AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA@AAAAAAAAAAAAAA==@====@

root@SFP:~# fw_printenv nPassword
nPassword=0xde 0xad 0x11 0x22 0x33 0x44 0x55 0x66 0xbe 0xef
root@SFP:~# fw_printenv gSerial
gSerial=ZTEG87654321
root@SFP:~# fw_printenv ethaddr
ethaddr=49:f2:02:33:7f:11

check registration status for O5 (successful)
root@SFP:~# onu ploamsg
errorcode=0 curr_state=5 previous_state=4 elapsed_msec=243880
root@SFP:~#

5 Likes