I'm writing an app in node.js to control a Nest Thermostat and I'm having some problems. My first attempt was to repurpose the Nest provided app (https://github.com/nestlabs/control-jquery), but when I install it, it works fine to display temp, but when I click the temp up/down buttons nothing happens.
When I detach the temperature change function from the JQuery click event, and just run the function on load, Firebase responds with "FAILURE". Here's the error:
FIREBASE WARNING: set at /devices/thermostats/C8Wx6yQWsEhWa-k5ZWvRslx2bB6bvpId/target_temperature_f failed: failure
Any thoughts?
Check the hvac mode of the thermostat you are adjusting.
- You cannot set the target temperature if the hvac is in heat-cool or off mode.
- You cannot set the high range temperature or low range temperature if the hvac is not in heat-cool mode.
Check the 'away' mode.
- You cannot set the target temperature if the building is in away mode.
See the error codes documentation:
developer.nest.com/documentation/error-codes
Did you select read AND write permissions when you created the Nest Client?
Related
I am working on a Chromecast custom receiver app, built on top of the sample app provided by Google (sampleplayer.CastPlayer)
The app manages a playlist, I would like the player to move on to the next item in the list after a video fails to play for whatever reason.
I am running into a situation where, after a video fails to load because of a network error, the player becomes unresponsive: in the 'onError_()' handler, my custom code will do this
var queueLoadRequest = ...
var mediaManager = ...
setTimeout (function(){mediaManager.queueLoad(queueLoadRequest)}), 5000
...the player does receive the LOAD event according to the receiver logs, but nothing happens on the screen, the player's status remains IDLEand the mediaManager.getMediaQueue().getItems() remains undefined. Same result trying to use the client controller to try to load a different video.
I have tried to recover with mediaManager.resetMediaElement() and player.reset() in the onError_ handler, but no luck.
For reference, here is a screenshot of the logs (filtered for errors only) leading up to the player becoming unresponsive. Note that I am not interested in fixing the original error, what I need to figure out is how to recover from it:
My custom code is most likely responsible for the issue, however after spending many hours + stripping the custom code to a bare minimum in an effort to isolate the responsible bit of code, I have not made any progress. I am not looking for a fix but rather for some guidance in troubleshooting the root cause: what could possibly cause the Player to become unresponsive? or alternatively how can one recover from an unresponsive Player?
I'm trying to run the Autodesk viewer-navigation.sample link on my machine but I get just a loading screen and nothing happens.
I think it's because I haven't loaded the model, I'm not sure I understand what it means to do:
To prepare the models, run the Initial Setup endpoint.
But when I navigate to http://localhost:3000/forge/initialsetup when the server is running I get: Cannot GET /forge/initialsetup
I did set in the Autoforge app the callback url to be http://localhost:3000/api/forge/callback/oauth
I also did run:
npm install
set FORGE_CLIENT_ID=<<YOUR CLIENT ID FROM DEVELOPER PORTAL>>
set FORGE_CLIENT_SECRET=<<YOUR CLIENT SECRET>>
What else can be done to make it work?
As a temporary workaround, till we'll fix it, you could try either define a FORGE_BUCKET env variable:
set FORGE_BUCKET=someuniquename2d3d
or within source code (forge.js) change the line 45:
var ossBucketKey = process.env.FORGE_BUCKET || 'navigationsample3d2d';
by replacing the 'navigationsample3d2d' string with something like 'someveryuniquename2d3d'.
This should work.
I have made a nodejs application using sails.js. It's working perfectly in my localhost. The problem appears in production when I try to publish it in the server(modulus). You can take a look the error below.
Error: The hook `pubsub` is taking too long to load.
Make sure it is triggering its `initialize()` callback, or else set `sails.config.pubsub._hookTimeout to a higher value (currently 20000)
at tooLong [as _onTimeout] (/mnt/data/1/ApiDevConf-master/node_modules/sails/lib/app/private/loadHooks.js:92:21)
at Timer.listOnTimeout (timers.js:110:15) { [Error: The hook `pubsub` is taking too long to load.
Make sure it is triggering its `initialize()` callback, or else set `sails.config.pubsub._hookTimeout to a higher value (currently 20000)] code: 'E_HOOK_TIMEOUT' }
I have tried to figure out how to solve the problem but nothing works. I was trying somethink like this here.
Also I have properly set the NODE_ENV = production
Thanks for your time.
It sounds like this could be one of two issues.
1.) You need to set your migrate setting in config/model.js to something besides alter. You should have migrate: 'safe' on in production mode. This should happen automatically if the NODE_ENV variable is set to production.
The reason it times out is every time you start the server Sails will try and migrate your existing data to the current schema. Obviously don't want this in production.
2.) You have a lot of files to load and Modulus is slow to read them from it's virtual disk. This is a bigger issue because it will take a very long time for your server to start each time you need to restart it. You can bump the global timeout limit and that should give you more time. To do that add the following to your config/env/production.js file:
module.exports = {
hookTimeout: 40000
}
Helllo,
My application is a web server that fires many requests to other servers. We set up a maximum timeout on those requests, and whenever the timeout is reached, the connection is closed and a ESOCKETTIMEDOUT rises.
Error: socket hang up
at createHangUpError (http.js:1472:15)
at Socket.socketCloseListener (http.js:1522:23)
at Socket.EventEmitter.emit (events.js:117:20)
at TCP.close (net.js:465:12)
I want to exclude these errors from the New Relic Dashboard, since they distort the error rate and other metrics. Hiding them doesn't work either, because they still count in the error rate.
How can remove specific errors (that do not have a HTTP status code) from my Dashboard?
You can pass status codes to ignore to the error collector. If you are configuring the New Relic agent using environment variables you can use a comma separated list of codes as the value for NEW_RELIC_ERROR_COLLECTOR_IGNORE_ERROR_CODES.
See the README.
If you are using newrelic.js to do so you can set the error_collector.ignore_codes value to an Array of status codes to ignore:
See the example config.
Important caveat: when setting this value manually you are overriding the default value of 404 which means that if you do not specify 404 in your manual configuration the Error Collector will start logging all 404 errors in your application (which you probably do not want).
I noticed you have javascript, I'm not sure if my solution can help you but I'll answer in the hope it does.
I use Java agent, and we have the same kind of problem. So far the only way that I found that can do something near what I want is having the specific errors wrapped in a dedicated exception ("NewRelicIgnorableException") and wrap whatever error I don't want to see in it.
Then I'd have to go into the dashboard/application and select "error collection". Last, I'd fill in the "Ignore these errors" with the full package name AND exception class name, like com.mypackage.NewRelicIgnorableException. Save and enjoy. These particular errors should not impact your apdex, but they will still count towards RPM and other metrics.
Other solutions have drawbacks. For example if I call ignoreexception the RPM and time metrics will not count. If you click the "hide error" button you only hide them from the error panel, but everything else will be as usual. If you ignore by status code you can get more or less the same results as ignoring the specific exception, but without any hope for fine control.
It's a pity that there's so little documentation on their site, I had to run tests to find these out.
I have disabled the default pattern/PIN lock using the following code in my lock screen app.
KeyguardManager km = (KeyguardManager) getSystemService(KEYGUARD_SERVICE);
k1 = km.newKeyguardLock("IN");
k1.disableKeyguard();
Also, i have used the FLAG_DISMISS_KEYGUARD.
It is working fine in my Moto G. But, few devices are showing the default Pattern lock after my lock screen. How can i fix it? What could be the issue?
Besides FLAG_DISMISS_KEYGUARD, you may need:
FLAG_KEEP_SCREEN_ON,
FLAG_SHOW_WHEN_LOCKED
and
FLAG_TURN_SCREEN_ON also.
i.e.
getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON|
WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD|
WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED|
WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON);