-
D17 is not listed because I ran the code in the RAM only setting 3 pins with setWatch. If I added the code to my clock app, D17 is also listed. Still no clue for the D24 appears again at the end of the list. It's nothing to do with the hardware, so you can try with your own watch, I guess.
I don't really care about more interrupt pins anymore because I can use my solution (#28) with diodes. I already tried this solution and it works fine as expected. -
After I tried to set pins with setWatch for the 3 pins, I ran your command again. Here is the result.
>global["\xFF"].watches =[ undefined, { pin: D32, recur: true, edge: -1, cb: function () { ... }, state: false }, { pin: D24, recur: true, edge: -1, cb: function () { ... }, state: false }, { pin: D22, recur: true, edge: -1, cb: function () { ... }, state: true }, { pin: D24, recur: true, edge: -1, cb: function () { ... }, state: false } ]
-
-
-
Here is my solution with diodes. See attached animated gif.
Three digital input (input_pullup, no additional 100k resistors in the image are needed) pins with 3 diodes will be used. As mentioned before, only 2 pins can be watched by setWatch with interrupts, so I will set two pins (D32 and D24) for setWatch and the third pin, D42, can be combined in the code to watch. In other words, no matter which button is pressed, always one or both of D32 and D24 will be triggered. This way, with only 2 interrupts, 4 pins can be monitored. Actually, there is one more combination, D24 and D42, is available for another switch if needed.
I saved one pin, D43, for an analog output for the buzzer. -
-
@Gordon, I was looking for easier and simple solution by using existing pins. I know, I'm lazy. :)
Your suggested method with resistors looks very interesting. I will definitely try it. I was thinking to use a combination with diodes, but I will see which one works better.
Thank you Gordon for sharing your brilliant ideas as always.
I will try a few approaches and report back. -
From the HRM connector header, I could only identify HRM_SDA (D24) and HRM_SCL (D32). I guess the other pins (HRM_INT and HRM_POWER) are gated. It’s hard to trace without removing components which likely damage parts.
Gordon already answered that the schematic is not available and no answers from anyone for my question about the HRM header pinout, so my guess is Bagle.js’ software is open, but not the hardware.
I really want just one more pin. Can anyone just let me know whether any of those pins, HRM_INT and HRM_POWER or both, are exposed and accessible on the PCB and where they are if accessible?Thanks.
-
-
I disconnected the HRM connector and checked each pins to find which is which. So I located 4 pins (D21: HRM_POWER, D22: HRM_INT, D24: HRM_SDA, D32: HRM_SCL). I was excited to see if I could use them as digital input for extra switches. Of course, the HRM power was off.
But it seems only two pins are allowed to use. I got an errorWARNING: No free GPIOTE for watch
if I tried to set more than 2 pins as digital inputs as @halemmerich also mentioned HERE.I couldn't find any information on the GPIOTE and why I got the errors. Does anyone have any clue?
Thanks.Update:
It looks like I would need to use nRF52 low level interface library, but have no clue how to use it. Is this the one I need to look at or should I do something else?
Thanks.Update 2:
So, I guess the GPIOTE (GPIO task and event) has certain limited number. And the pins for the HRM seems to be already taken in the Bootloader or firmware. If this is correct, how can I remove pre-assigned GPIOTE for the HRM? -
-
That's interesting to be able to double the voltage. I will take a look. But I still want another extra pin(s) for additional switches, so I will see if I can find any other unused pins.
@Gordon, I have asked this question before, but if there is a schematic available, it would be easy to trace/find an extra pin. If the schematic is not available for public, can you tell me at least how many layers in the PCB? If it's just 2 layers (top and bottom), I may be able to trace those test points.Since I'm not going to use the HRM, I guess I can use some of those pins like HRM_INT, HRM_SDA or HRM_SCL from the connector. Can I get the pinouts of the HRM header?
Thanks!
-
-
@halemmerich, yes, I saw your post for the custom case. That looks pretty good.
Here is the function to drive the piezo.
function piezoBuzz(pin, frequency, times, duration, pause) { let count = 0; function buzz() { if (count < times) { analogWrite(pin, 0.5, { freq: frequency }); setTimeout(() => { analogWrite(pin, 0); setTimeout(() => { count++; buzz(); }, pause); }, duration); } } buzz(); }
And here is an example to call the function.
piezoBuzz(D43, 5600, 2, 200, 200); //UATX pin, 5.6kHz, twice, 200ms pulse, 200ms pause
-
I (finally) opened the watch and attached a 27mm diameter piezo disc (with cutting sides to fit in the case) directly to the pin D43 (UATX) and GND. Even without a MOSFET, it sounded loud enough before reassembling the watch. But after assembling the watch and glued the screen, the sound level decreased significantly as expected. It was kind of an experiment. The piezo disc was not glued to any hard surface (such as inside of the watch back) which is needed for the disc vibrate properly.
My eventual goal is listed as below.- Modify (redesign and 3D print) the case for bigger battery and serviceability (screws instead of glue) and hard (aluminum maybe) back cover for the piezo disc.
- Add a MOSFET driver for the piezo disc using one of the pins, D42 or D43.
- Move the buzz motor to side of the watch and glue to the case for better buzz feel.
- Add a button switch to one of the extra pins (D42 or D43)
- Unfortunately the HRM sensor will be removed due to the back cover with the piezo disc. I don't really need the HRM anyway.
I wish I had another extra pin for digital input, but I guess there is no more extra pin, is there? If there is one, I could add one more switch. Actually, if I could use 2 DI pins, I could add 3 switches using binary input.
The reason why I want a bigger battery is for my golfing (golf-gps). Because it needs the GPS on all the time, the battery lasts about 5 hours which is normally fine even if there is some delay on the course. But if there is a longer delay, the watch can't work until the end of the game.
Just an FYI, the battery usually lasts longer than 3 weeks with normal usage (clock, notifications from the phone, and occasional HRM).I'm also very much interested in Gordon's GPS low level communication that he improved the fix time a lot. I'd like to find a way to reduce battery consumption by the GPS, power saving mode or data retrieving frequency adjustment, etc.
- Modify (redesign and 3D print) the case for bigger battery and serviceability (screws instead of glue) and hard (aluminum maybe) back cover for the piezo disc.
-
@Gordon, this is great news. I’m sorry that I didn’t see this post earlier. I will test the new GPS updater and report the results.
Thank you so much for your continuous effort on this matter. -
@Gordon, so far I haven’t noticed any issues with the onscreen keyboard. Until Apple fixes the bug, I think we can live with the HID enabled setting.
Thanks. -
@Gordon, by enabling the HID as a keyboard, iPhone finds it and I could connect them. Would there be any side effect by the HID setting or can I leave it as it is?
Thanks. -
@Gordon, I tried your suggested 'advertising the ANCS service,' but it didn't work.
NRF.setServices(undefined, { advertise: [ 'F431' ] });
-
I was able to find it with this app, which allows you to pair.
https://apps.apple.com/us/app/nrf-connect-for-mobile/id1054362403@pixelkarma, Wow, thank you so much. With the app, I could connect my Bangle.js 2 to my iPhone with iOS 18.01.
-
@Gordon, as always, thank you for your support.
I'm 100% sure it's not the watch's issue, but iOS issue.
I wondered if there are other iPhone users having the same issue and find any solution.
I will keep trying something and report back if I find anything.
Thanks. -
@Gordon, yes, I have restarted/toggled BLE/toggled airplane mode of my phone, rebooted the watch, tried older/cutting edge firmware (currently 2v24). Everything else works fine, but between the phone and the watch.
I'm not sure what else I could try now. :-( -
My iphone got upgraded to iOS 18.0 recently and I couldn't connect my Bangle.js 2 to the phone. I have no issues to connect to my both Windows laptop and Linux laptop, and my phone is still connect to my car via Bluetooth, so I think it's got to do with the iOS.
Just wonder if anyone else has the same issue and what could be the solution.Thanks.
-
I didn't mean to be rude. I just realized my previous reply might have sounded not very nice. My apologies. I'm also curious about the limits, but I just wanted to say I found a solution and I was fine without more interrupts. Thank you.