-1

I have a sim800l module connected to the Rpi pico hardware UART

/*
SIM800       RPi Pico
5v           *External 2A 5v supply*
GND          GND
VDD          3v3
TXD          GP1
RXD          GP0
*/

void setup() { Serial.begin(115200);

while (!Serial) ;

Serial1.begin(9600);

Serial.print("Initializing"); delay(1000); Serial.print("."); delay(1000); Serial.print("."); delay(1000); Serial.println(".");

pinMode(LED_BUILTIN, OUTPUT); digitalWrite(LED_BUILTIN, HIGH);

Serial1.println("AT"); //Once the handshake test is successful, it will back to OK updateSerial(); delay(3000);

Serial1.println("ATI"); //Returns the module name and revision. updateSerial(); delay(3000);

Serial1.println("AT+CCID"); //Read SIM information to confirm whether the SIM is plugged updateSerial(); delay(3000);

Serial1.println("AT+COPS?"); //Checks which network you are connected to updateSerial(); delay(3000);

Serial1.println("AT+COPS=?"); //Returns the list of operators present in the network. updateSerial(); delay(3000);

}

void loop() { updateSerial(); }

void updateSerial() { delay(200); while (Serial.available()) { Serial1.write(Serial.read());//Forward what Serial received to Software Serial Port } while (Serial1.available()) { Serial.write(Serial1.read());//Forward what Software Serial received to Serial Port }

}

terminal response

AT
OK
ATI
SIM800 R14.18

OK AT+CCID XXXXXXXXXXXXXXXXXXXX AT+COPS? +COPS: 0,0,"Vodaa TelAT+COPS=? +COPS: (2,"Vodaa Telecom","Ver

From what i know so far the SIM800L always ends its response with an "OK" but there are some commands that are cut short and not end with OK. such as AT+CDID and AT+COPS. I do not know if the problem is with the pico or with sim800l. The sim800l seems to be working fine so i suspect its with the pico but if so, it might be a problem with the internal libraries which is beyond me. To supoort that theory the number of characters that is being cut is about 20 characters, so it might be a setting i have to adjust

DrakeJest
  • 229
  • 3
  • 11

1 Answers1

0

Took me quite a while, but upon reading the pico's documentation

The size of the receive FIFO may also be adjusted from the default 32 bytes by using the setFIFOSize call prior to calling begin()

Serial1.setFIFOSize(128); 
Serial1.begin(baud);

settinng it to a much higher value like 256 solves the problem

DrakeJest
  • 229
  • 3
  • 11