What do I have to consider with my own implementation for communication with the SIM card to avoid errors?
Please make sure that you open a separate APDU channel to communicate with the applet on the SIM. Communication on the base channel (channel 0) may cause problems, because the modem hardware may already be communicating with the SIM on this channel. To open a separate channel please use the "MANAGE CHANNEL" APDU command and encode the channel assigned by the SIM in all subsequent commands in the CLA byte. (Details can be found in ISO 7816 Part 4 Sections 5.4.1 and 6.16.)
Also remember to close the channel if you no longer use the SIM or want to perform a reset. If you are using an ubirch testkit, opening a channel is automatically done by the micropython library.
Also note that for some hardware, resetting the main microcontroller does not automatically reset the modem hardware. This is because on some boards, the modem and microcontroller are implemented as quasi-separate systems. The reason for this is that such a configuration allows, for example, the modem to wake up a microcontroller that has been switched off to save power, depending on e.g. an SMS. However, this may also mean that your modem may need to perform a separate reset of its own in order to correctly reset it to its basic state before you start communication. Please refer to the documentation of your chosen board/modem to determine if and how you need to perform such a separate modem reset and, depending on the default configuration of your modem, AT status messages such as "+CEREG" may disturb your SIM communication if they occur while you are waiting for an AT+CSIM command response.
1NCE Shop

Buy the 1NCE IoT Lifetime Flat now!

Visit the 1NCE Shop and start connecting your IoT devices easily. Simply order your SIM cards, choose the desired type of SIM card and fill out all required forms. After the payment has been approved you get your cards within two to three business days.