wasp-os: MicroPython for PineTime!
#31

.png   Pinetime-log2.png (Size: 330.11 KB / Downloads: 239)
.png   Pinetime-log3.png (Size: 125.89 KB / Downloads: 232)
.png   Pinetime-log4.png (Size: 271.05 KB / Downloads: 235)
Daniel,

I typed in the commands you gave me and it failed the same place as yesterday.  I then tried a few things and found that the /flash filesystem seems to already exist, and it has a file in it.  I also found if I umount it then it will mount without error.  See the attached screenshots.

Hugh
#32
(05-28-2020, 09:01 PM)VMMainFrame Wrote: Daniel,

I typed in the commands you gave me and it failed the same place as yesterday.  I then tried a few things and found that the /flash filesystem seems to already exist, and it has a file in it.  I also found if I umount it then it will mount without error.  See the attached screenshots.

Hugh

Strange... so in summary everything appears to work perfectly! Thus it is *very* strange the watch doesn't show the UI automatically at boot.

I guess as a final check you should use cat('/flash/main.py') to make sure that the contents of main.py are correct. Perhaps you could also confirm that you are not acidentally booting into safe mode are you (if you have the button pressed when the pine cone disappears to the final time then the watch will enter safe mode and skip the startup file).

Anyhow... either way, thanks for your contributions. I've already improved the bootloader based on your feedback and today I filed another issue based on our conversation (since it would be so much better if safe-mode was obvious and I didn't have to ask the last question): https://github.com/daniel-thompson/wasp-os/issues/29 .
PineTime: wasp-os and MicroPython, Pinebook Pro:  Debian Bullseye
#33
Hi @danielt: I'm almost done documenting my wasp-os experiment on Mynewt, please have a look...

https://lupyuen.github.io/pinetime-rust-...icropython

I'm stuck with a multitasking conflict between wasp-os and Mynewt... wasp-os runs the REPL loop forever, scheduling its own tasks. But Mynewt needs to run the Event Loop to handle NimBLE Bluetooth packets.

Any idea which part of wasp-os I should modify to feed the Mynewt Event Loop?

Alternatively I could start another Mynewt task to run wasp-os, but that would consume extra memory (for the stack). Plus extra overheads for task switching. Thank you so much :-)
#34
(06-01-2020, 03:48 AM)danielt Wrote:
(05-28-2020, 09:01 PM)VMMainFrame Wrote: Daniel,

I typed in the commands you gave me and it failed the same place as yesterday.  I then tried a few things and found that the /flash filesystem seems to already exist, and it has a file in it.  I also found if I umount it then it will mount without error.  See the attached screenshots.

Hugh

Strange... so in summary everything appears to work perfectly! Thus it is *very* strange the watch doesn't show the UI automatically at boot.

I guess as a final check you should use cat('/flash/main.py') to make sure that the contents of main.py are correct. Perhaps you could also confirm that you are not acidentally booting into safe mode are you (if you have the button pressed when the pine cone disappears to the final time then the watch will enter safe mode and skip the startup file).

Anyhow... either way, thanks for your contributions. I've already improved the bootloader based on your feedback and today I filed another issue based on our conversation (since it would be so much better if safe-mode was obvious and I didn't have to ask the last question): https://github.com/daniel-thompson/wasp-os/issues/29 .

I issued the cat command and an ls command and the results are confusing, considering the information I previously provided.


.png   Pinetime-log5.png (Size: 320.82 KB / Downloads: 234)
#35
(06-01-2020, 08:43 PM)VMMainFrame Wrote:
(06-01-2020, 03:48 AM)danielt Wrote: Strange... so in summary everything appears to work perfectly! Thus it is *very* strange the watch doesn't show the UI automatically at boot.

I guess as a final check you should use cat('/flash/main.py') to make sure that the contents of main.py are correct. Perhaps you could also confirm that you are not acidentally booting into safe mode are you (if you have the button pressed when the pine cone disappears to the final time then the watch will enter safe mode and skip the startup file).

I issued the cat command and an ls command and the results are confusing, considering the information I previously provided.

Yes, confusing indeed.

I think to get to the bottom of this I think I'll need to change to the code to boot.py to get some more information out. IIRC you were using the 0.2 release... are you compiling yourself or working just with the binary release? Just wondered if I should share patches or .zip file?

PS Since we're getting to the point of throwing code around this might also be a good point to migrate the discussion to the github issue tracker for wasp-os? Attachments work out better there...
PineTime: wasp-os and MicroPython, Pinebook Pro:  Debian Bullseye
#36
(06-01-2020, 06:53 PM)lupyuen Wrote: Hi @danielt: I'm almost done documenting my wasp-os experiment on Mynewt, please have a look...

https://lupyuen.github.io/pinetime-rust-...icropython

I'm stuck with a multitasking conflict between wasp-os and Mynewt... wasp-os runs the REPL loop forever, scheduling its own tasks. But Mynewt needs to run the Event Loop to handle NimBLE Bluetooth packets.

Any idea which part of wasp-os I should modify to feed the Mynewt Event Loop?

Alternatively I could start another Mynewt task to run wasp-os, but that would consume extra memory (for the stack). Plus extra overheads for task switching. Thank you so much :-)

Sorry for the delay. I'm afraid missed this when I looked at the forum yesterday.

To keep things robust you probably need to deeply integrate this into Micropython rather then the wasp-os code.

I'd consider adding an implementation of MICROPY_VM_HOOK_LOOP to the MyNewt port that handles pending MyNewt events. This allows will dispatch the events from the main VM execution loop and will share the processor regardless of what Python code we are running. Note that this code is a really, really hot path so needs to be written for maximum performance. That usually means a divisor so the hook does not for every virtual opcode, take a loop at ports/esp8266/mpconfigport.h for an example.

After that you'd probably also need to call the MyNewt event loop from mp_hal_stdin_rx_chr() as well since most implementation of micropython just stop dead in that function when they are seeking user input! This code is less performance critical because is mostly runs a human speed however for simplicity I think it would be OK to call MICROPY_VM_HOOK_LOOP here as well.

A simpler alternative that would probably also work is to dispatch MyNewt events from mp_hal_stdin_rx_char(), machine_deepsleep and machine_lightsleep. That would rely on the system calling one of the sleep functions when it want to save power (which wasp-os does).
PineTime: wasp-os and MicroPython, Pinebook Pro:  Debian Bullseye
#37
Thanks Daniel! Lemme peek at those functions and experiment some more

Sent from my Pixel 4 XL using Tapatalk
#38
(06-03-2020, 02:55 AM)danielt Wrote:
(06-01-2020, 08:43 PM)VMMainFrame Wrote:
(06-01-2020, 03:48 AM)danielt Wrote: Strange... so in summary everything appears to work perfectly! Thus it is *very* strange the watch doesn't show the UI automatically at boot.

I guess as a final check you should use cat('/flash/main.py') to make sure that the contents of main.py are correct. Perhaps you could also confirm that you are not acidentally booting into safe mode are you (if you have the button pressed when the pine cone disappears to the final time then the watch will enter safe mode and skip the startup file).

I issued the cat command and an ls command and the results are confusing, considering the information I previously provided.

Yes, confusing indeed.

I think to get to the bottom of this I think I'll need to change to the code to boot.py to get some more information out. IIRC you were using the 0.2 release... are you compiling yourself or working just with the binary release? Just wondered if I should share patches or .zip file?

PS Since we're getting to the point of throwing code around this might also be a good point to migrate the discussion to the github issue tracker for wasp-os? Attachments work out better there...

Daniel,

Yes, I was using the 0.2 file from your web page.  I have not compiled anything, I am using your binaries.

I can move this discussion to the github tracker.  Do you want me to open a new issue or add on to one that already exists?

Hugh
#39
(06-04-2020, 11:36 AM)VMMainFrame Wrote:
(06-03-2020, 02:55 AM)danielt Wrote: Yes, confusing indeed.

I think to get to the bottom of this I think I'll need to change to the code to boot.py to get some more information out. IIRC you were using the 0.2 release... are you compiling yourself or working just with the binary release? Just wondered if I should share patches or .zip file?

PS Since we're getting to the point of throwing code around this might also be a good point to migrate the discussion to the github issue tracker for wasp-os? Attachments work out better there...

Yes, I was using the 0.2 file from your web page.  I have not compiled anything, I am using your binaries.

I can move this discussion to the github tracker.  Do you want me to open a new issue or add on to one that already exists?

That's fine. I can share .zip files for testing. Let's start a new github tracker. As it happens there is another "black screen" issue but it was fixed and AFAICT is completely unrelated to what you are seeing.

Feel free to post a link to the github issue on the forum so anyone else who's following this thread (or stumbles across us in a search engine six months from now) can join us if they wish.
PineTime: wasp-os and MicroPython, Pinebook Pro:  Debian Bullseye
#40
(06-05-2020, 03:36 AM)danielt Wrote:
(06-04-2020, 11:36 AM)VMMainFrame Wrote:
(06-03-2020, 02:55 AM)danielt Wrote: Yes, confusing indeed.

I think to get to the bottom of this I think I'll need to change to the code to boot.py to get some more information out. IIRC you were using the 0.2 release... are you compiling yourself or working just with the binary release? Just wondered if I should share patches or .zip file?

PS Since we're getting to the point of throwing code around this might also be a good point to migrate the discussion to the github issue tracker for wasp-os? Attachments work out better there...

Yes, I was using the 0.2 file from your web page.  I have not compiled anything, I am using your binaries.

I can move this discussion to the github tracker.  Do you want me to open a new issue or add on to one that already exists?

That's fine. I can share .zip files for testing. Let's start a new github tracker. As it happens there is another "black screen" issue but it was fixed and AFAICT is completely unrelated to what you are seeing.

Feel free to post a link to the github issue on the forum so anyone else who's following this thread (or stumbles across us in a search engine six months from now) can join us if they wish.

I have opened issue 31 on the wasp-os github page. 

https://github.com/daniel-thompson/wasp-os/issues/31


Possibly Related Threads…
Thread Author Replies Views Last Post
  PineTime display and micropython danielt 17 7,172 05-07-2021, 12:15 PM
Last Post: danielt
  Using Pine64 to install Wasp-os on PineTime Mpoint 1 622 04-30-2021, 02:39 AM
Last Post: danielt
  Star Trek computer themed wasp-os on PineTime graynada 13 7,476 12-14-2020, 07:10 PM
Last Post: tllim
  Update bootlogo and pinetime-app with OTA/DFU lookin 3 1,942 11-25-2020, 04:51 PM
Last Post: lookin
  PineTime Simulation Feature gjoyet 3 1,569 11-15-2020, 11:42 AM
Last Post: gjoyet
  Pinetime and P8 Integration testing framework maiden 7 3,403 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 1,857 10-18-2020, 09:24 PM
Last Post: lupyuen
  Article: Bluetooth Time Sync and LVGL on PineTime Mynewt lupyuen 0 925 10-15-2020, 05:51 PM
Last Post: lupyuen
  Remote PineTime for flashing and testing firmware remotely lupyuen 5 2,348 10-06-2020, 12:03 AM
Last Post: lupyuen
  Rust on PineTime at RIOT Summit lupyuen 3 2,344 09-25-2020, 05:05 PM
Last Post: lupyuen

Forum Jump:


Users browsing this thread: 2 Guest(s)