Code Monkey home page Code Monkey logo

kobopageturner's Introduction

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

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.

kobopageturner's People

Contributors

tylpk1216 avatar dependabot[bot] avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.