Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No sensor data is being collected when using a self-hosted server #31

Closed
avaidyam opened this issue Nov 11, 2020 · 41 comments
Closed

No sensor data is being collected when using a self-hosted server #31

avaidyam opened this issue Nov 11, 2020 · 41 comments
Assignees
Labels
10day 10 days effort required bug Something isn't working native core LAMP-core-ios, LAMP-swift, LAMP-core-android, and LAMP-kotlin

Comments

@avaidyam
Copy link
Member

avaidyam commented Nov 11, 2020

Collaborator: MindLAMP 2 (Google Play Store Version 1.0). I'm also seeing this behavior when building from the Android source code. I self-deployed MindLAMP and have set up both server and database. When logging in as a participant on my Pixel 3A (Android 11), I can see the notification pop up that sensor data collection is happening from time to time, but when I request sensor events for that participant through the API, I get a list that only includes LAMP dashboard analytics events.

@amaljofyzco Do you know if this/related sensor issues are fixed in v1.1 since you pushed that last week?


This issue has been reported multiple times across both iOS and Android devices.

@avaidyam avaidyam added the bug Something isn't working label Nov 11, 2020
@amaljofyzco
Copy link

Adithya, I hope Collaborator is not using the play-store - beta build. Now beta version is 1.1.

@avaidyam
Copy link
Member Author

Does the beta fix these issues? It works on my device but the sensor collection service notification disappears after some time. Does that mean there is no data being collected?

@amaljofyzco
Copy link

Aditya, Can you share the device information. We are not facing such issues, if possible I will share a build will log file so we can track it.

@avaidyam
Copy link
Member Author

The collaborator is running his own separate infrastructure so I do not have access to that info on his end. However, I am testing on both a Pixel 2 XL (Android 10) and a Pixel 4 XL (Android 11).

@amaljofyzco
Copy link

Ok Adithya, we haven't tested in android 11. I can share a test build with log file enabled is that okay.

@avaidyam
Copy link
Member Author

avaidyam commented Nov 12, 2020

Yes, that's fine. A few questions, though:

  1. How would you need to receive the log file from the device?
  2. And is there a way to automatically share the logs by default for all devices (i.e. no special builds for diagnostics purposes)?

@amaljofyzco
Copy link

1 - Goto internal-storage | Android | data | digital.lamp.mindlamp | files | LampLog.txt
2 - Yes, for now we can enable this.

@avaidyam
Copy link
Member Author

@amaljofyzco If you enable it, though, it should not impact the performance of the app or sensor collection. We should find a way to always save logs with confidential information stripped out and remotely request them for diagnostic purposes. Do you have any ideas on an implementation for this?

@michaelmenon
Copy link

@avaidyam Can we update beta to production and test that and see if we get these issues ? We don't want to spend time on it if its a build issue. In order to avoid confusion it would be better if we can just update the production with the current beta and test it again. As beta has fixes data collection which is not there in production.

@avaidyam
Copy link
Member Author

It's already set to v1.1 and the issues I am reporting come from v1.1 as well.
Screen Shot 2020-11-12 at 8 20 10 AM

Furthermore, the collaborator writes:

I'm also seeing this behavior when building from the Android source code.

So I think this is an ongoing issue if he's seeing it from directly building the repository too.

@michaelmenon
Copy link

Hi @amaljofyzco can you confirm the 1.1 is up to date with what is updated to beta ?

@michaelmenon
Copy link

@amaljofyzco there is a way to send log files to developer account from a separate thread in Android. We can implement that and update the build asap. I have shared the info with you in chat.

@michaelmenon
Copy link

@amaljofyzco suggested we can integrate firebase analytics to collect the logs from the app. We will update the build with that integrated asap to figure out what's going on with Android 11

@avaidyam avaidyam reopened this Nov 12, 2020
@michaelmenon
Copy link

why was it closed :)

@avaidyam
Copy link
Member Author

Let's keep this issue open until that integration is complete and the collaborator reports to us that the issue is fixed on their end.

@amaljofyzco
Copy link

Aditya, could you add me as a member in your firebase account (lampv2test@gmail.com). So that I can access it for setting up the analytics.

@amaljofyzco
Copy link

why was it closed :)

why was it closed :)

sorry by mistake

@avaidyam
Copy link
Member Author

@amaljofyzco I've added you to the Firebase account temporarily - let me know what changes you've made when you're done so we can document them too!

@amaljofyzco
Copy link

Aditya, I have enabled the Crashlytics and Firebase Events. I will be check-in the build.
But I can't see the analytics because of permission.
Screenshot 2020-11-13 at 7 31 15 PM

@avaidyam
Copy link
Member Author

@amaljofyzco Can you remind me why we are enabling analytics (this requires enabling Google Analytics) for the app? I thought Crashalytics was what we wanted?

@amaljofy
Copy link

Adithya, I also added the event-logs in the app. Like when we are sending the sensor-data we will post an event.
I have added the package for analytics and added in the code.

Crashlytics also implemented, I will be updating the build after testing.

Thanks

@avaidyam
Copy link
Member Author

Can you clarify exactly which new event logs you have added?

@amaljofyzco
Copy link

amaljofyzco commented Nov 16, 2020

Adithya, The event - logs added are follows.

  • Service_Started
  • Service_Stopped
  • API_Send_${sensorEventDataList.size}
  • Fit_Success //this event fire when google-fit auth success.
  • Fit_ERROR //this event fire when google-fit auth failed.

Crashlytics also enabled.

@avaidyam
Copy link
Member Author

By event logs are you suggesting these are SensorEvent objects? Or are you sending them to the logging gateway?

@amaljofyzco
Copy link

No SensorEvent object is passing to logs. Only the size of sensor object list is passing as a string.

@amaljofyzco
Copy link

I have updated my pixel 3xl to Android 11, a small Fix done inside our framework code, which doesn't support in 11OS.

@avaidyam
Copy link
Member Author

@amaljofy So the items you mentioned are being logged, not uploaded to the LAMP API? If so, that's helpful - thanks!

@amaljofyzco
Copy link

Correct, I will be pushing to beta shortly.

@avaidyam
Copy link
Member Author

That's fantastic - thanks @amaljofy! I'll have my team also use the beta and investigate issues on our end, and if we find anything we'll respond here.

@amaljofyzco
Copy link

Code check-in done. App updated to playstore-beta, now its Being reviewed.

@avaidyam avaidyam added the NO ETA No "days of effort required" assigned yet label Nov 17, 2020
@avaidyam avaidyam added the native core LAMP-core-ios, LAMP-swift, LAMP-core-android, and LAMP-kotlin label Dec 2, 2020
@avaidyam
Copy link
Member Author

avaidyam commented Dec 8, 2020

@amaljofy @michaelmenon Another recent report:

Collaborator:
We do not appear to be receiving sensor data from any iOS devices. I am
using the python version of the API to query our database, and whilst I
can see sensor data coming from the Android devices, the only data I
have from the iOS devices is the login information to the dashboard, and
their active data from the surveys. I've attached a screenshot of the
data I can see coming through from 1 of our 3 connected iOS devices,
when I use the LAMP.SensorEvent.all_by_particpant(‘id’) method.
I can see on our dashboard, that these 3 devices all have their devices
connected, and have recently accessed the dashboard, although it is also
saying no data has ever been received from their device.
I have checked with them that they have given LAMP access to all the
sensors on their device, and got them to send screen shots of their
settings on their phone to confirm. And I have also checked with them
that they had not exited LAMP, and that it was still running in the
background.

image

I think this is turning into a very urgent issue that we need to resolve quickly.

@jijopulikkottil
Copy link

jijopulikkottil commented Dec 9, 2020

"We do not appear to be receiving sensor data from any iOS devices"

We will test the app-store version with iOS 14 device and confirm. Hope the settings are like below:
IMG_FE7E69C86069-1

Edit:
Downloaded app from app-store on iOS14 device and is working.
Could you please ask to do like:

  1. Remove app from background (force quit the app)
  2. Open the app again and check its showing Login screen or Home screen!

@avaidyam
Copy link
Member Author

avaidyam commented Dec 9, 2020

@jijopulikkottil Let me invite the collaborator to respond here! //cc @nerfanian @zone86

@michaelmenon
Copy link

michaelmenon commented Dec 10, 2020

@avaidyam did we get any reply from the collaborator on the iOS issue they reported.. Also were you able to test the Android beta which @amaljofy pushed.

@avaidyam avaidyam added 10day 10 days effort required and removed NO ETA No "days of effort required" assigned yet labels Dec 15, 2020
@avaidyam avaidyam added this to the Bug Bash 2020 milestone Dec 22, 2020
@avaidyam
Copy link
Member Author

avaidyam commented Jan 5, 2021

@jijopulikkottil @michaelmenon I’ve just shared a collaborator’s iOS device logs privately with you on Basecamp. Please take a look and let me know if that issue has been fixed.

@avaidyam avaidyam changed the title No sensor data is being collected on Android 11 (Pixel 2) No sensor data is being collected when using a self-hosted server Jan 5, 2021
@jijopulikkottil
Copy link

We are doing some optimisations on our code.. its still testing mode. Once we pushed the code, hope we can provide them the testflight beta build to test sensor data syncing issue.
Hope I can push the code within two days.

@avaidyam
Copy link
Member Author

@kkadapa Were you noticing this issue on iOS or Android or both?

@kkadapa
Copy link

kkadapa commented Jan 12, 2021

Hi @avaidyam I see this issue currently only for iOS as mentioned here https://mindlamp.discourse.group/t/question-regarding-the-couchdb-step-count-bug/262

@kkadapa
Copy link

kkadapa commented Jan 27, 2021

Hi @avaidyam I installed TestFlight version 2021.1.21(237) and allowed to sync my Steps but I still don't see Steps data in Prevent tab as you can see below, please let me know if you need any additional details
image

@avaidyam
Copy link
Member Author

@kkadapa You will not be able to see raw step count data in the dashboard; you have to use the API to access it for now.

@avaidyam
Copy link
Member Author

avaidyam commented Feb 2, 2021

@kkadapa I've investigated this issue further to ensure we're able to solve the problem. After logging in to the latest production release of the mindLAMP app on an iPhone 6s using the credentials you specified in our email conversation, I performed a man-in-the-middle attack to intercept and inspect the incoming and outgoing data between the app and your self-hosted server.

This issue does not seem to be with the app or the server code itself. You/your organization will need to reconfigure the load balancer currently serving the API Server as it currently has a maximum payload size limit that is far too low (< 1 MB). All requests from the app are being returned with a 413 Payload Too Large HTTP error. To confirm this, I extracted the relevant API call and generated fake data for testing purposes.

Below is the command I executed to confirm this issue (replace ID with the correct Participant ID):

curl \
  -X POST \
  https://mindlampdev.eastus2.cloudapp.azure.com/participant/ID/sensor_event \
  -H 'Authorization: Basic ID@lamp.com:ID' \
  -H 'Content-Type: application/json' \
  -d @fakedata.txt

Below is the fake data I generated and used:
fakedata.txt

The response from your load balancer was:

<html>                                                            
<head><title>413 Request Entity Too Large</title></head>          
<body bgcolor="white">                                            
<center><h1>413 Request Entity Too Large</h1></center>            
<hr><center>nginx/1.14.0 (Ubuntu)</center>                        
</body>                                                           
</html>  

@jijopulikkottil @amaljofy @michaelmenon
One issue I was able to identify during this process is that the lamp.accelerometer.motion sensor only produces a key magnetic (with x, y, and z) instead of the 4 other ones required, but that will be discussed as part of a different issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
10day 10 days effort required bug Something isn't working native core LAMP-core-ios, LAMP-swift, LAMP-core-android, and LAMP-kotlin
Projects
None yet
Development

No branches or pull requests

6 participants