-
variant from this photo https://i.imgur.com/ZUWZ4vp.jpeg - this one looks worse as the opposite side of BLE antenna is populated by components - probably not very good design
just noticed that on this PCB the D16 pin is brought to place with unpopulated something possibly third LED. So if one would sacrifice 2nd LED there would be 2 pins D17,D16 for I2C to possibly add something or use it as serial console.
BTW I flashed Espruino over SWD to this and had my first NFC experience with Espruino, it works quite well :-) I even tried WebNFC in Chrome on Android and it worked too. However for some reason the Samsung Internet browser (based on Chrome too) does not work. I see no error but it does not get any NFC data when I tap it and also it does not ask for NFC permission like Chrome does.
-
But what does seem to help (needs more testing) is for me to pause all BLE operations ie disconnect from the IDE and also pause the BLE scans I am doing in my code.
I came across this article https://jimmywongiot.com/2019/12/15/high-speed-uart-on-nordic-nrf52-series/ that describes similar issue - when using older uart mode which does not use DMA and trigger interrupt after each character sent/received it can happen that bluetooth interrupts with higher priority can cause lost characters.
They discuss much higher baudrates there, however at 115200 sending/receiving one byte should be about 87uS (10bits/115200 ?) which is still pretty short compared to latencies mentioned in that article so it can be the issue.
Current UART code in Espruino is old and shared with nrf51 so it is probably not used in UARTE mode (=with DMA). Here I see only one character is expected when receiving https://github.com/espruino/Espruino/blob/master/targets/nrf5x/jshardware.c#L1763
-
Just tried and the SPEAKER definition only defines the SPEAKER_PIN for C source to use.
If one wants to have global SPEAKER object there is extra work to doCheck
https://github.com/search?q=repo%3Aespruino%2FEspruino%20SPEAKER&type=code
how this is done for different boards.Here is MICRORBIT2 way.
-
Just to let you know that I ordered few of them from different sellers and yesterday I got them. Two are exactly the same as the one @parasquid posted and third one is the variant from this photo https://i.imgur.com/ZUWZ4vp.jpeg - this one looks worse as the opposite side of BLE antenna is populated by components - probably not very good design.
First two advertise as AmiLoop, the third one is AMIIBOLINK. My phone with NFC TagInfo sees all of them as NTAG215, the AMIIBOLINK even has some data prefiled out of box. All are nrf52832 so not bad for the price (~US$9 including VAT and shipping). Finally I have some nrf52 devices with NFC to play with :-)
-
I've included my code below where I store data in the "compressedData = []" array.
so this is not about Uint8Array size since in your code it is only temporary variable. The remaining blocks going down by three is about the ordinary array having three integers added there by push.apply
> var d=[] >d.push.apply(d,new Uint8Array([1, 2, 3])) =3 >d =[ 1, 2, 3 ] >trace(d) #30[r1,l1] Array(3) [ #66[r1,l2] Name Integer 0 = int 1 #62[r1,l2] Name Integer 1 = int 2 #70[r1,l2] Name Integer 2 = int 3 ] >E.getSizeOf(d) =4 >d.push.apply(d,new Uint8Array([1, 2, 3])) =6 >d =[ 1, 2, 3, 1, 2, 3 ] >E.getSizeOf(d) =7 >d.push.apply(d,new Uint8Array([1, 2, 3])) =9 >E.getSizeOf(d) =10 >trace(d) #30[r1,l1] Array(9) [ #66[r1,l2] Name Integer 0 = int 1 #62[r1,l2] Name Integer 1 = int 2 #70[r1,l2] Name Integer 2 = int 3 #77[r1,l2] Name Integer 3 = int 1 #78[r1,l2] Name Integer 4 = int 2 #79[r1,l2] Name Integer 5 = int 3 #83[r1,l2] Name Integer 6 = int 1 #84[r1,l2] Name Integer 7 = int 2 #82[r1,l2] Name Integer 8 = int 3 ]
-
@fanoush I'm not sure what happened in your test, but a 3 char string should only be one var:
Don't have newest build but just retried on 52840 dongle with 2.17 and I still see 2, but in Bangle 2 Emulator I see 1 indeed.
>var a=E.toString(new Uint8Array([1, 2, 3])) ="\1\2\3" >E.getSizeOf(a) =2 >process.memory() ={ free: 13963, usage: 37, total: 14000, history: 10, gc: 0, gctime: 20.6298828125, blocksize: 14, stackEndAddress: 537092008, stackFree: 39728, flash_start: 0, flash_binary_end: 447188, flash_code_start: 516096, flash_length: 1048576 } >process.version ="2v17.450" >trace(a) #24[r1,l1] FlatString [2 blocks] "\1\2\3" =undefined >
EDIT: added trace
EDIT2: maybe that's older E.toString() which still only made flat strings?
-
-
-
-
Well you asked the community but the best one to answer is really the one who sells the device to you. @Gordon here or even Adafruit or whoever sells them - table of sellers here http://www.espruino.com/Order#puckjs
AFAIK the normal non-lite Puck.js is based on Raytac MDBT42Q module https://www.raytac.com/product/ins.php?index_id=31 see also photos here http://www.espruino.com/Puck.js#pinout so any certification that Raytac got for the module is valid for PuckJS too. That is also why such easy to use generic modules exist - to avoid the need of another certification. For US the info is here https://fccid.io/SH6MDBT42Q
For the lite version it is much more interesting as this is custom PCB.
That was the hardware. As for Bluetooth software there is also certification/qualification of the Bluetooth stack, Espruino uses standard Nordic SoftDevice and Nordic keeps qualification ids in table here
https://infocenter.nordicsemi.com/topic/comp_matrix_nrf52832/COMP/nrf52832/ble_qdid_qual_matrix.html?cp=5_2_3_4
Espruino uses S132 SoftDevice version 3.x so QDID is 85568
https://device.report/bluetooth/14827When checking the shop page https://shop.espruino.com/puckjs I don't see certification info there. It could be useful indeed to have something there.
However there is something here http://www.espruino.com/Puck.js#information - it links http://www.espruino.com/files/Puck.js-CE.pdf
And https://www.espruino.com/datasheets/MDBT42Q-E.pdf mentions certifications too.Take this as a community member answer :-)
-
I think constructive criticism is really important for improving and opens discussion. ..... Anytime I question something its with this aim of improving the product or my own understanding.
And BTW my replies are not meant to discourage or silence you, it is just that it still looks like your technical suggestions are missing the context a bit.
There are some other javascript engines for embedded devices that target a bit higher hardware requirements that made different design decisions. Maybe thanks to that they are more future proof or feature complete regarding JS specs but they do not run so well on the hardware we have here.
Two interesting ones I've seen sometime ago
https://kalumajs.org/ based on JerryScript
https://www.moddable.com/ - discussion https://forums.raspberrypi.com/viewtopic.php?t=304964
Did not actually try to do something with them as they target Raspberry Pico and/or ESP32/ESP8266 which are not low power platforms like nrf52. -
as vector maths is super quick on most processors
there are no vector instructions in Cortex M4 (if you mean something like https://en.wikipedia.org/wiki/Vector_processor ). Even all the floating point math is done in software because Javascript uses Double type and Cortex M4 only has single precision floats. There is really nothing that could be called super quick here.
I would still implement assocs as hashmaps so they are future proofed for larger mem sizes.
Are you aware there is even no dynamic heap (
malloc()
/free()
C api calls) available? Where would that hashmap and its data be stored?I think you still did not grasp fully the CPU and memory limitations. Which is OTOH a testament to all the work that Gordon did to make it work so well on such limited devices. Your comments would be more fitting if we had 10 times the memory and CPU speed. Then it would be comparable to e.g. 486 or Pentium machines from nineties running Windows 3.11 with 2MB of RAM (did javascript run on that?)
BTW Espruino also works on Microbit 1 which only has 16KB of RAM and it works there including Bluetooth LE stack (!) which had to be disabled in Micropython implementation because Micropython is really not designed for limited devices like this (that's why there is also Snek).
As for 'future-proofing' it might be a bit more complicated than adding hashmaps ;-) Only recently we got typed arrays over 64KB which made no sense few years ago as typical espruino device had less than that in total.
-
I happened to catch this in the IDE error log when it happened:
I just tried to run
require('Storage').list().forEach(x=>print(JSON.stringify(x)));
and it produces just list of strings, no JSON, so that is better than I remembered. Either it was changed recently or the nrf51822 had issues even with the.forEach(x=>print(JSON.stringify(x)));
giving back simple strings. Anyway it indeed looks like the output is cut. The"sched.bo"
string is incomplete and whole list should probably end with> >>
. And yes, the connection interval is increased automatically when connection is idle so first packets may be slow until it goes back.You can verify this is the case by setting it yourself via https://www.espruino.com/Reference#l_NRF_setConnectionInterval
, the{minInterval:20, maxInterval:100}
should still save some power when idle and should be faster. You can even force it to single value so you can try setting it to 500 or more to be pretty slow and see if the issue appears consistently -
the IDE insists that it's a binary file when it should be text
Quite likely it is binary (or maybe even UTF-8 now?) = there is some non-ASCII byte there. Often there is a button there to switch to text mode, maybe it should be there always (currently it is not).
. Further complicating matters is the fact that the default filename lacks the correct extension (it's log.txt (Storage file) instead of something ending in .txt)
Which OS or browser it is? On Windows in Chrome it definitely adds just
.txt
Instead, I only get a Send to RAM button and then a dump of strings representing the names of my storage files on the debug pane an instant after the dialog window pops up. Another possible clue is that when this happens there is usually a delay of a couple of seconds, which is longer than it normally takes.
It may be out of memory (or low stack?) situation. Maybe some app that use lot of memory/stack is running? Do you see some error or exception message in the 'dump of strings' or series of dots inside of (json) output?
I've seen this on low memory devices (nrf51822 with 16kb ram), the code sent by IDE that does the listing was the most complex thing to run there. While other simple code was running fine (there is not really much RAM available there) listing the storage failed a lot until I reduced total variables for the build => increased space for stack. I think it needs to build a relatively big JSON object (which depends on total number of files there) which needs a lot of stack space.
-
Well you could have sidplayer or modplayer app (both C64 and Amiga were slower than Bangle 2!), also speech synthesizer does not need lot of data and the bitrate is lower so could not use that much CPU when encoding
it's not likely to be of a great deal of use being able to replay a few seconds of audio
Navigation directions are quite short samples too.
Still not that much useful/practical I guess.
-
Thanks, sadly some of those seem to be cost optimized - no 32kHz crystal,no inductors for dc/dc. However they do have nfc antenna visible. I wonder where it is on the pcb that parasquid posted and why it is not around the button like on others. If it is under battery then it doesn't look very optimal.
Oh, and BTW I posted wrong nrf52832 reference schematics link before, the correct for this QFN48 package is here so now I see NFC pins are in fact going somewhere.
-
Makes sense to me. If the watch is on your wrist and phone in the pocket it makes sense to show phone notifications on the watch. If the watch is not worn and lying flat on the table then phone may be better place to show the notification. As long as it is configurable it looks useful.
So when not moved for some time (and possibly lying with screen up or down?) dnd mode is enabled, once it is moved it is disabled.
-
-
Bought a few of these on AliExpress a couple of years ago (before the chip shortage): https://www.aliexpress.com/item/32965114958.html
Oh, the price looks decent there and shipping does not increase when increased quantity. I never got those before since they were always relatively expensive (~$10 plus ~$4-5 shipping when other 52832 boards were $4 and 52840 dongle was for $6) but they look cheap now from this seller, no nfc or piezo though.
-
Thanks, looks like optional 32kHz crystal is there too and enabling DC/DC regulator is supported too (reference schematics here). Don't see nfc pins going anywhere, maybe on the other side? Coul you perhaps make a photo of the other side too?
The led may be RGB so maybe third pin could be connected too? two or three gpios next to swd pins (D22,23,24) look grounded, maybe it could be cut and connected to blue LED instead.
-
-
The default is definitely 4g's
Yes, in the unlikely case you already didn't find out this too, the source is here
https://github.com/espruino/Espruino/blob/master/libs/banglejs/jswrap_bangle.c#L3812 -
What do you mean by that, should it e.g. disconnect from phone with gadgetbridge running?
The radio hardware is off most of the time and is really drawing power only in very brief moments when it is actively communicating, that's how BLE is designed. That's how you can have BLE beacon or e.g. BLE thermometer advertising temperature for a year from one CR2032 battery.
If you don't want to disconnect existing connections then 'disabling the BLE radio' means stopping advertising (
NRF.sleep()
), that saves something but not very much and then you can't connect to the watch. You can also increase advertising interval to save power and for connections you can increase connection interval https://www.espruino.com/Reference#l_NRF_setConnectionInterval which I think is done automatically when it is idle.Overall I think it is not worth it, everything else draws much more power than BLE.
Check also https://www.espruino.com/Power+Consumption - line "Sleep with Bluetooth advertising"
EDIT: and there is also https://www.espruino.com/Bangle.js2#power-consumption
-
Although one could argue it's better to connect some bluetooth headset to the bangle for audio interfacing. Counter to that, you might not always want to have a headset on you.
Just noticed this comment. Unfortunately Bluetooth headsets are so far all classic Bluetooth which nrf52840 does not support. There is LE audio standard coming but it still might take some time to get widely used and unfortunately nrf52840 may be too slow to support this as per https://devzone.nordicsemi.com/f/nordic-q-a/72791/bluetooth-5-2-support-for-nrf52840/299994#299994
The LC in LC3 codec name means low complexity so decoding should be OK but we are talking about encoding here if we want to send audio to the headset.
Some CPU numbers for encoding are here https://devzone.nordicsemi.com/f/nordic-q-a/93689/nrf5340-lc3-decoder-question - 48% CPU for encoding stereo stream but that is on 128MHz Cortex M33 nRF5340 so it will be at least twice as much for 64MHz 52840.
BTW did you guys get some fake Amiibolink tags with something else inside? There are sellers with suspicious low prices like https://www.aliexpress.com/item/1005005726070115.html