Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
b603948
power mode flag
loulecrivain Jun 3, 2026
e917040
new architecture skel
loulecrivain Jun 4, 2026
f16b0f5
implement module management compat check
loulecrivain Jun 9, 2026
bae9d46
implement sff8636 basic admin info get
loulecrivain Jun 9, 2026
83d638d
switch over to new arch for show command (wip)
loulecrivain Jun 9, 2026
50b148f
implement rest of relevant lower mem queries
loulecrivain Jun 9, 2026
efd7d3a
implement protocol extension arch
loulecrivain Jun 10, 2026
20761f5
delete tunable laser ctrl and status
loulecrivain Jun 11, 2026
a0c863c
refactor GetPageBin and WritePageBin for protocol support
loulecrivain Jun 11, 2026
c56e03c
add flexoptix custom pages (wip)
loulecrivain Jun 11, 2026
1ffdd3d
switch to pointer receiver
loulecrivain Jun 11, 2026
3c38074
rename WritePageBin to WritePageByteBin
loulecrivain Jun 17, 2026
a599e2e
add diff iterator + WritePageBin method for writing whole pages
loulecrivain Jun 17, 2026
ce20677
flexoptix custom pages (wip)
loulecrivain Jun 17, 2026
2eb2cc9
use subcommands for show and make everything an option
loulecrivain Jun 17, 2026
c17fdc4
re-implement grid programming for flexoptix modules
loulecrivain Jun 18, 2026
b565ec6
cmis implementation wip
loulecrivain Jun 22, 2026
d87c7b8
change banks from array to slices
loulecrivain Jun 23, 2026
054e9e1
fix wrong offset in u32 parsing + clearer names for 12h fields
loulecrivain Jun 23, 2026
fe3cf71
delete unused files
loulecrivain Jun 24, 2026
c45d475
add general documentation
loulecrivain Jun 24, 2026
a0f0a63
fix binary functions and add tests
loulecrivain Jun 24, 2026
922182d
fix cmis implem and improvements
loulecrivain Jun 24, 2026
1fedb1c
renaming
loulecrivain Jun 24, 2026
6b2d720
delete unused files
loulecrivain Jun 24, 2026
56f72a1
move things around
loulecrivain Jun 24, 2026
7b6c3c4
remove unneeded arguments
loulecrivain Jun 24, 2026
eb63d9b
add reset and low power commands
loulecrivain Jun 25, 2026
aa815a8
fix binary logic bug
loulecrivain Jun 25, 2026
fff303d
fix missing admin ctrl bit clears
loulecrivain Jun 25, 2026
d99ff75
move to subcommand
loulecrivain Jun 25, 2026
58954c7
documentation
loulecrivain Jun 25, 2026
14e34af
restructure directory/package layout
loulecrivain Jul 1, 2026
a1784a2
add build workflow
loulecrivain Jul 1, 2026
0708649
add test workflow
loulecrivain Jul 1, 2026
3b9adb8
re-implement high power override for sff8636
loulecrivain Jul 1, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: "build"
on:
push:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v6
with:
go-version-file: 'go.mod'
cache-dependency-path: 'go.sum'
- name: build cmd
run:
go build ./cmd/optic-programmer.go
- uses: actions/upload-artifact@v4
with:
name: optic-programmer
path: optic-programmer

15 changes: 15 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: "test"
on:
push:
pull_request:
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v6
with:
go-version-file: 'go.mod'
cache-dependency-path: 'go.sum'
- name: test internal
run: 'go test ./internal/...'
150 changes: 88 additions & 62 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
# rtbrick-optic-programmer

A project to programm Finisar DWDM optics plugged into an RtBrick device.
CMIS & SFF8636 optics programmer for rtbrick remote devices. Features a JSON output for machine parsing.

Tested with Finisar CMIS optics, Finisar SFF8636, FlexOptix SFF8636 C-band programmable.

You are expected to have already set up your ssh key on the device, password entry is currently not supported.

# Building

Expand All @@ -14,71 +17,94 @@ Set the `LOG_LEVEL` env var to "debug" to view i2c dumps as they are read.

# Usage

```shell
./optic-programmer show --user horst lrmd0001.infra.lab.wobcom.de ifp-0/0/2
2026/01/09 16:54:56 Running command=sudo i2cset -y 33 0x50 127 0
2026/01/09 16:54:56 Running command=sudo i2cdump -y 33 0x50 b
2026/01/09 16:54:57 Running command=sudo i2cset -y 33 0x50 127 0
2026/01/09 16:54:57 Running command=sudo i2cset -y 33 0x50 127 18
2026/01/09 16:54:57 Running command=sudo i2cdump -y 33 0x50 b
2026/01/09 16:54:58 Running command=sudo i2cset -y 33 0x50 127 0
2026/01/09 16:54:58 Running command=sudo i2cset -y 33 0x50 127 30
2026/01/09 16:54:58 Running command=sudo i2cdump -y 33 0x50 b
2026/01/09 16:54:59 Running command=sudo i2cset -y 33 0x50 127 0
2026/01/09 16:54:59 Running command=sudo i2cset -y 33 0x50 127 27
2026/01/09 16:54:59 Running command=sudo i2cdump -y 33 0x50 b
2026/01/09 16:55:00 Running command=sudo i2cset -y 33 0x50 127 0
2026/01/09 16:55:00 Vendor Name: FINISAR CORP.
2026/01/09 16:55:00 Vendor PN: FTLC3351R3PL1
2026/01/09 16:55:00 Vendor SN: 2511W1653
2026/01/09 16:55:00 Grid Spacing: 100
2026/01/09 16:55:00 Frequency Offset: -9
2026/01/09 16:55:00 Frequency: 192.2 THz
2026/01/09 16:55:00 Channel: 22
2026/01/09 16:55:00 Flex Tune Enabled: false
2026/01/09 16:55:00 Low Power Mode: false
2026/01/09 16:55:00 Nominal Wavelength Control Enabled: false
## Manual
```
NAME:
optic-programmer - in-field optical module programming for rtbrick

USAGE:
optic-programmer [global options] [command [command options]]

DESCRIPTION:
CMIS & SFF8636 optics programmer for rtbrick remote devices. Only works with RBFS,
uses SMBus & i2c utils to issue direct i2c commands to optical modules.

COMMANDS:
show show information about an optic in a specific device. show basic (failsafe) or show all.
reset WARNING, YOU MAY LOSE CONFIG!!!! request module software reset
set, s sets parameter
set low-power toggle low power mode on/off
set dwdmgrid sets dwdm grid mode and channel
help, h Shows a list of commands or help for one command

GLOBAL OPTIONS:
--user string [$USER]
--device string [$DEVICE]
--interface string [$INTERFACE]
--help, -h show help

COPYRIGHT:
WDZ GmbH 2026
```
## Examples

### Showing basic information
Show basic only shows standard protocol information. Manufacturer protocol extensions are not used with
this command. You can get a detailed output, including protocol and manufacturer extensions,
using the command `show all`.

```shell
./optic-programmer program --user jwagner lrma0002.infra.lab.wobcom.de ifp-0/0/2 --grid-spacing=100 --channel=22
2026/01/09 16:53:22 Running command=sudo i2cset -y 11 0x50 127 0
2026/01/09 16:53:22 Running command=sudo i2cdump -y 11 0x50 b
2026/01/09 16:53:23 Running command=sudo i2cset -y 11 0x50 127 0
2026/01/09 16:53:23 Running command=sudo i2cset -y 11 0x50 127 18
2026/01/09 16:53:23 Running command=sudo i2cdump -y 11 0x50 b
2026/01/09 16:53:23 Running command=sudo i2cset -y 11 0x50 127 0
2026/01/09 16:53:24 Running command=sudo i2cset -y 11 0x50 127 30
2026/01/09 16:53:24 Running command=sudo i2cdump -y 11 0x50 b
2026/01/09 16:53:24 Running command=sudo i2cset -y 11 0x50 127 0
2026/01/09 16:53:24 Running command=sudo i2cset -y 11 0x50 127 27
2026/01/09 16:53:25 Running command=sudo i2cdump -y 11 0x50 b
2026/01/09 16:53:25 Running command=sudo i2cset -y 11 0x50 127 0
2026/01/09 16:53:25 Vendor Name: FINISAR CORP.
2026/01/09 16:53:25 Vendor PN: FTLC3351R3PL1
2026/01/09 16:53:25 Vendor SN: 2511W1695
2026/01/09 16:53:25 Setting Low Power Mode...
2026/01/09 16:53:25 Running command=sudo i2cset -y 11 0x50 127 0
2026/01/09 16:53:25 Running command=sudo i2cset -y 11 0x50 93 2
2026/01/09 16:53:26 Running command=sudo i2cset -y 11 0x50 127 0
2026/01/09 16:53:27 Flex Tune is already disabled...
2026/01/09 16:53:27 Grid Spacing is already programmed at 100 GHz, no programming needed...
2026/01/09 16:53:27 Channel must be programmed to 22, currently 37
2026/01/09 16:53:27 Running command=sudo i2cset -y 11 0x50 127 18
2026/01/09 16:53:27 Running command=sudo i2cset -y 11 0x50 137 247
2026/01/09 16:53:27 Running command=sudo i2cset -y 11 0x50 127 0
2026/01/09 16:53:27 Running command=sudo i2cset -y 11 0x50 127 18
2026/01/09 16:53:27 Running command=sudo i2cset -y 11 0x50 136 255
2026/01/09 16:53:27 Running command=sudo i2cset -y 11 0x50 127 0
2026/01/09 16:53:28 Setting Nominal Wavelength Control Programming...
2026/01/09 16:53:28 Running command=sudo i2cset -y 11 0x50 127 176
2026/01/09 16:53:28 Running command=sudo i2cset -y 11 0x50 129 1
2026/01/09 16:53:28 Running command=sudo i2cset -y 11 0x50 127 0
2026/01/09 16:53:29 Enabling High Power Mode...
2026/01/09 16:53:29 Running command=sudo i2cset -y 11 0x50 127 0
2026/01/09 16:53:30 Running command=sudo i2cset -y 11 0x50 93 4
2026/01/09 16:53:30 Running command=sudo i2cset -y 11 0x50 127 0
./optic-programmer --user llecrivain --device lrma0001.infra.lab.wobcom.de --interface ifp-0/0/2 show basic
{
"sff8636": {
"active": true,
"enable_high_power_class_8": false,
"enable_high_power_class_57": true,
"low_pwr_override": true
},
"management_protocol": "sff8636",
"sff_8024_identifier": 17,
"sff_8024_revision": 8,
"low_pwr_request_sw": false,
"software_reset": false,
"vendor_name": "FLEXOPTIX",
"vendor_part_number": "Q.16S1HG.14.O2D",
"vendor_part_revision": "Q.16S1HG.14.O2D",
"vendor_serial_number": "FQM0023"
}
```

### Programming the tunable laser

Lane and bank are optional, by default the tool will always select first bank, first lane or 1st lane (when
lanes are not banked). Be aware that not specifying grid spacing will reset it to default (100Ghz).

```shell
./optic-programmer --user llecrivain --device lrma0001.infra.lab.wobcom.de --interface ifp-0/0/0 set dwdmgrid \
--grid-spacing 50 --channel -20 --lane 1 --bank 1
module has processed command. check module status.
```

## Some jq examples for filtering output
### Checking tuning progress status for lane 0

Tuning complete flag will clear when being read.
```shell
./optic-programmer --user llecrivain --device lrma0001.infra.lab.wobcom.de --interface ifp-0/0/0 show all | \
jq "\
.cmis.tunable_laser.control_status[0] |
{
grid_spacing_tx: .grid_spacing_tx[0],
channel_number_tx: .channel_number_tx[0],
current_laser_frequency_mhz_tx: .current_laser_frequency_mhz_tx[0],
current_laser_frequency_mhz_tx: .current_laser_frequency_mhz_tx[0],
tuning_in_progress_tx: .tuning_in_progress_tx[0],
tuning_complete_flag_tx: .tuning_complete_flag_tx[0]
}"

```
### Only show CMIS tunable laser capabilities
```shell
./optic-programmer --user llecrivain --device lrma0001.infra.lab.wobcom.de --interface ifp-0/0/0 show all | \
jq ".cmis.tunable_laser.capabilities"
```
Loading
Loading