Skip to content

Commit 85d9e18

Browse files
XLTF7267-BHA+: Document how to change the PLOAM password (#212)
* Fix typo in the software version string * Add PLOAM password settings * Remove a wrong warning * Update max PLOAM length * Remove misleading warning * Update _ont_xgs/ont-hisense-ltf7267-bha+.md * Apply suggestions from code review * add nanomad js script * fix js * Add missing braces --------- Co-authored-by: Simone Bortolin <simonebortolin@users.noreply.github.com>
1 parent 514dbdc commit 85d9e18

2 files changed

Lines changed: 118 additions & 3 deletions

File tree

_ont_xgs/ont-hisense-ltf7267-bha+.md

Lines changed: 90 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,95 @@ INT CFG_ID_PON_VSSN = 0xAABBCCDD;
307307

308308
Reboot ONT to apply the change
309309

310+
## Setting ONU GPON PLOAM password
311+
312+
### Web procedure
313+
314+
<form id="hisense-ploam" novalidate>
315+
<div class="form-floating mb-3">
316+
<input type="text" class="form-control" placeholder="PLOAM in ASCII" name="ploam" id="ploam" required>
317+
<label for="ploam">PLOAM in ASCII</label>
318+
<div class="invalid-feedback">
319+
Please provide a valid PLOAM password.
320+
</div>
321+
</div>
322+
<div class="mb-3">
323+
<input type="submit" class="btn btn-primary" value="Encode!">
324+
</div>
325+
<div class="language-plaintext highlighter-rouge">
326+
<div class="highlight">
327+
<pre class="highlight" id="ploam-encoded">
328+
</pre>
329+
</div>
330+
</div>
331+
</form>
332+
333+
<script type="text/javascript" src="/assets/js/LTF7267-BHA-ploam.js"></script>
334+
<script type="text/javascript">
335+
var hisensePloamForm = document.getElementById('hisense-ploam');
336+
var hisenseResult = document.getElementById('ploam-encoded');
337+
hisensePloamForm.addEventListener('submit', (event) => {
338+
event.preventDefault();
339+
if (!hisensePloamForm.checkValidity()) {
340+
event.preventDefault();
341+
} else {
342+
const data = new URLSearchParams(new FormData(hisensePloamForm));
343+
hisenseResult.innerHTML = hisensePloam(data.get('ploam'));
344+
}
345+
});
346+
</script>
347+
348+
349+
### Normal procedure
350+
351+
This ONT seems to be supporting a PLOAM password up to 288 bits in lenghth (36 ASCII characters, 72 Hex digits).
352+
353+
The PLOAM password is stored into 32 bit chunks (4 ASCII characters / 8 Hex digits), each byte swapped.
354+
355+
So, starting from the following PLOAM in ASCII format
356+
357+
```
358+
A1B2C3D4E5
359+
```
360+
361+
It gets translated into the following HEX value:
362+
363+
```
364+
0x41314232433344344535
365+
```
366+
367+
Which is then split into the following blocks (the last block gets padded with 0 to reach 8 digits)
368+
369+
```
370+
BLOCK 0: 0x41314232
371+
BLOCK 1: 0x43334434
372+
BLOCK 2: 0x45350000
373+
```
374+
375+
Each block is then byte swapped (i.e. read each sequence of two digits from right to left)
376+
377+
```
378+
BLOCK 0: 0x32423141
379+
BLOCK 1: 0x34443343
380+
BLOCK 2: 0x00003545
381+
```
382+
383+
And then you can finally persist it by changing the configuration file
384+
385+
```sh
386+
# vi /config/scfg.txt
387+
```
388+
389+
Append lines below to the file and save it to change the PLOAM password
390+
391+
```
392+
INT CFG_ID_PON_REGISTRATION_ID0 = 0x32423141;
393+
INT CFG_ID_PON_REGISTRATION_ID1 = 0x34443343;
394+
INT CFG_ID_PON_REGISTRATION_ID2 = 0x00003545;
395+
```
396+
397+
Reboot the ONT to apply the change.
398+
310399

311400
## Setting ONU GPON LOID and LOID password
312401

@@ -330,7 +419,7 @@ Reboot ONT to apply the change
330419

331420
```sh
332421
# fw_setenv img_version0 20220527052622
333-
# fw_setenv img_version0 20220527052622
422+
# fw_setenv img_version1 20220527052622
334423
```
335424

336425
Reboot ONT to apply the change
@@ -381,8 +470,6 @@ Reboot ONT to apply the change
381470

382471
## Changing OMCC Version
383472

384-
{% include alert.html content="In Italy, if you are under some Huawei OLT it's mandatory to use 0xA3, while on Alcatel 0xB4, otherwise you will get O5 status but no MIBs - Note that this can be quirk of TIM Italy" alert="Warning" icon="svg-warning" color="red" %}
385-
386473

387474
```sh
388475
# vi /config/scfg.txt

assets/js/LTF7267-BHA-ploam.js

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
function hexEncode(str){
2+
var hex, i;
3+
4+
var result = "";
5+
for (i=0; i<str.length; i++) {
6+
hex = str.charCodeAt(i).toString(16);
7+
result += hex.padStart(2, "0");
8+
}
9+
10+
return result;
11+
}
12+
13+
function hisensePloam(ascii_ploam) {
14+
var hex_ploam = hexEncode(ascii_ploam);
15+
var hex_padded_ploam = hex_ploam.padEnd(72, "0");
16+
var array =[];
17+
for (i = 0; i<9; i++) {
18+
ploam_segment = hex_padded_ploam.slice(i*8, (i+1)*8);
19+
new_ploam_segment = "";
20+
for(j = 4; j>0; j--) {
21+
new_ploam_segment = new_ploam_segment + ploam_segment.slice((j-1)*2, j*2);
22+
}
23+
if(new_ploam_segment !== "00000000") {
24+
array.push("INT CFG_ID_PON_REGISTRATION_ID"+i+" = 0x"+new_ploam_segment+";");
25+
}
26+
}
27+
return array.join("\n");
28+
}

0 commit comments

Comments
 (0)