Getting cellular information from modem example code

Here’s some sample code you can use to get information about your cellular connection. It can retrieve:

  • Model information
  • ICCID, IMEI, IMSI numbers
  • Cellular operator (“AT&T” for example)
  • Signal strength (RSSI) and quality
  • Cellular band (“UMTS 850” for example)

It also can test ping and DNS using the functions in the cellular modem. And it can test connecting to the Particle cloud.

It can sometimes also get information about neighboring cell sites. That works for me on 2G (G350) but not 3G (U260) but I’m not sure why. You might see something like this:

rssi=15, qual=99
service rat=GSM mcc=310, mnc=11094, lac=2 ci=a782 band=GSM 900 bsic=3b arfcn=237 rxlev=39
neighbor 0 rat=GSM mcc=310, mnc=11094, lac=8057b0f ci=a56f band=GSM 900 bsic=18 arfcn=235 rxlev=37
neighbor 1 rat=GSM mcc=310, mnc=11094, lac=100 ci=a5f2 band=GSM 900 bsic=25 arfcn=180 rxlev=21

You will likely need to official manual in order to make sense of these parameters, and even then it may not help!

[] (

The code is here:

[] (