Kospet Magic 3 smartwatch #6986
Replies: 1 comment
-
Posted at 2021-10-11 by @gfwilliams That's great! Do you build with the jswrap_bangle.c included? Hopefully some minor changes and you could have some Bangle.js compatibility there. Hopefully as more apps move to using the Layout library and touchscreen for Bangle.js 2 there might actually be a decent amount of apps that work out of the box. Posted at 2021-10-11 by jeffmer Actually, for the P8, I did not use jswrap_ bangle.c as I found it easier to develop drivers in Espruino. I intended to put these into C afterwards but the Espruino driver performance seemed quite useable so I did not bother. I plan to look at using the new Layout and touch UI stuff in the coming weeks as it should then be possible to run standard Bangle apps on the P8. Posted at 2021-10-11 by @fanoush
well, no, the https://github.com/espruino/Espruino/blob/master/libs/banglejs/jswrap_bangle.c is quite big source with lot of bangle hardware specific assumptions. Long time ago I tried this with P8 and failed. Also lot of development goes into this file so maintaining fork with changes in this file can be nightmare. it could help if this would be splitted to separate files with drivers for specific hardware (touch, gps, compass, display,...) with some abstraction so only the generic stuff would remain in Bangle but it is probably lot of refactoring and lot of work. Also what I like on Espruino is the javascript side where you can change things easily without making new build so I'd prefer lot of this stuff that is not performance critical to be in javascript library like e.g. all stuff in http://www.espruino.com/modules/ Posted at 2021-10-11 by @fanoush
Yes, me too. I just searched in your source tree but did not find it, do you have some Bangle methods implemented in javascript? I think you or somebody else had enough Bangle object stubs implemented so most app would work. Posted at 2021-10-11 by jeffmer Yes, but I am afraid that I did not follow the Bangle conventions exactly so my apps did require tweaks. I agree with your views on jswrap_bangle.c but I think the new touch and layout stuff is worth getting to work on the P8. BTW does the Kospet Rock have a touch screen? It looks like it has three buttons. Posted at 2021-10-11 by @fanoush
yes, it is same hardware as magic3, some revisions need different display init commands. Also it only looks like it has two buttons on right side but I think both are actually same pin. At least there is for sure one revision of Rock where it is same pin. It is same with magic3, some screenshots show the button as rocker/up/down type with two labels like the rock buttons but it is in fact only one button. We've seen both taken apart and both had exactly same PCB inside. one review here noticing it too Posted at 2021-10-11 by @fanoush
Correction, @yngv126399 has Kospet Rock which does have two separate buttons on two separate GPIOs. Posted at 2021-11-08 by jeffmer I have now finished an initial version of a Bangle compatible environment for the ROCK and Magic3 watches. You can find it in this repository. The firmware uses a double buffered version of The emulation has versions of setUI options so menus and prompts work. Posted at 2021-11-08 by @allObjects like that very much (post #3 - missed it while in 'forum's display time window'):
Why? I't is core to Espruino. With faster and even lower power hardware (and enough memory), the next step may for many things be left out completely:
Moving to layout, I see now the same challenges as with the hardware: the abstract / common parts can be integrated where the very specific ones need their own implementation. I had suggested a while ago to have layout eco system to have the ability to 'branch out' because scaling is not a complete solution. In this case of a rectangular vs a square display, it would be nice to have the ability of unique layouts. I understand @gfwilliams 's reasoning to not get there, because it is not only not in his (current) set of hardware options, but also: Who is willing to build these things in the first place while having only one particular hardware, and who will update / complement the existing applications, etc. Longterm, I though see suitable source structure and build and runtime infrastructure to come to be, since also @gfwilliams has to respond to the hardware evolution - as he did for his own boards. Posted at 2021-11-15 by @gfwilliams
Great that you can emulate it in JS though! I think with Layout there are probably some hacks you could do to make it attempt to lay things out nicely on a circular screen... It'd be nice to have that flexibility anyway Posted at 2022-02-23 by Rebeca Tried it on a Kospet Rock, firmware: MOY-NAY3 and got a brick :( Posted at 2022-02-23 by @fanoush
you must release the button quickly after connecting charger, hold it for less than 3 seconds As for installing espruino_2v10.102_magic3-SPIFLASH.zip there is no known issue, it should work on Kospet Rock, however there is nothing on display if you expect that, it should be visible on Bluetooth only. Posted at 2022-02-23 by Rebeca Tried that combination with both of the buttons and it didn't work. Posted at 2022-04-14 by yngv126399 Not sure how your Rock/Brick turned out, but if it's still bricked, consider opening the watch. The Rock is VERY simple to open, then you can use SWD to flash new firmware. Posted at 2022-04-18 by Rebeca How simple? Posted at 2022-04-18 by yngv126399 https://drive.google.com/file/d/1XsxoQC_5yIpBad0jxVS1WACeJpYWmc6P/view?usp=sharing sorry should have warned you about the fake screws.... Posted at 2022-04-18 by Rebeca Thank you very much!!!! it looks way easier on your video. It's open now :D Posted at 2022-04-18 by yngv126399 https://drive.google.com/file/d/1hldJC7VxSTJEAsg58bTm_5uf5vYUMxqG/view?usp=drivesdk Posted at 2022-04-22 by Rebeca updates: I think that maybe there is some problem rebooting to DFU mode, that's why DaFlahser is not able to read the BTLE service that is only broadcasted by DFU mode Any idea or any file that could help me unbrick the watch? Posted at 2022-04-23 by yngv126399 you flashed a hex file intended for a different board. The Rock is an nrf52840, which has more SRAM, flash and thus different addresses for DFU entry points, etc. So your board is in an unknown state, you'll need a full build of Magic3 with bootloader and soft device as a .hex file. Are you set up to do your own builds? BTW: the Rock is not an officially supported Espruino board, you won't find any firmware for it here. Posted at 2022-04-25 by @fanoush You can try attached file to unbrick it via swd. it is full hex including softdevice and bootloader. I am not sure what exact configuration this one is built with but you can later update to something else. At worst it may clear the 8MB SPI flash with original dafit images and fonts but if you flashed any espruino zip named SPIFLASH before you already have it erased. Attachments: Posted at 2022-04-26 by Rebeca Thankd, another kind user as already shared an hex with me. Posted at 2022-04-26 by @fanoush
not sure which one is that but the hex file I uploaded has no display driver built in so you won't see anything on screen with @jeffmer's apps. So for you it is probably useful only to get bootloader, softdevice and then use basic espruino console to trigger DFU and upload something else. As for builds made by @jeffmer I think the xx_rock.zip has unbuffered driver (=drawing go directly to screen) and xx_rockbuf.zip has buffered one that may need extra Posted at 2022-04-26 by jeffmer The “p undefined” means that there is no graphics instance. Boot creates a dummy one which is overridden when you load “main”. As @fanoush mentioned if the lcd driver is not in the firmware then that would explain the error. Posted at 2022-04-28 by Rebeca humm ok. I think I understand now. Posted at 2023-01-26 by w00ter Hi @fanoush, @jeffmer and @gfwilliams, This is my first post here; I've been aware and following Bangle.js for a while now as I am very intrigued by the concept (and reality thanks to you guys) of running Javascript apps and app store on a watch or even smartphone. I see great potential with the "common" knowledge of JS. You guys are awesome! I am clueless as to why this has not gotten way more attention. Why post here? I'm considering getting the bangle.js2 just to play with or even wear on a daily base. My WearOS2 watch died on me and I am eager for a replacement that provides notifications (and time). However, I am hesistent reading the build quality issues of the js2 and was reading up on alternatives, like this topic about the Kospet 3 with its nice(r) specs. Since the last post is a bit old; is this firmware still current and usable for future updates by @gfwilliams? Would you recommend getting a Kospet 3 and get it running with the steps @fanoush documented, obviously knowing it will not be bug-free and without quirks? I'd love a new play-toy, try all sorts of apps and brush up on my Javascript skills to build my own to share :-) Thank you Posted at 2023-01-27 by @fanoush
Hi @w00ter, I'd say go for it if you are (or want to be) Espruino hacker. If you only want to write Bangle apps in existing apps ecosystem then get real Bangle.js. It is not that the main issue is about code for Magic/Rock (and many more watches like this) being not bug free/without quirks. It is about stuff missing as described in first ~6 posts of this topic. So if you are OK with it and want to invest extra effort like e.g. jeffmer did to reimplement enough to get some apps working then go for it. It is also possible to try to add support for some additional watch directly to Espruino so it is on same level as Bangle 1/2. I think the first step would be to modularize jswrap_bangle.c as mentioned in post #4 so that the bangle.js layer on top of espruino has no hardware specific stuff inside. The core of Espruino is done like that - you have stuff in src/ and then you have jshardware or bluetooth implementations inside targets/* For bangle.js there is no such abstraction so you can't just implement same methods for other watch easily. jswrap_bangle.c is mix of common functionality you don't want to touch with lot of ifdef-ed driver code for specific hardware. Posted at 2023-01-27 by w00ter Hi @fanoush, Thank you for taking the time to reply and explain the underlyings of Bangle.js and Espruino. Appreciate it. I see the issue with the way jswrap_bangle.c is built. Splitting the bangle.js layer from the specific hardware layer would make it much more scalable. If only someone knowledgeable enough would dare to take on this task ;-) Posted at 2023-01-27 by @fanoush Well then you can try stuff mentioned in jeffmer's post #9 and see what is missing for you. It is still usable, just a bit older. Also there is stuff done by enaon Posted at 2023-02-03 by @gfwilliams I should add that jswrap_bangle.c already supports quite a wide variety of different hardware (more than when the first extra watches were being added) so it may be that not a great deal of extra changes are needed to it to support the watch you're interested in... Also if it's a matter of adding extra hardware and it doesn't add too much bulk (things like accelerometers are usually very easy to add) then I'm open to pulling that into the main Espruino repo. Posted at 2023-02-03 by @fanoush
Well, it may be not a great deal for you to navigate ~5700 line file and sprinkle it with few lines in ~10 places of that file for adding support for yet another accelerometer device without breaking anything. For people like me, @jeffmer, @yngv126399 it is significantly harder to do both parts (1. add, 2. not break). And I think we actually don't need to care about maybe 3/4 of that file to add another watch and yet for now we need to learn all of it. I think jswrap_bangle.c is the wrong file to modify when we want to add e.g. another 3 types of accelerometers or touchscreens. Currently if I want to add bma420,bma223,sc7a20 there are couple of places like this one Or another random example - with new watch I need to think about this line https://github.com/espruino/Espruino/blob/master/libs/banglejs/jswrap_bangle.c#L1506 whether my watch is like F18 or not (whatever F18 actually is, I may not know). There are many place like this there. Basically just for adding one watch out of many I would need to add lot hacks/workarounds/ifdefs there, all the time thinking about all the other watches and hardware combinations already there. So it is not about adding one accelerometer type. With rest of Espruino it is like For bangle_jswrap.c all those layers are not there so generic Bangle watch policy/logic is intermixed with specific hardware support. It would be much easier and scalable to implement new accelerometer X support in separate file with known interface without touching jswrap_bangle.c at all. Same for new touchscreen , display, hr sensor or gps. Posted at 2023-02-22 by @gfwilliams Yes, understood - it is a bit of a pain for sure with all the ifdefs there. There's also the question of devices like Puck.js that end up duplicating the code to talk to accelerometers. I'm open to suggestions, but the problem for me is I don't really have the time to completely refactor everything, and really the only thing that can happen for me if I do it is something breaks and someone complains - nobody notices if it works. As you noted though, some of these things interact - either they're on the same I2C wires, have to run at different I2C speeds (Puck.js) or they need to be turned on an off via an IO expander (Bangle.js 1) - it feels quite hard to pull that functionality out in a way that will completely remove the ifdefs from jswrap_bangle.c Posted at 2023-10-02 by ccchan hi, from you people s conservation, i see that even gordon would like to see more device could run the 4xx app in bangle store, yet its just currently some technical trick with the aformentioned xxx file that render non-official espruino port unable to use most app from the bangle store, correct? i will buy a bangle.js v2 recently, so would like to see them later could also use bangle store s app too otherwise it limits to my own apps. thanks. Posted at 2023-10-02 by ccchan btw i am nothing a programmer compared to you guys, i am eager to make that happen, thx Posted at 2023-10-24 by ccchan
hi, i have the same goal, using pinetime/p8 as a backup platform for bangle.js v2, I am a layman. Do you think you and others could enlighten me so I could ask gpt4 to make a try? OR, if you could intelligently break it up into smaller steps, i could try to use gpt4 to do the small steps 1 at a time...etc. ps: ps2: Posted at 2023-10-26 by @fanoush
So it is Posted at 2023-10-27 by @allObjects I don't see
to be the issue here... It is the 'cartesian product' of all the nitty gritty deltas of all the components that have to play nice with each other by code that does not break the 'resources' bank. Infrastructures and frameworks that can handle the deltas of various hardware platforms are generally very bloated not only in respect to static resources - code memory - but also in respect to dynamic resources - variable memory and cycles - at runtime. Build-time effort left by the side. Therefore, picking and focusing on (just) a few 'animals' that are 'biologically' compatible is the requirement for (economic) sustainability. For me, Espruino ecosystem can claim the Guiness World Record for biodiversity, hackability, resourcefulness, robustness,... and is vibrantly alive (has survived many others). Posted at 2024-10-30 by @devsnd Hey @fanoush, do you have any plans to still work on the kospet magic 3? I was wondering if I should get one, so that I have something that I can tinker around with, without breaking my daily driver bangle.js... but if this is a dead end, I'd rather wait for another opportunity to get some cheap toys to play with Posted at 2024-10-30 by @fanoush
Your choice really, it depends on what you want to do with it, it is not a Bangle.js watch that can run bangle apps out of box, it is cheap nrf52840 Espruino device with battery and touchscreen that can run your custom code. All the hardware (except maybe HR sensor) works and is usable. If you want to tinker then go ahead - it seems to work for cat litter boxes https://forum.espruino.com/conversations/392685/?offset=25#17537542 EDIT: and if it was not clear it can be also used as a watch either with custom code or it can run some subset of banglejs apps but you need to maintain them yourself (including matching bangle.js runtime) Posted at 2024-11-05 by @enaon
hahaha :) The magic3 with your display driver is super for under 15 euros. I placed a 10pins plug where the charging pins were, so I got Vin, V batt, gnd, i2c bus and 5 pins available, very handy device. I even got the side button working fine after mounting it to place :) in case anyone is interested, this how to works fine for hacking it, mostly for part 2, the web ide part, it is easier from the loader I think. https://enaon.github.io/eucWatch/tools/hackme2/ Attachments: |
Beta Was this translation helpful? Give feedback.
-
Posted at 2021-10-11 by @fanoush
Just to let you know that there is now a build of Espruino for Kospet Magic 3 watch. This is nRF 52840 watch with full touchscreen one button and 240x280 color display.
It is similar to P8 or P22 watch just with 52840 instead of 52832 and a bit larger display. Like P8 it is available on aliexpress from many sellers. Like P8 it uses DaFit app and the firmware update procedure allows reflashing the watch without taking apart via DaFlasher android app.
some info at https://github.com/fanoush/ds-d6/tree/master/espruino/DFU/Magic3
Apart from more memory available, the SPI bus in 52840 is 4x faster so the display update is also 4x faster than with P8 watch.
BTW Magic3 is basically same hardware as Kospet Rock so some variants of those will work out of box too.
One more comment - Espruino build != Bangle.js , this is just the interpreter, to make it more like Bangle it needs additional effort similar to what e.g. @jeffmer did with P8 https://github.com/jeffmer/P8Apps
Beta Was this translation helpful? Give feedback.
All reactions