schollz / find3

High-precision indoor positioning framework, version 3.
https://www.internalpositioning.com/doc
MIT License
4.63k stars 364 forks source link

Trouble posting data from Android app #160

Open fsdgadfase opened 5 years ago

fsdgadfase commented 5 years ago

First off thank you very much for you efforts into developing a high precision FOSS WPS suite!

In an effort to compare VoIP (Asterisk PBX) QOS statistics with positional information, I installed the FIND3 Android client on a subsequent wireless VoIP peer device (Samsung Galaxy S6) and the FIND3 Docker server image on the main server PC.

So, my aim is to automatically record location of the peer in the event of VoIP communication.

However, despite following the documentation, I am unfortunately not able to gather the required data to achieve my goal. My initial problems seem to mirror the following Github threads: #138 and #159.

When plainly connecting to the server, walking around the campus and afterwards checking the localhost dashboard, a message appears, notifying me of the following:

You need to add learning data first: group 'targaryan' does not exist

This seems indifferent to the network setup because I tested on two independent networks, three servers (with or without UFW enabled) and the cloud.internalpositioning.com. server.

When I take a look in the local /FIND_DATA/data/ folder, no new .sqlite3.db or .ia file has been created. In an attempt to mitigate this problem, I thought of manually adding the family name to the server via the terminal. I did this because the python script in /main/testing/ succeeds in creating a family (and posting data).

The following command adds a group (/family): user@server$ curl -H "Content-Type: application/json" -X POST -d '{"username": "user", "group": "targaryan", "wifi-fingerprint": [{"rssi": -94, "mac": "80:37:73:ba:f7:d8"}], "location": "bogus", "timestamp": 1439596533831, "password": "fugazi"}' http://127.0.0.1:8005/learn

Then I deleted the bogus data with: user@server$ http DELETE http://0.0.0.0:8005/api/v1/location/targaryan/bogus

The dashboard no longer reports the unknown family and a new .sqlite3.db has been created in /FIND_DATA/data/. Finally, I tried to add learning data via the app with the following input:

Family: targaryan Device: user Server: http://192.168.2.3:8005 Location: Living room Submit GPS: False Mode: Learning

The above mentioned location was varied per room in 5 minutes intervals. After walking to a new room, I hit "Scan" and waited 5 minutes.

The following info appears in /FIND_DATA/data/logs/main.stdout:

... 2019-05-02 13:31:51 [INFO] [PID-14] server.go func1:1360 192.168.2.4:39495 GET /ws?family=targaryan&device=user 171.886µs 2019-05-02 13:31:51 [DEBUG] [PID-14] db.go getRows:1055 getting columns 2019-05-02 13:31:51 [DEBUG] [PID-14] db.go getRows:1062 getting sensorstringsizer 2019-05-02 13:31:51 [DEBUG] [PID-14] db.go getRows:1079 getting locations 2019-05-02 13:31:51 [DEBUG] [PID-14] db.go getRows:1085 got locations 2019-05-02 13:31:56 [DEBUG] [PID-14] server.go handlerData:927 [targaryan] problem parsing: problem validating data: sensor data cannot be empty 2019-05-02 13:31:56 [INFO] [PID-14] server.go func1:1360 192.168.2.4:39496 POST /data 260.998µs ...

Afterwards no new data appears to be added to the dashboard and the message on the non affability of learning data is still present. This might be related to the validation debug message.

Could it be the app is faulty or am I (most probably) missing something crucial?

I hope you find the time to investigate and respond. FIND_DATA_Z.zip

cuberinooo commented 5 years ago

Hey, @EdgarSnoeck I think the issue is on the app. I get the same errors. So far I can tell is that the receiving data are empty and therefore there will be not used on the backend system. Since empty data will be ignored your family will not be created.

On your mobile device: Did you try to give your app full access and open Bluetooth, GPS as well as W-LAN at the same time (open access privileges as well)? This helped me to send some data. The problem I have now as you can imagine is as long as I close Bluetooth (or any other wireless connection) this won't work again.

But I'm still investigating.

fsdgadfase commented 5 years ago

Hi Kubilay, thanks for the input!

I verified all the settings and the app has access to all requested system functions. Tomorrow I will test the app with the different wireless tech. enabled and post the results.

P.s. I accidentally marked this thread as closed.

olejorgenb commented 3 years ago

The "group" is never created for me either seemingly making the app completely non-functional. (only tried using the public server)

IoTThinks commented 3 years ago

New Android OS prevents the app to send the data.

You may need to enable Developer Mode for your phone. Wait a while.

Or try esp-client on an esp32 board. Good luck.