Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Readers > Kobo Reader > Kobo Developer's Corner

Notices

Reply
 
Thread Tools Search this Thread
Old 01-21-2021, 05:55 PM   #211
NiLuJe
BLAM!
NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.
 
NiLuJe's Avatar
 
Posts: 13,477
Karma: 26012492
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
Fair warning if your device is already is USBNet mode: Nickel will happily switch to the "Connected" black screen, but will crash and burn a horrible death on *exiting* it ^^.

(Perfectly safe in a stock USBMS state, though).
NiLuJe is offline   Reply With Quote
Old 01-22-2021, 01:25 PM   #212
Acorn
Connoisseur
Acorn is on a distinguished road
 
Posts: 56
Karma: 74
Join Date: Oct 2010
Device: Kindle 3
Quote:
Originally Posted by NiLuJe View Post
Fair warning if your device is already is USBNet mode: Nickel will happily switch to the "Connected" black screen, but will crash and burn a horrible death on *exiting* it ^^.

(Perfectly safe in a stock USBMS state, though).
Thanks for the heads up!

So, made some progress.. have a chessboard being drawn using calls to fbink_cls for the squares, and fbink_print_raw_data for the pieces extracted from a PNG sprite sheet using PIL.

Also have basic touch input working with libevdev. Didn't realise it even had the ability to "grab" the input built in! Sweet.

What's the deal when it comes to best practice drawing stuff to screen. I'm guessing that ideally you want to only draw stuff to screen that has changed to avoid unnecessary flickering, and that fbink doesn't do anything clever in this regard? Does fbink_cls do something special at a hardware level? Is it more efficient than printing an equivalent image for example?
Attached Thumbnails
Click image for larger version

Name:	PXL_20210122_180911255.jpg
Views:	198
Size:	215.1 KB
ID:	184885  
Acorn is offline   Reply With Quote
Old 01-22-2021, 02:57 PM   #213
NiLuJe
BLAM!
NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.
 
NiLuJe's Avatar
 
Posts: 13,477
Karma: 26012492
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
The EPDC itself will do some amount of magic, but, generally, yeah, only repaint/refresh damaged areas.

That's only for *refreshes* though. Painting will always paint .

As far as FBInk is concerned, you can draw without refreshing the screen, which is useful when you have a bunch of small things to draw in a short amount of time that you only really care about displaying at once.

That usually involves setting the no_refresh flag in your FBInkConfig instance, and then doing a manual fbink_refresh call at the end of the batch, with the appropriate region to encompass all your new stuff.
NiLuJe is offline   Reply With Quote
Old 01-25-2021, 12:39 PM   #214
Acorn
Connoisseur
Acorn is on a distinguished road
 
Posts: 56
Karma: 74
Join Date: Oct 2010
Device: Kindle 3
Is there a way to toggle force_wifi and turn wifi on or off programatically?

Also if force_wifi is on and the device is put to sleep, does the wifi stay on and drain the battery? Or does sleep actually put the whole device to sleep?

Last edited by Acorn; 01-25-2021 at 12:42 PM.
Acorn is offline   Reply With Quote
Old 01-25-2021, 01:32 PM   #215
NiLuJe
BLAM!
NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.
 
NiLuJe's Avatar
 
Posts: 13,477
Karma: 26012492
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
@Acorn: NickelDBus can probably do it, I think?

And, yes, force wifi prevents suspend, which will murder a battery in less than an afternoon .
NiLuJe is offline   Reply With Quote
Old 01-25-2021, 02:45 PM   #216
Acorn
Connoisseur
Acorn is on a distinguished road
 
Posts: 56
Karma: 74
Join Date: Oct 2010
Device: Kindle 3
Yeah, been experiencing that! Turn it on to do some tinkering over SSH and forget to turn it off. Want to find a way to turn it on with a long timeout or something.. or find some other way to make sure internet is kept on, but only while my app is open and active. I guess ideally if you put the device to sleep while my app was running it should turn off wifi and not drain your battery.
Acorn is offline   Reply With Quote
Old 01-25-2021, 03:04 PM   #217
sherman
Guru
sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.
 
Posts: 850
Karma: 2641698
Join Date: Aug 2008
Location: Taranaki - NZ
Device: Kobo Aura H2O, Kobo Forma
Yeah, NickelDBus can do what you want regarding WiFi. Look at wfmConnectWireless and nsForceWifi.

As a bonus, you can also listen for the the various wireless manager signals to know whether or not the connection succeeded (for example wmNetworkConnected).
sherman is offline   Reply With Quote
Old 01-25-2021, 03:31 PM   #218
Acorn
Connoisseur
Acorn is on a distinguished road
 
Posts: 56
Karma: 74
Join Date: Oct 2010
Device: Kindle 3
Oh awesome, will have a play with that! Any idea how I could make sure force wifi is off when the device is put to sleep? Is there a way to listen for that?
Acorn is offline   Reply With Quote
Old 01-25-2021, 03:40 PM   #219
sherman
Guru
sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.
 
Posts: 850
Karma: 2641698
Join Date: Aug 2008
Location: Taranaki - NZ
Device: Kobo Aura H2O, Kobo Forma
You pass a string to nsForceWifi to enable, disable, or toggle.
sherman is offline   Reply With Quote
Old 01-25-2021, 04:00 PM   #220
Acorn
Connoisseur
Acorn is on a distinguished road
 
Posts: 56
Karma: 74
Join Date: Oct 2010
Device: Kindle 3
Yep, looking at the examples in the docs I managed to figure that out. Still not sure how to listen for / react to the device going to sleep though.
Acorn is offline   Reply With Quote
Old 01-25-2021, 04:26 PM   #221
sherman
Guru
sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.
 
Posts: 850
Karma: 2641698
Join Date: Aug 2008
Location: Taranaki - NZ
Device: Kobo Aura H2O, Kobo Forma
Quote:
Originally Posted by Acorn View Post
Yep, looking at the examples in the docs I managed to figure that out. Still not sure how to listen for / react to the device going to sleep though.
Haven't looked into that to be honest.

There probably is a signal, I'll need to find it though.
sherman is offline   Reply With Quote
Old 01-25-2021, 05:03 PM   #222
sherman
Guru
sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.
 
Posts: 850
Karma: 2641698
Join Date: Aug 2008
Location: Taranaki - NZ
Device: Kobo Aura H2O, Kobo Forma
Let's continue the NickelDBus conversation to the NDB thread.
sherman is offline   Reply With Quote
Old 02-01-2021, 08:59 AM   #223
mattzz
Member
mattzz began at the beginning.
 
Posts: 19
Karma: 10
Join Date: Feb 2014
Device: pw, pw2
Quick question:
What is the correct way to print a string that is starting with a dash, e.g. "-1°C"?

With FBInk v1.23.1 I'm getting a parsing error regardless of how I try to escape the string.
mattzz is offline   Reply With Quote
Old 02-01-2021, 10:14 AM   #224
frostschutz
Linux User
frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.
 
frostschutz's Avatar
 
Posts: 2,279
Karma: 6123806
Join Date: Sep 2010
Location: Heidelberg, Germany
Device: none
Code:
fbink -- -1
frostschutz is offline   Reply With Quote
Old 02-01-2021, 11:18 AM   #225
mattzz
Member
mattzz began at the beginning.
 
Posts: 19
Karma: 10
Join Date: Feb 2014
Device: pw, pw2
Thanks a lot
mattzz is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Aura HD Small tool for filling book library in Kobo Aura Paxerus Kobo Developer's Corner 2 12-31-2013 07:05 PM
Small print Broadback Conversion 12 12-12-2011 02:31 PM
Small Tool to change book order (PRS-x50) goaspy Sony Reader 113 10-14-2011 03:28 PM
small print breezeman Introduce Yourself 13 07-03-2011 09:02 AM


All times are GMT -4. The time now is 09:11 PM.


MobileRead.com is a privately owned, operated and funded community.