fewieden / MMM-soccer

European Soccer Standings Module for MagicMirror²
MIT License
31 stars 24 forks source link

New version in works w/ several updates #28

Open lavolp3 opened 4 years ago

lavolp3 commented 4 years ago

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:

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 commented 4 years ago

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

Studentenfutter commented 4 years ago

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.

lavolp3 commented 4 years ago

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

fewieden commented 4 years ago

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

robertybob commented 3 years ago

@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

lavolp3 commented 3 years ago

@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)?

robertybob commented 3 years ago

@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
lavolp3 commented 3 years ago

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.

robertybob commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

@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? :) 
lavolp3 commented 3 years ago

Can you run the mirror in dev mode

pm2 stop all
npm start dev

and post any error showing up in the console?

robertybob commented 3 years ago

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 npm@6.14.6 3 info using node@v10.22.0 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 ]

lavolp3 commented 3 years ago

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

robertybob commented 3 years ago

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

lavolp3 commented 3 years ago

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.

robertybob commented 3 years ago

@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?

lavolp3 commented 3 years ago

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

lavolp3 commented 3 years ago

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.

fewieden commented 3 years ago

@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?

lavolp3 commented 3 years ago

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!

fewieden commented 3 years ago

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