No description
  • JavaScript 93.1%
  • Python 4.9%
  • Shell 2%
Find a file
2023-12-28 09:04:11 -07:00
apps/trpks fix high low hr swap 2023-12-28 08:53:34 -07:00
bin app deployed to personal app loader site 2023-12-27 13:31:06 -07:00
v1 basic countdown with layout 2021-12-21 18:31:48 -07:00
.prettierrc Get basic app working 2023-12-26 19:52:56 -07:00
msg.json examples 2023-12-28 09:04:11 -07:00
parse_fit.py Get basic app working 2023-12-26 19:52:56 -07:00
README.md working 2023-12-28 08:22:35 -07:00
workout.json examples 2023-12-28 09:04:11 -07:00

Charging

Looking at the back the charger should exit towards the buttons.

Development notes

Most of the instructions point towards using the web IDE. I don't want to use the web IDE so I need to handle my own connection to the device. https://www.espruino.com/Quick+Start+BLE#banglejs

First time:

settings -> security and privacy -> bluetooth # add ruby (/usr/bin/ruby) and iterm
npm i -g node-pre-gyp
npm i -g espruino

Normal development:

espruino --list
# Hopefully the device comes up in the list. If not go to troubleshooting steps.
# You now have two ways to connect
espruino -d Bangle  # via device name, this is probably easiest
Bangle.beep(); # Verify we are connected.
setWatch(() => {
  E.showMessage("You\npressed\nthe button!");
  setTimeout(()=>g.clear(), 1000);
}, BTN1);
espruino -d Bangle --watch app.js
# Write code in app.js
# On save it will be uploaded to the device

Troubleshooting: If you don't see the device in espruino --list then try connecting first through the web IDE

  1. Go to https://www.espruino.com/ide/ in Chrome
  2. Click on the connection button in the top left
  3. Click on "Web Bluetooth"
  4. Select the banglejs device from the list
  5. Connect
  6. Disconnect (maybe also try leaving connected)

On Mac when connected over web IDE to the device you can run system_profiler SPBluetoothDataType in iterm to see the mac addresses of the device.

Updating

Prettier

I've setup prettier via .prettierrc. My hope is to produce as compact code as possible which helps with the low memory usage. To run prettier: prettier app.js --write

TrainingPeaks export

In the ios app click on a workout and hit the download button. You can save it to files where ios shortcut will be able to find it.

To get a FIT file of the workout from TrainingPeaks follow these instructions.

You can then run python parse_fit.py (after updaing the file name in the script) to get an export of the workout.

Docs

Setting up custom app loader

I run a custom app loader at https://e-carlin.github.io/BangleApps . This allows me to have my own apps I'm working on be easily deployed to my watch. Without having to add them to the main repo and go through the whole pull request process.

My fork lives in ~/src/e-carlin/BangleApps.

To develop:

  1. Write some code in here (apps live in /apps).
  2. git commit -a
  3. bash bin/deploy.sh
  4. Go to https://github.com/e-carlin/BangleApps/tree/e-carlin to see the deployment progress.
  5. When deployed go to https://e-carlin.github.io/BangleApps and see the new app.

Another (faster) development option:

  1. Write some code
  2. cat apps/trpks/app.js | pbcopy
  3. Connect watch to web ide https://www.espruino.com/ide/
  4. Select upload to Storage, select trpks.app.js, then upload the file
  5. Once the file is uploaded hold btn1 and btn2 until watch reboots
  6. Now you're able to use the watch like normal with updated code.

BLE troubleshooting

If you're having trouble connecting the watch to the phone:

  1. Hit the "i" button in the bluetooth selection list for the watch
  2. Toggle "Share System Notifications"
  3. If that doesn't work click "Forget Device"
  4. Open up the LightBlue app
  5. Find the Bangle and click on it
  6. It will prompt to pair and accept messages. Say yes to both.