Hi!
I have the following modem: https://www.peplink.com/products/br1-mini-hw3/, for which I use the “Peplink Router API Documentation for Firmware 8.3.0”.
At initialization, I login to the modem with username and password. Next, every 30 seconds, I update the RTSP address using the GET /api/status.pepvpn from the API documentation. From the response, I obtain the modem name by getting the json response: modem_name = pepvpn.json()[“response”][“profile”][“siteId”]. This works as supposed to, however, when I run my Python script from a service for a long time (e.g. overnight), it keeps on failing. The GET /api/status.pepvpn works and returns status_code 200, meaning it succeeded. But when I then try to get the modem_name from the json response, I get a key error. It looks like a response is generated successfully, but empty. The same issue occurs for GET /api/status.lan request.
I thought it might have something to do with the login (since I only login once) that expires. Should I login again after a certain period of time, and if yes, after how long? Or should I for example create a client, obtain a token, and use that for requests, while obtaining a new token after a certain period of time?