LTE CAT M1 in Germany, Gpy

Got my card and trying to get it to run in Pycoms GPy MCU.

Problem is that attaching to the networks fails. I found some code that seems to have worked for US customers but unfortunately not for me.

What settings do I need?

Thanks

Heres the Micropython code:

Code

import time
from machine import RTC
from network import LTE

NTP_SERVER = “de.pool.ntp.org

Need to use global variables.

If in each function you delare a new reference, functionality is broken

#lte = LTE(carrier=“vodafone”)
lte = LTE()
rtc = RTC()

Returns a network.LTE object with an active Internet connection.

def getLTE():

# If already used, the lte device will have an active connection.
# If not, need to set up a new connection.
if lte.isconnected():
    return lte

# Modem does not connect successfully without first being reset.
print("Resetting LTE modem ... ", end="")
lte.send_at_cmd('AT^RESET')
print("OK")
time.sleep(1)
#print(".\n")
# While the configuration of the CGDCONT register survives resets,
# the other configurations don't. So just set them all up every time.
print("Configuring LTE ", end='')
lte.send_at_cmd('AT+CGDCONT=1,"IP","hologram"')  # Changed this from origninal
print(".", end='')
lte.send_at_cmd('AT!="RRC::addscanfreq"') #
print(".", end='')
lte.send_at_cmd('AT+CFUN=1')
print(" OK")

# If correctly configured for carrier network, attach() should succeed.
if not lte.isattached():
    print("Attaching to LTE network ", end='')
    lte.attach(apn='hologram')
    while(True):
        if lte.isattached():
            print(" OK")
            break
        print('.', end='')
        time.sleep(1)

# Once attached, connect() should succeed.
if not lte.isconnected():
    print("Connecting on LTE network ", end='')
    lte.connect()
    while(True):
        if lte.isconnected():
            print(" OK")
            break
        print('.', end='')
        time.sleep(1)

# Once connect() succeeds, any call requiring Internet access will
# use the active LTE connection.
return lte

Clean disconnection of the LTE network is required for future

successful connections without a complete power cycle between.

def endLTE():

print("Disonnecting LTE ... ", end='')
lte.disconnect()
print("OK")
time.sleep(1)
print("Detaching LTE ... ", end='')
lte.dettach()
print("OK")

Sets the internal real-time clock.

Needs LTE for Internet access.

def setRTC():

# Ensures LTE session is connected before attempting NTP sync.
lte = getLTE()

print("Updating RTC from {} ".format(NTP_SERVER), end='')
rtc.ntp_sync(NTP_SERVER)
while not rtc.synced():
    print('.', end='')
    time.sleep(1)
print(' OK')

Only returns an RTC object that has already been synchronised with an NTP server.

def getRTC():

if not rtc.synced():
    setRTC()

return rtc

Program starts here.

try:
print(“Initially, the RTC is {}”.format(“set” if rtc.synced() else “unset”))
rtc = getRTC()
while(True):
print(“RTC is {}”.format(rtc.now() if rtc.synced() else “unset”))
time.sleep(5)
except Exception:
pass # do nothing on error

finally:
endLTE()

It looks like Telefonia may support Cat-M1 in Germany, see: GSMA | Mobile IoT Deployment Map | Internet of Things

Hologram does have a contract with Telefonia in Germany, see: Global IoT Coverage | Hologram (click or type “Germany”) although they do not list Cat-M1 as being supported so it may or may not work. That would be the only carrier that supports Cat-M1 at this time. Note hologram does not support NB-IOT yet.

Your best bet is to find software / firmware that allows you to run AT commands manually and step through: https://help.hologram.io/en/articles/1944384-modem-sim-annotated-diagnostic-test and post the results here. The important one is the result of AT+CPIN? and AT+COPS=? although they all may help with diagnosis.

Thanks, I tried but I guess it simply doesn’t work here. A bit of a disappointment. Why sell it here if you can’t use it?

at(‘AT’)
modem command: AT
response=[‘OK’]
[‘OK’]
at(‘ATI’)
modem command: ATI
response=[‘PYCOM’, ‘FiPy’, ‘UE5.0.0.0d’, ‘OK’]
[‘PYCOM’, ‘FiPy’, ‘UE5.0.0.0d’, ‘OK’]
at(‘AT+CGMI’)
modem command: AT+CGMI
response=[‘PYCOM’, ‘OK’]
[‘PYCOM’, ‘OK’]
at(‘AT+CGMM’)
modem command: AT+CGMM
response=[‘FiPy’, ‘OK’]
[‘FiPy’, ‘OK’]
at(‘AT+GMM’)
modem command: AT+GMM
response=[‘ERROR’]
[‘ERROR’]
at(‘AT+CPIN?’)
modem command: AT+CPIN?
response=[‘ERROR’]
[‘ERROR’]
at(‘AT+CCID’)
modem command: AT+CCID
response=[‘ERROR’]
[‘ERROR’]
at(‘AT+CRSM=176,28539,0,0,12’)
modem command: AT+CRSM=176,28539,0,0,12
response=[‘ERROR’]
[‘ERROR’]
at(‘AT+CFUN?’)
modem command: AT+CFUN?
response=[‘+CFUN: 0’, ‘OK’]
[‘+CFUN: 0’, ‘OK’]
at(‘AT+CSQ’)
modem command: AT+CSQ
response=[‘+CSQ: 99,99’, ‘OK’]
[‘+CSQ: 99,99’, ‘OK’]
at(‘AT+CREG?’)
modem command: AT+CREG?
response=[‘+CREG: 0,0’, ‘OK’]
[‘+CREG: 0,0’, ‘OK’]
at(‘AT+CGRI’)
modem command: AT+CGRI
response=[‘ERROR’]
[‘ERROR’]
at(‘AT+COPS?’)
modem command: AT+COPS?
response=[‘ERROR’]
[‘ERROR’]
at(‘AT+COPS=?’)
modem command: AT+COPS=?
response=[‘ERROR’]
[‘ERROR’]

Hi @poesel,

If AT+CPIN? is returning an error, then the cellular modem is unable to communicate with your SIM. You’ll want to check that the SIM is inserted properly and that you’re satisfying the power requirements of the board you’re using.

Best,
PFW

Yep I agree with Pat, its an error with reading the simcard, likely not installed correctly, or bad power supply for the device causing it to brown out. Check the orientation of the simcard against the pycom documentation. I’ve definitely installed simcards in every wrong way possible, its also possible that its just not inserted all the way or inserted too far, some of the simcard holders are crap.

The CFUN being 0 instead of 1 would also be an issue, although this may be because the simcard is not readable, you could try running AT+CFUN=1 and see if it will switch to active mode.

The Hologram simcards work with a lot of technologies even in Europe such as 2G, 3G and “standard” LTE such as Cat-1, 2, 4. Cat-M1 and NB-IOT are fairly new and its actually the tower owners (“traditional” telecoms) that are fairly restrictive with it, likely because it is so new.

I was tinkering with the GPY with a Hologram card here in the US until I moved on to the DIGI XBee3 that works perfectly. Apparently the GPY is not certified to work on ATT network here :frowning: There is no need to use CPIN command as there is no pin for Hologram cards. If you want to make sure the modem can read the sim then use the AT+SQNCCID?. Before doing so though you need to set CFUN to 4 for it to read the ICCID from the sim card. For proper connection attempt, also be sure to set the APN to “hologram” either with AT commands or the Python functions built in to the GPY OS.

Thanks guys, really appreciate the help!
I removed and reinserted the SIM card. The orientation was correct, power supply is, too.
Just noticed that I missed the part that hologram doesn’t support NB, yet. The tests I ran below were with the NB firmware. I’ll flash CAT1 and come back.
I’ll leave the tests here for comparison.

at(‘AT+CPIN?’)
modem command: AT+CPIN?
response=[‘+CPIN: READY’, ‘OK’]
[‘+CPIN: READY’, ‘OK’]
at(‘AT+CFUN?’)
modem command: AT+CFUN?
response=[‘+CFUN: 0’, ‘OK’]
[‘+CFUN: 0’, ‘OK’]
at(‘AT+CFUN=1’)
modem command: AT+CFUN=1
response=[‘OK’]
[‘OK’]
at(‘AT+CFUN?’)
modem command: AT+CFUN?
response=[‘+CFUN: 1’, ‘OK’]
[‘+CFUN: 1’, ‘OK’]
at(‘AT+CFUN=4’)
modem command: AT+CFUN=4
response=[‘OK’, ‘+CEREG: 0’]
[‘OK’, ‘+CEREG: 0’]
at(‘AT+CFUN?’)
modem command: AT+CFUN?
response=[‘+CFUN: 4’, ‘OK’]
[‘+CFUN: 4’, ‘OK’]
at(‘AT+SQNCCID?’)
modem command: AT+SQNCCID?
response=[‘+SQNCCID: “8944501810180190859”,“”’, ‘OK’]
[‘+SQNCCID: “8944501810180190859”,“”’, ‘OK’]

Flashed the CAT1M firmware. Here’s the result of the test. What can I do now?
Thanks.

at(‘AT+CPIN?’)
modem command: AT+CPIN?
response=[‘ERROR’]
[‘ERROR’]
at(‘AT+CFUN?’)
modem command: AT+CFUN?
response=[‘+CFUN: 0’, ‘OK’]
[‘+CFUN: 0’, ‘OK’]
at(‘AT+CFUN=1’)
modem command: AT+CFUN=1
response=[‘OK’]
[‘OK’]
at(‘AT+CFUN?’)
modem command: AT+CFUN?
response=[‘+CFUN: 0’, ‘OK’]
[‘+CFUN: 0’, ‘OK’]
at(‘AT+CFUN=4’)
modem command: AT+CFUN=4
response=[‘OK’]
[‘OK’]
at(‘AT+CFUN?’)
modem command: AT+CFUN?
response=[‘+CFUN: 4’, ‘OK’]
[‘+CFUN: 4’, ‘OK’]
at(‘AT+SQNCCID?’)
modem command: AT+SQNCCID?
response=[‘+SQNCCID: “8944501810180190859”,“”’, ‘OK’]
[‘+SQNCCID: “8944501810180190859”,“”’, ‘OK’]