Skip to main content

Retrieve cellular connection state information


Device (from impOS™ 40)


Name Type Description
callback Function A function to be called when the cellular connection data has been gathered




This method requests current connection state information from the cellular modem integrated into imps that feature cellular interfaces. It takes as its argument a function which will be called when this information has been retrieved. Gathering this data can take a significant period of time, so operates asynchronously to prevent your application from being blocked while the information is collated. The information is only available once the imp’s cellular modem is powered on.

The cellular connection information is provided in a string — for example, "4G,6300,20,10,10,FDD,262,02,BF75,0345103,350,90,-94,-7,CONN" — and so the callback function should include a single parameter, cellinfo, which will receive the string. For more information on the data contained in the string, which varies according to the connected network type (2G, 3G, 4G, etc), please see ‘The Cinterion ELS61-E AT Command Set’, section 8.11.2.


In early releases of impOS™ 39, an internal-only version of the OS, the cellular connection information described above was provided by the imp API method via the key cellinfo within the cellular-specific table included in the returned data’s interface array. From impOS 40, will not include cellinfo key nor the other state-specific keys rssi and voltage.

This is a breaking change for application code written for earlier versions of impOS than release 40. Customers making use of to retrieve cellinfo, rssi and/or voltage values should update their application Squirrel accordingly. In release 40, accessing these keys via will cause an exception to be thrown.


// Request cellular connection info {
    // Parse string 'cellinfo' - comma-separated values
    local cellData = split(cellinfo, ",");

    // Log the network type
    local ACT = cellData[0];
    server.log("Connected to a " + ACT + " network");

    if (ACT == "4G") {
        // Log the cell ID
        server.log("Global Cell ID: " + cellData[9]);