tylpk1216 / KoboPageTurner

Use Wi-Fi to turn page on Kobo device.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

KoboPageTurner

Release When I knew the KoboCloud project, I wanted to follow its concept to run a Web Server on Kobo device(Clara HD). When the Web Sever receives API, it will simulate to turn a page by sending touch event to touch panel.

It can run on different Kobo device in theory. Just make sure two things:

  1. What is the touch panel of your Kobo device?
  2. Do we adjust X or Y to match your panel ?

You could modify the settings of "/mnt/onboard/.koboserver/koboserver.cfg" for your Kobo device.

Settings for Kobo ClaraHD. The origin point of Clara HD is right-top.

eventFile=/dev/input/event1
leftX=800
leftY=500
rightX=100
rightY=500

Settings for Kobo Libra H2O:

eventFile=/dev/input/event1
leftX=500
leftY=1200
rightX=500
rightY=500

By the way, I got my Kobo Elipsa on 6/29, I almost prepared to intall KoboPageTurner. Before installing it, I tried my Logitech R500 on Kobo Elipsa, and I could use R500 to turn page. If you have this machine, you could use R500 directly on Elipsa.

Kobo Elipsa + Logitech R500.

Although we can use bluetooth directly on Kobo Elipsa, I want to test whether KoboPageTurner works or not. I must modify some codes to support Kobo Elipsa.

Settings for Kobo Elipsa:

eventFile=/dev/input/event2
rawData=Elipsa
leftX=1211
leftY=500
rightX=100
rightY=500

Settings for Kobo Libra 2:

eventFile=/dev/input/event1
rawData=Elipsa
leftX=100
leftY=500
rightX=800
rightY=500

Settings for Kobo Clare 2E:

eventFile=/dev/input/event1
rawData=Elipsa
leftX=800
leftY=500
rightX=100
rightY=500

Architecture

Architecture

Installation

  1. Run KoboServer/makeKoboRoot.sh to get KoboRoot.tgz or you could use release version.
  2. Put KoboRoot.tgz to .kobo folder of your Kobo device.
  3. Reboot device.

Uninstallation

  1. Edit "uninstall=true" in "/mnt/onboard/.koboserver/koboserver.cfg".
  2. Turn on the Wi-Fi.
  3. All materials will be deleted except "/mnt/onboard/.koboserver" folder.

React-Native app

An app based on react-native is included in the KoboPageTurnerApp folder. This can be compiled for Android or iOS.

Follow the instructions from the react-native docs to setup the development environment and to get it on your device, all you have to do to make it work is change the ip-addresses to the ip of your kobo running the web server in App.js:

Usage

I used Kobo Clara HD to test this concept. System: 4.23.15505

  1. Connect your Kobo device to PC.
  2. Add below setting in the "/mnt/onboard/.kobo/Kobo/Kobo eReader.conf" or type "devmodeon" in search input area.
[DeveloperSettings]
EnableDebugServices=true
  1. Go to "Settings" -> "Device Information" -> "Developer options".
  2. Check "ForceWifiOn" item.
  3. Connect your bluetooth device to your cell phone.
  4. Turn on Wi-Fi on Kobo device. The Web Server will run on port 80.
  5. Make sure kobo device has the same ip-address every time it gets connected to the wifi, most of the times this can be setup in your router based on MAC-address.
  6. Use Android app or react-native app (ios & android) to send HTTP request.
  7. Modify settings for HTTPClient.

Codes:
21 ->
22 <-
24 volume up
25 volume down

You could click the input area of code, and click your key, it will show your key code here.
  1. Click "LEFT PAGE" or "RIGHT PAGE" to test the communication.
  2. After closing the Web Server, uncheck "ForceWifiOn" item. Then turn off Wi-Fi.

Caution

  1. HTTPClient always keeps screen on. If you do not use it, remember to close the App.

Three Web APIs

  • GET /left -> left page.
  • GET /right -> right page.
  • GET /exit -> shutdown the Web Server.

My Page Setting

Actually I do not know the formula of pixelToValue when sending the touch event. I used "cat /dev/input/event1" to catch raw data. This is my area setting to turn page.

Page Setting

Note

This project is just prototype verification because I found the Wi-Fi of Clara HD is very bad. It often closes the Wi-Fi suddenly. I don't find a solution to solve it. If the Wi-Fi is closed, I must back to Home screen to turn on the Wi-Fi again. Then I can go on to read a book with my KoboPageTurner.

Update: The Wi-Fi is closed automatically by Kobo system.

You colud add the setting in your "/mnt/onboard/.kobo/Kobo/Kobo eReader.conf". Maybe it will solve the Wi-Fi problem.

[DeveloperSettings]
ForceWifiOn=true

According to my test, if I used the "ForceWifiOn=true" setting, the Wi-Fi of Clara HD was always on even I turned off the Wi-Fi. I think this is not a good solution.

I tried to modify the "ForceWifiOn=true" setting when the Web Server ran, and modified the "ForceWifiOn=false" setting when the Web Server exited. However, this flow was not usefull. My Wi-Fi could not work after turning on or turning off the switch button many times. This flow is not the solution too.

Update(2020/08/04): The final solution is to add "EnableDebugServices=true" in the "/mnt/onboard/.kobo/Kobo/Kobo eReader.conf". The side-effect is that you will have many system logs in "/mnt/onboard/.kobo". When you turn on Wi-Fi, it will have one log. You turn on Wi-Fi next time, you have another log again. The workaround is to delete these logs when calling "run.sh".

[DeveloperSettings]
EnableDebugServices=true

Then we must follow steps below to keep Wi-Fi on when we use KoboPageTurner.

  1. Go to "Settings" -> "Device Information" -> "Developer options".
  2. Keep "ForceWifiOn" true.
  3. Turn on the Wi-Fi.
  4. Use stable wireless network(optional, I must use my cell phone to get stable network for Clara HD).

Hardware Implementation - ESP8266 (ESP-12S)

ESP8266

Finally, I used ESP8266 (ESP-12S) to do hardware page-turner.

This is final architecture.

ESP8266 Architecture

Test Video

Web Server + Android App(HTTP Shortcuts).

Web Server + Android App(HTTPClient + Bluetooth keyboard).

Web Server + Android App(HTTPClient + Bluetooth page-turner(BOOX)).

Web Server + Android App(HTTPClient + Bluetooth page-turner(Logitech R500)).

Web Server + ESP8266(ESP-12S, DC Converter, 2 x AAA battery).

Acknowledgement

Thanks to KoboCloud. I got this idea from it.

Thanks to Niels ten Boom. He created an app for iOS users.

Licsnse

MIT.

About

Use Wi-Fi to turn page on Kobo device.


Languages

Language:Go 37.4%Language:Java 33.1%Language:Objective-C 9.7%Language:C++ 5.1%Language:JavaScript 5.0%Language:Shell 4.9%Language:Batchfile 1.9%Language:Ruby 1.6%Language:Starlark 1.3%