Giter Site home page Giter Site logo

Comments (2)

nishantpardamwar avatar nishantpardamwar commented on August 23, 2024 2

above fix didn't work for me, so i wrote my own funtion.

replace these two function in SIM900.cpp

int SIMCOM900::getIMEI(char *imei)
int SIMCOM900::SimpleRead()

with

int SIMCOM900::getIMEI(char *imei){
  //AT command to get IMEI.
  int i =0,a;
  unsigned long startTime = millis();
  char c;
  SimpleWriteln(F("AT+GSN"));
  while(true){
    a = SimpleRead();
    c = a;
    if(a!=-1){
      if(a == 13 && i==15){
        imei[15] = '\0';
        return 1;
      }
      if(a != 13 && a!= 10 && c!= 'O' && c!= 'K'){
        startTime = millis();
        imei[i] = c;
        i++;
      }
    }else if((millis() - startTime)>5000){
      return 0;
    }
  }
  return 0;
}   

int SIMCOM900::SimpleRead(){
  char datain;
  if(_cell.available()>0){
    datain=_cell.read();
    if(datain>0){
      return datain;
    }else
      return -1;
  }else
    return -1;
}

from gsm-gprs-gps-shield.

michaelproino avatar michaelproino commented on August 23, 2024

Hi,
Although I have faced with the same problem, I can not solve with this solution,
Can you help me please realted with getting IMEI with using Marco's library?

from gsm-gprs-gps-shield.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.