Cannot connect to BNRV1300 B&N GL4+
| Affects | Status | Importance | Assigned to | Milestone | |
|---|---|---|---|---|---|
| calibre |
Fix Released
|
Undecided
|
Unassigned | ||
Bug Description
Calibre is unable to connect to Barnes & Noble Nook GlowLight4 Plus - BNRV1300. The NOOK folder is present under the 'Internal shared storage' drive. I am able to view the folder in Windows Explorer (Windows 10) and can create folders under the NOOK folder and copy files there. The device does not allow me to create folders or files under the 'Internal shared storage' location. Details of error message is below. Nook is running Platform version 8.1.7.31(E), App version 6.6.5.9 and shop version 6.6.5.3.
calibre, version 7.12.0
ERROR: Error: Error communicating with device
Failed to create the folder: NOOK in ('Internal shared storage',) with error: C:\r\src\
Traceback (most recent call last):
File "calibre\
wpd.WPDError: C:\r\src\
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "calibre\
File "calibre\
File "calibre\
File "calibre\
File "calibre\
File "calibre\
File "calibre\
File "calibre\
File "calibre\
OSError: Failed to create the folder: NOOK in ('Internal shared storage',) with error: C:\r\src\
| David Suarez (davids569) wrote : | #1 |
| Kovid Goyal (kovid) wrote : | #2 |
| Changed in calibre: | |
| status: | New → Invalid |
| David Suarez (davids569) wrote : | #3 |
I have reset the device as well as uninstalled and reinstalled Calibre, no change. From the error messages, it appears that the code is trying to create the NOOK folder, but it is already present. And the permissions on the device do not allow folders to be created under 'Internal shared storage'. The device updated itself upon setup the first time, so I suspect that something has changed on the device that is causing it to now not connect correctly.
| Kovid Goyal (kovid) wrote : | #4 |
Yes, the attempt to make the folder happens only if the code thinks the
folder doesnt exist. As I dont have the device I cant really help you
further, but if you are willing to run calibre from source it should be
fairly easy to narrow down the cause of that.
Running from source is easy, see:
https:/
| Keith Agar (kwa61) wrote : | #5 |
I have the exact same error message being reported with my Barnes & Noble Nook GlowLight4 Plus - BNRV1300.
Using Calibre Release: 7.15.
Nook is running Platform version 8.1.7.38(E), App version 6.6.7.11 and shop version 6.6.7.2.
I can see in Windows Explorer "This PC\BNRV1300\
| Rodrigo Pantoja (rpantojam) wrote : | #6 |
Same error here Nook BNRV1300, Platform 8.1.7.50(E), App 6.7.1.15
calibre, version 7.19.0
ERROR: Error: Error communicating with device
Failed to create the folder: NOOK in ('Internal shared storage',) with error: C:\r\src\
Traceback (most recent call last):
File "calibre\
wpd.WPDError: C:\r\src\
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "calibre\
File "calibre\
File "calibre\
File "calibre\
File "calibre\
File "calibre\
File "calibre\
File "calibre\
File "calibre\
OSError: Failed to create the folder: NOOK in ('Internal shared storage',) with error: C:\r\src\
Also I can see the eReader in explorer and folder NOOK does exist
| Changed in calibre: | |
| status: | Invalid → Confirmed |
| Changed in calibre: | |
| status: | Confirmed → Opinion |
| Tempest (tempythecleric) wrote : | #7 |
Any movement or solutions for this because I am also having the same issue.
calibre, version 7.24.0
ERROR: Error: Error communicating with device
Failed to create the folder: NOOK in ('Internal shared storage',) with error: C:\r\src\
Traceback (most recent call last):
File "calibre\
wpd.WPDError: C:\r\src\
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "calibre\
File "calibre\
File "calibre\
File "calibre\
File "calibre\
File "calibre\
File "calibre\
File "calibre\
File "calibre\
OSError: Failed to create the folder: NOOK in ('Internal shared storage',) with error: C:\r\src\
| Embryonic (alphatjh-g) wrote : | #8 |
Hey Kovid, Thanks for an awesome application.
I Also have this issue on my Windows Machine, but it works on my Linux Machine.
The BNRV1300 already HAS a NOOK folder on the device by default, so I think this issue is due to the windows version trying to create the folder and getting an error, and possibly not handling it correctly.
I Tried deleting the NOOK Folder and letting Calibre create it, but the nook appears to re-create the folder upon being deleted.
The default filesystem is laid out below:
BNRV1300
-Internal Storage
--.adobe-
--Android
--NOOK
Hope that helps!
| Kovid Goyal (kovid) wrote : | #9 |
See comment #4
| Kovid Goyal (kovid) wrote : | #10 |
Also try running the following command in a command prompt with your Nook connected and posting the output
```
calibre-debug -c "from calibre.
```
That will dump the filesystem metadata which might tell us more about why the folder is not being seen.
| Tempest (tempythecleric) wrote : | #11 |
I haven't done the step in comment #4 yet, but here is the output from the command prompt in comment #10.
```
C:\Windows\
MTP: Loading filesystem metadata...
MTP: Filesystem metadata loaded in 0.0535738 seconds (0 objects)
+ Internal shared storage [id:s10001 0 children modified=1969/12/31 16:00]
Prefix for main mem: Books
Traceback (most recent call last):
File "calibre\
wpd.WPDError: C:\r\src\
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "runpy.py", line 198, in _run_module_as_main
File "runpy.py", line 88, in _run_code
File "site.py", line 83, in <module>
File "site.py", line 78, in main
File "site.py", line 50, in run_entry_point
File "calibre\debug.py", line 245, in main
File "<string>", line 1, in <module>
File "calibre\
File "calibre\
File "calibre\
OSError: Failed to create the folder: developing-
```
| Kovid Goyal (kovid) wrote : | #12 |
Internal shared storage [id:s10001 0 children modified=1969/12/31 16:00]
shows that its not reading anything inside the internal storage (see 0 children)
On a properly working device you would get something like
Internal Storage [id:s10001 11 children modified=1970/01/01 05:30]
It indicates the windows WPD EnumObjects() function is failing to return any children for the internal storage object or getting the properties for the children is failing for some reason.
| Kovid Goyal (kovid) wrote : | #13 |
In filesystem_cache.py print out all_storage and entries in the constructor of FilesystemCache that should confirm if the driver is returning entries or not.
| Tempest (tempythecleric) wrote : | #14 |
I am not sure how to do that, so either someone else will have too, or I will need to take some time to learn what that is / how to do that.
| Kovid Goyal (kovid) wrote : | #15 |
You setup the calibre dev env as described in in: https:/
Then apply the following patch and run the above command again:
diff --git a/src/calibre/
index b9a48579cc.
--- a/src/calibre/
+++ b/src/calibre/
@@ -236,6 +236,10 @@ def mtp_id_path(self):
class FilesystemCache:
def __init__(self, all_storage, entries):
+ for x in all_storage:
+ print(x)
+ for x in entries:
+ print(x)
| Rodrigo Pantoja (rpantojam) wrote : | #16 |
Hi, I've just setup the development environment and run
calibre-debug -c "from calibre.
with a similar but somewhat different result than Tempest:
C:\Program Files\Calibre2>
MTP: Loading filesystem metadata...
MTP: Filesystem metadata loaded in 0.019624 seconds (0 objects)
+ Internal shared storage [id:s10001 0 children modified=1969/12/31 21:00]
{'device_version': '1.0',
'friendly_name': '',
'has_bulk_
'has_storage': True,
'manufacturer_
'model_name': 'BNRV1300',
'protocol': 'MTP: 1.00',
'serial_number': '5043010011337008',
'storage': [{'capacity': 29152509952,
'id': 's10001',
'rw': True,
'type': 'phone'}
Prefix for main mem: Books
Traceback (most recent call last):
File "C:\calsrc\
File "C:\calsrc\
File "C:\calsrc\
File "C:\calsrc\
AttributeError: 'wpd.Device' object has no attribute 'list_folder_
Adding the changes to filesystem_cache.py to list all_storage and entries:
C:\Program Files\Calibre2>
MTP: Loading filesystem metadata...
{'id': 's10001', 'size': 29152509952, 'name': 'Internal shared storage', 'is_folder': True, 'can_delete': False, 'is_system': True}
MTP: Filesystem metadata loaded in 0.027566 seconds (0 objects)
+ Internal shared storage [id:s10001 0 children modified=1969/12/31 21:00]
{'device_version': '1.0',
'friendly_name': '',
'has_bulk_
'has_storage': True,
'manufacturer_
'model_name': 'BNRV1300',
'protocol': 'MTP: 1.00',
'serial_number': '5043010011337008',
'storage': [{'capacity': 29152509952,
'id': 's10001',
'rw': True,
'type': 'phone'}
Prefix for main mem: Books
Traceback (most recent call last):
File "C:\calsrc\
File "C:\calsrc\
File "C:\calsrc\
File "C:\calsrc\
| Kovid Goyal (kovid) wrote : | #17 |
Yes, that's because I have changed what main() does for unrelated
reasons, but the problem remains the same. EnumObjects() is not
returning any children for the Internal storage. As long as that's the
case there is no way calibre can work with this device.
| Rodrigo Pantoja (rpantojam) wrote : | #18 |
Thanks Kovid. I see what you mean. I'm an IT profesional and even though my knowledge of Python and C++ is superficial for the first and very rusty for the second, I'll try and investigate why the WPD API is failing on this device. It took me a while but I found the EnumObjects call in device_
| Tempest (tempythecleric) wrote : | #19 |
Because all of this does mostly go over my head. If either of you do figure out a solution or find a workaround let me know please.
| Kovid Goyal (kovid) wrote : | #20 |
Yeah if you can figure out how to get enumobjects working with this device I can make the needed changes in the C++ code in the calibre driver.
| Tempest (tempythecleric) wrote (last edit ): | #21 |
Just to add this, I set up the environment, added the patch and ran the command again and here is the output:
```
C:\>calibre-debug -c "from calibre.
Hello, world!
MTP: Loading filesystem metadata...
{'id': 's10001', 'size': 29152509952, 'name': 'Internal shared storage', 'is_folder': True, 'can_delete': False, 'is_system': True}
MTP: Filesystem metadata loaded in 0.030947 seconds (0 objects)
+ Internal shared storage [id:s10001 0 children modified=1969/12/31 16:00]
{'device_version': '1.0',
'friendly_name': '',
'has_bulk_
'has_storage': True,
'manufacturer_
'model_name': 'BNRV1300',
'protocol': 'MTP: 1.00',
'serial_number': '5043010007857000',
'storage': [{'capacity': 29152509952,
'id': 's10001',
'rw': True,
'type': 'phone'}
Prefix for main mem: Books
Traceback (most recent call last):
File "C:\Users\
File "C:\Users\
File "C:\Users\
File "C:\Users\
AttributeError: 'wpd.Device' object has no attribute 'list_folder_
```
| Tempest (tempythecleric) wrote : | #22 |
- Screenshot 2025-01-22 142815.png Edit (89.7 KiB, image/png)
I also have no idea is anything from here will help, but here it is
| Rodrigo Pantoja (rpantojam) wrote : | #23 |
Kovid, setting up my PC for WPD development is becoming a PITA, mostly because my system disk is out of space. I will solve it eventually. But meanwhile I was looking at the WPD samples I mentioned earlier and also, prompted by Tempest's screen grab, at the WPD info tool. It seems to me that the sample/tools do a recursive enumeration, i.e. they first call EnumObjects with WPD_DEVICE_
{'id': 's10001', 'size': 29152509952, 'name': 'Internal shared storage', 'is_folder': True, 'can_delete': False, 'is_system': True}.
Could you compile a version of the system where you change device_
hr = content-
for:
hr = content-
just to check if this works with GL4+? If this does work I guess you can see the way to a fix.
| Tempest (tempythecleric) wrote : | #24 |
Rodrigo, let me know if there is a WPD test or screenshot you want me to take since I have Windows SKD and Dev tools up and running to try and diagnose it.
| Kovid Goyal (kovid) wrote : | #25 |
calibre also does a recursive enumeration and indeed does the
enumeration with the storage id, see the file content_
get_files_
WPD_DEVICE_
storage ids, each storage id is then recursively listed.
If it didnt do that it wouldnt work with any MTP device. The question is
basically why EnumObjects() doesnt work when called with the storage id
of the Internal Storage
| Rodrigo Pantoja (rpantojam) wrote : | #26 |
Understood. I'll keep quiet, finish up setting up my pc and do the tests. I'll get back once I've been able to have an answer to Kovid's question "why EnumObjects() doesnt work when called with the storage id
of the Internal Storage [?]"
| Rodrigo Pantoja (rpantojam) wrote : | #27 |
- Visual Studio debug Edit (166.1 KiB, image/png)
I installed Visual Studio and loaded a sample project that does basic operations on portable devices using the WPD API. It's like a lightweight, text based WPD Info Tool (the one Tempest used). Just running it on the Nook worked just fine, it showed all the folders and by debugging it I found that the answer to Kovid's question is: it does work when calling EnumObjects with id "s10001" and the call actually returns the objects inside (see attached screen grab). Unfortunately the problem must lie somewhere else within calibre. Only hint I have is that the WPD Info Tool does show an error "HRESULT = 0x80042009" when opening Nook and it doesn't when opening other readers, e.g. Kobo libra colour nor Kindle Oasis. It still does show all the information, but throws this error when opening the device. The description of the error code says "Invalid ObjectHandle, Indicates that an object handle does not refer to an actual object that is present on the device. The application should enumerate the storages again." Could it be that something similar is happening inside calibre and that you need to renumerate? I think this is as far as I can get without actually debugging calibre itself, or at least the driver. Which I'm willing to do if somebody tells me how to set it up. Of course I'm available to help in any other way you can suggest.
| Kovid Goyal (kovid) wrote : | #28 |
| Rodrigo Pantoja (rpantojam) wrote : | #29 |
Done, changed wtp.pyd in <calibre_
C:\Program Files\Calibre2>
MTP: Loading filesystem metadata...
MTP: Filesystem metadata loaded in 0.0384645 seconds (0 objects)
+ Internal shared storage [id:s10001 0 children modified=1969/12/31 21:00]
{'device_version': '1.0',
'friendly_name': '',
'has_bulk_
'has_storage': True,
'manufacturer_
'model_name': 'BNRV1300',
'protocol': 'MTP: 1.00',
'serial_number': '5043010011337008',
'storage': [{'capacity': 29152509952,
'id': 's10001',
'rw': True,
'type': 'phone'}
Prefix for main mem: Books
Traceback (most recent call last):
File "C:\calsrc\
File "C:\calsrc\
File "C:\calsrc\
File "C:\calsrc\
FileNotFoundError: Could not find folder named: Books in ('Internal shared storage',)
| Kovid Goyal (kovid) wrote : | #30 |
That's rather odd, just to do a sanity check, here is a version that explicitly prints out the number of children returned by EnumObjects. Can you run with this and see what it prints out. Unfortunately getting calibre to build on windows from source is highly non-trivial. If you have a linux machine you can easily cross compile for windows though. Anyway, this is the patch I applied:
diff --git a/src/calibre/
index db149d4f6c.
--- a/src/calibre/
+++ b/src/calibre/
@@ -569,6 +569,8 @@ get_files_
return true;
}
+ DWORD num; object_
+ fprintf(stderr, "EnumObjects() return %lu children for folder %ls\n", num, parent_id);
if (bulk_properties != NULL) {
if (!bulk_
This patch should confirm if the issue is in EnumObjects or somewhere later.
| Rodrigo Pantoja (rpantojam) wrote : | #31 |
Interesting:
C:\Program Files\Calibre2>
MTP: Loading filesystem metadata...
EnumObjects() return 13 children for folder s10001
MTP: Filesystem metadata loaded in 0.0391161 seconds (0 objects)
+ Internal shared storage [id:s10001 0 children modified=1969/12/31 21:00]
{'device_version': '1.0',
'friendly_name': '',
'has_bulk_
'has_storage': True,
'manufacturer_
'model_name': 'BNRV1300',
'protocol': 'MTP: 1.00',
'serial_number': '5043010011337008',
'storage': [{'capacity': 29152509952,
'id': 's10001',
'rw': True,
'type': 'phone'}
Prefix for main mem: Books
Traceback (most recent call last):
File "C:\calsrc\
File "C:\calsrc\
File "C:\calsrc\
File "C:\calsrc\
FileNotFoundError: Could not find folder named: Books in ('Internal shared storage',)
| Rodrigo Pantoja (rpantojam) wrote : | #32 |
As for the Linux environment, not my cup of tea. Maybe I could try it on a VM. Lets see how much we can accomplish working this way.
| Rodrigo Pantoja (rpantojam) wrote (last edit ): | #33 |
I see that in get_files_
| Rodrigo Pantoja (rpantojam) wrote : | #34 |
Hi, I found the problem. It is quite late I'm tired and want to go to sleep. I'll try to explain it better tomorrow. Summary, the storage has many children that give an error when reading their properties, be it in bulk or normally. The problem is that if you do it in bulk and mix the ones who throw an error with the ones that work correctly, everything fails, even the ones that you would be able to read if you queried them separately.
| Kovid Goyal (kovid) wrote : | #35 |
But that's pretty absurd, if getting properties for enumerable objects
fail how is the application supposed to know which of these to ignore
and which to abort on? Is there some pattern to the ones that fail? I have attached a
version of the driver that does not use bulk operations on this device (as identified by manufacturer and model names) and also that correctly reports failures and aborts in OnEnd on bulk operations. It also retries failed bulk gets with single gets and ignores objects for which the single get fails.
| Kovid Goyal (kovid) wrote : | #36 |
| Rodrigo Pantoja (rpantojam) wrote : | #37 |
Yes, it is absurd. I looks like a lazy/buggy implementation of the protocol and a testament to how robust windows drivers are (and surely Linux ones too). If we hadn't had problems with Calibre we'd never had noticed anything wrong with the device and maybe that is what B&N QA experienced too.
BTW, I did a very thorough testing both on the WPD Info tool and with the WpdApiSample example Visual Studio project. I was quite confident in what I said, but I did test again today just in case I was too tired yesterday and had misinterpreted something.
I can confirm these results:
EnumObjects returns 13 objects from id "s10001", only "o6", "o13" and "o14" work properly on WPD info tool reading their properties, and these three actually are the three folders visible in Windows Explorer: "Android", "NOOK" and ".adobe-
Using WpdApiSample things have become much weirder. Up until yesterday night I was able to replicate what I saw on the WPD info tool. However, I thought the problem might be related to what properties you're trying to read because it seems that wpd info tool tries to read them all. I tested only reading the name (WPD_OBJECT_NAME) and everything worked well, both individually and in bulk with all objects. Cool, it seems to be what I thought. I started adding the other properties one by one WPD_OBJECT_
As for testing with the last wpd.pyd this is what I got:
C:\Program Files\Calibre2>
MTP: Loading filesystem metadata...
Ignoring object with id: o1 because getting its properties failed.
That's all no, more output. When running calibre.exe with this wpd.pyd, it loads and then exits abruptly.
| Kovid Goyal (kovid) wrote : | #38 |
| Kovid Goyal (kovid) wrote : | #39 |
| Rodrigo Pantoja (rpantojam) wrote : | #40 |
| Kovid Goyal (kovid) wrote : | #41 |
So is it working with normal operations in calibre?
| Rodrigo Pantoja (rpantojam) wrote : | #42 |
Sorry, forgot about that. Disregarding all the error popups it works. First it connects to the device. It lists the device content. It allows sending content. The content shows up in the device. The content can be open and read in the device. I was able to delete content. I can open books from the device on the calibre book reader. The book covers carrousel is not updated when listing the device contents, it keeps showing the main library covers. Please let me know if you want me to do any other specific test.
| Kovid Goyal (kovid) wrote : | #43 |
What error popups? I have added a bunch of prints but no new error
popups.
| Rodrigo Pantoja (rpantojam) wrote (last edit ): | #44 |
| Kovid Goyal (kovid) wrote (last edit ): | #45 |
Those are likely coming from create_folder() or put_file() calls can you post the
full traceback.
| Kovid Goyal (kovid) wrote : | #46 |
You get the full traceback by clicking get details.
| Rodrigo Pantoja (rpantojam) wrote : | #47 |
- traceback.txt Edit (1.2 KiB, text/plain)
Attached is the traceback from one of the windows, they're all 10 the same
| Kovid Goyal (kovid) wrote : | #48 |
| Rodrigo Pantoja (rpantojam) wrote : | #49 |
The behavior of Calibre using this version looks normal. I mean no extraneous messages, and Nook works well, as described on note 42.
| Kovid Goyal (kovid) wrote : | #50 |
OK, marking this as fixed then.
| Changed in calibre: | |
| status: | Opinion → Fix Released |
| Rodrigo Pantoja (rpantojam) wrote : | #51 |
Thanks Kovid, pleasure working with you and many many thanks for your great application and the effort maintaining and enhancing Calibre.
| Kovid Goyal (kovid) wrote : | #52 |
You are welcome and thanks for helping with the debugging and testing,
this particular issue really needed someone with the hardware to do the
work of nailing down the root cause.
I really wish B&N would fix their MTP firmware though.
| Embryonic (alphatjh-g) wrote : | #53 |
Thank you Kovid and Rodrigo for working through this, Look forward to the fruits of your labor! You guys rock.
| Rodrigo Pantoja (rpantojam) wrote : | #54 |
Kovid said "I really wish B&N would fix their MTP firmware though." Totally agree, this situation certainly looks a lot more like a bug than a feature.
| Tempest (tempythecleric) wrote : | #55 |
Sorry I haven't been active. Does this mean we have a solution? Will there be an update to Calibre or do we need to do something manually to get it functioning now. Thank you so much for all your work!
| Kovid Goyal (kovid) wrote : | #56 |
Simply wait for the next release or try a preview release:
https:/

calibre works fine with the GL4. I dont have this device to test with
myself but several users have reported it works. From that error message
for some reason the NOOK folder in the internal storage is not being
detected. Try resetting the device, that should fix it.