Closed wshagcl closed 6 years ago
Hi, is your robot effectively offline? Can you see it online from the official Neato app?
Best, Marco
is not offline,the robot is online from the official Neato app
Is the {:robot_serial} placeholder filled?
yes
You're running our demo on our server (this one: https://developers.neatorobotics.com/demo/sdk-js) or you are trying to run it on your PC?
Btw If the robot is connected and you can see it in the official Neato application, then you have an error in your signature.
Working code can be found at: https://github.com/NeatoRobotics/neato-sdk-js/blob/0.9.0/src/robot.js#L50
Thank you. I'll go back and look at it.
i‘am trying by my code code: https://github.com/wshagcl/wshagcl.github.io server: https://wshagcl.github.io
The problem has been solved. URL is wrong.
https://nucleo.neatocloud.com:4443/vendors/neato/robots/{:robot_serial}/messages --> https://ap-nucleo.neatocloud.com:4443/vendors/neato/robots/{:robot_serial}/messages
This is because you are a chinese user... sorry I didn't realize that. The first one is the url for the rest of the world users the second one for chinese users. We'll update the doc soon. Thank you for reporting.
Thanks for your help!
Hi @marcouberti I am facing the same issue. I am using the official app, the robot is online, and have done the best possible background check regarding it. Although i could control the robot programmatically with the unofficial API https://github.com/kangguru/botvac but i would like to do it from the postman itself since integration of my robot with other application will be easier. Please suggest some solution
Hi @avanshee, if you are using Postman, are you filling also the request HTTP headers? Because you need to do that in order to have a valid request. I know you can manually add headers in Postman, but I don't know if you can do that dynamically. The headers signature use the date, so it is not a fixed string...
Hi @marcouberti, I am facing a similar issue here as well. Here is my code snippet.
robot_serial = RunNeatoJob::SERIAL
date = Time.now.utc.strftime("%a, %d %b %Y %H:%M:%S GMT")
body = '{"reqId":"77", "cmd":"getRobotState"}'
robot_secret_key = RunNeatoJob::SECRET
string_to_sign = "#{robot_serial.downcase}\n#{date}\n#{body}"
token = OpenSSL::HMAC.hexdigest('sha256', robot_secret_key, string_to_sign)
response = HTTParty.post("https://nucleo.neatocloud.com:4443/vendors/neato/robots/#{RunNeatoJob::SERIAL}/messages",
:body => {
:data => '{"reqId":"77", "cmd":"startCleaning", "params":{"category":2,"mode":1,"modifier":1}}'
}.to_json,
:headers => {
"Accept":"application/vnd.neato.nucleo.v1",
"X-Date": Time.now.utc.strftime("%a, %d %b %Y %H:%M:%S GMT"),
"Authorization": "NEATOAPP " + token,
}
)
returns
=> {"message"=>"Could not find robot_serial for specified vendor_name"}
Any help would be amazing! Thanks!
any updates on this? it looks broken
-> run the demo -> login with neato -> js error : [POST https://nucleo.neatocloud.com:4443/vendors/neato/robots/{:robot_serial}/messages 404 (Not Found)] form data: [{"reqId":"1","cmd":"getRobotState"}] response: {"message":"Could not find robot_serial for specified vendor_name"}
please help ,thanks!