Yeah, I finally remembered to make a post about this. I know it will like as a copy-paste of the previous one, because, in fact it is.
Ok, if you have been following the series, you should already know that I equally love and hate UFiber OLTs. They are affordable, deliver a lot of bang for the buck, and have an awful GUI.
Well, the GUI is lovely on v4.
Python in the middle
I wrote a quick and dirty client which acts as a sort of middleware between the HTTP inteface of the OLT and you.
It allows to provision non existing ONUs, GPON profiles, WiFi profiles, retrieve active ONU status and general configuration.
Take a look to it on https://github.com/baldoarturo/ufiber-client-4, and feel free to contribute if you want to.
How to help
It would be awesome to have docs 😀
Are you a pydoc master? Let’a add docstrings.
Do you have an OLT for me to test? Ping me and we can set up a VPN.
olt.py
This is the core of the project. It uses the OLTClient class to provide a middleware between you and the HTTP interface of the OLT.
Initialize a new OLTClient instance with:
client = OLTClient(host='192.168.1.1', username='ubnt', password='ubnt', debug_level=logging.DEBUG)
Required params are only host, and credentials.
The initialization will handle the login for you, altough you can call the login()
method manually.
If the OLT is network reachable, and you have provided the right credentials, and the OLT GUI is alive and well, you should be ready to start.
What changes on v4
Well, UBNT got rid of the GPON profiles. 🙁
This software is intented to give you an alternative by keeping profiles as JSON in the ./profiles folder.
You can copy the template.json
file and make your way using it as a starting point. It should be self descriptive.
There is an schema.json
which validates your profile before pushing changes into the OLT.
2 replies on “UFiber v4 Python Client”
Hi Arturo
Great new !
I was waiting since last year to give a try.
Thanks
Demian
PD. I tried to login with google, and give an error saying “Error: Google failed to return an expected code.” when I click post. (tried twice).
Give it a try and let me know!
I made v3 way easier btw, I just havent updated the post