MMM-soccer icon indicating copy to clipboard operation
MMM-soccer copied to clipboard

New version in works w/ several updates

Open lavolp3 opened this issue 5 years ago • 22 comments

I am working on a new version of this module with several changes, updates and fixes. I have done so many changes that it might be difficult to implement them here. A few examples:

  • several leagues
  • optional matches and table
  • focus on one team per league in table and matches
  • cup mode for CL.
  • fixed focus Planned
  • live mode (focus on matches in play)
  • include more leagues/cups using another API

I'd also try to include the issues on this repository.

@fewieden what is your opinion? Should I send a PR to the develop branch or publish an own repository with the changes references this rep? I'd rather do the latter.

lavolp3 avatar Feb 20 '20 08:02 lavolp3

already included are fixes for #24 , #26 , #22 , #11 (CL)

lavolp3 avatar Feb 20 '20 13:02 lavolp3

It would be awesome if you would release your code and I would love to give it a try! I suggest just opening your own repo/fork as there has been no response up until now.

This Repo is released under MIT license so it should be no problem.

Studentenfutter avatar Apr 01 '20 17:04 Studentenfutter

It's online. See my fork However not much soccer to follow at the moment. The postponements are messing the data up unfortunately.

I'll consider de-forking it since I don't plan to send PRs unless explicitely wished for. There are just too many changes

lavolp3 avatar Apr 01 '20 18:04 lavolp3

@lavolp3 feel free to either send a pr or creating your own module

fewieden avatar Apr 06 '20 17:04 fewieden

@lavolp3 I've installed your fork but I can't get the PL table to display

{ module: 'MMM-soccer', position: 'bottom_right', config: { api_key: 'xxxxxxxxxxx', show: ['PL'], colored: true, updateInterval: 60, showTables: true, matchType: 'league' } }, image

robertybob avatar Jul 26 '20 16:07 robertybob

@robertybob hm. It works for me. Can you include

debug: true

in your config and post any errors shown in the browser dev tools (press F12)?

lavolp3 avatar Jul 26 '20 22:07 lavolp3

@robertybob hm. It works for me. Can you include debug: true

in your config and post any errors shown in the browser dev tools (press F12)?

Uncaught TypeError: Cannot read property 'standings' of MMM-soccer.js:249
undefined
    at Class.filterTables (MMM-soccer.js:249)
    at Class.socketNotificationReceived (MMM-soccer.js:123)
    at module.js:243
    at r.<anonymous> (socketclient.js:39)
    at r.emit (index.js:83)
    at r.onevent (index.js:83)
    at r.MMSocket.self.socket.onevent (socketclient.js:33)
    at r.onpacket (index.js:83)
    at r.<anonymous> (index.js:83)
    at r.emit (index.js:83)

and then

Uncaught TypeError: Cannot read proerty 'standings' of MMM-soccer.js:249 
undefined
    at Class.filterTables (MMM-soccer.js:249)
    at MMM-soccer.js:113

robertybob avatar Jul 27 '20 22:07 robertybob

OK, I see that this message also appears when I leave out the API key. That needs improvement. Meanwhile please re-check your API key.

lavolp3 avatar Jul 27 '20 23:07 lavolp3

OK, I see that this message also appears when I leave out the API key. That needs improvement. Meanwhile please re-check your API key.

Thank you. I’ve packed away my Pi for tonight but I’ll check this again tomorrow. I’m sure I copied it correctly directly from the email I received, however I will also set the api to false too (just to be sure it’s definitely my api key)

robertybob avatar Jul 28 '20 00:07 robertybob

OK, I see that this message also appears when I leave out the API key. That needs improvement. Meanwhile please re-check your API key.

I've just tried it with api_key: false and I'm still having that exact same issue

 { 			module: 'MMM-soccer', 
			position: 'bottom_right', 
			config: { 
				show: ['PL'], 
				colored: true, 
				updateInterval: 60, 
				api_key: false, 
				showTables: true, 
				matchType: 'league' 
				} 
	},
Uncaught TypeError: Cannot read property 'standings' of MMM-soccer.js.249
undefined
at Class.filterTables (MMM-soccer.js:249)
at MMM-soccer.js:113

robertybob avatar Jul 28 '20 23:07 robertybob

@lavolp3 I've even copied your example one from your README and even that doesn't work (I'll include my API key this time too)

{
    module: 'MMM-soccer',
    position: 'bottom_right',
    config: {
        api_key: '0cff872ba97b443cbd1762d6ae167d23',
        show: ['CL', 'BL1', 'PL'],
        colored: true,
        updateInterval: 60,
        focus_on: {'BL1': 'FC Bayern München'},
        max_teams: 5,
        matchType: 'league'
    }
},

I'm trying to run this on a Raspberry Pi, I assume you're doing the same? :) 

robertybob avatar Jul 28 '20 23:07 robertybob

Can you run the mirror in dev mode

pm2 stop all
npm start dev

and post any error showing up in the console?

lavolp3 avatar Jul 29 '20 06:07 lavolp3

image

and the debug log from that error:

0 info it worked if it ends with ok 1 verbose cli [ '/usr/bin/node', '/usr/bin/npm', 'start', 'dev' ] 2 info using [email protected] 3 info using [email protected] 4 verbose config Skipping project config: /home/pi/.npmrc. (matches userconfig) 5 verbose stack Error: ENOENT: no such file or directory, open '/home/pi/package.json' 6 verbose cwd /home/pi 7 verbose Linux 5.4.51-v7+ 8 verbose argv "/usr/bin/node" "/usr/bin/npm" "start" "dev" 9 verbose node v10.22.0 10 verbose npm v6.14.6 11 error code ENOENT 12 error syscall open 13 error path /home/pi/package.json 14 error errno -2 15 error enoent ENOENT: no such file or directory, open '/home/pi/package.json' 16 error enoent This is related to npm not being able to find a file. 17 verbose exit [ -2, true ]

robertybob avatar Jul 29 '20 22:07 robertybob

You need to be inside the MagicMirror folder when executing this.

Also, you had three mm instances running via pm2. I doubt that this was intended? That might create lots of issues. You need to be sure to run one instance at a time, otherwise there will be several node_helpers running and you would send requests to APIs much more often than intended. Might be the reason for this issue as well

lavolp3 avatar Jul 30 '20 07:07 lavolp3

Thank you. I've no idea how I've managed to get multiple pm2 instances running, it happens automatically when I turn on the Pi. I don't know how to stop that, at this rate I think I'll just format the SD card and start again

robertybob avatar Jul 31 '20 00:07 robertybob

Id suggest to have a look into the documentation for pm2 and find it how to disable two of the three autostarts. It's surely not difficult.

lavolp3 avatar Jul 31 '20 13:07 lavolp3

@lavolp3 I created a new MM from scratch and it's seemingly working fine. Sorry for being a pain. Would you like me to delete my comments above?

robertybob avatar Sep 07 '20 21:09 robertybob

@robertybob no, no problem. Happy your issues have been solved.

lavolp3 avatar Sep 08 '20 04:09 lavolp3

closing this since I haven't send a PR and you have made many changes as well. Let me know if you have an interest to merge our work somehow.

lavolp3 avatar Jan 07 '21 10:01 lavolp3

@lavolp3 I cleaned up the repository a lot, as I didn't touch it for about 2 years. I'm curious about the changes you did and will try to check them out this weekend.

I'm interested in extending the functionality, therefore reopening the discussion.

Would you be interested in pair programming in order to merge our two versions?

fewieden avatar Jan 08 '21 07:01 fewieden

I don't know exactly what you mean but sounds good! Im thinking about giving me co-ownership or write-access and making together a plan of what to integrate/work on. Would be open for that. Sounds fun!

lavolp3 avatar Jan 08 '21 09:01 lavolp3

@lavolp3 I added you on discord, we can discuss further details there

fewieden avatar Jan 08 '21 15:01 fewieden