yashsingh1/xdaforums huggingface dataset:
[Nook Touch General] guitar_east:
That's ok. There's no reason to buy a Kindle, the Nook runs the app quite well
[Nook Touch General] met67:
As far as I can tell, in the internal.db there are 2 different table, 'docs' for sideloaded books and 'products' for B&N books and the 'docs' table misses the short synopsis field used for the book summary.

So probably there is no way to have summary for sideloaded books...
[Nook Touch General] ApokrifX:
If we put book into /data/media/B&N Downloads/Books/ folder, it’ll go into 'docs' table for sideloaded books still, right?

BTW: How do you fiddle with databases such as internal.db?

Use adb to pull/push and fiddle on PC, or use adb shell to do it on nook?
[Nook Touch General] met67:
IDK, never tried :)

Both, actually.

I use SQLiteStudio to browse data and definitions, and a copy of sqllite3 found on this forum to modify the DB on the device via adb shell
[Nook Touch General] persichini:
Well my thoughts were why can't we just manually insert the books in the the "products" with the data fields filled in. i tried guessing at what all those fields were. I'm assuming it wasn't the correct info or didn't match the book some how because it didn't work.

I tried to place the books into /data/media/B&N Downloads/Books/ folder but the nook ignored them. From what i can tell it checks the database file and if its not in there it doesn't see it.

if you place your books in /system/media/books/ folder it will recognize them as sideloaded books. That is the same location as your quick start.epub and the manual.epub

I have placed books there and the nook will load them after a reboot.

I adb pull/push and used a program called sqliteadmin in windows
[Nook Touch General] Droidatar:
sideloaded books on Nook

I was searching and came across your post, have you considered using Calibre to sideload your books? I just changed yesterday to include the metadata (within calibre program) on the first page of the book. that way you can review the information you have set. It will also download metadata for books you do not have info on.

Don't know if this helps good luck with your Nook.
[Nook Touch General] gadgetroid:
I realize I may be bumping this thread, but I figured that it was worth it. I worked around with a few of the files and I figured out everything now. I can get my side-loaded books to show up in the My Books section. Thanks to OP to giving me the hint about the database files. :good:

My method requires you to download a sample of the book you want to side load from the Nook Store ( remember, a sample; not the book. Samples are free.) The database files contain the metadata info. Copy the filename of the sample you have downloaded( this will be in \sdcard\Nook\Content). Copy over the ePub you want to side load and rename the file with the name of the sample downloaded. Going into the Nook app, you can now see that the sample in the Library has been replaced with the full version of the book.

Head over to Android Market and buy the SQLite Editor. Once that's done, open up the app and click on B&N Nook( or something to that effect, since I don't remember it exactly). Head into products, and scroll sideways until you come across "isSample". ( Please look into the column or row for your book.) For your sample book, the value will be set to 1. For the purchased books, it'll be zero. Just long click on that cell and edit the value and set it to 0. Click back, exit out of the app and launch the Nook app.

You can now see that the "Sample" logo from the sample book is gone. Voila! Sample books have all the privileges of the full book purchased from the B&N Store. The B&N Store has an abysmal selection of books, so I prefer buying my books from elsewhere and then using them on B&N app. That's the best app I've found for Android so far.

I haven't got the syncing to work yet. I just got onto my tablet, and I don't feel like going through the whole process again. I'll try it out tomorrow and let you know. Side note: I also got "Internal errors" upon launching the app. I believe this is because of me updating the database files and B&N not having a copy of the update. But the app obeys the local copy present, so I' m not too worried about that at the moment.

Can the OP look into this on the Nook tablet? I can confirm this works on the normal Android tablets, but I'm not so sure of the Nook tablet. Maybe it can be run from the CM ROMs?
[Nook Touch General] LastSilmaril:
gadgetdroid's workaround does, indeed give you sharing capabilities.

But this happened when I tried to share to facebook:

clicking 'more' in order to have metadata and summary come up yields 'service unavailable'.

Also, the sample books on my Nook get saved to /sdcard/B&N Downloads/Books/ (symlinked /data/media to /sdcard, so pretend it's /data/media for the rest of you who didn't make that change)

Still I count this as progress. I'm not sure if simply adding a line to the products db on scan is the answer because the products db has so many more columns than the docs db but I'ma try it and see what happens.
[Nook Touch General] LastSilmaril:
spoofing tryouts...

So I tried spoofing the products db to see what what would happen by copying an entry from the docs db (where I had a book already) to the products db, like so (IOW, without having downloaded a sample book from B&N):

I then deleted the relevant entry in the sideloaded db (e.g. docs), went into the Library and clicked the update key. this didn't seem to be effective. I then changed the ean entry to a real isbn number instead of just using the filename twice...still nothing. I then rebooted the device. I tihnk this actually caused the library to do a rescan. I now found that I had two copies of 'The Old Man and the Sea' listed (which of course were actually in the same physical location). The first one listed managed to begin to act like a bought book! E.g. when I went to 'more...' to read metadata, it showed the 'Service Unavailable' error. The sharing button was ungreyed! I then tried to share something to Facebook...but got an error message:

Still, I count that as progress. In the above example, the epub file didn't have a publisher field, and of course the _ean field in the docs database is not populated, so I had to manually drop that in. The ean field cannot be null, and cannot just be some random string of characters. I confirmed this by going back and modifying the db - progress stopped right there, and the Share button became greyed out again.

So I'm not sure if a) the other fields in the products db, which I still have not populated, are relevant to making this functionality work or b) this is as far as we can go and b&n holds all the keys.

One other note: The locker_delivery_id and luid numbers, which are identical except for the leading L, I made up; these cannot be null.

EDIT: one last thing - whenever I open either the 'first' or 'second' copies of 'The Old Man and the Sea' off of a cold boot, I simply get a black screen, and have to go back to the Library and click the book again. I'm not sure if that has to do with anything I'm doing or if it's because of the guevor's kernel (which I just installed)
[Nook Touch General] LastSilmaril:
copying the locker_delivery_id and luid from a book that has been dled from B&N as a sample, instead of just making one up, also doesn't seem to work...
[Nook Touch General] gadgetroid:
I repeat, unless B&N don't have a copy of your purchase, you will face errors of not finding metadata. I just installed Linux on my laptop, so I'll go through a few things and post the results soon. Have you updated the Nook app to the latest version? In the latest one, you don't have to restart the app any more or restart the device or kill it's process to see the new books added through the file manager.

One more thing. Have you manually tried filling up the metadata on the book you copied in Products db? Don't set the syncing to take place. Mark it as 0. I want to get metadata working first.
[Nook Touch General] LastSilmaril:
That seems to be the case. It's not that the metadata isn't on your device, because I compared the entry for the other books in the products table to the one I made, and there didn't seem to be any extra info in the other entries that the one I made lacked, besides for the category, page_count, short_synopsis, seriesTitle and soldBy columns, and I really don't understand why they would be relevant to sharing. Every other column of note - ean, productEAN, isbn, locker_delivery_id, luid, date_published, date_accessed, date_modified I manually added values to myself. So it looks like it might be that unless B&N's servers have a record of the 'sale' - at least the download of the sample - well, no sharing will take place. Even if you do use your method, like you say, something seems to be screwy with metadata, as this happens:

Clicking the sync button doesn't seem to be necessary to get anything to work and also doesn't seem to change the entry I made in the products table at all. But I think that the Library.apk does need to be restarted, so after any change to the db, I reboot the Nook.

As for what version of the 'Nook app' I have - I'm not sure what you're referring to. I have a Nook Glow on 1.1.5 with guevor's kernel.

---------- Post added at 07:15 PM ---------- Previous post was at 07:06 PM ----------

this does indeed seem to be an issue with the kernel or something - every time I start the device, the first book I open via the Library just kind of hangs, and requires me to go back to the Library and select a book again.
[Nook Touch General] gadgetroid:
I just found this out. You have to enable "Share to Facebook" while converting the book in Calibre. Note that enabling this option disables the syncing.
[Nook Touch General] LastSilmaril:
Seriously? That's it? Do we still have to follow the rest od the steps?
[Nook Touch General] gadgetroid:
Can you confirm if syncing between various devices work with the workaround I mentioned? I messed around with a few calibre plugins and I'm in the process of making one sends a copy of the updated Products.db each time you copy a book over to the nook. Of course, you'll have to manually copy the Products.db file over to the relevant folder on the Nook for it to take effect. Personally, I feel that this is too much of work, and I'm looking for a simpler process.

---------- Post added at 08:49 PM ---------- Previous post was at 08:31 PM ----------

As far as I'm aware, it worked for the last book I tried. Yes, we do unfortunately have to follow the rest of the steps, because I worked on a Calibre converted ebook with the sharing option turned on for the Products.db experiment. Can you tell me how you managed to pull the SQLite files from the Nook using ADB? It would be easier to edit them on the computer. :)
[Nook Touch General] LastSilmaril:
Well you just "adb pull" the internal.db file to your desktop, and then use sqlite3 or whatever editor you use to mess with it. If you've been editing it already then you must know where it is; I don't know off the top of my head and don't have my Nook here
[Nook Touch General] persichini:
/data/data/com.android.providers.media/databases/internal.db
[Nook Touch General] gadgetroid:
Yes, I do know where they are. I did all the editing on the phone so far, and I just set up ADB and Android SDK.

Thanks! I got the file. :) Installed SQLiteman. :)
[Hardware Hacking General] dpc.ucore.info:
I'm going to do some low-level software development on Samsung Galaxy Nexus (replacing kernel with custom one doing stuff that are not Android-related). To do so I'll require accessing uart output of bootloaders and Linux.

I'm looking for an information how to connect to i9250's uart serial port and possibly other stuff.

Currently the best what I've found is The all-in-one Galaxy S2 Hack Pack (http://xdaforums.com/showthread.php?t=1316501), but obviously this is not entirely what I'm looking for. The i9250 service manual maybe some help too. If anyone has any information regarding this matter, please post.
[Hardware Hacking General] superdetka:
To get access to your kernel's, bootloader's logs through UART you need UART jack(dont know this word in english, I think I guess 'jack') on your board, in your case i9250's.

If developers of board didn't add that jack to pcb design, your attempts to view logs will be unsuccessful.

If you find UART pins of your SoC, connect it to UART-USB converter and plug to your PC.

In bootloader sources you will find to which UART port debug messages will go, if your SoC has more than one controller.

In linux's kernel case debug port you could assign through startup string, like bootargs in uboot, or through menuconfig.

But all this stuff depends on have you got UART pins on board or not.
[Hardware Hacking General] E:V:A:
First you have to tell us what hardware you have! Find some links to "tear-aparts / tear-downs" etc. Also make sure, what you find, corresponds to your device. Samsung is going wild when it comes to making (incompatible) product variations. When we know the hardware we can start to find out the rest... In your case the most important is to find out about the application processor (AP), baseband processor (P) and the micro-USB mux.
[Hardware Hacking General] balban:
Its the Galaxy Nexus GSM/HSPA version. It has an OMAP4460. The processor found on the pandaboard.
[Hardware Hacking General] AdamOutler:
This device should have external UART.

Have you tried 619Kohms on the USB port yet? Most samsung device, including this one, have a FSA chip. This is the first way to tell if UART is properly connected.

If it is, than you can probe deeper to find the internal UART which will show more. The Internal UART connection will show UART before the FSA chip is initialized giving you even more to work with.

It's likely that because this is an OMAP chip, it should have the following characteristics:

192600 or 115200 bps

8 bits per word

1 stop bit

No parity

No flow control

1.8V high, Open drain

I'm not sure if the FSA chip will increase that level to 3V or not.
[Hardware Hacking General] E:V:A:
To briefly clarify (and confirm) what Adam says.

There is already built in UART-USB functionality controlled by the FSA (MUX). Thus you can just connect an external microUSB connector with appropriate resistor values, to get a serial connection. (Just google "I9x00 USB JIG"). But if you decide to use internal UART pins on the PCB, then you get earlier access to everything and you can start reading already at the IBL (Initial Boot Loader) stage, which are the absolute first characters coming out of phone after a reboot.
[Hardware Hacking General] balban:
I can confirm the 619Kohm trick works on Galaxy Nexus. I used a 3.3V USB/UART breakout card. Serial output:

�����[sbl_board_charger_init_post] : Succeed set model data : 0x78!!!!!

====== VCELL : 368500, SOC : 23, nType : 4 ======

[Charger] nScaledVCELL : 368500000, nDesriedSOC, : 23, nMaxSOC : 43, nMinSOC : 3

[ omap_power_get_reset_source :47] PRM_RSTST : 0x1

[ __omap_usbacc_test_donwload_by_musb :280] nDeviceType : 0x4

[ omap_usbacc_get_reboot_reason :333] nJigStatus = 0x00000001

[ __sbl_board_hw_init_late :719] final reboot mode in cable = 0x20000

[ __sbl_board_hw_init_late :730] Wake up by TA / USB / JIG

* FB base addr = 0xbea70000!

* PANEL_S6E8AA0_ID_READ : 0x12, 0x8e, 0x9f.

[ omap_power_get_reset_source :47] PRM_RSTST : 0x1

message.command =

message.status =

message.recovery =

Starting kernel at 0x81808000...

<hit enter twice to activate fiq debugger>

AST_POWERON
[Hardware Hacking General] balban:
This is what comes prior to the above, in case anyone is interested.

-- OMAP 00004460 (version 04460e11) PPA release 1.6.1 Hash 30639809--

Device type: HS, DEBUG OFF

CPFROM HAL API support integrated

THERMAL support integrated: Run Time + Boot time

HDCP support integrated

-- PROD PPA RC3.2.3 --

Reset reason = 00037ba2

PRM_RSTST = 00000002

PPA freed 2992 bytes

Texas Instruments X-Loader 1.41 (Nov 16 2011 - 16:28:45)

Starting OS Bootloader from MMC/SD1 ...

EXCEPTION : CM_CLKMODE_DPLL_ABE = 0x7

EXCEPTION : CM_IDLEST_DPLL_ABE = 0x1

EXCEPTION : CM_CLKSEL_DPLL_ABE = 0x804018

EXCEPTION : CM_CLKMODE_DPLL_CORE = 0xf

EXCEPTION : CM_IDLEST_DPLL_CORE = 0x1

EXCEPTION : CM_CLKSEL_DPLL_CORE = 0x7d05

EXCEPTION : CM_CLKMODE_DPLL_PER = 0x107

EXCEPTION : CM_IDLEST_DPLL_PER = 0x1

EXCEPTION : CM_CLKSEL_DPLL_PER = 0x1400

EXCEPTION : CM_CLKMODE_DPLL_MPU = 0x117

EXCEPTION : CM_IDLEST_DPLL_MPU = 0x1

EXCEPTION : CM_CLKSEL_DPLL_MPU = 0x807d07

CFG_LOADADDR = 0xa0208000

1st instruct = 0xEA000007

[ __omap_twl6030_init_vbat_cfg :49] SA_PHOENIX_START_CONDITION = 0x8

[ __omap_twl6030_init_vbat_cfg :54] SA_PH_CFG_VBATLOWV = 0x80

[ __omap_twl6030_init_vbat_cfg :63] SA_PH_CFG_VBATLOWV = 0x80

[ __omap_twl6030_init_vbat_cfg :86] SA_BBSPOR_CFG = 0x78
[Hardware Hacking General] E:V:A:
Now, could we have the English translation (of all that above) please?

[And if debug is OFF, how can we turn it ON?]

I seem to be able to count 4 bootloaders there, how many damn boot loaders are there!?
[Hardware Hacking General] balban:
USB - UART 619Kohm cable

Would anyone build a custom 619Kohm mini-USB to UART cable and ship it in the U.S. or India? We need it.

Is there any supplier of this in the U.S.?

Thanks,

Bahadir
[Hardware Hacking General] AdamOutler:
I've attached a circuit diagram. You will need to modify your cable. You will need a UART device like the FTDIFriend or Bus Pirate. I specified the communications settings above.

Here is the cable modifications and where to hook up on the MicroUSB port.

Power is disconnected

Data- and Data+ are your signal lines.

Pin X (aka Pin4) is connected to ground via 619Kohm resistor

Ground is used as a reference.

Just tear up a MicroUSB cable and modify it as above.
[Hardware Hacking General] iamsage2:
I managed to get the UART cable done and also some output from there. Now my questions is has anyone managed to get kernel boot log out of the UART as well? Atm. I get only the bootloader things:

[sbl_board_charger_init_post] : Succeed set model data : 0x78!!!!!
====== VCELL : 380250, SOC : 57, nType : 4 ======
[Charger] nScaledVCELL : 380250000, nDesriedSOC, : 60, nMaxSOC : 80, nMinSOC : 40
[ omap_power_get_reset_source :47] PRM_RSTST : 0x1
[ __omap_usbacc_test_donwload_by_musb :280] nDeviceType : 0x4
[ omap_usbacc_get_reboot_reason :333] nJigStatus = 0x00000001
[ __sbl_board_hw_init_late :719] final reboot mode in cable = 0x20000
[ __sbl_board_hw_init_late :730] Wake up by TA / USB / JIG
* FB base addr = 0xbea70000!
* PANEL_S6E8AA0_ID_READ : 0x12, 0x8e, 0x9d.
[ omap_power_get_reset_source :47] PRM_RSTST : 0x1
message.command =
message.status =
message.recovery =

Starting kernel at 0x81808000...

So does anyone know what kernel configs and cmdline I need in order to get the kernel messages out from the UART?

Thanks in advance.
[Hardware Hacking General] E:V:A:
Where is the actual resistor values determined? I know it has something to do with the USB MUX, but are the actual values determined by code or by hardware? Or is the Nexus MUX different? I'm wondering because according to this thread (for the GT-I9100) the resistor value should be R = 523 K.

---------- Post added at 11:58 AM ---------- Previous post was at 11:55 AM ----------

Check the link above...

...and let us know how it goes.

[EDIT] I've just answered my own questions, plus a resistor reference table over here.
[Hardware Hacking General] iamsage2:
I managed to get the kernel output out with the 619K resistor. Just had to enable some kernel options of FIQ_DEBUGGER

CONFIG_FIQ_DEBUGGER=y
CONFIG_FIQ_DEBUGGER_NO_SLEEP=y
# CONFIG_FIQ_DEBUGGER_WAKEUP_IRQ_ALWAYS_ON is not set
CONFIG_FIQ_DEBUGGER_CONSOLE=y
CONFIG_FIQ_DEBUGGER_CONSOLE_DEFAULT_ENABLE=y

And have the console=ttyFIQ0 on cmdline. Thanks for the nice thread :)
[Hardware Hacking General] AdamOutler:
Hey guys... I just got a Galaxy Nexus. I'm going to be doing some work. I used UART for the first time last night.

This works differently than standard UART with SBL or U-BOOT. How do you access the command line parmeters for the kernel, or do you need to take a kernel, un-boot.img it and then add new parmeters?
[Hardware Hacking General] E:V:A:
Probably you don't remember this and this. But basically you can use the sblParam tool, to look at and set your command line on the fly. (Do backup and check that the output of that program is the same, as it was originally developed for a different phone.) You can check with:

# hexdump -C /mnt/.lfs/param.blk

BTW. Do you know what the voltage levels are for Tx/Rx (D+/D-), when using the various resistor values, for USB/UART?

In particular the values:

150K UART Cable

255K Factory Mode Boot OFF-USB

301K Factory Mode Boot ON-USB

523K Factory Mode Boot OFF-UART

619K Factory Mode Boot ON-UART

I'd also like to know if the voltages changes when switching USB/UART mode when using:

a) The PhoneUtil menu: *#7284#

b) The ServiceMode menu : *#197328640#

==> MAIN MENU --> COMMON --> DIAG CONFIG
[1] LOG VIA USB *
[2] LOG VIA UART

Why?

1) It may be possible that there are already level-shifters built in to the MUX, and thus we may no longer need to build level shifter UART cables.

(Your PC should automatically recognize a new serial device, using one of the ~7 drivers included in the Samsung CDC, when connecting disconnecting via USB and using some (?) of the resistors above.)

2) I have the FTDI FT232R-3V3 cable and need to check if its TTL 5V or CMOS 3.3V levels on the output..

This is all hypothetical, so it may be that I'm on a wild goose chase... But I'm still waiting for my μUSB breakout connector and cable...and then found out I may have the wrong levels for my cable.
[Hardware Hacking General] AdamOutler:
Thanks.

Its supposed to be 3v3. 5v works fine thanks to the fsa chip
[Hardware Hacking General] AdamOutler:
Those menus dont exist on my stock device.
[Hardware Hacking General] E:V:A:
Really!? I don't believe it. They must have changed the code(s) to something else. Sometimes you also need to write the "*#" parts twice before or after the number, for reasons unknown, but probably some lame attempts to further hide these menus from curious users. Did you try *#0011#? (Or any other of the hundreds of "hidden" function codes?) No worry, we can find them by looking in the baseband or the available Apps on the phone...

[EDIT] Ah, I just remembered, the various codes are pointers to the various sub-menus in the servicemode app, so if they have updated this app, which they surely have if you're on ICS and Nexus, the sub-entry codes have likely changed as well. (Remember that this app is just a wrapper for the real/native code running on BP which is different for different platforms (phones). However, most main entry codes should always be the same. Like 0011 and 06 etc etc.

Also try:

# find / -iname "*service*"

If indeed none of these menus are available, they must have done some interesting kernel mods to extend the auto-detection and for tweaking functionality elsewhere. You're on ICS 404, right?
[Hardware Hacking General] AdamOutler:
I dont have find or hexdump yet. I have decided that any modifications i do to this device will be CASUAL implementations. I am running stock 4.0.2 ICL53F.i9250XWKL2.

I believe there is a root exploit out there i can port into CASUAL. Its a matter of getting time to do it.
[Hardware Hacking General] E:V:A:
^^ Well, that philosophy sound a little strange coming from you. We can't do much hardware hacking without root write access to the root filesystem "/". At least not, unless you know how to apply one of your unbreakable SW-JIG mods to gain temporary root somehow. All you really need is busybox,which contain the majority of commands and shells needed for normal system operations.
[Hardware Hacking General] AdamOutler:
Well.. im generating content for XDATV now... i have to move slower in order to make things reproducable... basically i log my work more thoroughly.

I want to start with taking a long hard look at the diagnostic port under the SIM card. I will be hooking up a logic analyzer to it and finding information on a stock device.