citolen / goproh4

Node.js module to control a GoPro Hero 4
MIT License
103 stars 24 forks source link

Wake on Lan not working #12

Closed famasya closed 8 years ago

famasya commented 8 years ago

Hi, I just tried your module and it's pretty awesome. But when I called powerOn() I can't wake it up. I have set the mac address correctly.

citolen commented 8 years ago

Hello Abid,

I really apologies for the delay, I've been busy.

Hopefully you have already resolved the issue. Otherwise I might have found what could be the problem, it's possible that the camera is turned off before it has even retrieved the mac address (I will find a fix for it).

Can you first try this to see if this code below works, it is suppose to turn off then 8 seconds later turn back on and it will output the mac address.

var GoPro = require('goproh4');

var cam = new GoPro.Camera();

cam.status()

// Fix: dirty wait to give time to the gopro to retrieve the mac address
.delay(1000)

.then(function () {
   // Turn the camera off
   return cam.powerOff();
})

// Wait 8s
.delay(8000)

// Turn the camera on
.then(function () {
    console.log('mac address:', cam._mac);
    return cam.powerOn()
});

If this works you should have your GoPro's mac address and you can then poweroff your GoPro manually and try to power it back on with this code:

var GoPro = require('goproh4');

var cam = new GoPro.Camera({
    mac: [ 212, 217, 22, 46, 114, 111]
});

cam.powerOn();

Hopefully this can help you.

brownell commented 8 years ago

I have created a fix for this that works with my GoPro Hero 4 Black.

I will create a pull request.

citolen commented 8 years ago

b6d6fdaedad8b58b19249cd075de0c5f54f38903