Read the statement by Michael Teeuw here.
MMM-News and BBC
-
@DarrenHill what is your address: in mm config.js?
have u changed it recently?
does this module report errors in the console?
might be a CORS error… -
Thanks gents. Nice to know support is still there.
It was working a while back (several weeks) then it started showing images with #null and no other text, and now it doesn’t show anything in the area assigned to it.
In mm-error.log after a reboot, all I see is this:
[06.09.2022 20:13.58.974] [ERROR] Whoops! There was an uncaught exception... [06.09.2022 20:13.58.990] [ERROR] Error: listen EADDRINUSE: address already in use 0.0.0.0:8080 at Server.setupListenHandle [as _listen2] (node:net:1330:16) at listenInCluster (node:net:1378:12) at doListen (node:net:1516:7) at process.processTicksAndRejections (node:internal/process/task_queues:84:21) { code: 'EADDRINUSE', errno: -98, syscall: 'listen', address: '0.0.0.0', port: 8080 } [06.09.2022 20:13.58.992] [ERROR] MagicMirror² will not quit, but it might be a good idea to check why this happened. Maybe no internet connection? [06.09.2022 20:13.58.993] [ERROR] If you think this really is an issue, please open an issue on GitHub: https://github.com/MichMich/MagicMirror/issues [29786:0906/201403.366075:ERROR:viz_main_impl.cc(186)] Exiting GPU process due to errors during initialization [29882:0906/201403.754866:ERROR:gpu_memory_buffer_support_x11.cc(44)] dri3 extension not supported. [29803:0906/201403.845480:ERROR:command_buffer_proxy_impl.cc(126)] ContextResult::kTransientFailure: Failed to send GpuControl.CreateCommandBuffer.(I renamed the log file and started a fresh log file with a reboot, as the old one is large and full of stuff).
The mirror has a static IP address which hasn’t changed, and I haven’t knowingly changed anything in the config, at least since the problem arose.
Can you remind me how to access the console?
-
@DarrenHill alt-spacebar, n
MagicMirror is the app created by my install
mm is the one created by following the manual instructions.
pm2 stop all
will stop everythingpm2 info 0 (or name) will dump out the info about what is to be run…
for MagicMirror it is /home/pi/MagicMirror/I stallers/mm.shto delete an entry
pm2 delete 0( or 1 or a name)
then pm2 save to update the pm2 startup cachepm2 --help, like most Linux commands will tell you all the things it can do
-
@sdetweil Thanks - I just found the wiki page about auto starting and saw I had somehow got it running twice.
That’s now fixed, but after a reboot the module issue still remains.
I’ll go check logs and console now.
-
@sdetweil OK I’ve found a News module error in the MagicMirror-out.log:
[06.09.2022 20:26.46.502] [LOG] [NEWS] Error : https://newsapi.org/v2/top-headlines?sources=bbc-news&pageSize=100&apiKey=<redacted> TypeError: Cannot read properties of undefined (reading 'toString') at slugify (/home/pi/MagicMirror/modules/MMM-News/node_helper.js:24:17) at cb (/home/pi/MagicMirror/modules/MMM-News/node_helper.js:89:33) at getArticles (/home/pi/MagicMirror/modules/MMM-News/node_helper.js:135:22) at process.processTicksAndRejections (node:internal/process/task_queues:96:5)I’ve removed my API key string, but the rest is copy/paste.
I tried a git pull on the module the other day before my first post here, and it’s up to date.
-
@DarrenHill that error means the content back from the API is not as expected. either nothing there or the format changed.
-
@sdetweil OK, although from what @mumblebaj posted above it still works for him with my config?
I’ll try removing it and reinstalling it and see if that helps.
-
@DarrenHill not a reinstall thing
-
@sdetweil OK.
So I guess I’m stuck for now unless you or the others have any suggestions.
I was wondering as you say if the incoming info format had changed when it started throwing the #null text, but it’s weird that it works for others?
-
@DarrenHill
Well, I also tried your config with my apiKey and it worked.Try this in your browser and let’s see what happens.
https://newsapi.org/v2/top-headlines?sources=bbc-news&pageSize=100&apiKey=YOUR_KEY
-
@DarrenHill ediut node_helper.js
insert this line
console.log("fetch result=",result)after line 128 so it looks like this
var result = await response.json() console.log("fetch result=",result) return(result)then rerun MM… best to stop using pm2 for all this
pm2 stop allthen
cd ~/MagicMirror npm start >somefile.txt 2>&1wait 15 seconds
ctrl-m to minimize MM
then ctrl-c on the terminal window you use to start MMthen edit somefile.txt
to look for status:
(ctrl-w in nano)this is another dumb api… there is an error , but it doesn’t return it in the return code, but in the data!!!.. stupid…
for mine it says (with a bad key)
[06.09.2022 14:56.29.138] [LOG] fetch result= { status: 'error', code: 'apiKeyInvalid', message: 'Your API key is invalid or incorrect. Check your key, or go to https://newsapi.org to create a free API key.' } -
@MMRIZE said in MMM-News and BBC:
@DarrenHill
Well, I also tried your config with my apiKey and it worked.Try this in your browser and let’s see what happens.
https://newsapi.org/v2/top-headlines?sources=bbc-news&pageSize=100&apiKey=YOUR_KEY
It should be like something similar to this(if your apiKey is valid);
{"status":"ok","totalResults":10,"articles":[{"source":{"id":"bbc-news","name":"BBC News"},"author":"BBC News","title":"Vaping: Juul to pay $438.5 m in youth marketing probe","description":"US prosecutors accuse the firm of \"relentlessly\" targeting underage buyers.","url":"http://www.bbc.co.uk/news/business-62813896","urlToImage":"https://ichef.bbci.co.uk/news/1024/branded_news/1F91/production/_126618080_323275f83124ee4f8c4cbed6b71c6807fe92d57c.jpg","publishedAt":"2022-09-06T19:52:21.045172Z","content":"Juul Labs will pay $438.5m (£380m) to end a probe of its advertising to underage buyers as it rose to be one of the top e-cigarette firms in the US.\r\nThe deal with 33 states and Puerto Rico also rest… [+1826 chars]"}, … -
@MMRIZE said in MMM-News and BBC:
https://newsapi.org/v2/top-headlines?sources=bbc-news&pageSize=100&apiKey=YOUR_KEY
I get this, which looks slightly different to yours? :
{"status":"ok","totalResults":10,"articles":[{"title":"Vaping: Juul to pay $438.5 m in youth marketing probe","author":"BBC News","source":{"Id":"bbc-news","Name":"BBC News"},"publishedAt":"2022-09-06T19:52:21.045172Z","url":"http://www.bbc.co.uk/news/business-62813896"},{"title":"Eliza Fletcher: Police identify body found in search for heiress","author":"BBC News","source":{"Id":"bbc-news","Name":"BBC News"},"publishedAt":"2022-09-06T16:52:18.6995928Z","url":"http://www.bbc.co.uk/news/world-us-canada-62811661"},{"title":"Ukraine war: Russians to pay €45 more to enter EU under new rules","author":"BBC News","source":{"Id":"bbc-news","Name":"BBC News"},"publishedAt":"2022-09-06T16:37:23.3671715Z","url":"http://www.bbc.co.uk/news/world-europe-62811675"},{"title":"Fat Leonard: Malaysian businessman linked to US Navy scandal escapes","author":"BBC News","source":{"Id":"bbc-news","Name":"BBC News"},"publishedAt":"2022-09-06T16:22:22.2671956Z","url":"http://www.bbc.co.uk/news/world-us-canada-62764226"},{"title":"Canada stabbings: Police hunt remaining suspect after Saskatchewan attacks","author":"BBC News","source":{"Id":"bbc-news","Name":"BBC News"},"publishedAt":"2022-09-06T15:22:24.1190163Z","url":"http://www.bbc.co.uk/news/live/world-us-canada-62811629"},{"title":"Ukraine: Ben Stiller and Sean Penn latest Americans banned from Russia","author":"BBC News","source":{"Id":"bbc-news","Name":"BBC News"},"publishedAt":"2022-09-06T12:52:14.8462267Z","url":"http://www.bbc.co.uk/news/world-europe-62806655"},{"title":"Canada stabbings: Relatives identify 'random' victims of Saskatchewan attack","author":"BBC News","source":{"Id":"bbc-news","Name":"BBC News"},"publishedAt":"2022-09-06T11:07:21.1055569Z","url":"http://www.bbc.co.uk/news/world-us-canada-62804826"},{"title":"Liz Truss: Boris Johnson to give farewell speech before new PM takes office","author":"BBC News","source":{"Id":"bbc-news","Name":"BBC News"},"publishedAt":"2022-09-06T04:37:21.3806544Z","url":"http://www.bbc.co.uk/news/live/uk-politics-62802807"},{"title":"Keith Davis: He was protecting the oceans - then he disappeared","author":"BBC News","source":{"Id":"bbc-news","Name":"BBC News"},"publishedAt":"2022-09-05T20:52:23.0241991Z","url":"http://www.bbc.co.uk/news/world-us-canada-62603911"},{"title":"Timed Teaser: How did Putin mark Gorbachev's death?","author":"BBC News","source":{"Id":"bbc-news","Name":"BBC News"},"publishedAt":"2022-09-05T20:37:23.1798468Z","url":"http://www.bbc.co.uk/news/world-us-canada-62763889"}]}@sdetweil I’ll do your test now…
-
@DarrenHill
Ok, I found something. I don’t know why, but your result has “articles.source.Name” instead of “articles.source.name” that makes this error. -
@MMRIZE yes, was just about to post that
-
@sdetweil I get this (for the relevant bit):
[06.09.2022 21:11.46.552] [LOG] fetch result= { status: 'ok', totalResults: 10, articles: [ { title: 'Vaping: Juul to pay $438.5 m in youth marketing probe', author: 'BBC News', source: [Object], publishedAt: '2022-09-06T19:52:21.045172Z', url: 'http://www.bbc.co.uk/news/business-62813896' }, { title: 'Eliza Fletcher: Police identify body found in search for heiress', author: 'BBC News', source: [Object], publishedAt: '2022-09-06T16:52:18.6995928Z', url: 'http://www.bbc.co.uk/news/world-us-canada-62811661' }, { title: 'Ukraine war: Russians to pay €45 more to enter EU under new rules', author: 'BBC News', source: [Object], publishedAt: '2022-09-06T16:37:23.3671715Z', url: 'http://www.bbc.co.uk/news/world-europe-62811675' }, { title: 'Fat Leonard: Malaysian businessman linked to US Navy scandal escapes', author: 'BBC News', source: [Object], publishedAt: '2022-09-06T16:22:22.2671956Z', url: 'http://www.bbc.co.uk/news/world-us-canada-62764226' }, { title: 'Canada stabbings: Police hunt remaining suspect after Saskatchewan attacks', author: 'BBC News', source: [Object], publishedAt: '2022-09-06T15:22:24.1190163Z', url: 'http://www.bbc.co.uk/news/live/world-us-canada-62811629' }, { title: 'Ukraine: Ben Stiller and Sean Penn latest Americans banned from Russia', author: 'BBC News', source: [Object], publishedAt: '2022-09-06T12:52:14.8462267Z', url: 'http://www.bbc.co.uk/news/world-europe-62806655' }, { title: "Canada stabbings: Relatives identify 'random' victims of Saskatchewan attack", author: 'BBC News', source: [Object], publishedAt: '2022-09-06T11:07:21.1055569Z', url: 'http://www.bbc.co.uk/news/world-us-canada-62804826' }, { title: 'Liz Truss: Boris Johnson to give farewell speech before new PM takes office', author: 'BBC News', source: [Object], publishedAt: '2022-09-06T04:37:21.3806544Z', url: 'http://www.bbc.co.uk/news/live/uk-politics-62802807' }, { title: 'Keith Davis: He was protecting the oceans - then he disappeared', author: 'BBC News', source: [Object], publishedAt: '2022-09-05T20:52:23.0241991Z', url: 'http://www.bbc.co.uk/news/world-us-canada-62603911' }, { title: "Timed Teaser: How did Putin mark Gorbachev's death?", author: 'BBC News', source: [Object], publishedAt: '2022-09-05T20:37:23.1798468Z', url: 'http://www.bbc.co.uk/news/world-us-canada-62763889' } ] } [06.09.2022 21:11.46.635] [LOG] [NEWS] Error : https://newsapi.org/v2/top-headlines?sources=bbc-news&pageSize=100&apiKey=<redacted> TypeError: Cannot read properties of undefined (reading 'toString') at slugify (/home/pi/MagicMirror/modules/MMM-News/node_helper.js:24:17) at cb (/home/pi/MagicMirror/modules/MMM-News/node_helper.js:89:33) at getArticles (/home/pi/MagicMirror/modules/MMM-News/node_helper.js:136:22) at process.processTicksAndRejections (node:internal/process/task_queues:96:5) -
-
@MMRIZE said in MMM-News and BBC:
@DarrenHill
Ok, I found something. I don’t know why, but your result has “articles.source.Name” instead of “articles.source.name” that makes this error.Anything I can do to overcome that?
No idea why I’m getting different API returns to you guys…?
-
also doesn’t get ‘content’ or ‘description’, so those will fail too…
-
I tried to register for a new api key, but when I tried it told me that they don’t support the UK (where I am) so I wonder if that somehow has something to do with it.
This has obviously changed since I first registered, and given I’m getting some response from the API it is at least partially working, but besides that I have no idea…
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login