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

[resim] how to do local PC development? #84

Closed
yduf opened this issue Feb 6, 2021 · 4 comments
Closed

[resim] how to do local PC development? #84

yduf opened this issue Feb 6, 2021 · 4 comments

Comments

@yduf
Copy link

yduf commented Feb 6, 2021

Hello Guys
not sure how to contact anybody.

I own a rM2 and I am interested in trying developping some app for it.
So far I had a look at libremarkable and rmkit.
I had not much success with using toltec toolchain with libremarkable,
that's why I invested some time on rmkit :-)

Thanks for your great jobs:
it's easy to build and could run natively on linux.

I first test the ARCH=x86, because it looks like the easiest path for testing.

I stumble on 2 issue trying to run harmony on fb on linux:

  • it requires src/vendor/NotoSansMono-Regular.ttf which is missing (easy to solve)
  • it's not clear at first that I had to change USE_RESIM := true to false to use ARCH=x86 otherwise it looks for ./event0..2 instead of opening mouse device

As side note, I don't know enough about resim to be able to use it.

After having successfully launched harmony on a virtual console + with mouse input, I was able to doodle,
but it crash when I tried to reach the 2/3 far right of the screen (landscape mode, resolution is 1920×1080).
Not sure why for the moment.

Do you guys develop first on x86 ?
or it's not really possible and you recommend testing directly on rM ?

Best Regards,

Yves

@raisjn
Copy link
Member

raisjn commented Feb 6, 2021

resim (https://pypi.org/project/remarkable-sim/, https://github.com/Evidlo/remarkable_sim) is the recommended way to go for testing on a PC. one of our devs was writing apps for months through ubuntu VM (without access to an rM) and it was sometimes sticky, but it mostly worked.

we no longer suggest using x86 build (and are about to remove mouse support) with the actual framebuffer device. can try ARCH=dev to compile a resim binary (x86 + RESIM mode). with resim, it draws to a local file (fb.pnm) and uses fake event FIFOs (instead of system ones).

i personally use resim for local development on small changes because its a bit faster to compile x86 (and doesn't need optimizations to run fast) compared to -O2 on arm, but once i am satisfied with changes, i will test on the rM. sometimes, i only use the rM for testing (make install_harmony drops harmony on the rM in /opt/bin. it works for any app in src/). you can run make resim_harmony as a shortcut for resim development. sometimes if the app crashes (ABORTED) at startup, you should just run ./src/build/harmony with gdb to see why it crashed.

re: libremarkable: there are a few apps in toltec that use it, look at plato and retris from linusCDE. toltec has a special image in the toolchain for rust / libremarkable development (in toltec-dev/toolchain)

PS: apologies in advance for the small bumps you might encounter setting up resim. it's really easier to use arm compilation unless you really want to use local PC dev (because of speed or no access to device)

@raisjn
Copy link
Member

raisjn commented Feb 6, 2021

Screenshot_2021-02-03_19-22-35

it's not pretty, but it's usable. perhaps we will do more work on the resim UI if more people start using it. (was also thinking about adapting resim for testing purposes in the cloud)

@raisjn raisjn changed the title Hello rmkit [resim] how to do local PC development? Feb 6, 2021
@yduf
Copy link
Author

yduf commented Feb 6, 2021

Thanks very much for all the details => I have googled for resim and fall on this one https://pypi.org/project/resim/ - ReSim (chemoREsistance SIMulator) is a python package that simulates cancer chemoresistance dynamics based on a stochastic model.

Which is what you get when doing pip install resim as stated on https://github.com/rmkit-dev/rmkit/blob/master/docs/BUILDING.md

I understand better why it didn't work now. :-)

@raisjn
Copy link
Member

raisjn commented Feb 6, 2021

ah, i see. sorry about the bad docs, now they are updated.

for the crash:

the framebuffer is hardcoded to DISPLAYWIDTH and DISPLAYHEIGHT of the rM (which are 1872 and 1404 or something like that), so when you go past the allocated bounds, it is likely causing a crash.

@raisjn raisjn closed this as completed Feb 6, 2021
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

2 participants