Omada portal client app

Omada portal client app

Omada portal client app
Omada portal client app
2024-10-12 05:24:32

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!

 

 

  1      
  1      
#1
Options
10 Reply
Re:Omada portal client app
2024-10-14 07:25:50 - last edited 2024-10-14 07:41:42

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

  0  
  0  
#3
Options
Re:Omada portal client app
2024-10-15 01:46:14

  @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.

  0  
  0  
#4
Options
Re:Omada portal client app
2024-10-15 02:15:45

  @tlt

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=""
 

  1. 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).
  2. 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&currentPage=1&currentPageSize=1'
    • Purpose: Retrieves the client data (such as MAC address) using the Wi-Fi IP address of the device.
  3. Fetch Remaining Time (by MAC):

    • Method: GET
    • URL: '{omadaUrl}/{controllerId}/api/v2/hotspot/sites/{siteId}/clients?searchKey={mac}&sorts.end=desc&token={authToken}&currentPage=1&currentPageSize=1'
    • Purpose: Retrieves the remaining time of the user's session based on the client's MAC address.
       
  1  
  1  
#5
Options
Re:Omada portal client app
2024-10-15 09:34:21

  Thank you for the information. I appreciate it

  0  
  0  
#6
Options
Re:Omada portal client app
3 weeks ago

  @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.

  0  
  0  
#7
Options
Re:Omada portal client app
3 weeks ago - last edited 3 weeks ago

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.

  0  
  0  
#8
Options
Re:Omada portal client app
3 weeks ago

  @tlt 

Ive found this video time checker hes using github as his web time checker and rapidapi

  0  
  0  
#9
Options
Re:Omada portal client app
3 weeks ago

  @tlt heres another video https://youtu.be/PKIkqJBZs2Y?si=5eVt2S39uefXkLhi

 

  0  
  0  
#10
Options
Re:Omada portal client app
2 weeks ago - last edited 2 weeks ago

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&currentPage=1&currentPageSize=1
even though API v2 doesn't seem to be officially supported for the software controller version.

  0  
  0  
#11
Options
Re:Omada portal client app
2 weeks ago

  @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

  0  
  0  
#12
Options