Skip to content

Instantly share code, notes, and snippets.

@q-a-z
Forked from JamesHagerman/stslte-notes.md
Created August 8, 2022 12:41
Show Gist options
  • Select an option

  • Save q-a-z/cd44c1cea2e4660692320aead7de73c2 to your computer and use it in GitHub Desktop.

Select an option

Save q-a-z/cd44c1cea2e4660692320aead7de73c2 to your computer and use it in GitHub Desktop.

Revisions

  1. @JamesHagerman JamesHagerman revised this gist Sep 12, 2020. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion stslte-notes.md
    Original file line number Diff line number Diff line change
    @@ -10,7 +10,7 @@ Dependencies:
    sudo apt install tree vim git g++ make cmake pkg-config libpython-dev python-numpy swig libi2c-dev libusb-1.0-0-dev libfftw3-dev libmbedtls-dev libboost-program-options-dev libconfig++-dev libsctp-dev gnuradio
    # For the graphical LimeSuiteGUI
    sudo apt-get install libwxgtk3.0-dev freeglut3-dev
    sudo apt-get install libboost-system-dev libboost-test-dev libboost-thread-dev libqwt-qt5-dev qtbase5-dev
    ```

    Sources:
  2. @JamesHagerman JamesHagerman revised this gist Mar 20, 2020. 1 changed file with 6 additions and 4 deletions.
    10 changes: 6 additions & 4 deletions stslte-notes.md
    Original file line number Diff line number Diff line change
    @@ -334,17 +334,19 @@ For `srslte`, I used the right hand `LTE/WCDMA Paramater` section, and clicked t

    These are the values I changed:

    *Note about MCC and MNC: Use 001 and 01. These are correct test values! If you're spoofing AT&T towers, you run the risk of fucking with 911 calls! Unactivated phones [basically roam](https://www.sharetechnote.com/html/IMS_SIP_PSAP.html#Emergency_Call_without_Normal_Registration) to make emergency calls. Lots of kids and disadvantaged people have unactivated phones for saftey! Don't be a dick!*
    *Note about MCC and MNC: Use 001 and 01. These are correct test values! If you're spoofing AT&T towers, you run the risk of fucking with 911 calls! Unactivated phones [basically roam](https://www.sharetechnote.com/html/IMS_SIP_PSAP.html#Emergency_Call_without_Normal_Registration) to make emergency calls. Lots of kids and disadvantaged people have unactivated phones for saftey!*

    For some fields, I'll provide a section number that tells where inside `TS 31.102 4.2.84` to find more information about the field.

    ```
    IMSI15: 001010000000001 Combination Field! [MCC+MNC+ID] and the ID usually increments
    AD: 00000002 This sets the phone's operation mode and the format of the MCC+MNC part of the IMSI
    AD: 00000002 (4.2.18) This sets the phone's operation mode and the format of the MCC+MNC part of the IMSI
    KI: 12341234123412341234123412341234 The special key! #1 thing you can't read or write on a normal SIM!
    OPC: Empty. Click the radio button next to OP instead.
    OP: 11111111111111111111111111111111 Another part of the KEY! #2 thing you can't read or write on a normal SIM!
    MSISDN: A phone number I'm sure there's a correct "test" number to use here, but I don't know it.
    SPN: CMCC Again, there is probably a correct test value for this...
    Algorithm: Milenage XOR is usually only used for testing, srslte supports Milenage so just use that.
    SPN: CMCC Service Provider Name. It's what gets displayed at the top of the phone.
    Algorithm: Milenage XOR is usually only used for testing, srslte supports Milenage so use it.
    ```

    **I feel like I'm missing something in here still. The `user_db.csv` documentation has more fields that don't match any fields in this SIM tools interface.**
  3. @JamesHagerman JamesHagerman revised this gist Mar 20, 2020. 1 changed file with 3 additions and 1 deletion.
    4 changes: 3 additions & 1 deletion stslte-notes.md
    Original file line number Diff line number Diff line change
    @@ -322,10 +322,12 @@ After it loads up, I unplugged the SIM writers, plugged in a sim, plugged the SI

    The SIM values popped up on screen and I was able to start going through and editing the values manually.

    *NOTE: It felt like some fields were locked! Apparently Copy/Pasteing into some fields is blocked. WTF, whatever, I can type just fine.*
    *NOTE: Apparently Copy/Pasteing into some fields is blocked.*

    ### Actual values

    *Note: The information here is a little bit inaccurate. The best place to look up the meaning of these values is in the 3gpp spec. Google `TS 31.102 4.2.84 pdf` and search for things like `EFPLMNwACT` or `EFAD` to find info about most fields.*

    For the `Common Parameter` section, I **only** touched the ICCID field! **Many SIM cards will brick themselves if you try to read them with the wrong PIN too many times. Like, three times. So don't muck with them unless you've okay losing a few SIMs figuring it out!** I don't know why and I ain't gonna test it yet, but it feels like the `PIN1` and `PIN2` fields should both be `1234` for the SIMs I got? Whatever. I'll play with these later.

    For `srslte`, I used the right hand `LTE/WCDMA Paramater` section, and clicked the `Same with LTE` button on the left hand panel every once in a while to copy the data back over to the `GSM/WCDMA/LTE` side of the interface. I don't know if it matters.
  4. @JamesHagerman JamesHagerman revised this gist Feb 22, 2020. 1 changed file with 16 additions and 17 deletions.
    33 changes: 16 additions & 17 deletions stslte-notes.md
    Original file line number Diff line number Diff line change
    @@ -26,9 +26,7 @@ git clone https://github.com/srsLTE/srsLTE.git

    Build:

    **RPi4,

    For my laptop, these versions seem to work:
    For my laptop, these versions work. For the RPi4, see the dedicated section below.

    ```
    pushd SoapySDR
    @@ -62,7 +60,7 @@ sudo make install
    sudo ldconfig
    sudo mkdir -p /etc/Nuand/bladeRF/
    sudo wget https://www.nuand.com/fpga/hostedx40-latest.rbf --output-document /etc/Nuand/bladeRF/hostedx40.rbf
    sudo scp user@othermachine:/.Nuand/bladeRF/61fa68225d43e227281054c3f56c03d8_dc_rx.tbl /etc/Nuand/bladeRF/61fa68225d43e227281054c3f56c03d8_dc_rx.tbl
    sudo scp user@othermachine:/.Nuand/bladeRF/whatever-serial-number_dc_rx.tbl /etc/Nuand/bladeRF/whatever-serial-number_dc_rx.tbl
    popd
    pushd SoapyBladeRF
    @@ -74,6 +72,7 @@ sudo make install
    popd
    pushd srsLTE
    # See note about which versions work on RPi4...
    mkdir build
    cd build
    cmake ../
    @@ -93,19 +92,19 @@ These are the bare minimum config files I changed away from the defaults:
    ```
    n_prb = 25
    tx_gain = 72
    all_level = info
    ```

    The `dl_earfcn = 3400` value is okay for my needs.

    The `dl_earfcn = 3400` value is okay for my needs. You should be sure you're aware of the implications of using Band 7.


    ## Raspberry Pi 4 - Issues with the current version of `srsLTE`

    While the versions listed above work on my laptop without any issues, they do not work on the RPi4 based on my testing.
    While the latest version of `srsLTE` works on my laptop without any issues, they do not work on the RPi4 based on my testing.

    Back in October, a user named Ralph posted details about his working RPi4, `srsLTE`, and LimeSDR Mini setup to the srsLTE mailing list. Here is the original message, for reference: http://www.softwareradiosystems.com/pipermail/srslte-users/2019-October/003063.html

    And here are the versions he called out:
    Here are the versions he called out in that message:

    ```
    LimeSDR Mini, Gateware 1.30
    @@ -116,13 +115,13 @@ srsGUI: 31c75d17b61c27271cd7c48a5de8873d15e2bd23
    srsLTE: 62d295671510630ea9aea1754835f6c346de6ed7
    ```

    I tried those versions and did not have luck getting the system stable. I keep getting this error: `SCHED: Could not transmit RAR within the window`
    That's version `19.09` of srsLTE. When I tried that version on my RPi4 the system was not stable and I keep getting this error: `SCHED: Could not transmit RAR within the window`.

    I have tried a bunch of different things to try getting this working, without success.
    After trying a bunch of things (see the list below), I ended up moving back to the latest version, `19.12`. It works on my laptop and that release added important features and various bug fixes missing from `19.09`. I had hoped it would fix the underlying issue and I'd prefer to be working closer to the most recent release.

    Because of the issues I was running into, I moved back to the latest to try and determine a potential root cause. The `19.12` release added important features which `19.09` lacks and I'd prefer to be working closer to the most recent release.
    But I get the same error on `19.12`! So I must be missing something.

    Therefore, I'm currently attempting to use the following versions. They work on my laptop but **do not work on the RPi4**. If you're trying to get this working, I suggest attempting to use the versions listed in Ralph's message instead.
    Here are the versions I'm using currently. They work on my laptop but **do not work on the RPi4**. If you're trying to get this working, I suggest attempting to use the versions listed in Ralph's message instead; maybe you'll have better luck than I.

    ```
    $ for x in `ls`; do pushd $x; git log -1; popd; done
    @@ -167,20 +166,22 @@ Date: Wed Jan 8 13:12:35 2020 +0100
    ~/dev
    ```



    ### Next things to try:

    - Start over (a third time) with a blank SD card, be sure I compile all the versions Ralph suggested, and see how that goes.

    - Ralph's original work was done at 3MHz. **I tried `n_prb = 50` and `n_prb = 25`** but I still saw the RAR window issue. Because my test devices do not seem to like connecting to a 3MHz (15 resource blocks) network on Band 7 and I figured that wasn't worth testing. I'll go back and retest this with `n_prb = 15` and see if I'm missing something.

    - Wait until the next release and hope the timing (and high RAM usage) improves somewhat.

    - I'm just pulling strings at this point; Maybe it's worth ensuring the clocks on both the UE and RPi4 eNB are in sync?

    I'm not sure what else should be on this list.
    - I'm not sure what else should be on this list.

    ### Things I've tried

    **I tried falling back to 19.09** and ran into some other issues. I need to go back and document them.

    **I tried to adjust `time_adv_nsamples`** but that didn't get the transmission to happen in time no matter what value I used:

    ```
    @@ -210,8 +211,6 @@ QT_X11_NO_MITSHM=1 lib/examples/pdsch_ue -f 2685.0e6 -F

    After adjusting things to get clean signal, I still hit the same issue I've been hitting all along. The RAR isn't transmitted in time.

    **I tried falling back to 19.09** and ran into other issues (I'll have to go back and document those issues).

    **I tried using a BladeRF x40 instead of the LimeSDR Mini** and along with the RAR window issue, I saw a lot of other errors communicating with the SDR correctly (again, I'll have to go back and document them more closely).

    **I tried running this whole thing on a Raspberry Pi 3B+** and it very quickly ran out of memory. Early on, I tried all this with a RPi4 with 2GB and it also quickly ran out of memory.
  5. @JamesHagerman JamesHagerman revised this gist Feb 22, 2020. 1 changed file with 25 additions and 15 deletions.
    40 changes: 25 additions & 15 deletions stslte-notes.md
    Original file line number Diff line number Diff line change
    @@ -26,18 +26,7 @@ git clone https://github.com/srsLTE/srsLTE.git

    Build:

    For RPi4, these versions have been tested by someone on the srsLTE mailing list. Here is the original message, for reference: http://www.softwareradiosystems.com/pipermail/srslte-users/2019-October/003063.html

    I tried these versions and did not have luck getting the system running. I'm missing some variable...

    ```
    LimeSDR Mini, Gateware 1.30
    SoapySDR: 189bc69217846581e34456f391683cc07c43ae0d
    LimeSuite: 627c82c76938765e93e85784cb359ea4aa71554e
    srsGUI: 31c75d17b61c27271cd7c48a5de8873d15e2bd23
    srsLTE: 62d295671510630ea9aea1754835f6c346de6ed7
    ```
    **RPi4,

    For my laptop, these versions seem to work:

    @@ -110,11 +99,30 @@ The `dl_earfcn = 3400` value is okay for my needs.



    ## Raspberry Pi 4 Issues
    ## Raspberry Pi 4 - Issues with the current version of `srsLTE`

    While the versions listed above work on my laptop without any issues, they do not work on the RPi4 based on my testing.

    Back in October, a user named Ralph posted details about his working RPi4, `srsLTE`, and LimeSDR Mini setup to the srsLTE mailing list. Here is the original message, for reference: http://www.softwareradiosystems.com/pipermail/srslte-users/2019-October/003063.html

    And here are the versions he called out:

    I keep getting this issue: `SCHED: Could not transmit RAR within the window`
    ```
    LimeSDR Mini, Gateware 1.30
    I have tried a bunch of different things to try getting this working, but it just doesn't want to work. After trying the versions suggested by Ralph back on Oct 21 (see the section on compiling above), I've landed on using these versions currently. They **do not work** from what I can tell. I'm not sure what I'm missing.
    SoapySDR: 189bc69217846581e34456f391683cc07c43ae0d
    LimeSuite: 627c82c76938765e93e85784cb359ea4aa71554e
    srsGUI: 31c75d17b61c27271cd7c48a5de8873d15e2bd23
    srsLTE: 62d295671510630ea9aea1754835f6c346de6ed7
    ```

    I tried those versions and did not have luck getting the system stable. I keep getting this error: `SCHED: Could not transmit RAR within the window`

    I have tried a bunch of different things to try getting this working, without success.

    Because of the issues I was running into, I moved back to the latest to try and determine a potential root cause. The `19.12` release added important features which `19.09` lacks and I'd prefer to be working closer to the most recent release.

    Therefore, I'm currently attempting to use the following versions. They work on my laptop but **do not work on the RPi4**. If you're trying to get this working, I suggest attempting to use the versions listed in Ralph's message instead.

    ```
    $ for x in `ls`; do pushd $x; git log -1; popd; done
    @@ -159,6 +167,8 @@ Date: Wed Jan 8 13:12:35 2020 +0100
    ~/dev
    ```



    ### Next things to try:

    - Ralph's original work was done at 3MHz. **I tried `n_prb = 50` and `n_prb = 25`** but I still saw the RAR window issue. Because my test devices do not seem to like connecting to a 3MHz (15 resource blocks) network on Band 7 and I figured that wasn't worth testing. I'll go back and retest this with `n_prb = 15` and see if I'm missing something.
  6. @JamesHagerman JamesHagerman revised this gist Feb 22, 2020. 1 changed file with 40 additions and 38 deletions.
    78 changes: 40 additions & 38 deletions stslte-notes.md
    Original file line number Diff line number Diff line change
    @@ -2,43 +2,6 @@

    These are notes I've taken while rying to get `srslte` up and running. This is messy, sorry...

    ## SDR configuration stuff

    ### LimeSDR USB

    https://wiki.myriadrf.org/LimeSDR-USB

    The LimeSDR USB exposes all 10 of the RF ports available on the LMS7002M chip.

    - Channel 0
    - TX1_1 = BAND1 (2GHz - 3.5GHz); TX1_2 = BAND2 (10MHz - 2GHz)
    - RX1_L = LNAL (10MHz - 2GHz); RX1_H = LNAH (2GHz - 3.5GHz); RX1_W = LNAW (10MHz - 2GHz)
    - Channel 1
    - TX2_1 = BAND1 (2GHz - 3.5GHz); TX2_2 = BAND2 (10MHz - 2GHz)
    - RX2_H = LNAH (2GHz - 3.5GHz); RX2_W = LNAW (10MHz - 2GHz)

    UNTESTED:

    ```
    device_args = rxant=LNAL,txant=BAND1
    ```

    ### LimeSDR Mini

    https://wiki.myriadrf.org/LimeSDR-Mini

    The Mini has 2x RF switches that allow the 2x SMA connectors to be routed to one of 5 RF ports on the LMS7002M (2x outputs for TX, 3x inputs for RX). SoapySDR gives these ports slightly different name. These names can be put into `device_args` to configure the RF paths.

    *Note: Frequency ranges were taken from the `v1.1` schematic*

    - TX1_1 = BAND1 (2GHz - 2.6GHz); TX1_2 = BAND2 (30MHz - 1.9GHz)
    - RX1_H = LNAH (2GHz - 3.5GHz); RX1_W = LNAW (10MHz - 2GHz)

    ```
    device_args = rxant=LNAH,txant=BAND1
    ```


    ## Working solution - LimeSDR + SoapySDR + srsLTE

    Dependencies:
    @@ -198,7 +161,7 @@ Date: Wed Jan 8 13:12:35 2020 +0100

    ### Next things to try:

    - Ralph's original work was done at 3MHz. **I tried `n_prb = 25` and `n_prb = 15`** but I still saw the RAR window issue. I did not try 3MHz yet because my test devices do not seem to like connecting to a 5MHz (15 resource blocks) network on Band 7 and I figured that 3MHz wasn't going to work.
    - Ralph's original work was done at 3MHz. **I tried `n_prb = 50` and `n_prb = 25`** but I still saw the RAR window issue. Because my test devices do not seem to like connecting to a 3MHz (15 resource blocks) network on Band 7 and I figured that wasn't worth testing. I'll go back and retest this with `n_prb = 15` and see if I'm missing something.

    - Wait until the next release and hope the timing (and high RAM usage) improves somewhat.

    @@ -275,6 +238,45 @@ The following tests FAILED:
    Errors while running CTest
    ```


    ## SDR configuration stuff

    ### LimeSDR USB

    https://wiki.myriadrf.org/LimeSDR-USB

    The LimeSDR USB exposes all 10 of the RF ports available on the LMS7002M chip.

    - Channel 0
    - TX1_1 = BAND1 (2GHz - 3.5GHz); TX1_2 = BAND2 (10MHz - 2GHz)
    - RX1_L = LNAL (10MHz - 2GHz); RX1_H = LNAH (2GHz - 3.5GHz); RX1_W = LNAW (10MHz - 2GHz)
    - Channel 1
    - TX2_1 = BAND1 (2GHz - 3.5GHz); TX2_2 = BAND2 (10MHz - 2GHz)
    - RX2_H = LNAH (2GHz - 3.5GHz); RX2_W = LNAW (10MHz - 2GHz)

    UNTESTED:

    ```
    device_args = rxant=LNAL,txant=BAND1
    ```

    ### LimeSDR Mini

    https://wiki.myriadrf.org/LimeSDR-Mini

    The Mini has 2x RF switches that allow the 2x SMA connectors to be routed to one of 5 RF ports on the LMS7002M (2x outputs for TX, 3x inputs for RX). SoapySDR gives these ports slightly different name. These names can be put into `device_args` to configure the RF paths.

    *Note: Frequency ranges were taken from the `v1.1` schematic*

    - TX1_1 = BAND1 (2GHz - 2.6GHz); TX1_2 = BAND2 (30MHz - 1.9GHz)
    - RX1_H = LNAH (2GHz - 3.5GHz); RX1_W = LNAW (10MHz - 2GHz)

    ```
    device_args = rxant=LNAH,txant=BAND1
    ```



    ## OLDER STUFF BELOW HERE

    ## Install stuff
  7. @JamesHagerman JamesHagerman revised this gist Feb 22, 2020. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions stslte-notes.md
    Original file line number Diff line number Diff line change
    @@ -241,6 +241,8 @@ After adjusting things to get clean signal, I still hit the same issue I've been

    **I tried using a BladeRF x40 instead of the LimeSDR Mini** and along with the RAR window issue, I saw a lot of other errors communicating with the SDR correctly (again, I'll have to go back and document them more closely).

    **I tried running this whole thing on a Raspberry Pi 3B+** and it very quickly ran out of memory. Early on, I tried all this with a RPi4 with 2GB and it also quickly ran out of memory.

    **I tried running all the tests to ensure they were passing** and found one that does not pass on `19.12` on the RPi4. I looked into this and it looks to be an issue with the test more than a root cause for my issue. I opened a GitHub Issue to document the problem: https://github.com/srsLTE/srsLTE/issues/461

    ```
  8. @JamesHagerman JamesHagerman revised this gist Feb 22, 2020. 1 changed file with 62 additions and 7 deletions.
    69 changes: 62 additions & 7 deletions stslte-notes.md
    Original file line number Diff line number Diff line change
    @@ -151,7 +151,64 @@ The `dl_earfcn = 3400` value is okay for my needs.

    I keep getting this issue: `SCHED: Could not transmit RAR within the window`

    I tried to adjust `time_adv_nsamples` but that didn't get the transmission to happen in time no matter what value I used:
    I have tried a bunch of different things to try getting this working, but it just doesn't want to work. After trying the versions suggested by Ralph back on Oct 21 (see the section on compiling above), I've landed on using these versions currently. They **do not work** from what I can tell. I'm not sure what I'm missing.

    ```
    $ for x in `ls`; do pushd $x; git log -1; popd; done
    ~/dev/LimeSuite ~/dev
    commit c931854ead81307206bce750c17c2301810b5545 (HEAD -> master, origin/stable, origin/master, origin/HEAD)
    Author: Ignas J <[email protected]>
    Date: Wed Jan 29 10:55:12 2020 +0200
    Remove some warnings (LimeRFE related)
    ~/dev
    ~/dev/SoapyBladeRF ~/dev
    commit 1c1e8aaba5e8ee154b34c6c3b17743d1c9b9a1ea (HEAD -> master, tag: soapy-bladerf-0.4.1, origin/master, origin/HEAD)
    Author: Josh Blum <[email protected]>
    Date: Sat Jan 26 12:22:27 2019 -0600
    soapybladerf: changelog entry for 0.4.1
    ~/dev
    ~/dev/SoapySDR ~/dev
    commit cbdcb115239d9747b93184c5cf13bf18a8964d52 (HEAD -> soapy-sdr-0.7.2, tag: soapy-sdr-0.7.2, origin/maint)
    Author: Josh Blum <[email protected]>
    Date: Sun Jan 12 12:05:37 2020 -0600
    soapysdr: changelog entry for 0.7.2
    ~/dev
    ~/dev/bladeRF ~/dev
    commit 45521019c540392287eb6e03d52b8073b2fd0743 (HEAD -> master, origin/master, origin/HEAD)
    Author: Robert Ghilduta <[email protected]>
    Date: Fri Dec 20 12:47:25 2019 -0800
    libbladeRF: rearrange position of get_speed in declarations
    ~/dev
    ~/dev/srsLTE ~/dev
    commit d045213fb9cbf98c83c06d7c17197a9dcbfddacf (HEAD -> master, tag: release_19_12, origin/master, origin/HEAD)
    Author: Andre Puschmann <[email protected]>
    Date: Wed Jan 8 13:12:35 2020 +0100
    fixing bug in RRC measurement when receiving periodic config
    in the UE conformance testing we've spotted an issue
    where an event was evaluated even though the trigger type for
    the report was periodic which caused an exception in RRC
    ~/dev
    ```

    ### Next things to try:

    - Ralph's original work was done at 3MHz. **I tried `n_prb = 25` and `n_prb = 15`** but I still saw the RAR window issue. I did not try 3MHz yet because my test devices do not seem to like connecting to a 5MHz (15 resource blocks) network on Band 7 and I figured that 3MHz wasn't going to work.

    - Wait until the next release and hope the timing (and high RAM usage) improves somewhat.

    - I'm just pulling strings at this point; Maybe it's worth ensuring the clocks on both the UE and RPi4 eNB are in sync?

    I'm not sure what else should be on this list.

    ### Things I've tried

    **I tried to adjust `time_adv_nsamples`** but that didn't get the transmission to happen in time no matter what value I used:

    ```
    SCHED: Could not transmit RAR within the window
    @@ -171,7 +228,7 @@ SCHED: Could not transmit RAR within the window

    The Carrier Offset Frequency (CFO) reported by `srsue` was around 1kHz off so I adjusted it with `freq_offset = -1100` and it got the CFO much closer to 0 Hz

    I noticed that sometimes the prefix's being sent by the UE are not the same as those being picked up by the eNB running on the RPi4 so I ran the `pdsch_ue` app from my laptop to check out the channel conditions visually:
    I noticed that sometimes the prefix's being sent by the UE are not the same as those being picked up by the eNB running on the RPi4 so **I ran the `pdsch_ue` app from my laptop to check out the channel conditions visually**:

    ```
    cd srsLTE/build
    @@ -180,13 +237,11 @@ QT_X11_NO_MITSHM=1 lib/examples/pdsch_ue -f 2685.0e6 -F

    After adjusting things to get clean signal, I still hit the same issue I've been hitting all along. The RAR isn't transmitted in time.

    Last thing I can think of is making sure the clocks on both the UE and RPi4 eNB are in sync.

    I'm not sure what else I can do.
    **I tried falling back to 19.09** and ran into other issues (I'll have to go back and document those issues).

    ### Failing test on RPi4:
    **I tried using a BladeRF x40 instead of the LimeSDR Mini** and along with the RAR window issue, I saw a lot of other errors communicating with the SDR correctly (again, I'll have to go back and document them more closely).

    Open Issue: https://github.com/srsLTE/srsLTE/issues/461
    **I tried running all the tests to ensure they were passing** and found one that does not pass on `19.12` on the RPi4. I looked into this and it looks to be an issue with the test more than a root cause for my issue. I opened a GitHub Issue to document the problem: https://github.com/srsLTE/srsLTE/issues/461

    ```
    99% tests passed, 1 tests failed out of 579
  9. @JamesHagerman JamesHagerman revised this gist Feb 22, 2020. 1 changed file with 3 additions and 2 deletions.
    5 changes: 3 additions & 2 deletions stslte-notes.md
    Original file line number Diff line number Diff line change
    @@ -63,7 +63,9 @@ git clone https://github.com/srsLTE/srsLTE.git

    Build:

    For RPi4, apparently, these versions have been tested by the community (not I):
    For RPi4, these versions have been tested by someone on the srsLTE mailing list. Here is the original message, for reference: http://www.softwareradiosystems.com/pipermail/srslte-users/2019-October/003063.html

    I tried these versions and did not have luck getting the system running. I'm missing some variable...

    ```
    LimeSDR Mini, Gateware 1.30
    @@ -149,7 +151,6 @@ The `dl_earfcn = 3400` value is okay for my needs.

    I keep getting this issue: `SCHED: Could not transmit RAR within the window`


    I tried to adjust `time_adv_nsamples` but that didn't get the transmission to happen in time no matter what value I used:

    ```
  10. @JamesHagerman JamesHagerman revised this gist Feb 22, 2020. 1 changed file with 11 additions and 2 deletions.
    13 changes: 11 additions & 2 deletions stslte-notes.md
    Original file line number Diff line number Diff line change
    @@ -55,8 +55,9 @@ Sources:
    ```
    git clone https://github.com/pothosware/SoapySDR.git
    git clone https://github.com/myriadrf/LimeSuite.git
    git clone https://github.com/Nuand/bladeRF.git - Optional
    git clone https://github.com/srsLTE/srsGUI.git - Optional (has to be installed before srsLTE is compiled)
    git clone https://github.com/Nuand/bladeRF.git - Optional
    git clone https://github.com/pothosware/SoapyBladeRF.git - Optional
    git clone https://github.com/srsLTE/srsGUI.git - Optional (has to be installed before srsLTE is compiled)
    git clone https://github.com/srsLTE/srsLTE.git
    ```

    @@ -110,6 +111,14 @@ sudo wget https://www.nuand.com/fpga/hostedx40-latest.rbf --output-document /etc
    sudo scp user@othermachine:/.Nuand/bladeRF/61fa68225d43e227281054c3f56c03d8_dc_rx.tbl /etc/Nuand/bladeRF/61fa68225d43e227281054c3f56c03d8_dc_rx.tbl
    popd
    pushd SoapyBladeRF
    mkdir build
    cd build
    cmake ..
    make
    sudo make install
    popd
    pushd srsLTE
    mkdir build
    cd build
  11. @JamesHagerman JamesHagerman revised this gist Feb 22, 2020. No changes.
  12. @JamesHagerman JamesHagerman revised this gist Feb 22, 2020. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions stslte-notes.md
    Original file line number Diff line number Diff line change
    @@ -107,6 +107,7 @@ sudo make install
    sudo ldconfig
    sudo mkdir -p /etc/Nuand/bladeRF/
    sudo wget https://www.nuand.com/fpga/hostedx40-latest.rbf --output-document /etc/Nuand/bladeRF/hostedx40.rbf
    sudo scp user@othermachine:/.Nuand/bladeRF/61fa68225d43e227281054c3f56c03d8_dc_rx.tbl /etc/Nuand/bladeRF/61fa68225d43e227281054c3f56c03d8_dc_rx.tbl
    popd
    pushd srsLTE
  13. @JamesHagerman JamesHagerman revised this gist Feb 22, 2020. 1 changed file with 5 additions and 2 deletions.
    7 changes: 5 additions & 2 deletions stslte-notes.md
    Original file line number Diff line number Diff line change
    @@ -55,7 +55,8 @@ Sources:
    ```
    git clone https://github.com/pothosware/SoapySDR.git
    git clone https://github.com/myriadrf/LimeSuite.git
    git clone https://github.com/Nuand/bladeRF.git
    git clone https://github.com/Nuand/bladeRF.git - Optional
    git clone https://github.com/srsLTE/srsGUI.git - Optional (has to be installed before srsLTE is compiled)
    git clone https://github.com/srsLTE/srsLTE.git
    ```

    @@ -100,10 +101,12 @@ popd
    pushd bladeRF/host/
    mkdir build
    cd build/
    cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local -DINSTALL_UDEV_RULES=ON ..
    cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local -DINSTALL_UDEV_RULES=ON -DBLADERF_GROUP=plugdev ..
    make
    sudo make install
    sudo ldconfig
    sudo mkdir -p /etc/Nuand/bladeRF/
    sudo wget https://www.nuand.com/fpga/hostedx40-latest.rbf --output-document /etc/Nuand/bladeRF/hostedx40.rbf
    popd
    pushd srsLTE
  14. @JamesHagerman JamesHagerman revised this gist Feb 22, 2020. 1 changed file with 1 addition and 2 deletions.
    3 changes: 1 addition & 2 deletions stslte-notes.md
    Original file line number Diff line number Diff line change
    @@ -55,7 +55,7 @@ Sources:
    ```
    git clone https://github.com/pothosware/SoapySDR.git
    git clone https://github.com/myriadrf/LimeSuite.git
    git clone https://github.com/myriadrf/gr-limesdr.git
    git clone https://github.com/Nuand/bladeRF.git
    git clone https://github.com/srsLTE/srsLTE.git
    ```

    @@ -97,7 +97,6 @@ cd ../udev-rules
    sudo sh ./install.sh
    popd
    git clone https://github.com/Nuand/bladeRF.git
    pushd bladeRF/host/
    mkdir build
    cd build/
  15. @JamesHagerman JamesHagerman revised this gist Feb 22, 2020. 1 changed file with 10 additions and 0 deletions.
    10 changes: 10 additions & 0 deletions stslte-notes.md
    Original file line number Diff line number Diff line change
    @@ -97,6 +97,16 @@ cd ../udev-rules
    sudo sh ./install.sh
    popd
    git clone https://github.com/Nuand/bladeRF.git
    pushd bladeRF/host/
    mkdir build
    cd build/
    cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local -DINSTALL_UDEV_RULES=ON ..
    make
    sudo make install
    sudo ldconfig
    popd
    pushd srsLTE
    mkdir build
    cd build
  16. @JamesHagerman JamesHagerman revised this gist Feb 22, 2020. 1 changed file with 10 additions and 0 deletions.
    10 changes: 10 additions & 0 deletions stslte-notes.md
    Original file line number Diff line number Diff line change
    @@ -111,6 +111,16 @@ popd

    Then write yourself a SIM, cd to `~/.config/srslte`, configure srsLTE, and run both the eNodeB and EPC!

    These are the bare minimum config files I changed away from the defaults:

    `enb.conf`:
    ```
    n_prb = 25
    tx_gain = 72
    ```

    The `dl_earfcn = 3400` value is okay for my needs.



    ## Raspberry Pi 4 Issues
  17. @JamesHagerman JamesHagerman revised this gist Feb 22, 2020. 1 changed file with 1 addition and 11 deletions.
    12 changes: 1 addition & 11 deletions stslte-notes.md
    Original file line number Diff line number Diff line change
    @@ -97,16 +97,6 @@ cd ../udev-rules
    sudo sh ./install.sh
    popd
    pushd gr-limesdr
    mkdir build
    cd build
    cmake ..
    make
    sudo make install
    sudo ldconfig
    popd
    pushd srsLTE
    mkdir build
    cd build
    @@ -115,7 +105,7 @@ make
    make test
    sudo make install
    sudo ldconfig
    srslte_install_configs.sh
    sudo ./srslte_install_configs.sh service
    popd
    ```

  18. @JamesHagerman JamesHagerman revised this gist Feb 22, 2020. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions stslte-notes.md
    Original file line number Diff line number Diff line change
    @@ -163,6 +163,8 @@ I'm not sure what else I can do.

    ### Failing test on RPi4:

    Open Issue: https://github.com/srsLTE/srsLTE/issues/461

    ```
    99% tests passed, 1 tests failed out of 579
  19. @JamesHagerman JamesHagerman revised this gist Feb 22, 2020. 1 changed file with 19 additions and 1 deletion.
    20 changes: 19 additions & 1 deletion stslte-notes.md
    Original file line number Diff line number Diff line change
    @@ -161,7 +161,7 @@ Last thing I can think of is making sure the clocks on both the UE and RPi4 eNB

    I'm not sure what else I can do.

    Failing test on RPi4:
    ### Failing test on RPi4:

    ```
    99% tests passed, 1 tests failed out of 579
    @@ -174,6 +174,24 @@ Errors while running CTest
    make: *** [Makefile:152: test] Error 8
    ```

    Re-ran the test and got the same result:

    ```
    $ ctest -R pucch_test
    Test project /home/pi/dev/srsLTE/build
    Start 218: pucch_test
    1/2 Test #218: pucch_test .......................Bus error***Exception: 0.04 sec
    Start 219: pucch_test_uci_cqi_decoder
    2/2 Test #219: pucch_test_uci_cqi_decoder ....... Passed 0.97 sec
    50% tests passed, 1 tests failed out of 2
    Total Test time (real) = 1.04 sec
    The following tests FAILED:
    218 - pucch_test (Bus error)
    Errors while running CTest
    ```

    ## OLDER STUFF BELOW HERE

  20. @JamesHagerman JamesHagerman revised this gist Feb 22, 2020. 1 changed file with 13 additions and 0 deletions.
    13 changes: 13 additions & 0 deletions stslte-notes.md
    Original file line number Diff line number Diff line change
    @@ -161,6 +161,19 @@ Last thing I can think of is making sure the clocks on both the UE and RPi4 eNB

    I'm not sure what else I can do.

    Failing test on RPi4:

    ```
    99% tests passed, 1 tests failed out of 579
    Total Test time (real) = 4533.80 sec
    The following tests FAILED:
    218 - pucch_test (Bus error)
    Errors while running CTest
    make: *** [Makefile:152: test] Error 8
    ```


    ## OLDER STUFF BELOW HERE

  21. @JamesHagerman JamesHagerman revised this gist Feb 22, 2020. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions stslte-notes.md
    Original file line number Diff line number Diff line change
    @@ -76,7 +76,7 @@ For my laptop, these versions seem to work:

    ```
    pushd SoapySDR
    git checkout tag tags/soapy-sdr-0.7.2 -b soapy-sdr-0.7.2
    git checkout tags/soapy-sdr-0.7.2 -b soapy-sdr-0.7.2
    mkdir build
    cd build
    cmake ..
    @@ -86,7 +86,7 @@ sudo ldconfig
    popd
    pushd LimeSuite
    git checkout tag tags/v19.04.0 -b v19.04.0
    git checkout tags/v19.04.0 -b v19.04.0
    mkdir builddir
    cd builddir
    cmake ..
  22. @JamesHagerman JamesHagerman revised this gist Feb 22, 2020. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion stslte-notes.md
    Original file line number Diff line number Diff line change
    @@ -76,7 +76,7 @@ For my laptop, these versions seem to work:

    ```
    pushd SoapySDR
    git checkout tag tags/soapy-sdr-0.7.1 -b soapy-sdr-0.7.1
    git checkout tag tags/soapy-sdr-0.7.2 -b soapy-sdr-0.7.2
    mkdir build
    cd build
    cmake ..
  23. @JamesHagerman JamesHagerman revised this gist Feb 22, 2020. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion stslte-notes.md
    Original file line number Diff line number Diff line change
    @@ -76,7 +76,7 @@ For my laptop, these versions seem to work:

    ```
    pushd SoapySDR
    git checkout tag/soapy-sdr-0.7.1 -b soapy-sdr-0.7.1
    git checkout tag tags/soapy-sdr-0.7.1 -b soapy-sdr-0.7.1
    mkdir build
    cd build
    cmake ..
  24. @JamesHagerman JamesHagerman revised this gist Feb 15, 2020. 1 changed file with 34 additions and 0 deletions.
    34 changes: 34 additions & 0 deletions stslte-notes.md
    Original file line number Diff line number Diff line change
    @@ -123,9 +123,43 @@ Then write yourself a SIM, cd to `~/.config/srslte`, configure srsLTE, and run b



    ## Raspberry Pi 4 Issues

    I keep getting this issue: `SCHED: Could not transmit RAR within the window`


    I tried to adjust `time_adv_nsamples` but that didn't get the transmission to happen in time no matter what value I used:

    ```
    SCHED: Could not transmit RAR within the window
    90 samples
    (RA TTI=7011, Window=10, Now=7029 18
    100 samples:
    (RA TTI=3201, Window=10, Now=3245) 44
    150 samples:
    (RA TTI=8641, Window=10, Now=8661) 20
    250 samples:
    (RA TTI=6641, Window=10, Now=6656) 15
    ```

    The Carrier Offset Frequency (CFO) reported by `srsue` was around 1kHz off so I adjusted it with `freq_offset = -1100` and it got the CFO much closer to 0 Hz

    I noticed that sometimes the prefix's being sent by the UE are not the same as those being picked up by the eNB running on the RPi4 so I ran the `pdsch_ue` app from my laptop to check out the channel conditions visually:

    ```
    cd srsLTE/build
    QT_X11_NO_MITSHM=1 lib/examples/pdsch_ue -f 2685.0e6 -F
    ```

    After adjusting things to get clean signal, I still hit the same issue I've been hitting all along. The RAR isn't transmitted in time.

    Last thing I can think of is making sure the clocks on both the UE and RPi4 eNB are in sync.

    I'm not sure what else I can do.


    ## OLDER STUFF BELOW HERE
  25. @JamesHagerman JamesHagerman revised this gist Feb 15, 2020. 1 changed file with 37 additions and 7 deletions.
    44 changes: 37 additions & 7 deletions stslte-notes.md
    Original file line number Diff line number Diff line change
    @@ -146,7 +146,7 @@ This is where things get tricky.
    - Configure the EPC to match the SIM (apn settings, MCC, MNC, probably more)
    - Add the IMSI and other SIM data to the `user_db.csv`

    ### SIMs
    ## SIMs

    You need to be able to write your own SIM cards. Encryption is pretty important in LTE and without USIMs with custom stuff on them, you're going to have a bad time.

    @@ -166,7 +166,7 @@ The SIM values popped up on screen and I was able to start going through and edi

    *NOTE: It felt like some fields were locked! Apparently Copy/Pasteing into some fields is blocked. WTF, whatever, I can type just fine.*

    #### Actual values
    ### Actual values

    For the `Common Parameter` section, I **only** touched the ICCID field! **Many SIM cards will brick themselves if you try to read them with the wrong PIN too many times. Like, three times. So don't muck with them unless you've okay losing a few SIMs figuring it out!** I don't know why and I ain't gonna test it yet, but it feels like the `PIN1` and `PIN2` fields should both be `1234` for the SIMs I got? Whatever. I'll play with these later.

    @@ -197,7 +197,7 @@ ue1,xor,001010123456789,00112233445566778899aabbccddeeff,opc,63bfa50ee6523365ff1
    ```


    ### Picking Frequencies (and some RF details about LTE)
    ## Picking Frequencies (and some RF details about LTE)

    This is another tricky bit.

    @@ -213,7 +213,7 @@ So how do we get from a supported band (Say, `LTE B2 (1900 PCS)`) to actual freq

    This is where I needed to dig into LTE physical layer specs.

    #### `Evolved-UTRA Absolute Radio Frequency Numbers` (EARFCN's) and `Resource Blocks` (RBs)
    ### `Evolved-UTRA Absolute Radio Frequency Numbers` (EARFCN's) and `Resource Blocks` (RBs)

    In LTE land, we don't usually have to worry about picking exact frequencies. Instead, we use an `EARFCN`. When you see an EARFCN like `3400`, a calculation will spit out the frequency values for the uplink and downlink channels. There are differeny EARFCN's for uplink and downlink, but they are related. **Look for the `dl_earfcn` setting in `enb.conf`.**

    @@ -236,7 +236,7 @@ This [LTE Overview](http://rfmw.em.keysight.com/wireless/helpfiles/89600B/WebHel
    |20 MHz| 100| 1201| 1200|


    #### Working backwards to find LTE Band
    ### Working backwards to find LTE Band

    Let's work backwards from the default `dl_earfcn` and `n_prb` values that come with `srslte`.

    @@ -258,7 +258,7 @@ The `srslte` uplink and downlink frequencies are:
    * 120MHz apart from each other (which matches the `Duplex spacing` for Band 7)
    * Integer multiples of 100kHz (which matches the channel raster for LTE Release 8)

    #### Picking frequencies for a specific LTE Band
    ### Picking frequencies for a specific LTE Band

    So now let's figure out the downlink EARFCN and RBs config for a band supported by my old unlocked iPhone 5c: `LTE B2 (1900 PCS)`

    @@ -303,7 +303,7 @@ That should be enough to sort out how to move `srslte` to any band your phone/LT

    ## Running the UE

    As far as I know, this allows you to emulate `User Equipment`. That means a "mobile handset"/phone or other some other LTE device.
    This allows you to emulate `User Equipment`. That means a "mobile handset"/phone or other some other LTE device.

    This means you'll need 2 computers, 2 SDRs, and 2 installs of `srslte`. One setup running the eNB (and probably also the EPC) and one running the UE.

    @@ -313,3 +313,33 @@ Some advantages of using the UE:

    I don't really care about running the UE right now.



    ## BSoM connecting...

    ```
    Built in Release mode using commit d045213f on branch master.
    17:17:34.577122 [PHY0] [I] [ 0] Component Carrier Worker 0 configured cell 50 PRB
    17:17:34.577321 [PHY0] [I] [ 0] Worker 0 configured cell 50 PRB
    17:17:34.814501 [PHY1] [I] [ 0] Component Carrier Worker 0 configured cell 50 PRB
    17:17:34.814637 [PHY1] [I] [ 0] Worker 0 configured cell 50 PRB
    17:17:35.052768 [PHY2] [I] [ 0] Component Carrier Worker 0 configured cell 50 PRB
    17:17:35.052891 [PHY2] [I] [ 0] Worker 0 configured cell 50 PRB
    17:17:35.062798 [RRC ] [I] SIB payload - Tx systemInformationBlockType1 (15 B)
    17:17:35.062825 [RRC ] [I] SIB payload - Tx systemInformation (27 B)
    17:17:35.062833 [RRC ] [I] Allocating 2 PRBs for PUCCH
    17:17:35.062856 [S1AP] [I] Proc "MME Connection" - Starting new MME connection.
    17:17:35.062859 [S1AP] [I] Connecting to MME 127.0.1.100:36412
    17:17:35.062976 [S1AP] [I] SCTP socket established with MME
    17:17:35.063404 [S1AP] [I] Sending s1SetupRequest to MME
    0000: 00 11 00 2d 00 00 04 00 3b 00 08 00 00 f1 10 00
    0010: 00 19 b0 00 3c 40 0a 03 80 73 72 73 65 6e 62 30
    17:17:35.063449 [S1AP] [I] Proc "MME Connection" - S1SetupRequest sent. Waiting for response...
    17:17:35.066484 [S1AP] [I] Received S1AP PDU
    0000: 20 11 00 25 00 00 03 00 3d 40 0a 03 80 73 72 73
    0010: 6d 6d 65 30 31 00 69 00 0b 00 00 00 f1 10 00 00
    17:17:35.066544 [S1AP] [I] Received S1SetupResponse
    17:17:35.066578 [S1AP] [I] Proc "MME Connection" - S1Setup procedure completed successfully
    17:17:35.086144 [PHY0] [I] [ 0] Starting RX/TX thread nof_prb=50, sf_len=11520
    Closing log
    ```
  26. @JamesHagerman JamesHagerman revised this gist Feb 15, 2020. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion stslte-notes.md
    Original file line number Diff line number Diff line change
    @@ -35,7 +35,7 @@ The Mini has 2x RF switches that allow the 2x SMA connectors to be routed to one
    - RX1_H = LNAH (2GHz - 3.5GHz); RX1_W = LNAW (10MHz - 2GHz)

    ```
    device_args = rxant=LNAH,txant=BAND2
    device_args = rxant=LNAH,txant=BAND1
    ```


  27. @JamesHagerman JamesHagerman revised this gist Feb 15, 2020. No changes.
  28. @JamesHagerman JamesHagerman revised this gist Feb 15, 2020. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions stslte-notes.md
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    # My srsLTE notes
    # srsLTE notes

    My trying to get `srslte` up and running. This is messy, sorry...
    These are notes I've taken while rying to get `srslte` up and running. This is messy, sorry...

    ## SDR configuration stuff

  29. @JamesHagerman JamesHagerman revised this gist Feb 15, 2020. 1 changed file with 2 additions and 3 deletions.
    5 changes: 2 additions & 3 deletions stslte-notes.md
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,6 @@
    # `srslte` notes

    These are my notes about getting `srslte` up and running.
    # My srsLTE notes

    My trying to get `srslte` up and running. This is messy, sorry...

    ## SDR configuration stuff

  30. @JamesHagerman JamesHagerman revised this gist Feb 15, 2020. 1 changed file with 0 additions and 441 deletions.
    441 changes: 0 additions & 441 deletions stslte-notes.md
    Original file line number Diff line number Diff line change
    @@ -314,444 +314,3 @@ Some advantages of using the UE:

    I don't really care about running the UE right now.


    ## Trying to connect a Particle Boron LTE to `srslte`

    The following is a partial log from the USB serial port on the Boron after I've compiled a monolithic firmware image using `DEBUG_BUILD=y` from `deivce-os/main`. The user app picks the external SIM and attempts to register on the network with the `srslte` APN I set up in the `enb.conf`. Clearly, I put my custom SIM in the external SIM slot on the Boron before I started.

    I'll try to comment the AT commands as they go

    This queries the Ublox modem for the state of it's GPIO pins:
    ```
    2019-06-06 20:29:16 -0700 0000006756 [ncp.at] TRACE: > AT+UGPIOC?
    2019-06-06 20:29:16 -0700 0000006761 [ncp.at] TRACE: < +UGPIOC:
    2019-06-06 20:29:16 -0700 0000006762 [ncp.at] TRACE: < 16,255
    2019-06-06 20:29:16 -0700 0000006763 [ncp.at] TRACE: < 19,255
    2019-06-06 20:29:16 -0700 0000006764 [ncp.at] TRACE: < 23,0
    2019-06-06 20:29:16 -0700 0000006765 [ncp.at] TRACE: < 24,255
    2019-06-06 20:29:16 -0700 0000006766 [ncp.at] TRACE: < 25,255
    2019-06-06 20:29:16 -0700 0000006767 [ncp.at] TRACE: < 42,255
    2019-06-06 20:29:16 -0700 0000006768 [ncp.at] TRACE: < OK
    ```

    This reads the state of one of the gpio pins
    ```
    2019-06-06 20:29:16 -0700 0000006769 [ncp.at] TRACE: > AT+UGPIOR=23
    2019-06-06 20:29:16 -0700 0000006775 [ncp.at] TRACE: < +UGPIOR: 23,0
    2019-06-06 20:29:16 -0700 0000006776 [ncp.at] TRACE: < OK
    ```

    This checks to see if the SIM needs a PIN or not. `READY` means no.
    ```
    2019-06-06 20:29:16 -0700 0000006778 [ncp.at] TRACE: > AT+CPIN?
    2019-06-06 20:29:16 -0700 0000006783 [ncp.at] TRACE: < +CPIN: READY
    2019-06-06 20:29:16 -0700 0000006784 [ncp.at] TRACE: < OK
    ```

    This fetches the ICCID from the SIM:
    ```
    2019-06-06 20:29:16 -0700 0000006785 [ncp.at] TRACE: > AT+CCID
    2019-06-06 20:29:16 -0700 0000006790 [ncp.at] TRACE: < +CCID: 17911982291800000719
    2019-06-06 20:29:16 -0700 0000006792 [ncp.at] TRACE: < OK
    ```

    This detacthes the device from the netwrok (It will camp on any suitable cell at boot apparently)
    ```
    2019-06-06 20:29:16 -0700 0000006793 [ncp.at] TRACE: > AT+COPS=2,2
    2019-06-06 20:29:16 -0700 0000006804 [ncp.at] TRACE: < OK
    ```

    This selects which network to register with. 3,2 means "set only numeric <oper>" but the oper is blank so I don't get it.

    ```
    2019-06-06 20:29:16 -0700 0000006805 [ncp.at] TRACE: > AT+COPS=3,2
    2019-06-06 20:29:16 -0700 0000006810 [ncp.at] TRACE: < OK
    ```

    This queries the protocol stack for the radio access technology. 7 means `LTE Cat.M1`. I'm not sure if this depends on the SIM or the Ublox module model number/support.

    ```
    2019-06-06 20:29:16 -0700 0000006811 [ncp.at] TRACE: > AT+URAT?
    2019-06-06 20:29:16 -0700 0000006815 [ncp.at] TRACE: < +URAT: 7
    2019-06-06 20:29:16 -0700 0000006816 [ncp.at] TRACE: < OK
    ```

    This checks the state of eDRX (extended discontinuous reception):
    ```
    2019-06-06 20:29:16 -0700 0000006817 [ncp.at] TRACE: > AT+CEDRXS?
    2019-06-06 20:29:16 -0700 0000006822 [ncp.at] TRACE: < +CEDRXS:
    2019-06-06 20:29:16 -0700 0000006823 [ncp.at] TRACE: < OK
    ```


    This disables the power save mode:
    ```
    2019-06-06 20:29:16 -0700 0000006824 [ncp.at] TRACE: > AT+CPSMS=0
    2019-06-06 20:29:16 -0700 0000006836 [ncp.at] TRACE: < OK
    ```

    This enables the multiplexing protocol control channel defined in `3GPP TS 27.010`. `0,0,,1509,,,,,` means basic option mode, UIH frames used only, undefined transmissionrate, max framesize set to 1509.

    ```
    2019-06-06 20:29:16 -0700 0000006837 [ncp.at] TRACE: > AT+CMUX=0,0,,1509,,,,,
    2019-06-06 20:29:16 -0700 0000006845 [ncp.at] TRACE: < OK
    ```

    This isn't AT stuff, but it is the system moving to a GSM07.01 mulitplexed serial port.
    ```
    2019-06-06 20:29:16 -0700 0000006846 [gsm0710muxer] INFO: Starting GSM07.10 muxer
    2019-06-06 20:29:16 -0700 0000006847 [gsm0710muxer] INFO: Openning mux channel 0
    2019-06-06 20:29:16 -0700 0000006848 [gsm0710muxer] INFO: GSM07.10 muxer thread started
    2019-06-06 20:29:16 -0700 0000006850 [system.nm] TRACE: br_enabled=0, br_permitted=0
    2019-06-06 20:29:16 -0700 0000006852 [system.nm] TRACE: br_enabled=0, br_permitted=0
    2019-06-06 20:29:16 -0700 0000006853 [system.nm] TRACE: br_enabled=0, br_permitted=0
    2019-06-06 20:29:16 -0700 0000006900 [gsm0710muxer] INFO: Resuming channel 0
    2019-06-06 20:29:16 -0700 0000006902 [gsm0710muxer] INFO: Openning mux channel 1
    2019-06-06 20:29:16 -0700 0000007002 [gsm0710muxer] INFO: Resuming channel 1
    2019-06-06 20:29:16 -0700 0000007003 [gsm0710muxer] INFO: Resuming channel 1
    ```

    This is the Boron resuming it's chat with the modem in multiplexed mode and moving on...
    ```
    2019-06-06 20:29:16 -0700 0000007005 [ncp.at] TRACE: > AT
    2019-06-06 20:29:16 -0700 0000007057 [ncp.at] TRACE: < OK
    2019-06-06 20:29:16 -0700 0000007057 [hal] TRACE: NCP state changed: 1
    2019-06-06 20:29:16 -0700 0000007059 [net.pppncp] TRACE: NCP event 1
    2019-06-06 20:29:16 -0700 0000007060 [hal] TRACE: Muxer AT channel live
    2019-06-06 20:29:16 -0700 0000007062 [hal] TRACE: PPP thread event LOWER_DOWN
    2019-06-06 20:29:16 -0700 0000007064 [hal] TRACE: PPP thread event ADM_DOWN
    2019-06-06 20:29:16 -0700 0000007066 [hal] TRACE: PPP thread event ADM_UP
    2019-06-06 20:29:16 -0700 0000007068 [hal] TRACE: State NONE -> READY
    ```

    Set up the basic "Packet switched Data Protocl" parameters `PDP`. `IP` means use ipv4. `srsapn` is the APN I set in the user application! So at least that's working!

    ```
    2019-06-06 20:29:16 -0700 0000007066 [ncp.at] TRACE: > AT+CGDCONT=1,"IP","srsapn"
    2019-06-06 20:29:16 -0700 0000007106 [ncp.at] TRACE: < OK
    ```

    This configures the "Evolved Packet Core" (EPC) network registration for the Boron. 2 means ` network registration and location information`, which I'm not sure about.

    ```
    2019-06-06 20:29:16 -0700 0000007108 [ncp.at] TRACE: > AT+CEREG=2
    2019-06-06 20:29:17 -0700 0000007156 [ncp.at] TRACE: < OK
    ```

    meh?
    ```
    2019-06-06 20:29:17 -0700 0000007157 [hal] TRACE: NCP connection state changed: 1
    2019-06-06 20:29:17 -0700 0000007158 [net.pppncp] TRACE: NCP event 2
    2019-06-06 20:29:17 -0700 0000007159 [net.pppncp] TRACE: State changed event: 1
    2019-06-06 20:29:17 -0700 0000007161 [hal] TRACE: PPP thread event LOWER_DOWN
    ```

    Now we're back to this `AT+COPS` command, but with different values!

    This forces an attempt to select and register with the LTE network operator. `0,2` means use "automatic network selection" using the "numeric" format. I don't know what numeric format.

    ```
    2019-06-06 20:29:17 -0700 0000007162 [ncp.at] TRACE: > AT+COPS=0,2
    2019-06-06 20:29:17 -0700 0000007206 [ncp.at] TRACE: < OK
    ```

    This returns the network registration status. `2` followed by `2,2` seems to mean `not registered, but the MT is currently trying to attach or searching an operator to register to`.

    ```
    2019-06-06 20:29:17 -0700 0000007207 [ncp.at] TRACE: > AT+CEREG?
    2019-06-06 20:29:17 -0700 0000007209 [ncp.at] TRACE: < +CEREG: 2
    2019-06-06 20:29:17 -0700 0000007256 [ncp.at] TRACE: < +CEREG: 2,2
    2019-06-06 20:29:17 -0700 0000007258 [ncp.at] TRACE: < OK
    ```

    This likely means the Boron isn't able to connect to `srslte` without more work... Or my `srslte` configs are bad.

    Here's a chopped down version of what the `epc.log` dumps over the same time:

    ```
    Built in Release mode using commit 5343b33f on branch master.
    --- Software Radio Systems EPC log ---
    20:29:02.629456 [HSS ] [I] Opened DB file: user_db.csv
    20:29:02.629651 [HSS ] [D] Added user from DB, IMSI: 001010000000001
    20:29:02.629676 [HSS ] [D] User Key :
    0000: 12 34 12 34 12 34 12 34 12 34 12 34 12 34 12 34
    20:29:02.629708 [HSS ] [D] User OP :
    0000: 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11
    20:29:02.629724 [HSS ] [D] User OPc :
    0000: 75 a8 8d 37 e6 7c ff fc f7 83 e0 82 1e c0 95 26
    20:29:02.629783 [HSS ] [D] AMF :
    0000: 90 01
    20:29:02.629808 [HSS ] [D] SQN :
    0000: 00 00 00 00 12 34
    20:29:02.629824 [HSS ] [D] Default Bearer QCI: 7
    20:29:02.629866 [HSS ] [I] HSS Initialized. DB file user_db.csv, MCC: 61441, MNC: 65281
    20:29:02.673925 [S1AP] [I] S1-MME Initializing
    20:29:02.674039 [S1AP] [I] S1AP Initialized
    20:29:02.674047 [MME GTPC] [I] Initializing MME S11 interface.
    20:29:02.674057 [MME GTPC] [I] MME S11 Initialized
    20:29:02.674068 [MME GTPC] [I] MME GTP-C Initialized
    20:29:02.674074 [S1AP] [I] MME Initialized. MCC: 0xf001, MNC: 0xff01
    20:29:02.674089 [GTPU] [I] TUN file descriptor = 7
    20:29:02.675943 [GTPU] [I] Initialized SGi interface
    20:29:02.675971 [GTPU] [I] S1-U socket = 8
    20:29:02.675988 [GTPU] [I] S1-U IP = 127.0.1.100, Port = 2152
    20:29:02.675995 [GTPU] [I] Initialized S1-U interface
    20:29:02.676001 [GTPU] [I] SPGW GTP-U Initialized.
    20:29:02.676015 [SPGW GTPC] [I] Initializing SPGW S11 interface.
    20:29:02.676031 [SPGW GTPC] [D] SPGW: init_ue_ip ue ip addr 172.16.0.2 is added to pool
    [...]
    20:29:02.677651 [SPGW GTPC] [I] SPGW S11 Initialized.
    20:29:02.677661 [SPGW] [I] SP-GW Initialized.
    20:29:02.677752 [S1AP] [D] Waiting for S1-MME or S11 Message
    20:29:02.677776 [SPGW] [D] Message received at SPGW: SGi Message
    20:29:02.677806 [GTPU] [D] Received SGi PDU. Bytes 48
    20:29:02.677817 [GTPU] [W] IPv6 not supported yet.
    20:29:04.680621 [SPGW] [D] Message received at SPGW: SG
    <WHAT THE HECK? The Logs can't keep up apparently. This makes stuff more difficult to test...>
    i Message
    20:29:04.680649 [GTPU] [D] Received SGi PDU. Bytes 200
    20:29:04.680695 [GTPU] [D] SGi PDU -- IP version 4, Total length 200
    20:29:04.680706 [GTPU] [D] SGi PDU -- IP src addr 172.16.0.1
    20:29:04.680713 [GTPU] [D] SGi PDU -- IP dst addr 239.255.255.250
    20:29:04.680719 [GTPU] [D] Packet for unknown UE.
    20:29:05.149786 [S1AP] [I] Received S1AP msg. Size: 49
    20:29:05.149841 [S1AP] [I] Received initiating PDU
    20:29:05.149863 [S1AP] [I] Received S1 Setup Request.
    20:29:05.149891 [S1AP] [I] S1 Setup Request - eNB Name: srsenb01, eNB id: 0x19b
    20:29:05.149899 [S1AP] [I] S1 Setup Request - MCC:001, MNC:01, PLMN: 61712
    20:29:05.149908 [S1AP] [I] S1 Setup Request - TAC 7, B-PLMN 0
    20:29:05.149920 [S1AP] [I] Adding new eNB context. eNB ID 411
    20:29:05.150483 [S1AP] [I] Sending S1 Setup Response
    20:29:05.150532 [S1AP] [D] Waiting for S1-MME or S11 Message
    20:29:05.681762 [SPGW] [D] Message received at SPGW: SGi Message
    20:29:05.681796 [GTPU] [D] Received SGi PDU. Bytes 200
    20:29:05.681801 [GTPU] [D] SGi PDU -- IP version 4, Total length 200
    20:29:05.681813 [GTPU] [D] SGi PDU -- IP src addr 172.16.0.1
    20:29:05.681817 [GTPU] [D] SGi PDU -- IP dst addr 239.255.255.250
    20:29:05.681820 [GTPU] [D] Packet for unknown UE.
    20:29:06.681959 [SPGW] [D] Message received at SPGW: SGi Message
    20:29:06.681985 [GTPU] [D] Received SGi PDU. Bytes 200
    20:29:06.681989 [GTPU] [D] SGi PDU -- IP version 4, Total length 200
    20:29:06.681993 [GTPU] [D] SGi PDU -- IP src addr 172.16.0.1
    20:29:06.681997 [GTPU] [D] SGi PDU -- IP dst addr 239.255.255.250
    20:29:06.682001 [GTPU] [D] Packet for unknown UE.
    20:29:06.982927 [SPGW] [D] Message received at SPGW: SGi Message
    20:29:06.982997 [GTPU] [D] Received SGi PDU. Bytes 48
    20:29:06.983011 [GTPU] [W] IPv6 not supported yet.
    20:29:07.680842 [SPGW] [D] Message received at SPGW: SGi Message
    20:29:07.680868 [GTPU] [D] Received SGi PDU. Bytes 68
    20:29:07.680872 [GTPU] [D] SGi PDU -- IP version 4, Total length 68
    20:29:07.680876 [GTPU] [D] SGi PDU -- IP src addr 172.16.0.1
    20:29:07.680878 [GTPU] [D] SGi PDU -- IP dst addr 224.0.0.251
    20:29:07.680881 [GTPU] [D] Packet for unknown UE.
    20:29:07.680885 [SPGW] [D] Message received at SPGW: SGi Message
    20:29:07.680889 [GTPU] [D] Received SGi PDU. Bytes 68
    20:29:07.680891 [GTPU] [D] SGi PDU -- IP version 4, Total length 68
    20:29:07.680904 [GTPU] [D] SGi PDU -- IP src addr 172.16.0.1
    20:29:07.680908 [GTPU] [D] SGi PDU -- IP dst addr 224.0.0.251
    20:29:07.680911 [GTPU] [D] Packet for unknown UE.
    20:29:07.682315 [SPGW] [D] Message received at SPGW: SGi Message
    20:29:07.682335 [GTPU] [D] Received SGi PDU. Bytes 200
    20:29:07.682340 [GTPU] [D] SGi PDU -- IP version 4, Total length 200
    20:29:07.682344 [GTPU] [D] SGi PDU -- IP src addr 172.16.0.1
    20:29:07.682348 [GTPU] [D] SGi PDU -- IP dst addr 239.255.255.250
    20:29:07.682352 [GTPU] [D] Packet for unknown UE.
    20:29:07.690840 [SPGW] [D] Message received at SPGW: SGi Message
    20:29:07.690875 [GTPU] [D] Received SGi PDU. Bytes 40
    20:29:07.690882 [GTPU] [D] SGi PDU -- IP version 4, Total length 40
    20:29:07.690891 [GTPU] [D] SGi PDU -- IP src addr 172.16.0.1
    20:29:07.690897 [GTPU] [D] SGi PDU -- IP dst addr 224.0.0.22
    20:29:07.690903 [GTPU] [D] Packet for unknown UE.
    20:29:08.230882 [SPGW] [D] Message received at SPGW: SGi Message
    20:29:08.230939 [GTPU] [D] Received SGi PDU. Bytes 40
    20:29:08.230966 [GTPU] [D] SGi PDU -- IP version 4, Total length 40
    20:29:08.230991 [GTPU] [D] SGi PDU -- IP src addr 172.16.0.1
    20:29:08.231009 [GTPU] [D] SGi PDU -- IP dst addr 224.0.0.22
    20:29:08.231023 [GTPU] [D] Packet for unknown UE.
    20:29:08.681015 [SPGW] [D] Message received at SPGW: SGi Message
    20:29:08.681042 [GTPU] [D] Received SGi PDU. Bytes 68
    20:29:08.681049 [GTPU] [D] SGi PDU -- IP version 4, Total length 68
    20:29:08.681056 [GTPU] [D] SGi PDU -- IP src addr 172.16.0.1
    20:29:08.681062 [GTPU] [D] SGi PDU -- IP dst addr 224.0.0.251
    20:29:08.681067 [GTPU] [D] Packet for unknown UE.
    20:29:08.681074 [SPGW] [D] Message received at SPGW: SGi Message
    20:29:08.681081 [GTPU] [D] Received SGi PDU. Bytes 68
    20:29:08.681086 [GTPU] [D] SGi PDU -- IP versio
    <Again, log delay. I'm hitting enter here after it pauses mid line... it catches up later on sometimes.>
    n 4, Total length 68
    20:29:08.681092 [GTPU] [D] SGi PDU -- IP src addr 172.16.0.1
    20:29:08.681128 [GTPU] [D] SGi PDU -- IP dst addr 224.0.0.251
    20:29:08.681134 [GTPU] [D] Packet for unknown UE.
    20:29:10.681786 [SPGW] [D] Message received at SPGW: SGi Message
    20:29:10.681849 [GTPU] [D] Received SGi PDU. Bytes 68
    20:29:10.681881 [GTPU] [D] SGi PDU -- IP version 4, Total length 68
    20:29:10.681905 [GTPU] [D] SGi PDU -- IP src addr 172.16.0.1
    20:29:10.681926 [GTPU] [D] SGi PDU -- IP dst addr 224.0.0.251
    20:29:10.681944 [GTPU] [D] Packet for unknown UE.
    20:29:10.681970 [SPGW] [D] Message received at SPGW: SGi Message
    20:29:10.681989 [GTPU] [D] Received SGi PDU. Bytes 68
    20:29:10.682003 [GTPU] [D] SGi PDU -- IP version 4, Total length 68
    20:29:10.682017 [GTPU] [D] SGi PDU -- IP src addr 172.16.0.1
    20:29:10.682039 [GTPU] [D] SGi PDU -- IP dst addr 224.0.0.251
    20:29:10.682055 [GTPU] [D] Packet for unknown UE.
    20:29:15.686911 [SPGW] [D] Message received at SPGW: SGi Message
    20:29:15.686944 [GTPU] [D] Received SGi PDU. Bytes 48
    20:29:15.686947 [GTPU] [W] IPv6 not supported yet.
    20:29:34.886838 [SPGW] [D] Message received at SPGW: SGi Message
    20:29:34.886868 [GTPU] [D] Received SGi PDU. Bytes 48
    20:29:34.886873 [GTPU] [W] IPv6 not supported yet.
    20:30:09.702859 [SPGW] [D] Message received at SPGW: SGi Message
    20:30:09.702886 [GTPU] [D] Received SGi PDU. Bytes 48
    20:30:09.702890 [GTPU] [W] IPv6 not supported yet.
    20:30:35.717766 [S1AP] [I] Deleting eNB context. eNB Id: 0x19b
    20:30:35.762933 [HSS ] [I] Opened DB file: user_db.csv
    20:30:35.763037 [HSS ] [I] Deleting UE context in HSS. IMSI: 001010000000001
    Closing log
    ```



    ### Figuring out supported bands on the Boron LTE

    I used this user app to send the `AT+UBANDMASK?` command to the LTE modem on the Boron:

    ```
    #include "application.h"
    void setup();
    void loop();
    int callbackRAT(int type, const char* buf, int len, char* paramsToBeUpdated);
    SYSTEM_MODE(SEMI_AUTOMATIC);
    SerialLogHandler g_logSerial(LOG_LEVEL_ALL);
    void setup() {
    Serial.begin(9600);
    Cellular.on();
    // Cellular.setActiveSim(INTERNAL_SIM);
    Cellular.setActiveSim(EXTERNAL_SIM);
    Cellular.setCredentials("srsapn");
    //Cellular.connect();
    //Particle.connect();
    delay(10000);
    char paramsToBeUpdated[64] = "";
    if (RESP_OK == Cellular.command(callbackRAT, paramsToBeUpdated, 10000, "AT+UBANDMASK?\r\n") ) {
    Serial.printlnf("RAT mask = %s\r\n", paramsToBeUpdated);
    } else {
    Serial.println("AT command borked...\r\n");
    }
    // 2019-06-06 23:55:10 -0700 0000010496 [ncp.at] TRACE: > AT+UBANDMASK?
    // 2019-06-06 23:55:10 -0700 0000010552 [ncp.at] TRACE: < +UBANDMASK: 0,275063445663,1,185538719
    // 2019-06-06 23:55:10 -0700 0000010554 [ncp.at] TRACE: < OK
    // 2019-06-06 23:55:10 -0700 RAT mask = 0,275063445663,1,185538719
    }
    void loop() {
    }
    int callbackRAT(int type, const char* buf, int len, char* paramsToBeUpdated) {
    if ((type == TYPE_PLUS) && paramsToBeUpdated) {
    if (sscanf(buf, "\r\n+UBANDMASK: %[^\r]\r\n", paramsToBeUpdated) == 1)
    /*nothing*/;
    }
    return WAIT;
    }
    ```

    The `RAT mask = 0,275063445663,1,185538719` means the Boron LTE supports:

    * `0`: LTE Cat M1
    * `275063445663`: Cat M1 Bands 1, 2, 3, 4, 5, 8, 12, 13, 17, 18, 19, 20, 25, 26, 28, 39
    * `1`: LTE Cat NB1
    * `185538719`: Cat NB1 Bands 1, 2, 3, 4, 5, 8, 12, 13, 17, 18, 19, 20, 25, 26, 28 (not 39)

    So, we should be able to pick a band for `srslte` with that info!

    We can also use the `AT+UCGED?` command to learn more about the `EARFCN` the device is trying to use and tailor `srslte` to that!

    To do this with any luck, we should probably use the internal SIM and actually register to a cell first. Here's the updated code. I'll toggle back to external sim after I get valid EARFCN data.

    ```
    #include "application.h"
    void setup();
    void loop();
    int callbackRAT(int type, const char* buf, int len, char* UBANDMASK);
    int callbackUCGED(int type, const char* buf, int len, char* paramsToBeUpdated);
    SYSTEM_MODE(SEMI_AUTOMATIC);
    SerialLogHandler g_logSerial(LOG_LEVEL_ALL);
    void setup() {
    Serial.begin(9600);
    Cellular.on();
    Cellular.setActiveSim(INTERNAL_SIM);
    Cellular.clearCredentials();
    // Cellular.setActiveSim(EXTERNAL_SIM);
    // Cellular.setCredentials("srsapn");
    //Cellular.connect();
    //Particle.connect();
    delay(10000);
    char UBANDMASK[64] = "";
    if (RESP_OK == Cellular.command(callbackRAT, UBANDMASK, 10000, "AT+UBANDMASK?\r\n") ) {
    Serial.printlnf("RAT mask = %s\r\n", UBANDMASK);
    } else {
    Serial.println("AT+UBANDMASK command borked...\r\n");
    }
    // 2019-06-06 23:55:10 -0700 0000010496 [ncp.at] TRACE: > AT+UBANDMASK?
    // 2019-06-06 23:55:10 -0700 0000010552 [ncp.at] TRACE: < +UBANDMASK: 0,275063445663,1,185538719
    // 2019-06-06 23:55:10 -0700 0000010554 [ncp.at] TRACE: < OK
    // 2019-06-06 23:55:10 -0700 RAT mask = 0,275063445663,1,185538719
    // This means the Boron LTE supports:
    // 0: LTE Cat M1
    // 275063445663:
    // 1: LTE Cat NB1
    // 185538719:
    char paramsToBeUpdated[64] = "";
    if (RESP_OK == Cellular.command(callbackUCGED, paramsToBeUpdated, 10000, "AT+UCGED=?\r\n") ) {
    Serial.printlnf("UCGED response = %s\r\n", paramsToBeUpdated);
    } else {
    Serial.println("AT+UCGED command borked...\r\n");
    }
    // 2019-06-07 00:08:57 -0700 0000010404 [ncp.at] TRACE: > AT+UCGED=?
    // 2019-06-07 00:08:57 -0700 0000010449 [ncp.at] TRACE: < +UCGED: (0,5)
    // 2019-06-07 00:08:57 -0700 0000010451 [ncp.at] TRACE: < OK
    // 2019-06-07 00:08:57 -0700 UCGED response = (0,5)
    }
    void loop() {
    }
    int callbackRAT(int type, const char* buf, int len, char* UBANDMASK) {
    if ((type == TYPE_PLUS) && UBANDMASK) {
    if (sscanf(buf, "\r\n+UBANDMASK: %[^\r]\r\n", UBANDMASK) == 1)
    /*nothing*/;
    }
    return WAIT;
    }
    int callbackUCGED(int type, const char* buf, int len, char* paramsToBeUpdated) {
    if ((type == TYPE_PLUS) && paramsToBeUpdated) {
    if (sscanf(buf, "\r\n+UCGED: %[^\r]\r\n", paramsToBeUpdated) == 1)
    /*nothing*/;
    }
    return WAIT;
    }
    ```