Toporin / SatochipApplet

The open source hardware wallet smartcard - Satochip.io
https://satochip.io/shop
GNU Affero General Public License v3.0
117 stars 42 forks source link

Unknown error in get_status() (error code 0x6c0c) #8

Open thotheolh opened 2 years ago

thotheolh commented 2 years ago

Electrum Satochip Version: electrum-satochip-v4.1.5 SatopchipApplet Version: SatoChip-0.12-05.cap Card Type: THD-89 (Proprietary JCOS)

Issue: Getting 'Failed to create a client for this device. Make sure it is in the correct state.' error message when trying to create a new hardware wallet with Satochip applet and Electrum client.

Trace Log:

20211204T095959.036948Z |     INFO | plugin.DeviceMgr | Registering <SatochipClient TODO>
20211204T095959.169798Z |     INFO | pysatochip.CardConnector | +Inserted: 3B 1B 96 50 6F 6C 61 72 69 73 20 21 01 11
20211204T100000.446336Z |    DEBUG | pysatochip.CardConnector | In card_select
20211204T100000.446336Z |    DEBUG | pysatochip.CardConnector | In card_transmit
20211204T100000.446336Z |    DEBUG | pysatochip.CardConnector | > 00 A4 04 00 08 53 61 74 6F 43 68 69 70
20211204T100000.460175Z |    DEBUG | pysatochip.CardConnector | < [] 90 00
20211204T100000.460582Z |    DEBUG | pysatochip.CardConnector | Found a Satochip!
20211204T100000.460582Z |    DEBUG | pysatochip.CardConnector | In card_get_status
20211204T100000.460582Z |    DEBUG | pysatochip.CardConnector | In card_transmit
20211204T100000.460582Z |    DEBUG | pysatochip.CardConnector | > B0 3C 00 00
20211204T100000.466263Z |    DEBUG | pysatochip.CardConnector | < [] 6C 0C
20211204T100000.466263Z |  WARNING | pysatochip.CardConnector | Unknown error in get_status() (error code 0x6c0c)
20211204T100000.467263Z |    DEBUG | pysatochip.CardConnector | In card_disconnect()
20211204T100000.467263Z |     INFO | pysatochip.CardConnector | disconnecting from'ExcelSecu Contact_Rd 0'
20211204T100000.510724Z |     INFO | plugins.satochip.satochip | [SatochipClient] client request: update_status
20211204T100000.510724Z |     INFO | plugins.satochip.satochip | [SatochipClient] self.handler is None! 
20211204T100001.944041Z |     INFO | plugins.satochip.satochip | [SatochipPlugin] setup_device()
20211204T100001.944041Z |     INFO | plugin.DeviceMgr | scanning devices...
20211204T100001.959304Z |     INFO | plugins.satochip.satochip | [SatochipPlugin] detect_smartcard_reader
20211204T100012.066339Z |     INFO | plugins.satochip.satochip | has_usable_connection_with_device()
20211204T100012.066339Z |    DEBUG | pysatochip.CardConnector | In card_get_ATR()
20211204T100012.066339Z |    ERROR | plugins.satochip.satochip | Exception in has_usable_connection_with_device: 'NoneType' object has no attribute 'connection'
Traceback (most recent call last):

Comments: It seems that the GET_STATUS instruction is returning SW 0x6C0C. I am wondering if some card types are sensitive to Le being used and the current CardConnector does not issue a Le in the APDU.

A suggestion is to issue Le with 255 for all APDU commands which may help to accommodate more types of cards to run Electrum-Satochip by default.

Here's a GP.EXE execution with APDU with Le enabled:

>java -jar gp-old.jar -a 00A40400085361746F43686970 -a B03C000011 --debug
GlobalPlatformPro v20.01.23-0-g5ad373b
Running on Windows 10 10.0 amd64, Java 16.0.2 by Oracle Corporation
# Detected readers from JNA2PCSC
[*] ExcelSecu Contact_Rd 0
SCardConnect("ExcelSecu Contact_Rd 0", T=*) -> T=0, 3B1B96506F6C6172697320210111
SCardBeginTransaction("ExcelSecu Contact_Rd 0")
A>> T=0 (4+0008) 00A40400 08 5361746F43686970
A<< (0000+2) (15ms) 9000
A>> T=0 (4+0000) B03C0000 11
A<< (0012+2) (16ms) 000C00050000000000000001 9000
A>> T=0 (4+0000) 00A40400 00
A<< (0093+2) (32ms) 6F5B8408A000000003000000A54F734906072A864886FC6B01600B06092A864886FC6B020202630906072A864886FC6B03640B06092A864886FC6B040255650B06092A864886FC6B020101660C060A2B060104012A026E01029F6501FF 9000
[TRACE] GPSession -  [6F]
[TRACE] GPSession -      [84] A000000003000000
[TRACE] GPSession -      [A5]
[TRACE] GPSession -          [73]
[TRACE] GPSession -              [06] 2A864886FC6B01
[TRACE] GPSession -              [60]
[TRACE] GPSession -                  [06] 2A864886FC6B020202
[TRACE] GPSession -              [63]
[TRACE] GPSession -                  [06] 2A864886FC6B03
[TRACE] GPSession -              [64]
[TRACE] GPSession -                  [06] 2A864886FC6B040255
[TRACE] GPSession -              [65]
[TRACE] GPSession -                  [06] 2A864886FC6B020101
[TRACE] GPSession -              [66]
[TRACE] GPSession -                  [06] 2B060104012A026E0102
[TRACE] GPSession -          [9F65] FF
[DEBUG] GPSession - Auto-detected ISD: A000000003000000
SCardEndTransaction("ExcelSecu Contact_Rd 0")
SCardDisconnect("ExcelSecu Contact_Rd 0", true) tx:23/rx:111

Here's a GP.EXE execution with APDU with Le not enabled:

java -jar gp-old.jar -a 00A40400085361746F43686970 -a B03C0000 --debug
GlobalPlatformPro v20.01.23-0-g5ad373b
Running on Windows 10 10.0 amd64, Java 16.0.2 by Oracle Corporation
# Detected readers from JNA2PCSC
[*] ExcelSecu Contact_Rd 0
SCardConnect("ExcelSecu Contact_Rd 0", T=*) -> T=0, 3B1B96506F6C6172697320210111
SCardBeginTransaction("ExcelSecu Contact_Rd 0")
A>> T=0 (4+0008) 00A40400 08 5361746F43686970
A<< (0000+2) (15ms) 9000
A>> T=0 (4+0000) B03C0000
A<< (0000+2) (16ms) 9C11
A>> T=0 (4+0000) 00A40400 00
A<< (0093+2) (31ms) 6F5B8408A000000003000000A54F734906072A864886FC6B01600B06092A864886FC6B020202630906072A864886FC6B03640B06092A864886FC6B040255650B06092A864886FC6B020101660C060A2B060104012A026E01029F6501FF 9000
[TRACE] GPSession -  [6F]
[TRACE] GPSession -      [84] A000000003000000
[TRACE] GPSession -      [A5]
[TRACE] GPSession -          [73]
[TRACE] GPSession -              [06] 2A864886FC6B01
[TRACE] GPSession -              [60]
[TRACE] GPSession -                  [06] 2A864886FC6B020202
[TRACE] GPSession -              [63]
[TRACE] GPSession -                  [06] 2A864886FC6B03
[TRACE] GPSession -              [64]
[TRACE] GPSession -                  [06] 2A864886FC6B040255
[TRACE] GPSession -              [65]
[TRACE] GPSession -                  [06] 2A864886FC6B020101
[TRACE] GPSession -              [66]
[TRACE] GPSession -                  [06] 2B060104012A026E0102
[TRACE] GPSession -          [9F65] FF
[DEBUG] GPSession - Auto-detected ISD: A000000003000000
SCardEndTransaction("ExcelSecu Contact_Rd 0")
SCardDisconnect("ExcelSecu Contact_Rd 0", true) tx:22/rx:99

It seems the pysatochip.CardConnector getting SW 0x6C0C is abit odd since without Le, GP.EXE returns SW 0x9C11 and pysatochip.CardConnector on the other hand returns 0x6C0C.

There seems to be some differences in how GP.EXE and pysatochip.CardConnector calls the smartcards ?

thotheolh commented 2 years ago

Card Type: THD-89 (Proprietary JCOS)

I noticed that Satochip v0.9 applet (SatoChip-3.0.4.cap) seems to be working properly.

Here's the Trace Log:

20211204T114454.743715Z |     INFO | simple_config.SimpleConfig | electrum directory C:\Users\***\AppData\Roaming\Electrum
20211204T114454.743715Z |     INFO | logging | Electrum version: 4.1.5 - https://electrum.org - https://github.com/spesmilo/electrum
20211204T114454.743715Z |     INFO | logging | Python version: 3.8.8 (tags/v3.8.8:024d805, Feb 19 2021, 13:08:11) [MSC v.1928 32 bit (Intel)]. On platform: Windows-10-10.0.19041-SP0
20211204T114454.743715Z |     INFO | logging | Logging to file: C:\Users\***\AppData\Roaming\Electrum\logs\electrum_log_20211204T114454Z_3548.log
20211204T114454.743715Z |     INFO | logging | Log filters: verbosity '', verbosity_shortcuts ''
20211204T114454.743715Z |     INFO | plugin.Plugins | registering hardware bitbox02: ('hardware', 'bitbox02', 'BitBox02')
20211204T114454.743715Z |     INFO | plugin.Plugins | registering hardware coldcard: ('hardware', 'coldcard', 'Coldcard Wallet')
20211204T114454.743715Z |     INFO | plugin.Plugins | registering hardware digitalbitbox: ('hardware', 'digitalbitbox', 'Digital Bitbox wallet')
20211204T114454.743715Z |     INFO | plugin.Plugins | registering hardware keepkey: ('hardware', 'keepkey', 'KeepKey wallet')
20211204T114454.743715Z |     INFO | plugin.Plugins | registering hardware ledger: ('hardware', 'ledger', 'Ledger wallet')
20211204T114454.743715Z |     INFO | plugin.Plugins | registering hardware safe_t: ('hardware', 'safe_t', 'Safe-T mini wallet')
20211204T114454.743715Z |     INFO | plugin.Plugins | registering hardware satochip: ('hardware', 'satochip', 'Satochip wallet')
20211204T114454.743715Z |     INFO | plugin.Plugins | registering hardware trezor: ('hardware', 'trezor', 'Trezor wallet')
20211204T114454.743715Z |     INFO | plugin.Plugins | registering wallet type ('2fa', 'trustedcoin')
20211204T114454.743715Z |    DEBUG | util.profiler | Plugins.__init__ 0.0000
20211204T114454.759342Z |     INFO | network | blockchains [0]
20211204T114454.759342Z |     INFO | exchange_rate.FxThread | using exchange CoinGecko
20211204T114454.759342Z |    DEBUG | util.profiler | Daemon.__init__ 0.0156
20211204T114454.759342Z |     INFO | daemon.Daemon | launching GUI: qt
20211204T114454.759342Z |     INFO | network | starting network
20211204T114454.759342Z |     INFO | network | setting proxy None
20211204T114454.759342Z |     INFO | daemon.Daemon | starting taskgroup.
20211204T114454.759342Z |     INFO | network | connecting to electrumx.ddns.net:50002:s as new interface
20211204T114454.759342Z |     INFO | network | starting taskgroup.
20211204T114454.821823Z |     INFO | interface.[electrumx.ddns.net:50002] | disconnecting due to: ErrorGettingSSLCertFromServer(ConnectError(OSError(22, 'The format of the specified network name is invalid', None, 1214, None)))
20211204T114454.821823Z |     INFO | network | couldn't launch iface electrumx.ddns.net:50002:s -- CancelledError()
20211204T114454.931172Z |     INFO | gui.qt.history_list | could not import electrum.plot. This feature needs matplotlib to be installed.
20211204T114454.931172Z |     INFO | gui.qt.ElectrumGui | Qt GUI starting up... Qt=5.15.2, PyQt=5.15.4
20211204T114455.118600Z |    DEBUG | util.profiler | ElectrumGui.__init__ 0.1874
20211204T114455.118600Z |     INFO | storage.WalletStorage | wallet path c:\users\***\appdata\roaming\electrum\wallets\wallet_1
20211204T114455.477891Z |     INFO | storage.WalletStorage | wallet path c:\users\***\appdata\roaming\electrum\wallets\wallet_1
20211204T114455.539554Z |     INFO | interface.[bitcoin.corgi.party:50002] | disconnecting due to: ErrorGettingSSLCertFromServer(ConnectError(gaierror(11001, 'getaddrinfo failed')))
20211204T114455.540581Z |     INFO | network | couldn't launch iface bitcoin.corgi.party:50002:s -- CancelledError()
20211204T114455.565484Z |     INFO | interface.[electrum.villocq.com:50002] | disconnecting due to: ErrorGettingSSLCertFromServer(ConnectError(gaierror(11001, 'getaddrinfo failed')))
20211204T114455.566482Z |     INFO | network | couldn't launch iface electrum.villocq.com:50002:s -- CancelledError()
20211204T114455.848532Z |     INFO | interface.[electrum.emzy.de:50002] | connection established. version: ['ElectrumX 1.16.0', '1.4']
20211204T114456.044277Z |     INFO | interface.[electrum.emzy.de:50002] | set blockchain with height 712557
20211204T114456.045308Z |     INFO | interface.[electrum.emzy.de:50002] | skipping header 712557
20211204T114456.045308Z |     INFO | network | no height for main interface
20211204T114456.127624Z |     INFO | network | switching to electrum.emzy.de:50002:s
20211204T114456.128663Z |     INFO | interface.[128.0.190.26:50002] | connection established. version: ['ElectrumX 1.16.0', '1.4']
20211204T114456.233873Z |     INFO | network | fee_estimates {25: 1016, 10: 2012, 5: 8864, 2: 9180}
20211204T114456.258786Z |     INFO | interface.[xtrum.com:50002] | connection established. version: ['ElectrumX 1.15.0', '1.4']
20211204T114456.268782Z |     INFO | interface.[electrumx.electricnewyear.net:50002] | connection established. version: ['ElectrumX 1.15.0', '1.4']
20211204T114456.330565Z |     INFO | interface.[128.0.190.26:50002] | set blockchain with height 712557
20211204T114456.331596Z |     INFO | interface.[128.0.190.26:50002] | skipping header 712557
20211204T114456.332562Z |     INFO | network | fee_estimates {25: 1017, 10: 2012, 5: 8864, 2: 9180}
20211204T114456.433361Z |     INFO | network | fee_histogram []
20211204T114456.436384Z |     INFO | network | fee_histogram []
20211204T114456.453560Z |     INFO | interface.[xtrum.com:50002] | set blockchain with height 712557
20211204T114456.454595Z |     INFO | interface.[xtrum.com:50002] | skipping header 712557
20211204T114456.524314Z |     INFO | interface.[electrumx.electricnewyear.net:50002] | set blockchain with height 712557
20211204T114456.525348Z |     INFO | interface.[electrumx.electricnewyear.net:50002] | skipping header 712557
20211204T114456.529305Z |     INFO | interface.[electrum.blockstream.info:50002] | connection established. version: ['electrs-esplora 0.4.1', '1.4']
20211204T114456.657072Z |     INFO | network | fee_estimates {25: 1018, 10: 2012, 5: 8864, 2: 9180}
20211204T114456.740426Z |     INFO | interface.[electrum.blockstream.info:50002] | set blockchain with height 712557
20211204T114456.740426Z |     INFO | interface.[electrum.blockstream.info:50002] | skipping header 712557
20211204T114456.977628Z |     INFO | interface.[E-X.not.fyi:50002] | connection established. version: ['ElectrumX 1.10.0', '1.4']
20211204T114457.208192Z |     INFO | interface.[E-X.not.fyi:50002] | set blockchain with height 712557
20211204T114457.209223Z |     INFO | interface.[E-X.not.fyi:50002] | skipping header 712557
20211204T114457.323758Z |     INFO | interface.[electrumx.bot.nu:50002] | disconnecting due to: ErrorGettingSSLCertFromServer(ConnectError(gaierror(11001, 'getaddrinfo failed')))
20211204T114457.324754Z |     INFO | network | couldn't launch iface electrumx.bot.nu:50002:s -- CancelledError()
20211204T114458.479820Z |     INFO | interface.[node.degga.net:50002] | connection established. version: ['ElectrumX 1.16.0', '1.4']
20211204T114458.745384Z |     INFO | interface.[node.degga.net:50002] | set blockchain with height 712557
20211204T114458.745384Z |     INFO | interface.[node.degga.net:50002] | skipping header 712557
20211204T114459.245255Z |     INFO | interface.[51.38.56.35:50002] | connection established. version: ['ElectrumX 1.16.0', '1.4']
20211204T114500.479339Z |     INFO | interface.[51.38.56.35:50002] | set blockchain with height 712557
20211204T114500.479339Z |     INFO | interface.[51.38.56.35:50002] | skipping header 712557
20211204T114502.719407Z |     INFO | storage.WalletStorage | wallet path c:\users\***\appdata\roaming\electrum\wallets\wallet_2
20211204T114507.959676Z |     INFO | plugin.Plugins | loaded bitbox02
20211204T114507.965660Z |     INFO | plugin.Plugins | loaded coldcard
20211204T114507.970647Z |     INFO | plugin.Plugins | loaded digitalbitbox
20211204T114508.020513Z |     INFO | plugin.Plugins | loaded keepkey
20211204T114508.046445Z |     INFO | plugin.Plugins | loaded ledger
20211204T114508.076364Z |     INFO | plugin.Plugins | loaded safe_t
20211204T114508.099305Z |     INFO | plugins.satochip.satochip | [SatochipPlugin] init()
20211204T114508.099305Z |     INFO | plugin.Plugins | loaded satochip
20211204T114508.162135Z |     INFO | plugin.Plugins | loaded trezor
20211204T114508.164114Z |     INFO | plugin.DeviceMgr | scanning devices...
20211204T114511.346113Z |     INFO | interface.[electrum.qtornado.com:50002] | disconnecting due to: ConnectError(ConnectionResetError(22, 'The specified network name is no longer available', None, 64, None))
20211204T114511.346113Z |     INFO | network | couldn't launch iface electrum.qtornado.com:50002:s -- CancelledError()
20211204T114512.564216Z |     INFO | interface.[guichet.centure.cc:50002] | connection established. version: ['ElectrumX 1.16.0', '1.4']
20211204T114512.829779Z |     INFO | interface.[guichet.centure.cc:50002] | set blockchain with height 712557
20211204T114512.829779Z |     INFO | interface.[guichet.centure.cc:50002] | skipping header 712557
20211204T114516.938567Z |     INFO | interface.[ndnd.selfhost.eu:50002] | disconnecting due to: ErrorGettingSSLCertFromServer(ConnectError(OSError(22, 'The semaphore timeout period has expired', None, 121, None)))
20211204T114516.938567Z |     INFO | network | couldn't launch iface ndnd.selfhost.eu:50002:s -- CancelledError()
20211204T114517.063451Z |     INFO | interface.[hsmiths4fyqlw5xw.onion:50002] | disconnecting due to: ErrorGettingSSLCertFromServer(ConnectError(gaierror(11001, 'getaddrinfo failed')))
20211204T114517.063451Z |     INFO | network | couldn't launch iface hsmiths4fyqlw5xw.onion:50002:s -- CancelledError()
20211204T114518.016427Z |     INFO | interface.[electrum.bitaroo.net:50002] | connection established. version: ['ElectrumX 1.16.0', '1.4']
20211204T114518.188256Z |     INFO | interface.[electrum.bitaroo.net:50002] | set blockchain with height 712557
20211204T114518.188256Z |     INFO | interface.[electrum.bitaroo.net:50002] | skipping header 712557
20211204T114520.296840Z |     INFO | plugins.satochip.satochip | [SatochipPlugin] detect_smartcard_reader
20211204T114520.343640Z |    DEBUG | util.profiler | DeviceMgr.scan_devices 12.1795
20211204T114520.343640Z |     INFO | plugins.satochip.satochip | [SatochipPlugin] create_client()
20211204T114520.343640Z |     INFO | plugins.satochip.satochip | [SatochipClient] __init__()
20211204T114520.343640Z |     INFO | pysatochip.CardConnector | Logging set to level: 10
20211204T114520.343640Z |    DEBUG | pysatochip.CardConnector | In __init__
20211204T114520.343640Z |    DEBUG | pysatochip.CardDataParser | In __init__
20211204T114520.343640Z |     INFO | plugin.DeviceMgr | Registering <SatochipClient TODO>
20211204T114520.477247Z |     INFO | pysatochip.CardConnector | +Inserted: 3B 1B 96 50 6F 6C 61 72 69 73 20 21 01 11
20211204T114521.759698Z |    DEBUG | pysatochip.CardConnector | In card_select
20211204T114521.759698Z |    DEBUG | pysatochip.CardConnector | In card_transmit
20211204T114521.759698Z |    DEBUG | pysatochip.CardConnector | > 00 A4 04 00 08 53 61 74 6F 43 68 69 70
20211204T114521.775314Z |    DEBUG | pysatochip.CardConnector | < [] 90 00
20211204T114521.775314Z |    DEBUG | pysatochip.CardConnector | Found a Satochip!
20211204T114521.775314Z |    DEBUG | pysatochip.CardConnector | In card_get_status
20211204T114521.775314Z |    DEBUG | pysatochip.CardConnector | In card_transmit
20211204T114521.775314Z |    DEBUG | pysatochip.CardConnector | > B0 3C 00 00
20211204T114521.775314Z |    DEBUG | pysatochip.CardConnector | < [] 9C 04
20211204T114521.775314Z |     INFO | plugins.satochip.satochip | [SatochipClient] client request: update_status
20211204T114521.775314Z |     INFO | plugins.satochip.satochip | [SatochipClient] self.handler is None! 
20211204T114525.620485Z |     INFO | plugins.satochip.satochip | [SatochipPlugin] setup_device()
20211204T114525.620485Z |     INFO | plugin.DeviceMgr | scanning devices...
20211204T114535.682284Z |     INFO | plugins.satochip.satochip | [SatochipPlugin] detect_smartcard_reader
20211204T114535.723233Z |     INFO | plugins.satochip.satochip | has_usable_connection_with_device()
20211204T114535.723233Z |    DEBUG | pysatochip.CardConnector | In card_get_ATR()
20211204T114535.725127Z |     INFO | plugins.satochip.satochip | Card ATR: 3b1b96506f6c6172697320210111
20211204T114535.725127Z |    DEBUG | util.profiler | DeviceMgr.scan_devices 10.1046
20211204T114535.726091Z |    DEBUG | pysatochip.CardConnector | In card_get_status
20211204T114535.726091Z |    DEBUG | pysatochip.CardConnector | In card_transmit
20211204T114535.726091Z |    DEBUG | pysatochip.CardConnector | > B0 3C 00 00
20211204T114535.732102Z |    DEBUG | pysatochip.CardConnector | < [] 9C 04
20211204T114556.396823Z |     INFO | network | fee_histogram [[7.8, 100228], [1.0, 118820]]
20211204T114557.912096Z |     INFO | interface.[electrum.blockstream.info:50002] | disconnecting due to GracefulDisconnect('session was closed')
20211204T114559.068049Z |     INFO | interface.[188.230.155.0:50002] | succeeded in getting cert
20211204T114559.895994Z |     INFO | interface.[188.230.155.0:50002] | connection established. version: ['ElectrumX 1.16.0', '1.4']
20211204T114600.099036Z |     INFO | interface.[188.230.155.0:50002] | set blockchain with height 712557
20211204T114600.099036Z |     INFO | interface.[188.230.155.0:50002] | skipping header 712557
20211204T114618.967795Z |    ERROR | gui.qt.installwizard.InstallWizard | 
Traceback (most recent call last):
  File "electrum\base_wizard.py", line 366, in on_device
  File "C:\Users\***\AppData\Local\Temp\_MEI135562\electrum\plugins\satochip\satochip.py", line 551, in setup_device
    (is_PIN, pin_0)= client.PIN_setup_dialog(msg, msg_confirm, msg_error)
  File "C:\Users\***\AppData\Local\Temp\_MEI135562\electrum\plugins\satochip\satochip.py", line 203, in PIN_setup_dialog
    raise RuntimeError(('A PIN code is required to initialize the Satochip!'))
RuntimeError: A PIN code is required to initialize the Satochip!
20211204T114619.996234Z |     INFO | plugin.DeviceMgr | scanning devices...
20211204T114630.062092Z |     INFO | plugins.satochip.satochip | [SatochipPlugin] detect_smartcard_reader
20211204T114630.108644Z |     INFO | plugins.satochip.satochip | has_usable_connection_with_device()
20211204T114630.108644Z |    DEBUG | pysatochip.CardConnector | In card_get_ATR()
20211204T114630.108644Z |     INFO | plugins.satochip.satochip | Card ATR: 3b1b96506f6c6172697320210111
20211204T114630.108644Z |    DEBUG | util.profiler | DeviceMgr.scan_devices 10.1124
20211204T114634.812437Z |     INFO | plugins.satochip.satochip | [SatochipPlugin] setup_device()
20211204T114634.812437Z |     INFO | plugin.DeviceMgr | scanning devices...
20211204T114644.881114Z |     INFO | plugins.satochip.satochip | [SatochipPlugin] detect_smartcard_reader
20211204T114644.922097Z |     INFO | plugins.satochip.satochip | has_usable_connection_with_device()
20211204T114644.922097Z |    DEBUG | pysatochip.CardConnector | In card_get_ATR()
20211204T114644.924091Z |     INFO | plugins.satochip.satochip | Card ATR: 3b1b96506f6c6172697320210111
20211204T114644.924091Z |    DEBUG | util.profiler | DeviceMgr.scan_devices 10.1117
20211204T114644.924091Z |    DEBUG | pysatochip.CardConnector | In card_get_status
20211204T114644.924091Z |    DEBUG | pysatochip.CardConnector | In card_transmit
20211204T114644.924091Z |    DEBUG | pysatochip.CardConnector | > B0 3C 00 00
20211204T114644.931101Z |    DEBUG | pysatochip.CardConnector | < [] 9C 04
20211204T114646.747570Z |    ERROR | gui.qt.installwizard.InstallWizard | 
Traceback (most recent call last):
  File "electrum\base_wizard.py", line 366, in on_device
  File "C:\Users\***\AppData\Local\Temp\_MEI135562\electrum\plugins\satochip\satochip.py", line 551, in setup_device
    (is_PIN, pin_0)= client.PIN_setup_dialog(msg, msg_confirm, msg_error)
  File "C:\Users\***\AppData\Local\Temp\_MEI135562\electrum\plugins\satochip\satochip.py", line 203, in PIN_setup_dialog
    raise RuntimeError(('A PIN code is required to initialize the Satochip!'))
RuntimeError: A PIN code is required to initialize the Satochip!
20211204T114647.629580Z |     INFO | plugin.DeviceMgr | scanning devices...
20211204T114656.533396Z |     INFO | network | fee_histogram [[7.8, 100228], [1.0, 118820]]
20211204T114657.700407Z |     INFO | plugins.satochip.satochip | [SatochipPlugin] detect_smartcard_reader
20211204T114657.731569Z |     INFO | plugins.satochip.satochip | has_usable_connection_with_device()
20211204T114657.731569Z |    DEBUG | pysatochip.CardConnector | In card_get_ATR()
20211204T114657.747203Z |     INFO | plugins.satochip.satochip | Card ATR: 3b1b96506f6c6172697320210111
20211204T114657.747203Z |    DEBUG | util.profiler | DeviceMgr.scan_devices 10.1176
20211204T114756.557160Z |     INFO | network | fee_histogram [[10.1, 101022], [3.0, 111524], [1.0, 125021]]
20211204T114856.625981Z |     INFO | network | fee_histogram [[10.1, 101022], [3.0, 111524], [1.0, 125021]]
20211204T114956.641589Z |     INFO | network | fee_histogram [[20.0, 106075], [9.7, 111969], [4.0, 122497], [1.0, 177552]]
20211204T115056.705064Z |     INFO | network | fee_histogram [[20.0, 106075], [9.7, 111969], [4.0, 122497], [1.0, 177552]]
20211204T115156.750898Z |     INFO | network | fee_histogram [[20.0, 112485], [10.3, 114422], [6.1, 126785], [2.1, 137428]]
20211204T115248.274704Z |     INFO | daemon.Daemon | on_stop() entered. initiating shutdown
20211204T115248.274704Z |     INFO | gui.qt.ElectrumGui | closing GUI
20211204T115248.274704Z |     INFO | daemon.Daemon | stopping all wallets
20211204T115248.274704Z |     INFO | daemon.Daemon | stopping network and taskgroup
20211204T115248.274704Z |     INFO | network | stopping network
20211204T115248.274704Z |     INFO | daemon.Daemon | taskgroup stopped.
20211204T115248.446538Z |     INFO | interface.[51.38.56.35:50002] | disconnecting due to: CancelledError()
20211204T115248.446538Z |     INFO | interface.[electrum.bitaroo.net:50002] | disconnecting due to: CancelledError()
20211204T115248.462159Z |     INFO | interface.[electrum.emzy.de:50002] | disconnecting due to: CancelledError()
20211204T115248.477781Z |     INFO | interface.[xtrum.com:50002] | disconnecting due to: CancelledError()
20211204T115248.477781Z |     INFO | interface.[128.0.190.26:50002] | disconnecting due to: CancelledError()
20211204T115248.477781Z |     INFO | interface.[188.230.155.0:50002] | disconnecting due to: CancelledError()
20211204T115248.509025Z |     INFO | interface.[E-X.not.fyi:50002] | disconnecting due to: CancelledError()
20211204T115248.540266Z |     INFO | interface.[guichet.centure.cc:50002] | disconnecting due to: CancelledError()
20211204T115248.540266Z |     INFO | interface.[node.degga.net:50002] | disconnecting due to: CancelledError()
20211204T115248.571509Z |     INFO | interface.[electrumx.electricnewyear.net:50002] | disconnecting due to: CancelledError()
20211204T115248.571509Z |     INFO | network | taskgroup stopped.
20211204T115248.571509Z |     INFO | daemon.Daemon | removing lockfile
20211204T115248.571509Z |     INFO | daemon.Daemon | stopped
20211204T115248.587130Z |     INFO | plugin.Plugins | stopped

The commonality in the working applet is that it returns SW 0x9C04 when INS_GET_STATUS is enquired on a blank card.