Skip to content

Dfrobot Sim808 join network error with Telenor Denmark #25

@danielkp1234

Description

@danielkp1234

So I trying to get it to join my sim provider network and send TCP request. My Operator is Telenor Danmark
here is the Serial Output
18:09:07.450 -> AT+CFUN=1
18:09:07.484 -> AT+CPIN?
18:09:12.023 -> Init Success, please call or send SMS message to me!
18:09:12.092 -> AT+CSTT="internet","",""
18:09:17.046 -> AT+CIICR
18:09:22.056 -> AT+CIFSR
18:09:27.043 -> Sim808 join network error
18:09:29.062 -> AT+CSTT="internet","",""
18:09:34.077 -> AT+CIICR
18:09:39.068 -> AT+CIFSR
18:09:44.084 -> Sim808 join network error

here is my code
`#include <DFRobot_sim808.h>
#include <SoftwareSerial.h>

//#define PIN_TX 10
//#define PIN_RX 11
//SoftwareSerial mySerial(PIN_TX,PIN_RX);
//DFRobot_SIM808 sim808(&mySerial);//Connect RX,TX,PWR,

//make sure that the baud rate of SIM900 is 9600!
//you can use the AT Command(AT+IPR=9600) to set it through SerialDebug

DFRobot_SIM808 sim808(&Serial);

char http_cmd[] = "GET /admin/Scripts/submit?x=8.869531&y=56.414029 HTTP/1.0\r\n\r\n";
char buffer[512];

void setup(){
//mySerial.begin(9600);
Serial.begin(9600);

//******** Initialize sim808 module *************
while(!sim808.init()) {
delay(1000);
Serial.print("Sim808 init error\r\n");
}
delay(3000);
Serial.println("Init Success, please call or send SMS message to me!");

//*********** Attempt DHCP *******************
while(!sim808.join(F("internet"),F(""),F(""))) {
Serial.println("Sim808 join network error");
delay(2000);
}

//************ Successful DHCP ****************
Serial.print("IP Address is ");
Serial.println(sim808.getIPAddress());

//*********** Establish a TCP connection ************
if(!sim808.connect(TCP,"My.website", 80)) {
Serial.println("Connect error");
}else{
Serial.println("Connect success");
}

//*********** Send a GET request *****************
Serial.println("waiting to fetch...");
sim808.send(http_cmd, sizeof(http_cmd)-1);
while (true) {
int ret = sim808.recv(buffer, sizeof(buffer)-1);
if (ret <= 0){
Serial.println("fetch over...");
break;
}
buffer[ret] = '\0';
Serial.print("Recv: ");
Serial.print(ret);
Serial.print(" bytes: ");
Serial.println(buffer);
break;
}

//************* Close TCP or UDP connections **********
sim808.close();

//*** Disconnect wireless connection, Close Moving Scene *******
sim808.disconnect();
}

void loop(){

}`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions