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!
Answered! Go to the Best Answer.
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.
Fitbit Product Experts Alumni are retired members of the Fitbit Product Expert Program. Learn more
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.
Best Answer
Fitbit Developers oversee the SDK and API forums. We're here to answer questions about Fitbit developer tools, assist with projects, and make sure your voice is heard by the development team.
This question sounds to be with the Device DSK, not the Web APIs. Hopefully someone here can help you out.
Fitbit Product Experts Alumni are retired members of the Fitbit Product Expert Program. Learn more
can someone please help me out with the above question?
Best AnswerEver 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.