Ogadai / zwift-mobile-api

MIT License
120 stars 25 forks source link

404 for riderStatus #10

Closed otakuu closed 6 years ago

otakuu commented 6 years ago

Hi,

When I wanna get the riderStatus I get a 404:

world.riderStatus(playerId).then(status => { console.log(status); // JSON of rider status });

(node:12596) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 2): Error: Request failed with status code 404

otakuu commented 6 years ago

i am an idiot. rider has to be riding...

Ogadai commented 6 years ago

No worries @otakuu - it's not obvious and probably should be mentioned in the docs :-)

otakuu commented 6 years ago

hi ogadai

your API is awesome! thank you for this work!

i wanna build a speed controlled fan like you and i saw your project. would you mind sending me a skeleton of settings.js. It's git-ignored.

greets domnic

2017-11-30 10:20 GMT+01:00 Ogadai notifications@github.com:

No worries @otakuu https://github.com/otakuu - it's not obvious and probably should be mentioned in the docs :-)

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Ogadai/zwift-mobile-api/issues/10#issuecomment-348129292, or mute the thread https://github.com/notifications/unsubscribe-auth/AE8SdlC4GD9jLWWGQxXLCgPrJEfgmJS0ks5s7nNvgaJpZM4QwLl7 .

Ogadai commented 6 years ago

I think you're referring to the zwift-fan-speed project?

settings.js is ignored because it has credentials in it. It should look something like this:

module.exports = {
    username: '{zwift user name}',
    password: '{zwift password}',
    player: {zwift rider id},
    interval: 2000,
    fan: {
        gpio: { pin: 20 },
        min: 10,
        max: 50,
        scale: 1.5,
        pollInterval: 20
    }
};

Note that this project works with my 12v DC fan (turning the power off and on to slow it down). A mains/AC fan would require a different approach (and not a dimmer switch)

otakuu commented 6 years ago

thank you very much!

2017-11-30 14:10 GMT+01:00 Ogadai notifications@github.com:

I think you're referring to the zwift-fan-speed https://github.com/Ogadai/zwift-fan-speed project?

settings.js is ignored because it has credentials in it. It should look something like this:

module.exports = { username: '{zwift user name}', password: '{zwift password}', player: {zwift rider id}, interval: 2000, fan: { gpio: { pin: 20 }, min: 10, max: 50, scale: 1.5, pollInterval: 20 } };

Note that this project works with my 12v DC fan (turning the power off and on to slow it down). A mains/AC fan would require a different approach (and not a dimmer switch https://www.facebook.com/groups/zwiftCoders/permalink/1215919811873577/)

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Ogadai/zwift-mobile-api/issues/10#issuecomment-348183620, or mute the thread https://github.com/notifications/unsubscribe-auth/AE8Sdh3mAYfTQVDqms3RFeZtbnrlWrgKks5s7qlKgaJpZM4QwLl7 .