maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   SailfishOS (https://talk.maemo.org/forumdisplay.php?f=52)
-   -   [WIP] Prey - antitheft system (https://talk.maemo.org/showthread.php?t=92829)

nieldk 2014-03-19 12:11

Re: [WIP] Prey - antitheft system
 
Quote:

Originally Posted by solbrit (Post 1417630)
Hmm, I somehow lost track of prey.timer when updating the ui. I'm adding it to the start/stop button to enable/disable .timer and .service simultaneously. This should make more sense seeing as how disabling .service only won't keep it from running when called by timer, right? Correct me if I'm wrong...

Stopping the prey.timer, and disabling prey.timer should be sufficient. The prey.service is only run, when called by prey.timer.

solbrit 2014-03-19 12:46

Re: [WIP] Prey - antitheft system
 
Quote:

Originally Posted by nieldk (Post 1417657)
Stopping the prey.timer, and disabling prey.timer should be sufficient. The prey.service is only run, when called by prey.timer.

That's what I thought, my bad.
With timer active prey.service should run once every hour, meaning checking your device on https://panel.preyproject.com/devices should never show Offline for >1 hour, right? In my case only running prey.service manually will update the info on url though, suggesting the timer doesn't actually call prey.service, or have I understood it all wrong? :confused:

nieldk 2014-03-19 12:52

Re: [WIP] Prey - antitheft system
 
Quote:

Originally Posted by solbrit (Post 1417663)
That's what I thought, my bad.
With timer active prey.service should run once every hour, meaning checking your device on https://panel.preyproject.com/devices should never show Offline for >1 hour, right? In my case only running prey.service manually will update the info on url though, suggesting the timer doesn't actually call prey.service, or have I understood it all wrong? :confused:

The prey.timer is responsible for calling prey.service once an hour.
However, this may be missed, for example, the device goes to sleep. It will then call again on the next hour, depending if the device is not sleeping/have Internet access etc.
Calling the prey.service (or even the prey.sh script) manually, yes, that will trigger a login, notifying prey servers that the device has activated and responding to the device with actions to take.
So, the prey.timer calls prey.service, just as you could do manually.

solbrit 2014-03-19 15:19

Re: [WIP] Prey - antitheft system
 
Quote:

Originally Posted by nieldk (Post 1417665)
...However, this may be missed, for example, the device goes to sleep. It will then call again on the next hour, depending if the device is not sleeping/have Internet access etc...

Thanks, that explains it, it's the whole Jolla-when-sleeping-is-dead-to-the-world deal. This can make communication a bit tricky for Prey I suppose.

nieldk 2014-03-19 15:58

Re: [WIP] Prey - antitheft system
 
Quote:

Originally Posted by solbrit (Post 1417691)
Thanks, that explains it, it's the whole Jolla-when-sleeping-is-dead-to-the-world deal. This can make communication a bit tricky for Prey I suppose.

it will report eventually, in my experience worst case between contact is around 4 hours, this could possibly be reduced with a more agressive timer. But I think the 1 hr setting is an Ok compromise for service/battery/reliability and assurance. Best is if lock-code is set by user obviously. I hope to further expand this to include the option to enable lock code remotely - perhaps Jolla will incorporate this better eventually :)

HolgerN 2014-03-19 16:10

Re: [WIP] Prey - antitheft system
 
Enabling a timer is not enough. I changed the code, so that after a timer is enabled, he is also started. Otherwise, the timer would work only after a reboot.

So
Quote:

systemctl enable prey.timer
enables the timer, but he is executed after a reboot.
Quote:

systemctl start prey.timer
enables the timer instantly.

nieldk 2014-03-19 20:15

Re: [WIP] Prey - antitheft system
 
Quote:

Originally Posted by HolgerN (Post 1417697)
Enabling a timer is not enough. I changed the code, so that after a timer is enabled, he is also started. Otherwise, the timer would work only after a reboot.

So

enables the timer, but he is executed after a reboot.
enables the timer instantly.

Yes, starting timer is needed - or reboot.
I didnt start the timer, since the config file was needing update with the owners API key, before this would work anyways.

cy8aer 2014-03-23 20:02

Re: [WIP] Prey - antitheft system
 
nieldk: would it be possible to compile all the prey stuff against openssl-1.0.1f-1.2.1 as installed in 1.0.4.20 by default?

nieldk 2014-03-24 11:31

Re: [WIP] Prey - antitheft system
 
Quote:

Originally Posted by cy8aer (Post 1418228)
nieldk: would it be possible to compile all the prey stuff against openssl-1.0.1f-1.2.1 as installed in 1.0.4.20 by default?



Yes, no problem.
What needs to be recompiled actually only is perl modules

IO::Socket::SSL and Net::SSLeay

And those you can easy do by using cpan

cpan install IO::Socket::SSL
cpan install Net::SSLeay


allthough, you will need to install development tools to do that.
But, I will compile all during the next days.

solbrit 2014-03-26 01:02

Re: [WIP] Prey - antitheft system
 
Here goes, the final update of the UI:

v0.1-4

- Registration output in real time (and possible registration abort)
- Timer state updated and always displayed on main page
- Various fixes (Python mostly) and graphical nick nacks

https://openrepos.net/content/solbrit/preyui

"Final" is ofcourse an optimistic expectation that'll keep me going until the first critical bug is reported :D


All times are GMT. The time now is 16:29.

vBulletin® Version 3.8.8