Alarm locked mode: Disconnection investigation

Hi @spenceur,

So I’m creating this thread to talk about the bug you have in alarm mode.

I’ve investigated quite a bit, but so far I can’t reproduce it.

I have an idea for a potential fix but here we’re really doing divination :smiley:

I created this PR: Alarm: Try to fix disconnect on tablet locked mode by Pierre-Gilles · Pull Request #1976 · GladysAssistant/Gladys · GitHub

Basically my idea would be that the access_token (valid 24h) expired at the moment you enter your code, so I force a refresh of this token at the moment the code is entered.

Do you have any leads that could help me?

Does my theory seem possible to you?

1 Like

Isn’t that already done here? Gladys/front/src/utils/HttpClient.js at master · GladysAssistant/Gladys · GitHub

Not in the case of locked tablet mode, look at the line above :slight_smile:

Hello!

It’s entirely possible — in fact the issue happens every day around 6 PM or so.
You should know that every time I open the door, I refresh the tablet display to get the latest info on it; sometimes, for reasons I can’t explain, the info isn’t updated (on tablet, computer, phone or Gladys+).

Basically,

Door opened then,
I refresh the page
I turn on the screen then
I wait a minute then afterwards
I turn off the screen

And fairly regularly, when I deactivate the alarm, I get an error, I don’t really remember which one (but it’s a generic message). I refresh the page via the button, open the home page and then it asks me to log in again.
Unable to access the browser console.
Next time I’ll run docker logs to see if I get an explicit message.

I was thinking to help you debug, couldn’t you be more verbose in the case where a user enters a code and it hits a catch? Just long enough to find the needle, you know ^^

1 Like

Yes, we’ll do that I think :slight_smile: I’ll add it to my PR

I added the error message in case the error is unknown.

For example, if the network is down it will look like this:

PR merged, it will be included in the next Gladys release

2 Likes

@spenceur I’ve posted this first PR in Gladys Assistant 4.33. It will give us clearer logs in the interface in case of issues + potentially a fix that could resolve the problem, but with no guarantee since I wasn’t able to fix the bug :slight_smile:

Let me know here if the bug persists, with a screenshot of the error :slight_smile:

1 Like

Yep I’ll put the message here as soon as gladys is updated and I have the error :wink:
Thanks a lot and have a good vacation

It also happened to me 3 times that I had to reconnect, so you’re not alone. From memory it’s when I click on « Arm ». « Disarm » stays green, « Arm » turns blue at the same time, I refresh because having both at the same time shouldn’t be possible and I end up on the login screen. The link therefore seems to be broken before I click on « Arm », and the display bug is related to it failing to reach the instance.

Hi @Philou @spenceur :slight_smile: Have you had the error since the last update?

If so, I’d like the error message that must have appeared above the numeric keypad

Nothing from me yet :slight_smile:

1 Like

No error message, but the absence of a message may be related to my database-locked problems at times. To be confirmed over time — I haven’t had any disconnections for 3 days.

1 Like

Great :slight_smile: Keep me posted!

1 Like

Here we go again, my tablet keeps disconnecting. Up to twice a day. To be able to use « tablet mode » it is connected locally to Gladys’ IP.
No problem on smartphones connected to Gladys Plus which (I’m including my wife’s) have never experienced any disconnection.
I can’t find anything in the logs that could explain this…
Can anyone tell me where to look?

Hi @Philou, what’s the symptom?

Can you describe a bit what you’re doing and when it happens?

The best logs for this kind of bug will be on the browser side — but if you’re on your tablet it will be difficult to view them.

The symptom is that I find my tablet on Gladys’s login screen.
Exemple this morning. 8:30, I activate the alarm from the tablet which correctly displays the numeric keypad. My wife comes home at 11:00 and the tablet is displaying the login screen. She had to turn off the alarm from her smartphone.
I use Fully Kiosk Browser in the free version with almost all settings at their defaults.
This happens more or less at random but we mostly notice it when we come home and want to deactivate the alarm.
The tablet is not brand new. It’s a Sony running Android 6 :sweat_smile: which I reset to factory settings before dedicating it to Gladys.
When I reconnect

It’s clearly my tablet that’s the problem. I’m going to look I don’t have the issue on a regular PC even after restarting it, the reconnection is automatic.
Now to find the checkbox. It’s always a checkbox :sweat_smile:

Since you use Fully Kiosk Browser, you need to set a URL.

I assume the URL is that of your Gladys dashboard?

In alarm mode, maybe Fully Kiosk after a while refreshes the page to return to the desired URL, and that would trigger a redirect to the login since the tablet is actually « locked »?

Same here — it’s back at my place too :frowning: I didn’t have time to come and talk about it but when I saw Philou’s post I thought, let’s go