LudovicRousseau / pyscard

pyscard smartcard library for python
http://pyscard.sourceforge.net/
GNU Lesser General Public License v2.1
377 stars 108 forks source link

The Smart Card Resource Manager is not running. (0x8010001D) #168

Open syariffortask opened 2 months ago

syariffortask commented 2 months ago

Your system information

Please describe your issue in as much detail as possible:

The Smart Card Resource Manager is not running. (0x8010001D)

Describe what did happen.

I was confused because there was an error: Failed to establish context: The Smart Card Resource Manager is not running. (0x8010001D), but I have run the smartcard service on windows service, can it help me

Steps for reproducing this issue:

and this is my code.

from smartcard.Exceptions import NoCardException
from smartcard.System import readers
from smartcard.util import toHexString

try:
    available_readers = readers()
    if not available_readers:
        print("Tidak ada pembaca kartu pintar yang tersedia.")
    else:
        for reader in available_readers:
            try:
                connection = reader.createConnection()
                connection.connect()

                atr = toHexString(connection.getATR())

                print("Pembaca:", reader)
                print("ATR:", atr)
            except NoCardException:
                print("Pembaca:", reader)
                print("Tidak ada kartu yang dimasukkan.")
except Exception as e:
    print("Terjadi kesalahan:", e)
LudovicRousseau commented 2 months ago

What did you do to get the error? Have you removed the reader?

See also https://github.com/LudovicRousseau/pyscard/issues/136 https://github.com/LudovicRousseau/pyscard/issues/153

syariffortask commented 2 months ago
  1. I use the ACS 120U reader, I want to learn to use the Smartcard Reader in my Python program, but when I run the program to see the available readers I get this error

    1. Yes, I have removed the reader
LudovicRousseau commented 2 months ago

You get the error AFTER you removed the reader?

Please describe exactly what you do and what you get.

syariffortask commented 2 months ago

I have run my code with the smartcard reader plug in my computer's USB port, but when I run my program above there is an error, this is the error "The Smart Card Resource Manager is not running. (0x8010001D)"

LudovicRousseau commented 2 months ago

The error is returned by Windows itself. Maybe you reader driver is not installed or something like that.

syariffortask commented 2 months ago

But i have already install driver for acs reader 120u

LudovicRousseau commented 2 months ago

I can't help on Windows. Maybe ACS can provide some support.

mbokil commented 2 months ago

Windows requires the Smart Card service to be running. Sometimes you have to enable it before you can communicate to a NFC reader. https://answers.microsoft.com/en-us/windows/forum/all/smartcard-resource-manager-is-not-running/b9aefb42-9d43-4356-8d63-341d2b1bba4a

syariffortask commented 2 months ago

I've already runing smart card service

mbokil commented 2 months ago

One other thing with Windows we found is after the user plugs in the NFC reader we always have them restart. We found the device drivers that install via plug and play often times need to be restarted. Then Python will be able to communicate to the device via SWIG.

syariffortask commented 1 month ago

still can't solve this isue, anybody can help please

LudovicRousseau commented 1 month ago

@syariffortask have you asked Microsoft? You've bought a Windows license, so you should receive technical support for Windows-related problems. No ?

syariffortask commented 1 month ago

I have already ask Microsoft but Microsoft still can't reply my message