Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ubiquiti airFiber Parser #329

Conversation

gt732
Copy link
Contributor

@gt732 gt732 commented Jul 31, 2023

  • Added parser for ubiquiti airFiber/airmax radios
  • Compliance Tests
  • Parser Tests

@itdependsnetworks
Copy link
Contributor

I think the only thing to consider is the name of the OS.

@gt732
Copy link
Contributor Author

gt732 commented Aug 1, 2023

I think the only thing to consider is the name of the OS.

@itdependsnetworks I updated the parser to be the OS of the device "airos". Let me know if you need me to update anything else. Thanks for reviewing!!

@jeffkala
Copy link
Collaborator

jeffkala commented Aug 2, 2023

@gt732 is the airfiber not running unifiOS? Just curious if this same parser would work for the whole Ubiquiti family that run unifiOS

@gt732
Copy link
Contributor Author

gt732 commented Aug 2, 2023

@gt732 is the airfiber not running unifiOS? Just curious if this same parser would work for the whole Ubiquiti family that run unifiOS

@jeffkala I don't have any other ubiquiti devices with me so I can't confirm. I work for a WISP so mostly long distance wireless radios. The airfiber/airmax radios from ubiquiti use a OS called "airOS". The configs for these devices are pretty basic flat files.

@jeffkala
Copy link
Collaborator

jeffkala commented Aug 3, 2023

Does appear that the airfiber os config file is slightly different then the standard unifi OS config properties. I'd say in general I'm good with the os name now. Will review the rest of the PR.

config_lines = []
config = self.config.strip()
for line in config.splitlines():
if line and line != "##" and not self.is_comment(line):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't any number of # a comment line?

Comment on lines 5 to 42
ConfigLine(config_line="#board.sysid=0xaf01", parents=()),
ConfigLine(config_line="#board.cpurevision=0x4e840102", parents=()),
ConfigLine(config_line="#board.name=airFiber 24G", parents=()),
ConfigLine(config_line="#board.shortname=AF24", parents=()),
ConfigLine(config_line="#board.subtype=", parents=()),
ConfigLine(config_line="#board.netmodes=16;", parents=()),
ConfigLine(config_line="#board.hwaddr=802AA8CF8DB6", parents=()),
ConfigLine(config_line="#board.reboot=130", parents=()),
ConfigLine(config_line="#board.upgrade=330", parents=()),
ConfigLine(config_line="#board.phycount=1", parents=()),
ConfigLine(config_line="#board.phy.1.maxmtu=1500", parents=()),
ConfigLine(config_line="#board.gps=1", parents=()),
ConfigLine(config_line="#board.airfiber=1", parents=()),
ConfigLine(config_line="#board.portnumber=1", parents=()),
ConfigLine(config_line="#board.fdd=1", parents=()),
ConfigLine(config_line="#feature.gps=1", parents=()),
ConfigLine(config_line="#feature.rssi.leds=0", parents=()),
ConfigLine(config_line="#feature.gps.leds=0", parents=()),
ConfigLine(config_line="#radio.1.name=", parents=()),
ConfigLine(config_line="#radio.1.shortname=", parents=()),
ConfigLine(config_line="#radio.1.bus=spi", parents=()),
ConfigLine(config_line="#radio.1.rf_revision=0x0000", parents=()),
ConfigLine(config_line="#radio.1.subsystemid=0xaf01", parents=()),
ConfigLine(config_line="#radio.1.subvendorid=0x0777", parents=()),
ConfigLine(config_line="#radio.1.txpower.max=43", parents=()),
ConfigLine(config_line="#radio.1.txpower.offset=0", parents=()),
ConfigLine(config_line="#radio.1.antennas=1", parents=()),
ConfigLine(config_line="#radio.1.def_antenna=4", parents=()),
ConfigLine(config_line="#radio.1.antenna.1.id=4", parents=()),
ConfigLine(config_line="#radio.1.antenna.1.name=Combined", parents=()),
ConfigLine(config_line="#radio.1.antenna.1.gain=0", parents=()),
ConfigLine(config_line="#radio.1.ccode=840", parents=()),
ConfigLine(config_line="#radio.1.ccode.fixed=0", parents=()),
ConfigLine(config_line="#radio.1.ccode.locked=1", parents=()),
ConfigLine(config_line="#radio.1.ptp_only=1", parents=()),
ConfigLine(config_line="#radio.1.ptp_sta=1", parents=()),
ConfigLine(config_line="#radio.1.chanbw=100", parents=()),
ConfigLine(config_line="#deac9d0212791db5ede667c016876ba4", parents=()),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In similar concept to my previous comment, I wouldn't want these in ConfigLine as to me I believe these configs are not applied. I'd expect any line starting with a # is a comment line, whether there is 1,2,or 3 of them. Is this not the case?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gt732 thoughts?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jeffkala Sorry for the late reply! Yes correct, I updated the parser to remove the "#" lines.
Thanks!

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@itdependsnetworks
Copy link
Contributor

@gt732 can you get tests working all the way through?

@gt732
Copy link
Contributor Author

gt732 commented Sep 1, 2023

@itdependsnetworks hey! the black issue should be fixed now.

@itdependsnetworks itdependsnetworks merged commit 48c597c into networktocode:develop Sep 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants