pragmatically-dev / PNG2Rm-System

This repository implements a gRPC service for converting PNG files to Remarkable tablet documents. Clients can stream PNG images, which are processed and converted to .rmdoc format. The service, written in Go, receives PNG files in chunks, saves them, converts them with the drawj2d tool, and streams the resulting document back to the client
MIT License
2 stars 0 forks source link

Running server #2

Open PepikVaio opened 2 months ago

PepikVaio commented 2 months ago

Do I understand correctly that for the transfer to work, the PC where the server will run must be turned on? You can use raspberryPi or others but without the server running it is not possible to do the conversion?

Thank you for the information.

pragmatically-dev commented 2 months ago

Hey there! Yeah that’s correct. Using the server on a raspberry pi will work probably fine you would need only to compile the server for the architecture of your raspberry pi, setup the server-config file and that’s it!!

I’m using as a server a 13 YO laptop that’s running 24/7 and it works fine!

Just remember to install java jdk to run drawj2d

I can compile the server to your architecture if you need Ping my with it and I’ll upload it on the release section

pragmatically-dev commented 2 months ago

I’m also working on a PoC port of Drawj2d written in go so on a couple of weeks the java dependency wouldn’t be needed anymore

PepikVaio commented 2 months ago

OK, thanks for the clarification - I thought so. Unfortunately this doesn't make sense to me, as I would use the function most somewhere on the road and I don't have any devices on 24/7 at home.

I'm still thinking of using a mobile phone (iPhone) - would it be able to keep the server running?

Thanks for the info and hard work.

pragmatically-dev commented 2 months ago

You can use ngrok on the server side to expose the server to the internet via tcp tunnels (I expose my server with it)

it’s pretty straightforward to do: Create a ngrok account https://ngrok.com/

Download the binary : https://ngrok.com/download

Setup the binary with the ngrok given access token: ngrok config add-authtoken

And run ngrok tcp 4040

you can also configure a free static domain for it with ngrok

Now ngrok will give you the URL of the proxy, with that you just add it to the config file on the remarkable and that’s it!

Now you would be able to convert files anywhere

pragmatically-dev commented 2 months ago

Also you can try the PoC for on device conversion it’s currently working fine https://github.com/pragmatically-dev/PoC-drawj2d-port-go

the goal of that project is to have the possibility to convert file without having to turn on the wifi Everything happens on the remarkable itself

It is only 2 sec slower than this system

PepikVaio commented 2 months ago

You can use ngrok on the server side to expose the server to the internet via tcp tunnels (I expose my server with it)

it’s pretty straightforward to do: Create a ngrok account https://ngrok.com/

Download the binary : https://ngrok.com/download

Setup the binary with the ngrok given access token: ngrok config add-authtoken

And run ngrok tcp 4040

you can also configure a free static domain for it with ngrok

Now ngrok will give you the URL of the proxy, with that you just add it to the config file on the remarkable and that’s it!

Now you would be able to convert files anywhere

OK, thanks for the ideas - I'll have to look into that later. Right now I don't have rm-hacks (I have an unsupported version of the system).

PepikVaio commented 2 months ago

Also you can try the PoC for on device conversion it’s currently working fine https://github.com/pragmatically-dev/PoC-drawj2d-port-go

the goal of that project is to have the possibility to convert file without having to turn on the wifi Everything happens on the remarkable itself

It is only 2 sec slower than this system

Wait, now I'm confused. The server has to be turned on for the transfer to be done but on the other hand you say that reMarkable doesn't need to have wi-fi turned on and everything runs on reMarkable itself.

pragmatically-dev commented 2 months ago

Sorry for the confusion: Those are different systems

This repo uses a client-server approach

while drawj2d-port-go is a PoC of screenshots to rmlines conversion (on device without having to connect to the wifi nor setup a server)

PepikVaio commented 2 months ago

Thank you for the clarification.

It's clear to me now. In that case, it makes more sense to me. Never mind that it's slower.

I'll try it when I have rm-hacks.

pragmatically-dev commented 2 months ago

Yeah on a couple of weeks a friend and I will try to port all of the heavy image processing to SIMD instructions, that should decrease the processing time for on device conversion