-
-
I should have just recorded a video to start with. Always makes things much easier to debug.
This shows what happens when the battery is completely dead and it is connected to the cable - https://streamwo.com/file/61af5a2262dbf
-
Thanks Gordon - no idea how I missed that...
Unfortunately there is no way to take those steps. This is what happens while there is battery capacity (without touching the screen or button):
- White bootloader appears (is this right term?)
- Loading meter fills
- Black Bangle.js OS screen appears
Checking storage...
Storage Ok.
- Return to 1.
Is there any lower level way to reset it? Bit worried it's bricked.
EDIT
Quick thought - could there be some kind of contact inside the button which gives it pressed state constantly? I was fine until I took it off my wrist - no idea how that could have caused it, but perhaps an option? - White bootloader appears (is this right term?)
-
Last night I took off my Bangle.js 2 and laid it on side table, so I could read in bed. I noticed out of the corner of my eye that some light was coming on and off from it - it was face down. I picked it up and saw that it was stuck in a boot loop. This morning when the battery had died, I tried charging it again and it started the loop once more.that
I've not done much interesting with it yet - no firmware updates and just installing a few apps from the store. And I can't think of anything unusual that I have done with it - no jet skiing, scuba diving or having MRIs.
I can't find any documentation about what to do. This is the type of thing I was hoping for, but it only applies to v1 - https://www.espruino.com/Bangle.js#resetting-without-loading-any-code
-
@Robin and @allObjects
Right after you gave me your advice I went through a long patch of not having any quality thinking time, due to having two very young kids.But I came back to it over the weekend, reflected more on what I was doing and got pretty much to where I wanted to get to. Thanks very much for taking the time to reply - it did help. And knowing about dump() is going to be a big help going forward.
For the record, I think that I'd been getting confused by looking at code examples which featured JSON without really clocking that they were JSON. I simplified my data to being an "object of objects", adapted my functions to not rely on indexers and now it works.
The only thing which would have made life a bit nicer is the Object.values() method which I learnt about while reading around. I guess there isn't enough space to include everything in Espruino - shouldn't be greedy :)
-
I restructured my data in "days" a few times and lost understanding of what I was dealing with. I thought that it was an object as I couldn't reference its contents with an index e.g
console.log(days[2].hour);
Firefox console says:
TypeError: days[2] is undefined
If it's an array after all, then I'll do some more reading about arrays. Thanks
-
-
I've stumbled across a problem that I can't get my head around and am not sure what to search for to learn how to resolve it. Can anyone help name a technique or method which I can read up on?
I'm trying to access a propety of an object which changes depending on the output of a function. This is a simplified example:
var days = { Monday: {hour: 6, minute: 30}, Tuesday: {hour: 7, minute: 0}, }; var today = function() { return "Tuesday" // simplified for this example - not sure if return is best approach }; console.log(days[today].hour);
Espruino says:
Uncaught Error: Cannot read property 'hour' of undefined at line 1 col 24 console.log(days[today].hour); ^
Do I need to get today to return a string instead? Any help would be much appreciated.
This is a situation where I don't know enough to help myself :)
-
I'm working on a project which basically does 2 jobs, which both have different outputs depending on the current time of day:
- continuously watch pin for sensor data, and perform function A whenever it arrives
- perform function B on fixed schedule (e.g. every minute)
I currently have a setwatch() for 1 and a function start() for 2. But both require the same function for checking the time of day and doing different things depending on it.
What's the best way to structure this code? I'm happy doing either one, but I feel like I'm missing something in my approach to combine them.
Sorry if I've not explained this well - thought it would be better as an abstract question, than sharing my mess of code.
- continuously watch pin for sensor data, and perform function A whenever it arrives
I've tried the suggested technique but had no luck. I can now feel that the "keycap" does not seem to be as well attached - sometimes pressing the button results in instant resistance, but others it slips slightly, or is mushy, before resisting. In both cases I can still register an audible click at the bottom of the travel.
Is there anything else worth doing? Otherwise it's pretty disappointing to have only had a few weeks out of it.