SIM800L AT+CSQ return 0,0 when SIM is inserted and 20~40 when I insert the sim
I found the solution, it was from the power it takes.
when the module is trying to connect to a network it consumes a lot of power, so I lower down the resistor.

now it is stable and connect smoothly.

try to check your module datasheet and check the power consumption