-
@Gordon -- cool! Loaded it up, connected, loaded my LBS service code and it all works just fine. Seems the LED's and buttons have the polarity switched though... No big deal at all!
Nice...
-
Thanks @Gordon for putting up with the noob... I'll be looking out for 1v92 and I'll work on the beacon code some more, probably over the weekend.
I hope you can tell that I love the puck, btw... Quick question: is there a version of this code that will run on the Nordic 10040 Dev Kit? I'd love to be able to use the work you've done on a board with easier access to IO and power supplies.
-
@Gordon - last post of the day; need to move to another task. I switched to a 'virgin' device and can't get the code snippet to load. I must be making some noob mistake here. I just copied the code you provided above into the editor window and clicked the 'send to espruino' button. It seems to send, but a dump(); shows nothing. I tried copy and paste directly into the espruino window to no avail. See the attachment above; I get the same behavior. I must be doing something stupid here?
-
HI @Gordon; Yes, I rebooted it. I've even reloaded the flash completely (DFU). I'm still having flash issues, it seems. I can't even make this behave enough to load the code snippet above. See the attached screen grab. This is after doing the DFU update. I can't even get it to load code. I think somehow my flash is corrupted in this device. Do you concur? I have a spare but haven't used it yet...
-
Hi @Gordon, Hope I'm not taking too much of your bandwidth, but really appreciate the help as I explore the puck with some practical applications.
I've been in contact with the Nordic folks and the SoftDevice does support getting RSSI for each handle (connection). It would be great to have a way to access this on the puck. See below:
In order to measure the RSSI on a connected peripheral, you can use
the SoftDevice functions sd_ble_gap_rssi_get(),
sd_ble_gap_rssi_start() and sd_ble_gap_rssi_stop(). Provide the
conn_handle for the peripheral you want to get the RSSI from. You can
read more about these functions
here. -
@Gordon - that didn't work. I had gotten to this point by using "save on send", so I enabled that again and used "var foo;" and was finally able to clear it out that way. I had even reloaded the boot code. Somehow that area of flash isn't getting cleared properly by any other method. I'd say there is a bug if I had to guess... I'd imagine this is going to cause others to have issues, so it bears looking into if you can do so. See attached screen grab.
Now, on to my task. I tried the following, but don't see the UUID/major, minor being advertised when I use my iBeacon scanners on the iPhone. It is based on the previously mentioned conversation:
var advertise = function(options) { var d = new Uint8Array([ 0x02, // Number of bytes after first AD structure 0x01, // BLE_GAP_AD_TYPE_FLAGS 0x04, // BLE_GAP_ADV_FLAG_BR_EDR_NOT_SUPPORTED 0x1A, // Length 0xFF, // BLE_GAP_AD_TYPE_MANUFACTURER_SPECIFIC_DATA 0x4C, 0x00, // 0x004C == Apple 0x02, 0x15, // iBeacon type + length 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,// iBeacon proximity uuid 0x80, 0x00, // major 0x34, 0xab, // minor 0xc5]); // 2'c complement RSSI at 1 meter distance in dBm d.set(options.uuid,9); if (options.major!==undefined) d.set([options.major>>8,options.major],25); if (options.minor!==undefined) d.set([options.minor>>8,options.minor],27); if (options.rssi!==undefined) d.set([(options.rssi<0)?(options.rssi+256):options.rssi],29); var e = [].slice.call(d); NRF.setAdvertising(e, {interval:100}); }; advertise({ uuid : [0xDA, 0xB5, 0x9C, 0x4F, 0xA4, 0xD6, 0xEE, 0x28, 0x6B, 0xFE, 0x8E, 0x00, 0x00, 0xBB, 0xC2, 0xBB], // ibeacon uuid major : 0x8000, // optional minor : 0x1234, // optional rssi : -59 // optional RSSI at 1 meter distance in dBm });
-
Hi,
I need some help understanding setRSSIHandler(). I want to get RSSI for individual connections that are made from the puck-js when operating as a Central. The scenario is: device connects to puck (puck as peripheral), puck connects to another device (puck as central) simultaneously. What does setRSSIHandler report?A code snippet would also be helpful; the documentation shows a commented snippet without context and is probably part of my confusion.
Thanks!
Bill -
Hi @Gordon, thanks for the reply. I had indeed found that conversation, but it didn't work for me. I think the problem stems from bootcode that I had set and can't seem to get rid of.
I've read past conversations about issues and tried what I found. See attached; what am I doing wrong to clear the flash and get rid of bootcode?
-
Correct I don't want to change BDADDR (programmed at the factory). I tried to use nrf.setAdvertising() as shown in the iBeacon discussion (http://forum.espruino.com/conversations/298200/) , but couldn't get it to work for changing the UUID. All of the iBeacons I use for the application I'm developing have the same UUID for ease of location and then use the Major and Minor.
Something I'm missing?
-
-
-
Hi All,
I supported puck.js in Kickstarter. I'm a bluetooth geek and recently got called upon to help a friend with a piece of stagecraft for the theater. They needed an actor-initiated button to actuate a relay at the light board. I prototyped it using a Nordic PCA10028 dev board set using their LED Button Service (LBS) demo. This weekend I picked up my puck.js's and implemented the peripheral side (code attached). I'm still using the dev board for the central so that they can use AC power (through USB) for that side and easily access the IO pins.Bottom line - code attached for Nordic's LBS peripheral side - my first puck.js project. Shipped it off today.
Enjoy (I sure did)!
Hi @Gordon,
I'm trying to find documentation on how to set up to receive a notification event when the puck is operating as a Central. Any hints, or is this possible (hope it is)?
Thanks!
Bill