Omada portal client app
Hi, I’ve developed a client app that displays the remaining time for connected users in voucher mode. Since I don’t have much time at the moment, I’m considering sharing my code in case anyone is interested in continuing the project. The app is built with Flutter.
Here’s the repo link: https://github.com/yowgerald/omada-portal-client
Please feel free to ask me if you encounter any problems while setting up or testing. Thank you!
- Copy Link
- Subscribe
- Bookmark
- Report Inappropriate Content
Hi Thanks for sharing. I'm a developer but not familiar with flutter.
Is it intended for mobile platform or can it work everywhere?
Can you give me a brief explanation of the technical principle you used please?
At first glance, it seems that you are using an undocumented v2 API and searching information based on the MAC address in the link
Thanks in advance
- Copy Link
- Report Inappropriate Content
@tlt Hi,
I based my API endpoints on the information found here:
https://community.tp-link.com/en/business/forum/topic/590430
In my case, I'm using V5.4.6.
Theoretically, this should also work on the web. You need to get the client's Wi-Fi MAC address or Wi-Fi IP.
- Copy Link
- Report Inappropriate Content
Here are the API endpoints used.
Please note that you may not need endpoint #2 if you can obtain the Wi-Fi MAC address on your webpage. In that case, you can proceed to endpoint #3 directly.
Also, you will need to obtain these controller data to proceed in using the endpoints.
OMADA_URL="https://192.168.0.x:8043"
CONTROLLER_ID=""
SITE_ID=""
USERNAME=""
PASSWORD=""
-
Login Endpoint:
- Method:
POST
- URL:
'{omadaUrl}/{controllerId}/api/v2/login'
- Purpose: Used to authenticate the user with the username and password, and obtain an authentication token (
authToken
).
- Method:
-
Fetch Client Data (by IP):
- Method:
GET
- URL:
'{omadaUrl}/{controllerId}/api/v2/sites/{siteId}/clients?&token={authToken}&searchKey={wifiIp}&sorts.end=desc&filters.active=true¤tPage=1¤tPageSize=1'
- Purpose: Retrieves the client data (such as MAC address) using the Wi-Fi IP address of the device.
- Method:
-
Fetch Remaining Time (by MAC):
- Method:
GET
- URL:
'{omadaUrl}/{controllerId}/api/v2/hotspot/sites/{siteId}/clients?searchKey={mac}&sorts.end=desc&token={authToken}¤tPage=1¤tPageSize=1'
- Purpose: Retrieves the remaining time of the user's session based on the client's MAC address.
- Method:
- Copy Link
- Report Inappropriate Content
Thank you for the information. I appreciate it
- Copy Link
- Report Inappropriate Content
@tlt
Hi, ive been creating this for a long time but it failed me to develop one. Im not a coder or a dev guy. I need a help with the use of AI.
I already have this kind of setup using the authentication token. The only problem is how to host it. Do i need to host it using my own pc or via web hosting? How to check the remaining time? Is there a link that will show after entering the voucher code or is there a specific link to check it.
- Copy Link
- Report Inappropriate Content
Hi,
I haven't implemented mine yet. But in practice, yes, you need to create a webpage that performs background processing (get mac address, call all those api) and displays the information.
And yes, you also need to set up preferably a small local server in order to run the page.
And you preferably should also install a DNS server that will give you a custom web address to display the page that shows the informations.
This won't be a small task and there will still be a lot to do, depending on your final expectations.
- Copy Link
- Report Inappropriate Content
- Copy Link
- Report Inappropriate Content
@tlt heres another video https://youtu.be/PKIkqJBZs2Y?si=5eVt2S39uefXkLhi
- Copy Link
- Report Inappropriate Content
I attempted to test his code, but it doesn't meet my specific requirements. Additionally, I'm unsure about the functionality of his RapidAPI.
I tried creating my own code too, but it was unsuccessful.
The endpoint /openapi/v1/{omadacId}/sites/{siteId}/clients/{clientMac} from the documentation doesn't seem to be working, or perhaps I've made a mistake in my implementation.
I will continue my investigation with the API URL {omadaUrl}/{controllerId}/api/v2/sites/{siteId}/clients?&token={authToken}&searchKey={wifiIp}&sorts.end=desc&filters.active=true¤tPage=1¤tPageSize=1
even though API v2 doesn't seem to be officially supported for the software controller version.
- Copy Link
- Report Inappropriate Content
@tlt
I also dont know if hes using cloud controller or software controller. The only thing i was wondering is on the implementation of rapidapi.
I tried to use the github as webpage and use chatgpt to generate codes since im not good at coding but still not working properly. I am also experimenting about this matter
- Copy Link
- Report Inappropriate Content
Information
Helpful: 1
Views: 545
Replies: 10