IMO this doesn't work because at the time you call require("ble_eddystone"), the Puck is already left alone without any link to reach the module source. What you could try is to upload in the Puck a script like
var beacon=require("ble_eddystone");
save();
Then on your web page , the command should be <button onClick="Puck.write('NRF.setAdvertising([beacon.get("goo.gl/B3J0Oc")]);\n');">Advertise</button>.
This way, you ensure the module ble_eddystoneis already available on the Puck.
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
IMO this doesn't work because at the time you call
require("ble_eddystone")
, the Puck is already left alone without any link to reach the module source. What you could try is to upload in the Puck a script likeThen on your web page , the command should be
<button onClick="Puck.write('NRF.setAdvertising([beacon.get("goo.gl/B3J0Oc")]);\n');">Advertise</button>
.This way, you ensure the module
ble_eddystone
is already available on the Puck.