Cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How Can I send accelerometer values to server?

ANSWERED

Hi,

I am using a fit bit studio for collecting accelerometer, Heart rate values and then wanted to send those values to my server for inserting into my database. 

 

This is my URL: https://qav2.cs.odu.edu/fitbit/test.php

first priority if possible: How can I send data from index.js in app folder?

 

I tried sending data from index.js which is there in the companion folder.

Code in companion index.js:

function sendData() {
var data = {username: 'example'};
console.log("welcome fetech....");
fetch('https://qav2.cs.odu.edu/fitbit/test.php', {
method: 'POST', // or 'PUT'
// body: JSON.stringify(data), // data can be `string` or {object}!

}).then(res => res.json())
.then(response => console.log('Success:', JSON.stringify(response)))
.catch(error => console.error('Error:', error));

}

setInterval(sendData, 250);

 

I got an error while sending:

[3:26:22 PM]Failed to fetch - Error Domain=NSURLErrorDomain Code=-1200 "An SSL error has occurred and a secure connection to the server cannot be made." UserInfo={NSLocalizedRecoverySuggestion=Would you like to connect to the server anyway?, _kCFStreamErrorDomainKey=3, NSErrorPeerCertificateChainKey=( "<cert(0x1140a8200) s: qav2.cs.odu.edu i: InCommon RSA Server CA>", "<cert(0x114169600) s: AddTrust External CA Root i: AddTrust External CA Root>", "<cert(0x114103200) s: USERTrust RSA Certification Authority i: AddTrust External CA Root>", "<cert(0x1142dd000) s: InCommon RSA Server CA i: USERTrust RSA Certification Authority>" ), NSErrorClientCertificateStateKey=0, NSErrorFailingURLKey=https://qav2.cs.odu.edu/fitbit/test.php, NSErrorFailingURLStringKey=https://qav2.cs.odu.edu/fitbit/test.php, NSUnderlyingError=0x2833e5e90 {Error Domain=kCFErrorDomainCFNetwork Code=-1200 "(null)" UserInfo={_kCFStreamPropertySSLClientCertificateState=0, kCFStreamPropertySSLPeerTrust=<SecTrustRef: 0x280f7f9f0>, _kCFNetworkCFStreamSSLErrorOriginalValue=-9802, _kCFStreamErrorDomainKey=3, _kCFStreamErrorCodeKey=-9802, kCFStreamPropertySSLPeerCertificates=( "<cert(0x1140a8200) s: qav2.cs.odu.edu i: InCommon RSA Server CA>", "<cert(0x114169600) s: AddTrust External CA Root i: AddTrust External CA Root>", "<cert(0x114103200) s: USERTrust RSA Certification Authority i: AddTrust External CA Root>", "<cert(0x1142dd000) s: InCommon RSA Server CA i: USERTrust RSA Certification Authority>" )}}, _NSURLErrorRelatedURLSessionTaskErrorKey=( "LocalDataTask <366B904A-6643-462C-8E27-1F607C807A8B>.<59>" ), _kCFStreamErrorCodeKey=-9802, _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask <366B904A-6643-462C-8E27-1F607C807A8B>.<59>, NSURLErrorFailingURLPeerTrustErrorKey=<SecTrustRef: 0x280f7f9f0>, NSLocalizedDescription=An SSL error has occurred and a secure connection to the server cannot be made.}

 

Please help!

Best Answer
0 Votes
1 BEST ANSWER

Accepted Solutions

Ever Firefox won't go to that URL without throwing up security errors. I'd say the problem is with your server SSL setup; it's not (yet) a Fitbit-specific issue.

Peter McLennan
Gondwana Software

View best answer in original post

Best Answer
5 REPLIES 5

Hi @Handsonlab,

 

I moved your question to the Web API forum. It was originally posted in the Versa forum, which is for general support. Let me know if you think it should be in the SDK forum, and I can move it there.

Work out...eat... sleep...repeat!
Dave | California

Best Answer
0 Votes

This question sounds to be with the Device DSK, not the Web APIs.   Hopefully someone here can help you out.

 

 

Gordon Crenshaw
Senior Technical Solutions Consultant
Fitbit Partner Engineering & Web API Support | Google
Best Answer

Thanks @GordonFitbit. I saw mention of .php and .js files and wrongly assumed it was a web issue.

Work out...eat... sleep...repeat!
Dave | California

Best Answer
0 Votes

can someone please help me out with the above question?

Best Answer
0 Votes

Ever Firefox won't go to that URL without throwing up security errors. I'd say the problem is with your server SSL setup; it's not (yet) a Fitbit-specific issue.

Peter McLennan
Gondwana Software
Best Answer