Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stuck on bootloader (Colmi P8) #69

Closed
tomdoughty62 opened this issue Aug 28, 2020 · 12 comments
Closed

Stuck on bootloader (Colmi P8) #69

tomdoughty62 opened this issue Aug 28, 2020 · 12 comments

Comments

@tomdoughty62
Copy link

Similar to this issue - #41
I'm using a Colmi P8.
Having used Daflasher and the nRF Connect app on Android, I've flashed over the daflasher bootloader, but after flashing over the Micropython.zip file the watch remains in the bootloader mode.
When I press the button once, it shows the wasp-os logo for a couple of seconds, then one for one quick second before going to a black screen. When I attempt to flash over the bootloader again the watch just restarts and displays the wasp-os logo again, and uploading different versions of the micropython.zip (from older commits) the results are sadly the same.
Any assistance would be greatly appreciated.

@hrmckay
Copy link

hrmckay commented Aug 29, 2020

When the watch is in the black screen have you tried issuing commands to it with the Serial Bluetooth Terminal app on Android? When my Pinetime booted to a black screen it was because main.py had failed. But when I issued the commands 'import wasp' and 'wasp.system.run()' (without the quotes) the watch came to life.

Hugh

@tomdoughty62
Copy link
Author

Oh thanks that's great advice! After importing and running that command I got:
AttributeError: 'module' object has no attribute 'system'

So I can connect and tinker with my P8, but wasp may not be working correctly.

But at least I can connect to it and send code

@daniel-thompson
Copy link
Collaborator

Try the same commands after booting into safe mode (hold down the physical button thru the bootloader and until Init button appears on the screen, then release). That will skip some initialization that allows you to see what is really happening during the import wasp (results of module import are cached and I think it may have previously been imported).

@tomdoughty62
Copy link
Author

Its just reported an invalid sensor. I've attached a screenshot.
Screenshot_20200829-122740

@daniel-thompson
Copy link
Collaborator

daniel-thompson commented Aug 29, 2020

So, I think there is good news and bad news here.

The good news is that I suspect if you comment out a single line (and rebuild) then the watch will start booting OK:
https://github.com/daniel-thompson/wasp-os/blob/01ac0d93c30a219e5cd2aa47551d1730fd34c627/wasp/wasp.py#L119

The bad news is that this will disable the step counting feature!

Basically I suspect the step counter in your watch is a different type to the one that others have (e.g. it has been replaced with an alternative for supply chain or cost reduction reasons). Happily with the watch working you will be in a good position to try both use the rest of the watch and understand more about the step counter. A good first goal will be to see if the sensor is very different or only a subtle revision... a quick way to do that is to enable the BMA42x driver debug mode. From memory (e.g. untested but roughly the right idea) would need something like:

watch.accel.debug(True)
watch.accel.reset()

@daniel-thompson
Copy link
Collaborator

Looks like I made a mistake in the instructions, the first line should have been watch.accel._dev.debug(True) (the second line is correct as it was).

@tomdoughty62
Copy link
Author

Hello,

Thank you very much for all the help. The watch switched on as soon as I'd commented out the StepCounterApp. Absolutely chuffed to bits that I can now start tinkering.

When I used watch.accel_dev.debug(True) and accel.reset() I got the following output:
BMA42x read: 24 00 [00]
Traceback (most recent call last):
File " in
File "drivers/bma421.py", in reset
ValueError: invalid sensor

Also lovely to see more documentation on this. This project is very accessible for newbies like me.

@MirkoCovizzi
Copy link

The new accelerometer is the SC7A20. I have just received 2 new P8 smartwatches and both have it. The SC7A20 doesn't have hardware step counter, so it's going to be needed a step counter algorithm implemented by software.

@tomdoughty62
Copy link
Author

@MirkoCovizzi How would I discover that now that I've got Waspos installed?

@MirkoCovizzi
Copy link

@tomdoughty62 You need to either open it up and see for yourself or trust other people that did that before you. At the moment there are at least 3 variants of the P8, the main perceivable difference is the accelerometer and there are 2 possible models, so if the "regular" wasp-os doesn't work without disabling accel, then it means that it has the other model.

@daniel-thompson
Copy link
Collaborator

This issue (not booting) should be fixed by 889115f ("wasp: Allow app initialization to fail") and this is now in the master branch. Could someone with a P8a test and confirm?

PS I have also updated the docs to explain what is happening so providing the changes work I'll probably close this ticket...SC7A20 support would be nice but at present its status is "pull requests welcome":
https://wasp-os.readthedocs.io/en/latest/install.html#colmi-p8

@daniel-thompson
Copy link
Collaborator

Haven't seen a confirmation... but it's been nearly two months so I'm going to assume this is fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants