Welcome to the Pycom forum Forum
    • \[\[global:header.categories\]\]
    • \[\[global:header.recent\]\]
    • \[\[global:header.tags\]\]
    • \[\[global:header.popular\]\]
    • Login

    Explore Pybytes | Official Documentation | Report a Firmware Bug/Issue | GitHub

    Fipy connect to Hologram network

    Scheduled Pinned Locked Moved FiPy
    1 Posts 1 Posters 32 Views 1 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • R Offline
      Ryan Slaugh
      last edited by

      I have seen some convos in this general area, but very little success.

      Data on setup:
      UE5.2.0.3
      LR5.2.1.0-48829
      External Antenna connected

      Hologram SIM card activated.

      I have the following code: (Found through online posts to be somewhat successful for some.)

      import time
      from network import LTE
      import utime
      import machine
      import _thread
      
      print('main-testy.py starting.  This is the code snippet from pycom docs')
      
      def send_at_cmd_pretty(cmd):
          response = lte.send_at_cmd(cmd).split('\r\n')
          for line in response:
              print(line)
      
      def do_ntp(a_server):
          # Syncing time
          RTCI = machine.RTC()
          print('Syncing time with %s' % a_server, end='')
          RTCI.ntp_sync(a_server)
          while not RTCI.synced():
              print('.', end='')
              utime.sleep(1)
          print('')
      
      def get_time_as_string():
          year, month, mday, hour, minute, second, weekday, yearday = utime.localtime()
          # form an iso time string
          # eg. 1985-12-04T23:20:50
          a_string = '{}-{:02d}-{:02d}T{:02d}:{:02d}:{:02d}' . format(year, month, mday, hour, minute, second)
          return a_string
      
      
      ###############################################
      
      
      lte = LTE()
      lte.reset()
      lte.init()
      
      
      
      print("trying to attach")
      lte.attach()
      
      send_at_cmd_pretty('AT+CGDCONT=1,"IP","hologram"')
      send_at_cmd_pretty('AT+CFUN=0')
      send_at_cmd_pretty('AT+CEREG=2')
      send_at_cmd_pretty('AT+CFUN=1')
      send_at_cmd_pretty('AT+CPSMS=0')
      send_at_cmd_pretty('AT+CEDRXS=0')
      time.sleep(5)
      send_at_cmd_pretty('AT!="showinit"')
      while not lte.isattached():
          time.sleep(0.5)
          print('Attaching...', end='')
          time.sleep(1)
          send_at_cmd_pretty('AT!="showphy"')
          send_at_cmd_pretty('AT!="fsm"')
          send_at_cmd_pretty('AT+CEREG?')         # get the System FSM
      
      time.sleep(5)
      
      
      print("trying to connect")
      lte.connect(cid=1)
      while not lte.isconnected():
          time.sleep(0.5)
          print('Connecting...')
      
      time.sleep(5)
      
      
      
      # Now use sockets as usual...
      print('**** connected ***********************')
      
      
      do_ntp('time.google.com')
      #do_ntp('pool.ntp.org')
      time.sleep(5)
      print(get_time_as_string())
      

      When running the code, the following is observed:

      >>>
      main-testy.py starting.  This is the code snippet from pycom docs
      trying to attach
      
      OK
      
      
      OK
      
      
      OK
      
      
      OK
      
      
      OK
      
      
      OK
      
      
      -- Scan options -------------------------------------------
      | . Init Stored info use     : true
      | . Init MRU freq use        : true
      | . Init REG freq use        : false
      | . Init FastScan use        : true
      | . Init iterative band scan : false
      | . Init scan batch of freq  : false
      | . Init hybrid 1 mode       : false
      | . Init optim SIB rx        : true
      | . Forced freq              : false
      | . MRU cell use             : true
      -----------------------------------------------------------
      -- Scan Command config ----------------------------------------------------
      | id | type  | object                                                     |
      ---------------------------------------------------------------------------
      | 1  | FREQ  | (id:1)                                                     |
      | 2  | BAND  | (id:2) 3,4,5,8,12,13,20,28                                 |
      | 3  | DELAY | 5000 msec                                                  |
      | 4  | LOOP  | jump to cmd:1, dur:5000ms                                  |
      ---------------------------------------------------------------------------
      
      OK
      
      Attaching...
      DL SYNCHRO STATISTICS
      =====================
          Synchro state                         : FAST SCAN
          PPU SIB1 ACQ watchdog                 : 0
          Frequency Hypothesis RF  (Hz)         : 0
          RSRP (dBm)                            : 0.00
          RSRQ  (dB)                            : 0.00
          Channel estimation state (Cell-spec.) : LOW CINR
          Channel estimation state (UE-spec.)   : LOW CINR
          Channel estimation state (MBSFN)      : LOW CINR
          Channel estimation CINR               : 0.00
          Channel length                        : SHORT
        AGC
          AGC RX gain (dB)                      : 27.05
          RX PSD BO (dBFs)                      : 0.00
          RX PSD (dBm)                          : 0.00
          Noise level RS (dBm)                  : 0.00
          Digital gain (dB)                     : 2.95
          CINR RS (dB)                          : 0.00
        NARROWBANDS
          Last DL NB                            : 0
          Last UL NB                            : 0
        AFC
          Frequency offset RF  (Hz)             : 0
          Frequency offset BB  (Hz)             : 0
        PBCH
          MIB received quantity                 : 0
          MIB timeout quantity                  : 0
      
      OK
      
      
      SYSTEM FSM
      ==========
          +--------------------------+--------------------+
          |            FSM           |        STATE       |
          +--------------------------+--------------------+
          | RRC TOP FSM              |SCANNING            |
          | RRC SEARCH FSM           |WAIT_RSSI           |
          | RRC ACTIVE FSM           |NULL                |
          | PMM PLMN FSM             |NORM_WAITCELL       |
          | EMM MAIN FSM             |NULL                |
          | EMM AUTH FSM             |NULL                |
          | EMM CONN FSM             |NULL                |
          | EMM TAU FSM              |NULL                |
          | EMM TEST FSM             |NULL                |
          | ESM BEARER FSM           |BEARER_NULL         |
          | SMS MT FSM               |IDLE                |
          | SMS MO FSM               |IDLE                |
          | LPP FSM                  |IDLE                |
          | HP MAIN FSM              |IDLE                |
          | HP USIM FSM              |READY               |
          | HP SMS MO FSM            |IDLE                |
          | HP SMS MT FSM            |IDLE                |
          | HP CAT FSM               |IDLE                |
          +--------------------------+--------------------+
      
      OK
      
      
      +CEREG: 2,2
      
      OK
      

      This repeats, with the same CEREG, et.al. for a few minutes. At some point it will change to a +CEREG: 2,4

      I know from experience with the Hologram SIM on other modems that there can be some band focusing, but am unsure how (or if possible) on the fipy.

      Any help is greatly appreciated.

      1 Reply Last reply Reply Quote 0

      Hello! It looks like you're interested in this conversation, but you don't have an account yet.

      Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

      With your input, this post could be even better 💗

      Register Login
      • 1 / 1
      • First post
        Last post

      Pycom on Twitter

      Pycom