Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error [pimatic-openweather]: Unexpected token i #9

Closed
lcfm1 opened this issue May 21, 2015 · 12 comments
Closed

error [pimatic-openweather]: Unexpected token i #9

lcfm1 opened this issue May 21, 2015 · 12 comments

Comments

@lcfm1
Copy link

lcfm1 commented May 21, 2015

No description provided.

@sweetpi
Copy link
Collaborator

sweetpi commented May 21, 2015

Do you have an stack trace (debug message following to the error)?

@lcfm1
Copy link
Author

lcfm1 commented May 22, 2015

How i can make that? these error i saw few times.

@coccyx00
Copy link

coccyx00 commented Oct 9, 2015

i have the same. error shown:

debug [pimatic-openweather]: SyntaxError: Unexpected token I at Object.parse (native) at IncomingMessage.<anonymous> (/home/pi/pimatic-app/node_modules/pimatic-openweather/node_modules/openweathermap/openweather.js:146:21) at IncomingMessage.EventEmitter.emit (events.js:117:20) at _stream_readable.js:920:16 at process._tickCallback (node.js:415:13)

@christophfroehlich
Copy link

same here (0.8.15)
since a few days, this plugin is spamming the logfile with
[pimatic-openweather] error: Unexpected token I
and it doesn't retrieve the weather data for hours.. any chance to get rid of this?

@mwittig
Copy link
Collaborator

mwittig commented Oct 9, 2015

Yes, same here. The openweather service is a pain in the a..

I'll look into this tomorrow and will report back about my findings.

@renearts
Copy link

renearts commented Oct 9, 2015

Same here indeed. When I surf to http://api.openweathermap.org/data/2.5/weather?q=Volkel,nl, I get as response: Invalid API key. Please see http://openweathermap.org/faq#error401 for more info.
The 401 error says I would need an API key. I guess I/we requested data to many times?

@mwittig
Copy link
Collaborator

mwittig commented Oct 10, 2015

"For FOSS developers: we welcome free software and are willing to help you. If you want to use OWM data in your free software application please register an API key and file a ticket describing your application and API key registered. OWM will review your request and grant immunity from usage limit overflow blocking." Besides this, it is possible to acquire a free key for personal use.

Maybe, the blocking is temporarilly only as the error has occurred multiple times in the past. May be it is better to ask inividuals to acquire a ApiKey for their personal use.

@sweetpi What's your opinion on this? Does it make sense to request an Apikey for pimatic? I am happy to take the initiative.

@sweetpi
Copy link
Collaborator

sweetpi commented Oct 10, 2015

An apikey for pimatic would be cool. However we should be sure to meet their licensing terms. I'm not 100% sure, but probably we need to mention openweather somewhere in the ui. I don't know if the readme is enough. http://openweathermap.org/price @mwittig Would you request one from them and ask if mentioning openweather in the plugin readme is enough?

@sweetpi
Copy link
Collaborator

sweetpi commented Oct 10, 2015

In any case: We should not repeat the error message and parse the result as an error message, if json parse fails...

@mwittig
Copy link
Collaborator

mwittig commented Oct 10, 2015

@sweetpi OK, I am ready to do this. I have already sorted the error message on my working copy and will add the apikey as an optional feature to your fork of "node-openweathermap". EDIT: Perhaps you give me access to the repo, or I'll do a fork/PR, otherwise.

mwittig added a commit to mwittig/pimatic-openweather that referenced this issue Oct 11, 2015
…r" (1 min) which applies if last request failed

+ Added API key handling following issue josecastroleon#9
+ Updated README
mwittig added a commit to mwittig/node-openweathermap that referenced this issue Oct 11, 2015
…send response with error string - see issue josecastroleon/pimatic-openweather#9

Revised license information to provide a SPDX 2.0 license identifier according to npm v2.1 guidelines
@mwittig
Copy link
Collaborator

mwittig commented Oct 11, 2015

Published pimatic-openweather@0.8.16

@mwittig mwittig closed this as completed Oct 11, 2015
@poeml
Copy link

poeml commented Oct 11, 2015

Big thank you from my side.

Viele Grüße, Peter Pöml

Am 11.10.2015 um 17:32 schrieb Marcus Wittig notifications@github.com:

Published pimatic-openweather@0.8.16


Reply to this email directly or view it on GitHub.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants