pwasem/vuforiajs

Error RequestTimeTooSkewed Issue Coming

Closed this issue · 6 comments

Few days ago i am uploading an targeting image successfully on vuforia by vuforiajs but suddenly vuforiajs stop working and sending me this Error message RequestTimeTooSkewed and does not upload an image on vuforia i did't make any changes in code i don't know why this happen help me to sort out this problem

Hey @monuram12 did you solve your issue? I'm having problems to upload a target too.

@monuram12 and @giorat Can you please post the code that you are running and the exact error message?

app.post('/add3dModel', multer(multerConfig2).single('photo'), function(req, res) {
    const imageUrl =  "assetsImage/"+targetId;
  const modelUrl =  "assets3d/"+targetId;
  const title = req.body.title;
	const brand = req.body.brand;
	const size = req.body.sizeTarg;
  fs.readFile(__dirname +"/public/"+imageUrl+".jpeg", function(err, data) {
    if (err) throw err;
    var target = {
      name: targetId,
      width: size,
      image: utilV.encodeFileBase64(__dirname +"/public/"+imageUrl+".jpeg"),
      active_flag: true,
      application_metadata: utilV.encodeBase64("{}")
    };
    client.addTarget(target, function (error, result) {
			if (error) {	
					console.dir(error);
					res.send(error);
			} else {
					console.dir(result);
					res.redirect('/add3dModel/'+targetId);
			}
	});
  });
});

Is there a way to get more info about the error from the Vuforia server? I tried making a request with postman app and I got the same error. It might be that Vuforia changed API?

Not sure what is going on, but I don't think it is anything to do with their API. I was just able to post an image with the following:

var vuforia = require('./vuforia.js');
var client = vuforia.client({
    'accessKey': <db_server_access_key>,
    'secretKey': <db_server_secret_key>
});

var util = vuforia.util();

var target = {
    'name': 'testing_post_with_js_08_09',
    'width': 32.0,
    'image': util.encodeFileBase64(__dirname + '/Sunset_2007-1.jpg'),
    'application_metadata': '434324'
}

client.addTarget(target, function(err, result) {
    if (err) {
        console.log(err);
   } else {
        console.log(result);
  }
});

I just fixed it by using parseFloat(size) I thought that vuforiajs or at least Vuforia API were able to understand that "0.22" was equal to 0.22 but Vuforia won't tell you that's the error.

I'll implement a simple function here to convert the input size to float to prevent this stupid error from happening again to anyone.

var vuforia = require('vuforiajs');
var client = vuforia.client({
'accessKey': <db_server_access_key>,
'secretKey': <db_server_secret_key>
});
var target = {

                    'name': "ABD2323",
                     'width': 32.0,
                    'image': util.encodeFileBase64(`${Path.resolve("../web/uploads")}${artData.image[0]}`),
                    'active_flag': true,
                    'application_metadata': util.encodeBase64(`${Path.resolve("../web/uploads")}${artData.image[0]}`)
                };
                client.addTarget(target, function (error, result) {
                        if (error) { // e.g. [Error: AuthenticationFailure]
                            console.error(error);
                            resolve(result)
                        } else {
                            resolve(result)
                        }
                    });

Here is my code