-
-
So the problem for my disconnection seems to be that the signal strengh of the Bangle is too low.
Is there any way I can improve the signal strengh ? My issue is that the peripheral is behind the user (on his back), the body seems to affect the signal too strongly.In real world situation this may indeed be a problem even if in more normal conditions the device sensitivity is quite good (which the bangle sadly isn't that much). maybe @enaon could comment as he uses P8, DS-D6 and other watches/fitness trackers with unicycles and connection drops outside when moving even if it works otherwise fine in house when not moving. To make it short - he finetuned antenna length as the default length was not optimal at all. looks like they cut the wire at random length and even in different pieces of same model (P8) the size of the wire was different by quite a lot and changing it did significant difference in reliability of the connection. Not sure how Bangle antenna looks but maybe similar tuning can be done.
-
It is actually 'nrfutil' not 'nrfutils' as I wrongly suggested. also you can try
python3 -m pip
to be sure you are running the python3 version of pip. Also I think some latest nrfutil was also not working for me on some older linux distro, then you can force some older versionpython3 -m pip install nrfutil==5.2.0
-
Just to let you know that there is issue with native/InlineC code related to this. This was perhaps not found on ESP port as the native code feature is not there. Created issue https://github.com/espruino/Espruino/issues/2040
Basically the 16 or 12 byte size variables had nice feature that they are long word aligned in memory so native code flat string produced by atob was always aligned. Now when it does not begin on 4 byte boundary it crashes/reboots when native code is run. Not sure there is easy/nice solution.In fact I now wonder how it works with Uint16 or Uint32 arrays, maybe they are not aligned too? That would be a bit unfortunate as well, will try.
-
-
Thanks, the RTL8720DN looks really interesting.
there is also Feasycom module based on same chip
https://www.feasycom.com/product-RTL8720DN-Chip-BLE-5-Wi-Fi-Combo-Module.html
that comes with AT command based firmwareOn the bottom page there are two PDF links, one having list of AT commands, however they are different from those in ambd sdk, not sure why they did that, maybe to be compatible with something else(?), however it looks different from esp8266 AT commands too
Anyway they sell it for $6 and looks like there are more GPIOs available on this one. And maybe support from them will be better than random aliexpress shop.
The Cortex M4F + Cortex M0 + relatively big SRAM looks nice, could even run Espruino natively.
-
this should work with
var wifi = require("ESP8266WiFi_0v25").connect(Serial2, function(err) {
i guess?Not sure how it differs from ESP8266 AT commands. The list of RTL8720DN AT commands is referenced in this post https://forum.amebaiot.com/t/resources-bw16-troubleshooting-guide/678#references-23 and looks like the AT firmware is part of official SDK so (same?) AT commands are also described here https://github.com/ambiot/ambd_sdk/tree/master/doc and the source code is https://github.com/ambiot/ambd_sdk/tree/master/component/common/api/at_cmd and https://github.com/ambiot/ambd_sdk/tree/master/component/common/example/uart_atcmd
Also SeedStudio did some work here https://github.com/Seeed-Studio/Seeed_Arduino_rpcWiFi to unify development using esp32 and RTL8720DN so same code can use both, however this is not using AT commands so not easily usable from Espruino.
It looks interesting, ordered BW16 kit and bare module from https://www.aliexpress.com/item/1005001320366011.html just in case. Total price below $10 including VAT and shipping for both.
-
there is long ESP32 5ghz thread here https://esp32.com/viewtopic.php?f=12&t=6162&start=30 , the first estimate was "end of 2019", still nothing released :-)
someone also mentioned "Realtek RTL8722dn (BW-16)" which is ~$4 thing on aliexpresslooks like it can do AT commands and there is some Arduino support
https://www.seeedstudio.com/Realtek8720DN-2-4G-5G-Dual-Bands-Wireless-and-BLE5-0-Combo-Module-p-4442.html
https://github.com/mikey60/BW16-RTL8720DN-Module-Arduino -
-
Interesting Pinetime effort https://forum.pine64.org/showthread.php?tid=14623
Maybe Bangle can do it including sound via piezo speaker?
The video is already converted here https://github.com/TT-392/pinetime-bad-apple/tree/master/src/bad_apple
Also nice trick with SPI DMA there, the whole initial rectangle setup commands/data sequence of ST7789 is sent as single DMA transfer with just carefully timed DC pin toggling (via timer and PPI) while the DMA transfer runs https://github.com/TT-392/pinetime-bad-apple/blob/master/src/drivers/pinetime_display_driver/display_fast.c#L123
That could be used in current LCD_SPI_UNBUF driver to speed up small rectangles. -
Do you mass erase the flash memory before flashing the hex? otherwise you may still have old bootloader there if you disabled it only with later builds
D9 is NFC pin, for that you need -DCONFIG_NFCT_PINS_AS_GPIOS so the button would work correctly, otherwise it may be stuck in one state when reading.
as for
pinutils.findpin(pins, "PD19", True)["functions"]["ADC1_IN1"]=0; # LED red pinutils.findpin(pins, "PD20", True)["functions"]["ADC1_IN2"]=0; # LED green pinutils.findpin(pins, "PD21", True)["functions"]["ADC1_IN3"]=0; # LED blue
that makes no sense, nrf5x can do analog only on first (D2-D5) and last (D28-D31) four pins,
for LEDs you would want to do pwm to dim them anyway? -
I don't see button BTN1 defined, you mentioned the board has one. As you build with bootloader the button is (or recently was) needed to build it properly as it is the way to enter bootloader.
Also if you made several different builds for different boards try to run with added 'clean' make target first to start from clean state.
-
long code loops can cause this if you have watchdog set to manual mode on first lines, that watchdog is there on purpose but you can skip it if you wish or set it as automatic. watchdog is kicked from setinterval if button is not held so if that interval is not running it will reboot. also invalid memory access may cause reboot like e.g. wrong poke or peek command.
also when you upload new code (= you delete the watchdog kicking setinterval) it will reboot as watchdog cannot be disabled
-
I think this should represent a good improvement.
Please let me know how you get on!Wow, looks interesting. Could be useful to force old 16 byte way via some define in board file to compare otherwise same build version on two identical devices with same js code.
So there are more variables but smaller. Can it take more memory in some cases? Like something fitting two 16byte variables before (=32 bytes) that would need three variables now (=39 bytes)? Or even needing two now (=26) that would fit one variable before? That something being e.g array with one or two values, some typical string or byte array length, simple number variable with some typical variable name length ... just guessing, have no idea.
Also slightly related idea, can we have one or two more bits for array size so typed arrays over 64k are possible on 52840 (with 256k of ram)?
-
Oh, nice it works If it would not start at all then the bootloader still have this "touch button after it vibrates to stay in DFU when put on charger from dead batery" feature, so would not be in fact bricked even if the espruino build was completely broken, forgot about that. Not all devices have this bootloader. The F07 one you probably have does not have it yet, added it later I think.
-
-
I have uploaded newer build espruino_2v09.119_DK08_SDK12.zip Apart from increased MTU which is default in 2v09 I also added DK08 to
if
here https://github.com/espruino/Espruino/blob/914b77c18219cae28204dae36ac148608e77a620/src/jsflash.c#L903 so like with Bangle holding button should skip running .bootX files too as described in "Looks for files in Storage named .boot0, .boot1, .boot2 and .boot3 and executes them in sequence." (On Bangle.js these are not executed if BTN1 is held down, but all other devices execute them each time)I did not test this build yet so it is a bit risky, if you brick your DK08 then it will be really the final brick you always wanted :-) Or just wait, will test it in dev board this evening and let you know it is safe.
Anyway with that build holding button at startup would skip .boot0 so makes sense to use only if you really saved it as .boot0. Try to hold button when flashing ends. Will not vibrate but may work.
-
-
-
BTW: yes, I'm desperate (just bricked a DK08*)
let the battery die, after you put in on charger it will vibrate, right after that touch the button, it will vibrate again, if you release it, it will stay in dfu mode, if you still hold it for 3 seconds it will continue to espruino and skip loading any code on startup, well, hopefully, didn't test this too much. And don't charge it too much so you can retry soon :-)
-
yes, just follow the readme at https://github.com/fanoush/ds-d6/tree/master/espruino/DFU/DK08
driver is also linked there - https://gist.github.com/fanoush/f91dc52e76e8281a127cce86d8313ec9
procedure same as with f07 - minimal espruino, just upload dk08 bootloader https://github.com/fanoush/ds-d6/blob/master/espruino/DFU/DK08/DK08-bootloader.txt not the one for f07 -
-
What will be the main reasons for upgrading? More RAM and better LCD?
4x bigger RAM allows more complex SW in future. Also it is smaller, lighter, rectangular, the display is always on, sunlight readable - all quite subjective advantages. For me it is better in every way but can imagine some people prefer bigger, heavier round military style watches. Also indoors a bit higher display resolution and color of V1 might be a reason for someone - 8 colors of V2 are not that much and they are not that much vivid - check e.g. AmazFit Bip youtube reviews, the screen technology and resolution is same as the one in Q3 (not sure about size). Again I'd take this display (or the one in DK08) without thinking due to always on feature and sunlight visibility (as 'smart' watch which shows blank face until you move it or press button feels a bit dumb to me ;-) but when you compare e.g. P8 screen vs Q3/DK08 indoors the difference in color quality is clearly visible - P8 screen is simply beautiful indoors.
-
Is there any way to generate a debug message that can be passed back out to openocd or similar?
I think with segger tools this is pretty straightforward - google for Segger RTT. With OpenOCD google for SWO tracing - however this need GPIO pin 18 = TRACEDATA[0] to be free. RTT does not need any extra pins since this is just preallocated buffer in SRAM read over SWD.
Or maybe opeocd already has Segger RTT support merged https://www.reddit.com/r/embedded/comments/80dg3a/how_exactly_does_the_segger_rtt_work/ that works with any SWD dongle?
Or as a poor man's RTT you can allocate fixed buffer, write to it and dump it periodically from openocd via memory dump commands, it s not needed to stop CPU to read memory.
Of course you can also setup plain uart with just TX pin and log to that.
There is https://github.com/espruino/Espruino#porting-to-new-devices
Good start would be getting familiar with building for existing architecture, in this case ESP32. If you try your own ESP32 build and possibly try to do some modification to it then addind ESP32-C3 could be easier.
Check also
https://github.com/espruino/Espruino/blob/master/README_BuildProcess.md
https://github.com/espruino/Espruino/blob/master/README_Building.md