FIND (personalized indoor localization)

wifi
find
Tags: #<Tag:0x00007f15d58fd5f8> #<Tag:0x00007f15d58fd490>

(Graham Knights) #23

I’ve also been using Zanzito, which essentially replaces the Owntracks app, with the exception it doesn’t specifically handle geofences (would have to be configured server-side), but has great FIND integration, and ability to receive notifications and picture notifications via MQTT. It also has built-in location sharing and remote administration capability. I haven’t got that far yet, but I see great potential (picture notification from doorbell press, etc) to get notifications without needing another app. It’s beyond my capabilities but would be cool to see some kind of binding for it :slight_smile:


(Graham Knights) #24

I’ve run into an issue where findserver stops receiving updates from MQTT after a period of 24-48 hours. The UI at openhabianpi:8003 still works but shows no updates. Checking with journalctl -u findserver.service shows no errors or even status after the last connection:

Feb 10 00:36:19 openHABianPi findserver[391]: DEBUG: 2018/02/10 00:36:19 fingerprint.go:229: Tracking fingerprint containing 13 APs for phone_graham (home) at masterbath (guess)
Feb 10 00:36:26 openHABianPi findserver[391]: DEBUG: 2018/02/10 00:36:26 mqtt.go:182: Got valid MQTT request for group home, user phone_graham
Feb 10 00:36:27 openHABianPi findserver[391]: DEBUG: 2018/02/10 00:36:27 fingerprint.go:229: Tracking fingerprint containing 7 APs for phone_graham (home) at masterbed (guess)
Feb 10 00:36:49 openHABianPi findserver[391]: DEBUG: 2018/02/10 00:36:49 mqtt.go:182: Got valid MQTT request for group home, user phone_graham
Feb 10 00:36:49 openHABianPi findserver[391]: DEBUG: 2018/02/10 00:36:49 fingerprint.go:229: Tracking fingerprint containing 7 APs for phone_graham (home) at masterbed (guess)
Feb 10 16:40:55 openHABianPi findserver[391]: [GIN] 2018/02/10 - 16:40:55 | 302 |     2.32582ms |     192.168.0.2 |  GET     /
Feb 10 16:41:01 openHABianPi findserver[391]: [GIN] 2018/02/10 - 16:41:01 | 200 |  5.511400308s |     192.168.0.2 |  GET     /dashboard/home

MQTT continues to receive the updates from the phone at regular intervals (checked with MQTTfx).

systemctl status findserver.service gives me the following:

● findserver.service - FIND internal positioning server
   Loaded: loaded (/etc/systemd/system/findserver.service; enabled; vendor preset: enabled)
   Active: active (running) since Sat 2018-02-10 20:17:51 PST; 3min 41s ago
     Docs: https://www.internalpositioning.com/server/
 Main PID: 17425 (findserver)
   CGroup: /system.slice/findserver.service
           └─17425 /usr/sbin/findserver -mqtt localhost:1883 -mqttadmin admin -mqttadminpass adminpass -mosquitto mosquitto) -p :8003 localhost:8003

Feb 10 20:17:51 openHABianPi systemd[1]: Stopped FIND internal positioning server.
Feb 10 20:17:51 openHABianPi systemd[1]: Started FIND internal positioning server.
Feb 10 20:17:51 openHABianPi findserver[17425]: /var/lib/findserver/data
Feb 10 20:17:51 openHABianPi findserver[17425]: WARN : 2018/02/10 20:17:51 mqtt.go:164: exit status 1
Feb 10 20:17:51 openHABianPi findserver[17425]: DEBUG: 2018/02/10 20:17:51 mqtt.go:50: Finished setup
Feb 10 20:17:51 openHABianPi findserver[17425]: -----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----
Feb 10 20:17:51 openHABianPi findserver[17425]:    _________  _____
Feb 10 20:17:51 openHABianPi findserver[17425]:   / __/  _/ |/ / _ \  ______ _____  _____ ____
Feb 10 20:17:51 openHABianPi findserver[17425]:  / _/_/ //    / // / (_-< -_) __/ |/ / -_) __/
Feb 10 20:17:51 openHABianPi findserver[17425]: /_/ /___/_/|_/____/ /___|__/_/  |___/\__/_/
Feb 10 20:17:51 openHABianPi findserver[17425]: (version 2.4.1 build bc170638) is up and running on http://localhost:8003
Feb 10 20:17:51 openHABianPi findserver[17425]: -----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----
Feb 10 20:19:04 openHABianPi findserver[17425]: DEBUG: 2018/02/10 20:19:04 mqtt.go:182: Got valid MQTT request for group home, user phone_graham

Which appears okay, but is the argument -mosquitto mosquitto) correct? My understanding is this should be the PID of mosquitto. I’ve searched, but can’t find a definitive answer to run “pgrep mosquitto” as a variable from within the findserver.service file:

[Unit]
Description=FIND internal positioning server
Documentation=https://www.internalpositioning.com/server/
After=mosquitto.service

[Service]
EnvironmentFile=-/etc/default/findserver
WorkingDirectory=/var/lib/findserver
ExecStart=/usr/sbin/findserver -mqtt localhost:1883 -mqttadmin admin -mqttadminpass adminpass -mosquitto $(pgrep mosquitto) -p :8003 localhost:8003
Restart=always

[Install]
WantedBy=multi-user.target

Is there a way to enable more detailed logging? Any help is greatly appreciated - let me know if there’s anything I’m missing.


(Markus Storm) #25

Well, the -mosquitto option isn’t really needed (the docs say: “The pgrep mosquitto is for getting the mosquitto PID, which is used to send SIGHUP to reload the passwd file.” which we don’t require in openHABian as we set the mosquitto user/passwd in the install routine there).
I guess it doesn’t do harm but who knows. Try to simply remove it.

OTOH, if we set it in systemd, it should work, and I, too, can’t find a definitive confirmation that the current code should work.
Any improvement on findserver.service systemd config is welcome (@job, any suggestion how to handle that pgrep ?)


(Graham Knights) #26

I tried removing the pgrep mosquitto but the service failed to start, so I’ve put it back in, but I’m curious if it’s parsing the PID correctly.


(Graham Knights) #27

I’ve made a temporary workaround and will see what happens; I changed the ExecStart= in findserver.service to call a script to load findserver with the $(pgrep mosquitto) argument, which gets the correct PID and passes it onto the service correctly now:

● findserver.service - FIND internal positioning server
   Loaded: loaded (/etc/systemd/system/findserver.service; enabled; vendor preset: enabled)
   Active: active (running) since Sun 2018-02-11 20:30:39 PST; 10s ago
     Docs: https://www.internalpositioning.com/server/
 Main PID: 2335 (startfind.sh)
   CGroup: /system.slice/findserver.service
           ├─2335 /bin/bash /var/lib/findserver/startfind.sh
           └─2340 /usr/sbin/findserver -mqtt localhost:1883 -mqttadmin admin -mqttadminpass adminpass -mosquitto 390 -p :8003 localhost:8003

Feb 11 20:30:39 openHABianPi startfind.sh[2335]: DEBUG: 2018/02/11 20:30:39 mqtt.go:50: Finished setup
Feb 11 20:30:39 openHABianPi startfind.sh[2335]: -----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----
Feb 11 20:30:39 openHABianPi startfind.sh[2335]:    _________  _____
Feb 11 20:30:39 openHABianPi startfind.sh[2335]:   / __/  _/ |/ / _ \  ______ _____  _____ ____
Feb 11 20:30:39 openHABianPi startfind.sh[2335]:  / _/_/ //    / // / (_-< -_) __/ |/ / -_) __/
Feb 11 20:30:39 openHABianPi startfind.sh[2335]: /_/ /___/_/|_/____/ /___|__/_/  |___/\__/_/
Feb 11 20:30:39 openHABianPi startfind.sh[2335]: (version 2.4.1 build bc170638) is up and running on http://localhost:8003
Feb 11 20:30:39 openHABianPi startfind.sh[2335]: -----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----

I noted I’m no longer getting the WARN message I got previously.

I’ll admit I’m not entirely sure what I’m doing :slight_smile: but we’ll see how it works out after a day or so!


(Will) #28

@mcqwerty , May I ask if you were able to execute the simple instructions at the internalposition.com install page, or whether you had to do something else? I am having an issue with Go finding the FIND directory, and am getting the error;

go install: no install location for directory /home/will/find outside GOPATH

I have added the HOME/find directory to GOPATH in both my .profile and .bashrc files but still no success. Do I need to move the /find directory under the /go/pkg directory?


(Joachim Boeddeker) #29

No, sorry, I guess the real expert regarding systemd is @ptweety. Maybe he can provide some idea.


(mcqwerty) #30

I am running Windows and as far as I remember I just download the windows version of the FIND server. I didn’t have to install GO.
I read through the instructions to figure out the command line needed to run the FIND server but I didn’t need to install anything else to get it to run.
If you are not on Windows then I don’t think I can be of much help.


(Graham Knights) #31

Unfortunately FINDSERVER stops receiving updates from MQTT after an undetermined timeout - when I turn off my phone at night, it only randomly starts receiving the updates again in the morning when turned back on (sometimes it works, sometimes it doesn’t). Only way to start receiving updates is to restart findserver.
Unfortunately I might have to give up on this one… Anyone else using this addon with success? Such great potential but I’m hitting a roadblock here. :frowning:


(Markus Storm) #32

I’ve been using findserver for quite some time and have never encountered this sort of behavior.
You could start debugging on Linux level (see findserver log output first and if that does not give any hint try tcpdump, strace on findserver process) but it’s rather unlikely that the findserver process is your problem and more likely that something else in the process chain keeps the MQTT packages from being sent (you sure they arrive at the findserver process? try strace)


(Graham Knights) #33

Thanks for the tips @mstormi - I’ll have to look into this some more and hopefully find what’s causing the issue.


(Markus Storm) #34

FIND3 was just released.
It now supports Bluetooth as a data source in parallel to WiFi (and potentially others) and brings a renewed app version.

See overview, there’s a section on FIND3 vs. the old version we’ve integrated with openHAB here. I didn`t check FIND3 out so far, will do as time permits.


(Jeff Haskel) #35

Tasker for android


(mcqwerty) #36

Hi @Chod thanks for the reply but please could you provide more details.
I am aware of Tasker and have used it for various other purposes but I don’t see how it can be used to provide the specific access point signature data that the FIND server needs.
If you have Tasker working with FIND please could you provide details.

Thanks


(Christos) #37

a quite important question ? How accurate is it ? I am playing for a couple of days with FIND3 (never used FIND) and I was not impressed with the accuracy. I was getting a lot of false readings although I spent more than 5mins in learning mode in each room.

I have put some BLE raspi’s in a couple of rooms and the accuracy improved. I will continue testing to see how things go
Another problem is that for accurate position in the house using the smartphone is not good for me, as more often than not I do not carry it around when going from one room to another, eating, playing with kids etc

A wearable like a BLE smartwatch could be more realistic but then I again will be losing the wifi fingerprints


(Elser Marc) #38

Can anyont tell me what the “group” name is? I have installed the local find server for openhab2 and it displays it’s login page on localhost:8003/login asking for group. I used the adnroid app find3 and there’s no group name. You have “family” and “device”. it scans for fingerprints to the local server just fine, I just cannot logon to the local server because “group” is neither the “family” name nor the “device”.

Can anyone advise please?


(Markus Storm) #39

You can define the group in the clients options. You should be able to select an arbitrary name.
findserver uses it to group data from various users as a common set of data, and uses this in its MQTT subscription, too.