martes, 25 de octubre de 2022
(My) Best espruino apps (for bangle.js 1)
xx
miércoles, 5 de enero de 2022
Commands and developing for Espruino
IDE commands
reset(); //most common command when you find problems
after any freeze
require("Storage").eraseAll();
Removes all files, including apps that can't be removed from apps loader
E.setTimeZone(2);
peek16(0x300c).toString(16); //TO see the espruino SDK
//0x8C or 0x91 is SDK12
//0x81 or 0x88 is SDK11
Memory usage per app
print(require("Storage").list().map(f=>require("Storage").read(f).length.toString().padStart(7)+" - "+f).sort());
It'll list all files sorted by size and you can see what's taking up the space
Status
process.env;
process.memory();
require("Storage").getStats();
(total, free,...storage bytes)
E.getBattery() ;
print(require("Storage").list().map(f=>require("Storage").read(f).length.toString().padStart(7)+" - "+f).sort());
Device name (useful for Gadgetbridge)
bangle.js , puck.js , espruino, espruino-dev
NRF.setAdvertising({},{name:"espruino"});
Testing notifications
GB({t:"notify", id:5, src:"gadget",title:"Test",body:"message for testing notifications "});
Basics of developing
Logging:
console.log("Debug mode enabled");
Creating the icon
Compatibility and Dynamic code
Bangle.js1 =240x240
Bangle.js2= 176x176
var v_model=process.env.BOARD;
//EMSCRIPTEN,EMSCRIPTEN2
if (v_model=='BANGLEJS'||v_model=='EMSCRIPTEN') {
Multidevice developing (BJS1, BJS2, P8, C16....
Code for bangle App Loader (store)
martes, 1 de junio de 2021
OTA Flashing for Hackable smartwatches
jueves, 17 de septiembre de 2020
bangle.js 1 -opensource smartwatch
- Nordic 64MHz nRF52832 ARM Cortex-M4 processor with Bluetooth LE
- 64kB RAM 512kB on-chip flash, 4MB external flash
- 1.3 inch 240x240 16 bit LCD display with 2 zone touch (1+2=3rd zone)
Configuration:
Connection
Web BLE Admin apps
Gadgetbridge
Android, Settings, Sounds and notifications,Notification access: Gadgetbridge (enabled)
Android, Settings, Sounds and notifications,App notifications: whatsapp (allowed),....
Upgrade firmware
Installing basic apps
![]() |
default apps |
jueves, 3 de septiembre de 2020
flashing espruino+ninebot/eucWatch to a P8 smartwatch
Flashing espruino+eucWatch (formerly ninebot-one)
Steps:
- DaFitBootloader23Hacked.bin (A custom Bootloader using the preInstalled SoftDevice5.0.1)
- FitbootloaderDFU2 zip (Soft Device 2)
- espruino_2v0x.xxx_p8_SDK11_SD20.zip (from fanoush github page for p8)
If you start from p8 default status/Dafit stock then you have to install before the first 2 files.
1) Flash bootloader
1.1) if you have Dafit/stock ROM
Click button "Do DFU Update"
Selectfile: FitbootloaderDFU2 zip [check Use Nordic Bootloader]
1.2) if you have ATCwatch installed on the P8
2) Daflasher step
At BLE devices list
Select: ATCdfu
Click button "Do DFU Update"
[Checked box: Nordic bootloader]
[Unchecked box: Toggle Bluetooth]
Select DFU file: espruino_2v0x.xx_p8_SDK11_SD20.zip
3) Espruino step (PC and Chrome)
- from Chrome (tested in v84): https://www.espruino.com/ide/#
- how to Flash /Upload "init" file
Drag an drop "init" file to left side (
Click on Send to espruino arrow down icon, choose Upload destination, "Storage" , choose name ".bootrst"
Click on ".bootrst"
- (optional) Edit "handler" file before upload
- Upload files
- Click on Storage/HD icon (Access files in device's storage), "Upload a file": handler, main, settings, calc,...
- Verify/execute
Click on Storage/HD icon (Access files in device's storage), verify existence of files and .bootrst
short tap on the button, and it will boot to working mode
On left side terminal, execute command "reset()" or "E.reboot()" (last one reset the hardware and loose the time)
DEV mode: (required for future files upload)
Do a reset() while holding the p8 button
Configuring/coding nb espruino:
Using nb/ninebot UI
martes, 21 de julio de 2020
Flashing atcwatch and Stock(dafit) to P8 smartWatch
![]() |
atcwatch menu |
Flashing P8 - Daflasher (atcwatch and Stock)
Index- flashing atcwatch
- flashing/restore the original P8 - stock dafit
- flashing SD5
- flashing the stock application (for dafit)
- Common problems and solutions
- Additional info/links
- Glossary
Intro:
OTA flashing process require to install and execute daflasher or nRFConnect app (available at Play)
[if you want to preserve you personal data from Dafit app, you can do a backup with android "oandbackup")
Note that:
Obvious, mobile requires to have BT enabled
If Dafit or other app to sync with smartbands are installed, they will
be using the BLE connection so device will not be found, uninstall
Dafit, and others such as D6notifications
flashing atcwatch
From a browser download following apps from github- DaFitBootloader23Hacked.bin (A custom Bootloader using the preInstalled SoftDevice5.0.1)
- FitbootloaderDFU2 zip (Soft Device 2)
- ATCwatchP8.ino.zip
![]() | ||
Daflasher app |
Selectfile: DaFitBootloader23Hacked.bin
go back
Select: ATCdfu
Click button "Do DFU Update"
Selectfile: FitbootloaderDFU2 zip
P8 screen [red square and ATCnetz.de]
go twice back
Select: ATCdfu
Click button "Do DFU Update"
![]() |
Atcwatch about |
[Unchecked box: Toggle Bluetooth]
Select DFU file: ATCwatchP8.ino.zip
flashing/restore the original P8 - stock dafit
Intro:
Note that going back to Stock-Dafit disables the possibility of later OTA/BLE flashing. So no more easy way to flash experimental OS/ROM. You can still do it but it will require to open the back lid and connect a cable to pins)
You need to download
- SoftDevice: ATCdfuFromSD2toSD5.zip (from atc1441 github page)
- The stock "firmware" application, you can try get the package from dafit upgrade function, and it will be .bin file of 1xxKB
Then you need to create DFU package containing the bin with nrfutil, a private key will be applied to the package. Though the previously downloaded SD5 will accept any possible key.
>nrfutil version (nrfutil version 6.1.0 )
>nrfutil keys generate myprivate.key
>nrfutil.exe pkg generate --hw-version 52 --application-version 1 --application MOY-TFK5-1.7.7.bin --sd-req 0x9D --key-file myprivate.key p8stock_tfk5.zip
--sd-req softdevice FWIDs
--sd-req 0x9D = S132 v5.0.0S132 v5.0.0 (SD5 for stock TFK5-1.7.7)
flashing SD5
Select: ATCWatchStartBootLoader
P8 screen [red square and ATCnetz.de]
Click button "Do DFU Update"
[Checked box: Nordic bootloader]

Select DFU file:ATCdfuFromSD2toSD5.zip
P8 screen [3 color squares and ATCnetz.de]
flashing the stock application (for dafit)
Select: ATCWatchDo DFU Update
[Checked box: Nordic bootloader]
[Unchecked box: Toggle Bluetooth]
Select DFU file: p8stock_tfk5.zip (3 files, inc .bin)
Common problems and solutions
- Device is not found in BLE list
stop or remove other apps that are using BLE connections
- Progress percentage stop a some point, or it is is increasing in each attempt
- Error GATT ERROR until success
turn off phone or
try "nRF Connect" app as an alternative to Daflasher, as it also can flash a DFU
- Daflasher DFU FILE NOT FOUND
- try with different file explorers
- ES explorer (has 2 pick file 2modes), CXexplorer and Amaze
- Reset the watch. requires to open the back lid, and create a Short in the battery, (during decs of a second) connect with metal both pins (+ and -)
- Turn off the watch. It requires to open the back lid and unsolder the the red cable(+)
Additional info/links:
nrfConnectGlossary:
OTA On The AirRSSI Received Signal Strength Indicator
DFU Device Firmware Update
SD Soft device
precompiled and linked binary software implementing a wireless protocol developed by Nordic Semiconductor.
.ino.??
jueves, 18 de junio de 2020
Smartwatches, hack and opensource
P8 Smartwatch (based in RF52)
Rebranding:Colmi, Makibes, utelite...
nRF52832
ARM Cortex-M4, CPU with floating point unit running at 64 MHz
64KB de RAM, 512KB de RAM
Flash 4MB SPI (Serial Peripheral Interface) ¿NOR?
240x240 color display.
170 mAh lithium polymer
Normal/non rotated display
Manufactured by: MoYoung/CRREPA
strap:20mm
Stock firmware/ROM: MOY-XXXN-1.7.N
MOY=Moyoung (company)
XXX model can be normal or rotated display
Model | ID | Touch | Accel | Notes |
---|---|---|---|---|
P8, Pinetime | TEH,TBH... | Hynitron 00B40001 CST816S | BMA421 | best touch, S=200hz |
P8a, Pinetime | TFK,... | Hynitron 00B40002 CST716S | BMA421 | worse touch, S=200hz |
P8b | TIN,... | Hynitron 00B40002 CST716S | SC7A20 (no step counter) | worse touch, worse accel,S=200hz |
Alternative ROM
ATCWatch (Arduino C++ firmware)https://github.com/atc1441/ATCwatch
(to flash with DaFlasher, Companion app: D6 notifications)
Espruino for DS-D6 and P8
https://github.com/fanoush/ds-d6/tree/master/espruino/DFU/P8
Recommend notification apps
Other Opensource "smart"watches
PineTime
nRF52832 ARM Cortex-M4 processor with Bluetooth LERAM: 64KB Flash: 512KB with additional 4MB SPI NOR
Underdevelopment, many options in the future
By default has a fully operative P8 stock firmware/ROM: MOY-XXXN-1.7.N
Companion App(underdevelopment): https://github.com/lupyuen/pinetime-companion
banglejs
- nRF52832 ARM Cortex-M4 processor with Bluetooth LE
- 64kB RAM 512kB on-chip flash, 4MB external flash
- 1.3 inch 240x240 16 bit LCD display with 2 zone touch
- GPS/Glonass receiver (UBlox)
- Many javascript apps
- strap: 30mm
https://shop.espruino.com/banglejs
Apps: https://banglejs.com/apps/
Companion app: compatible with Gadgetbridge
Developer emulator: https://www.espruino.com/ide/emulator.html
Forum http://forum.espruino.com/microcosms/1424/
Based in watch. No.1 F18
Companion app: Hplus Watch
164 KB RAM
ROM de 512 KB
DK08
- nRF52832 ARM Cortex-M4 processor with Bluetooth LE
- LCD 1,28" 176x176 64 colors (RGB222) ST7301
- HR sensor EM7028
- Accelerometer Bosch BMA222E
- 2MB SPI flash / fontchip GT24L24A2Y
SMA-Q2
Another NRF52832smartwatch to run open source firmware on ithttps://hackaday.io/project/85463-color-open-source-smartwatch
https://github.com/Emeryth/sma-q2-oss
Tools and Utilities
lightBLUE. Bluetooth Low Energy Tool and Explorer
nRF Connect (apk). technical tests
lunes, 12 de enero de 2015
My best opensource IT resources
Useful "open" resources that i use frequently when I am creating creative commons or opensource content/products
Icons/cliparts
Useful for small icons (i.e for a smartwatch), not opensource but free just adding a reference link.
"Established open-source projects could receive the icons for free. For you, we'll open-source the needed resources."
https://www.iconfinder.com/icons
Sizes and formats: PNG, SVG, ICO, ICNS. Every icon includes info about its license
PICOL icons (SVG or in a font type)
PICOL, PIctorial COmmunication Language
http://openiconlibrary.sourceforge.net/
https://openclipart.org
Each artist at Openclipart releases all rights to the images they share (Creative Commons Zero 1.0 Public Domain License)
http://p.yusukekamiyamane.com/
map icons
http://mapicons.nicolasmollet.com/
www.flaticon.com (All or many with Creative Commons license)
Photos and icon/vectors...
http://www.freepik.com (Mix of Commercial and and license info linked to author page)
Typographic Fonts
An interesting article: free-fonts-free-is-not-always-freeFree as Freedom
SIL Open Font License (OFL) is a free, libre and open source license specifically designed for fonts and related software based on our experience in font design and linguistic software engineering.
http://openfontlibrary.org/en/catalogue?view=sentence
Following free fonts include IPA Phonetic symbols:
CharisSIL-5.000.zip
Download "DoulosSIL-5.000.zip"
Notes about free fonts and compatibility with non free fonts:
Liberation Sans - Arial
Liberation Serif - Times New Roman
Liberation Mono - Courier New
Free as free beer
http://www.1001fonts.com/free-fonts-for-commercial-use.html
Howto use new fonts in Windows without administrative rights.
i.e
D:\Ejecutables\LibreOfficeportable\Data\fonts
http://www.pendriveapps.com/search/Boot+It
Media
Wikimedia Commons
https://commons.wikimedia.org (a huge database of freely usable media files)
Software
http://portableapps.com/http://sourceforge.net/
F-Droid (Android)
https://f-droid.org/repository/browse/