wasp-os: MicroPython for PineTime!
#91
(12-07-2020, 07:05 AM)purlupar Wrote:
(12-07-2020, 05:25 AM)danielt Wrote: To be honest I've never seen the simulator unreactive to these things. There are a couple of ways a broken application could cause this but you've done a fresh clone and the built-in applications are unlikely to cause this.

Either way I'd recommend starting by adding a couple of prints:

1. Check the lowest level of the simulator is correctly handling events by printing event here: https://github.com/daniel-thompson/wasp-...ay.py#L221
2. Check wasp-os is handling interrupts from the (simulated) touch screen by printing dbuf here: https://github.com/daniel-thompson/wasp-...ay.py#L105

After that follow where the prints lead and add further prints further through the stack to zoom in. If you need to learn more about the structure of wasp-os you might be able to use traceback.print_tb or pdb.set_trace from critical bits of code (the former prints a stack trace, the later enters a text mode debugger allowing you to explore dynamically)... or you can just ask here once you have gathered more evidence!

1. Gives back <sdl2.events.SDL_Event object at 0x.....
2. Gives back bytearray(b'\x03\...

Now, I realized that the simulator seems to be working -- it tells me "volume down" (for the mock music app), for example -- but not updating the simulator display (the time does not change either, for example). I'm a bit overwhelmed by deciding where to look next. What I've been doing is removing the dependencies of the simulator (requirements.txt) via pip and installing them via my distro's package manager, which my distro's wiki says is the preferred way to install python packages. The point being, this looks like a sdl-related problem if I understand correctly, and well, I have very little experience with that. Oh and the simulator's stdout tells that it does in fact refresh (I put a print there), and a lot so. What would you do next? Thanks for the advice so far!

A simple trick might be to reverse the comments in lines 57/58: https://github.com/daniel-thompson/wasp-...lay.py#L58

Using sdl2.ext.PixelView instead of sdl2.ext.pixels2d makes screen updates incredibly slow but there is a warning issued by pixels2d to say it is experimental so it is worth a try.

Might also be useful to know what distro you are running.
PineTime: wasp-os and MicroPython, Pinebook Pro:  Debian Bullseye
  Reply
#92
(12-10-2020, 03:55 AM)danielt Wrote: A simple trick might be to reverse the comments in lines 57/58: https://github.com/daniel-thompson/wasp-...lay.py#L58

Using sdl2.ext.PixelView instead of sdl2.ext.pixels2d makes screen updates incredibly slow but there is a warning issued by pixels2d to say it is experimental so it is worth a try.
I'm afraid that did not make it work either.

(12-10-2020, 03:55 AM)danielt Wrote: Might also be useful to know what distro you are running.

Arch, with the python modules installed as Arch (Pacman) packages. I remembered that in the beginning (spring 2020), I had exactly this problem, and then in the fall at some point it worked (i.e. the simulator was controllable by swipes/keyboard). Seems I messed it up again now. What I am up to next is further minimize down sdl hello world examples to find the issue. Or maybe start a virtual environment and install the py-modules via pip. Any pointers would be appreciated, (anyone on Arch reading this?) I feel kind of stuck!
  Reply
#93
Daniel,

I have tried your OS its really good I like it Smile

Just a quick question, what is the best way to change the time?

I used to use my PinePhone to connect to the watch using bluetoothctl and manually setting the HEX bits needed to change the time using the Time Service

I tried this with wasp OS and I keep getting 

[CHG] Device D3:14:37:A9:BB:32 Connected: yes
Failed to pair: org.bluez.Error.AuthenticationFailed
[CHG] Device D3:14:37:A9:BB:32 Connected: no


When I look at the nrf app I can't see the time service anymore.


===========

ok I found the below, I just need to figure out how to do it.

At the end of the install process your watch will show the time (03:00) together with a date and a battery meter. When the watch goes into power saving mode you can use the button to wake it again.
At this point you will also be able to use the Nordic UART Service to access the MicroPython REPL. You can use 
Code:
tools/wasptool --console
 to access the MicroPython REPL.
To set the time and restart the main application:
[color=var(--color-prettylights-syntax-constant)]^[color=var(--color-prettylights-syntax-variable)]C[/color]
watch.rtc.[color=var(--color-prettylights-syntax-entity)]set_localtime[/color]((yyyy, mm, dd, [color=var(--color-prettylights-syntax-variable)]HH[/color], [color=var(--color-prettylights-syntax-variable)]MM[/color], [color=var(--color-prettylights-syntax-variable)]SS[/color]))
wasp.system.[color=var(--color-prettylights-syntax-entity)]run[/color]()
[/color]
Or, if you have a suitable GNU/Linux workstation, just use:
./tools/wasptool --rtc


=============================

Never mind I found what I needed now

Simply run the script (using Python 3 - Python 2 is not supported!) and it automatically connects to the first NUS console it can find. Exit using 

Code:
Ctrl-X
.
  Reply
#94
If you have an Android device then you can just use GadgetBridge. I've sent the patches upstream but they are not applied at this point so you'll need to grab the .apk from the CI loop: https://github.com/daniel-thompson/gadge.../445429267

For regular laptops then ./tools/wasptool --rtc is the way to go (if they have good Bluetooth Low Energy support).

I've not 100% sure that wasptool is running on PinePhone although, in principle, it is exactly the same as running it on regular Linux (clone the repo, grab the prerequisites mentioned in the install guide and run wasptool... it will help to be using one of the desktop-ish distros such as Debian or Manjaro on the phone). Either way I suspect Marteen de Jong would almost certainly know since he has started adopting wasptool as the backend for a GUI tool he is working on: https://gitlab.com/arteeh/wasp-companion .
PineTime: wasp-os and MicroPython, Pinebook Pro:  Debian Bullseye
  Reply
#95
Got the modified build of gadgetbridge installed. (What an ordeal! This was not easy to do, and not very well explained.)

What functionality do we have with it? I can see it sets the time. I tried the music player. I got it to work once (I think, maybe) and pause the music, but that's all it did. Hung the watch and I had to long-press for a reboot.

UPDATE: I actually got a few more features of the music app working, it did pause/unpause and I got it to skip tracks (didn't know you could do that until I looked at the source code for it). But it's a little crashy, and locks the watch up eventually. Unsure why, just stops responding and all you can do is long-press for a reboot.
  Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Star Trek computer themed wasp-os on PineTime graynada 13 3,287 12-14-2020, 07:10 PM
Last Post: tllim
  Update bootlogo and pinetime-app with OTA/DFU lookin 3 551 11-25-2020, 04:51 PM
Last Post: lookin
  PineTime Simulation Feature gjoyet 3 502 11-15-2020, 11:42 AM
Last Post: gjoyet
  Pinetime and P8 Integration testing framework maiden 7 1,522 10-23-2020, 03:25 PM
Last Post: maiden
  Article: Create Your Own PineTime Watch Face in Rust... And Publish on crates.io lupyuen 2 728 10-18-2020, 09:24 PM
Last Post: lupyuen
  Article: Bluetooth Time Sync and LVGL on PineTime Mynewt lupyuen 0 403 10-15-2020, 05:51 PM
Last Post: lupyuen
  Remote PineTime for flashing and testing firmware remotely lupyuen 5 972 10-06-2020, 12:03 AM
Last Post: lupyuen
  Rust on PineTime at RIOT Summit lupyuen 3 1,198 09-25-2020, 05:05 PM
Last Post: lupyuen
  Article: Preview PineTime Watch Faces in your Web Browser with WebAssembly lupyuen 1 811 09-13-2020, 02:09 PM
Last Post: VMMainFrame
  Article: Porting PineTime Watch Face from C to Rust On RIOT with LVGL lupyuen 0 444 09-12-2020, 10:13 PM
Last Post: lupyuen

Forum Jump:


Users browsing this thread: 1 Guest(s)