- JavaScript 93.1%
- Python 4.9%
- Shell 2%
| apps/trpks | ||
| bin | ||
| v1 | ||
| .prettierrc | ||
| msg.json | ||
| parse_fit.py | ||
| README.md | ||
| workout.json | ||
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
- Go to https://www.espruino.com/ide/ in Chrome
- Click on the connection button in the top left
- Click on "Web Bluetooth"
- Select the banglejs device from the list
- Connect
- 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
- https://www.espruino.com/Bangle.js
- https://www.espruino.com/Bangle.js+Layout
- app store https://banglejs.com/apps/
- functions https://www.espruino.com/ReferenceBANGLEJS
- bluetooth https://forum.espruino.com/conversations/341272/
- resetting https://www.espruino.com/Bangle.js#resetting You can go to "More.."" in GUI and i click "Install favourite apps" which will delete everything and install just my apps. This works with my version of the app loader website.
- setting up custom app loader https://www.espruino.com/Bangle.js+App+Loader (https://e-carlin.github.io/BangleApps/)
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:
- Write some code in here (apps live in /apps).
- git commit -a
bash bin/deploy.sh- Go to https://github.com/e-carlin/BangleApps/tree/e-carlin to see the deployment progress.
- When deployed go to https://e-carlin.github.io/BangleApps and see the new app.
Another (faster) development option:
- Write some code
cat apps/trpks/app.js | pbcopy- Connect watch to web ide https://www.espruino.com/ide/
- Select upload to Storage, select trpks.app.js, then upload the file
- Once the file is uploaded hold btn1 and btn2 until watch reboots
- 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:
- Hit the "i" button in the bluetooth selection list for the watch
- Toggle "Share System Notifications"
- If that doesn't work click "Forget Device"
- Open up the LightBlue app
- Find the Bangle and click on it
- It will prompt to pair and accept messages. Say yes to both.