This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Connecting the nRF9160DK to the nRF52833 over Bluetooth

Hi,

I would like to set up a couple of boards communicating over Bluetooth; I was hoping someone could provide some pointers.

I would like to connect the nRF9160DK to the nRF52833DK. 

I have programmed the nRF52 on the nRF9160DK with the HCI UART code and the nRF9160 with the LTE_BLE_Gateway code. 

Is this correct?

What should I program the nRF52833 with?

Thanks,

Rod

Parents
  • Hello Rod, 

    The LTE_BLE_Gateway sample, or LTE Sensor Gateway sample, is designed to be used with the Thingy:52. It will look for Thingy (name or service UUID) and expect to find Thingy services. Your best chance is to configure the LTE Sensor Gateway sample to connect with e.g. Bluetooth Peripheral LBS

    Kind regards,
    Øyvind

  • Hi Øyvind,

    Thank you for your reply. So, just to clarify.

    1. The LTE_BLE_Gateway code is designed to run with the Thingy52 (or '91 I assume) only

    2. If I want want to connect the nRF9160DK to the nRF5233DK I should use the BT Peripheral LBS code. Do I use that on both systems? i.e on both the nRF9160DK and the nRF5233DK

    I'm having problems building the LTE_BLE_Gateway code for the nRF9160DK; please could you send me the merged.hex file for this board? I will try and get a Thingy52 to test.

    Thanks,
    Rod

  • RodWatt said:
    1. The LTE_BLE_Gateway code is designed to run with the Thingy52 (or '91 I assume) only

     Thingy:52 only, as the Thingy:91 is LTE (reference design) similar to the nRF9160DK.

     

    RodWatt said:
    2. If I want want to connect the nRF9160DK to the nRF5233DK I should use the BT Peripheral LBS code. Do I use that on both systems? i.e on both the nRF9160DK and the nRF5233DK

     No, you have to keep the LTE_BLE_Gateway, however, you will need to modify it to connect with your application on the nRF52833DK. This application can be based on e.g. the BT Peripheral LBS sample. This way the 833 will send something to the nRF9160DK, where the nRF52840 Board controller running bluetooth-hci-uart sample will send this via UART to the application LTE Sensor Gateway sample running on the nRF9160. 

     

    RodWatt said:
    I'm having problems building the LTE_BLE_Gateway code for the nRF9160DK;

     Can you please explain what the problem is? What version of NCS are you running?

    Kind regards,
    Øyvind

  • Hi Øyvind,

    Not sure what version of NCS I'm using. This is what Im seeing..

    Watts-MacBook-Pro-2:lte_ble_gateway Watt$ west build -b nrf9160dk_nrf9160ns
    -- west build: generating a build system
    Including boilerplate (Zephyr base (cached)): /Users/Watt/zephyrproject/zephyr/cmake/app/boilerplate.cmake
    -- Application: /Users/Watt/Documents/Switch_That/ZEPHYR_Code/nRF9160DK/lte_ble_gateway
    -- Zephyr version: 2.3.0-rc2 (/Users/Watt/zephyrproject/zephyr)
    -- Board: nrf9160dk_nrf9160ns
    -- Found west: /Library/Frameworks/Python.framework/Versions/3.8/bin/west (found suitable version "0.7.2", minimum required is "0.7.1")
    -- Found dtc: /usr/local/bin/dtc (found suitable version "1.6.0", minimum required is "1.4.6")
    -- Found toolchain: gnuarmemb (/Users/Watt/gnuarmemb)
    -- Found BOARD.dts: /Users/Watt/zephyrproject/zephyr/boards/arm/nrf9160dk_nrf9160/nrf9160dk_nrf9160ns.dts
    nrf9160dk_nrf9160ns.dts.pre.tmp:92.42-104.3: Warning (unique_unit_address_if_enabled): /soc/peripheral@40000000/flash-controller@39000: duplicate unit-address (also used in node /soc/peripheral@40000000/kmu@39000)
    nrf9160dk_nrf9160ns.dts.pre.tmp:341.19-347.3: Warning (unique_unit_address_if_enabled): /soc/peripheral@40000000/clock@5000: duplicate unit-address (also used in node /soc/peripheral@40000000/power@5000)
    -- Generated zephyr.dts: /Users/Watt/Documents/Switch_That/ZEPHYR_Code/nRF9160DK/lte_ble_gateway/build/zephyr/zephyr.dts
    -- Generated devicetree_unfixed.h: /Users/Watt/Documents/Switch_That/ZEPHYR_Code/nRF9160DK/lte_ble_gateway/build/zephyr/include/generated/devicetree_unfixed.h
    Parsing /Users/Watt/Documents/Switch_That/ZEPHYR_Code/nRF9160DK/lte_ble_gateway/Kconfig
    Loaded configuration '/Users/Watt/zephyrproject/zephyr/boards/arm/nrf9160dk_nrf9160/nrf9160dk_nrf9160ns_defconfig'
    Merged configuration 'prj.conf'
    
    prj.conf:18: warning: attempt to assign the value 'y' to the undefined symbol LTE_LINK_CONTROL
    
    prj.conf:19: warning: attempt to assign the value 'n' to the undefined symbol LTE_AUTO_INIT_AND_CONNECT
    
    prj.conf:22: warning: attempt to assign the value 'y' to the undefined symbol AT_HOST_LIBRARY
    
    prj.conf:25: warning: attempt to assign the value 'y' to the undefined symbol BSD_LIBRARY
    
    prj.conf:28: warning: attempt to assign the value 'n' to the undefined symbol BSD_LIBRARY_TRACE_ENABLED
    
    prj.conf:31: warning: attempt to assign the value 'y' to the undefined symbol NRF_CLOUD
    
    prj.conf:45: warning: attempt to assign the value 'y' to the undefined symbol DK_LIBRARY
    
    prj.conf:46: warning: attempt to assign the value 'n' to the undefined symbol DK_LIBRARY_INVERT_LEDS
    
    prj.conf:58: warning: attempt to assign the value 'y' to the undefined symbol BT_GATT_DM
    
    prj.conf:59: warning: attempt to assign the value 'y' to the undefined symbol BT_SCAN
    
    prj.conf:60: warning: attempt to assign the value 'y' to the undefined symbol BT_SCAN_FILTER_ENABLE
    
    prj.conf:61: warning: attempt to assign the value '1' to the undefined symbol BT_SCAN_UUID_CNT
    
    error: Aborting due to Kconfig warnings
    
    CMake Error at /Users/Watt/zephyrproject/zephyr/cmake/kconfig.cmake:217 (message):
      command failed with return code: 1
    Call Stack (most recent call first):
      /Users/Watt/zephyrproject/zephyr/cmake/app/boilerplate.cmake:510 (include)
      /Users/Watt/zephyrproject/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:24 (include)
      /Users/Watt/zephyrproject/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:40 (include_boilerplate)
      CMakeLists.txt:20 (find_package)
    
    
    -- Configuring incomplete, errors occurred!
    FATAL ERROR: command exited with status 1: /usr/local/bin/cmake -B/Users/Watt/Documents/Switch_That/ZEPHYR_Code/nRF9160DK/lte_ble_gateway/build -S/Users/Watt/Documents/Switch_That/ZEPHYR_Code/nRF9160DK/lte_ble_gateway -GNinja

  • sorry, forgot to add. I tried updating NCS, but see this

    Watts-MacBook-Pro-2:nrf Watt$ pwd
    /Users/Watt/zephyrproject/ncs/nrf
    Watts-MacBook-Pro-2:nrf Watt$ git checkout master
    fatal: not a git repository (or any of the parent directories): .git
    Watts-MacBook-Pro-2:nrf Watt$ 
    
     

Reply Children
  • Watts-MacBook-Pro-2:nrf Watt$ west init -m https://github.com/nrfconnect/sdk-nrf --mr v1.3.0
    FATAL ERROR: already initialized in /Users/Watt/zephyrproject, aborting.
    Note:
        In your environment, ZEPHYR_BASE is set to:
        /Users/Watt/zephyrproject/zephyr
    
        This forces west to search for a workspace there.
        Try unsetting ZEPHYR_BASE and re-running this command.
    

  • Looks like there is some confusion ongoing. What is /Users/Watt/zephyrproject/? In your environment, ZEPHYR_BASE is set to: /Users/Watt/zephyrproject/zephyr

    Have you tried to initialize NCS inside of a zephyr repo? As the output from your previous comment:

    Watts-MacBook-Pro-2:nrf Watt$ pwd
    /Users/Watt/zephyrproject/ncs/nrf

    NCS is initialized inside of zephyrproject, and this includes another zephyr folder:
    /Users/Watt/zephyrproject/ncs/zephyr

    Please try to fix this first.

    Kind regards,
    Øyvind

  • Morning Øyvind,

    This is what I have in my /Users/Watt/zephyrproject directory...

                Watts-MacBook-Pro-2:zephyrproject Watt$ pwd

                           /Users/Watt/zephyrproject

                 Watts-MacBook-Pro-2:zephyrproject Watt$ ls

                             bootloader modules ncs tools zephyr

    Yes, my Zephyr base is set to.

    ZEPHYR_BASE=/Users/Watt/zephyrproject/zephyr

    Under ncs, the only directory is nrf. Its empty.

    I agree, it looks like my directory structure is messed up. I have tried to reinstall, please see my last posting, but this has failed.

    Whats the easiest way to reinstall?

  • Good morning Rod, 

    My apologies for the late reply. From your last comment, I agree that something is messed up. 
     

    RodWatt said:
    Whats the easiest way to reinstall?

     Try to add a new folder to /Users/Watt/ e.g. NCS. Follow the instructions given here. Inside of /Users/Watt/NCS run the following command in terminal:

    west init -m https://github.com/nrfconnect/sdk-nrf --mr v1.3.0

    This will clone the manifest repository into NCS. Once complete, run the following commands:

    west update
    
    west zephyr-export

    Lastly, make sure to install dependencies:

    pip3 install -r zephyr/scripts/requirements.txt
    pip3 install -r nrf/scripts/requirements.txt
    pip3 install -r bootloader/mcuboot/scripts/requirements.txt
    

    Let me know how that works for you.

    Kind regards,
    Øyvind

  • Hi Øyvind,

    No problem. I followed your instructions above but still seeing problems.

    atts-MBP-2:lte_ble_gateway Watt$ west build -b nrf9160dk_nrf9160ns
    -- west build: generating a build system
    Including boilerplate (Zephyr base): /Users/Watt/zephyrproject/zephyr/cmake/app/boilerplate.cmake
    -- Application: /Users/Watt/zephyrproject/ncs/nrf/samples/nRF9160/lte_ble_gateway
    -- Zephyr version: 2.3.0-rc2 (/Users/Watt/zephyrproject/zephyr)
    -- Found Python3: /Library/Frameworks/Python.framework/Versions/3.8/bin/python3.8 (found suitable exact version "3.8.1") found components: Interpreter 
    -- Board: nrf9160dk_nrf9160ns
    -- Found west: /Library/Frameworks/Python.framework/Versions/3.8/bin/west (found suitable version "0.7.2", minimum required is "0.7.1")
    -- Found dtc: /usr/local/bin/dtc (found suitable version "1.6.0", minimum required is "1.4.6")
    -- Found toolchain: gnuarmemb (/Users/Watt/gnuarmemb)
    -- Found BOARD.dts: /Users/Watt/zephyrproject/zephyr/boards/arm/nrf9160dk_nrf9160/nrf9160dk_nrf9160ns.dts
    -- Found devicetree overlay: /Users/Watt/zephyrproject/ncs/nrf/samples/nRF9160/lte_ble_gateway/nrf9160dk_nrf9160ns.overlay
    nrf9160dk_nrf9160ns.dts.pre.tmp:92.42-104.3: Warning (unique_unit_address_if_enabled): /soc/peripheral@40000000/flash-controller@39000: duplicate unit-address (also used in node /soc/peripheral@40000000/kmu@39000)
    nrf9160dk_nrf9160ns.dts.pre.tmp:201.18-207.3: Warning (unique_unit_address_if_enabled): /soc/peripheral@40000000/uart@a000: duplicate unit-address (also used in node /soc/peripheral@40000000/i2c@a000)
      also defined at nrf9160dk_nrf9160ns.dts.pre.tmp:498.8-501.3
      also defined at nrf9160dk_nrf9160ns.dts.pre.tmp:605.8-613.3
    nrf9160dk_nrf9160ns.dts.pre.tmp:341.19-347.3: Warning (unique_unit_address_if_enabled): /soc/peripheral@40000000/clock@5000: duplicate unit-address (also used in node /soc/peripheral@40000000/power@5000)
    -- Generated zephyr.dts: /Users/Watt/zephyrproject/ncs/nrf/samples/nRF9160/lte_ble_gateway/build/zephyr/zephyr.dts
    -- Generated devicetree_unfixed.h: /Users/Watt/zephyrproject/ncs/nrf/samples/nRF9160/lte_ble_gateway/build/zephyr/include/generated/devicetree_unfixed.h
    
    /Users/Watt/zephyrproject/ncs/nrf/samples/nRF9160/lte_ble_gateway/prj.conf:18: warning: attempt to assign the value 'y' to the undefined symbol LTE_LINK_CONTROL
    
    /Users/Watt/zephyrproject/ncs/nrf/samples/nRF9160/lte_ble_gateway/prj.conf:19: warning: attempt to assign the value 'n' to the undefined symbol LTE_AUTO_INIT_AND_CONNECT
    
    /Users/Watt/zephyrproject/ncs/nrf/samples/nRF9160/lte_ble_gateway/prj.conf:22: warning: attempt to assign the value 'y' to the undefined symbol AT_HOST_LIBRARY
    
    /Users/Watt/zephyrproject/ncs/nrf/samples/nRF9160/lte_ble_gateway/prj.conf:25: warning: attempt to assign the value 'y' to the undefined symbol BSD_LIBRARY
    
    /Users/Watt/zephyrproject/ncs/nrf/samples/nRF9160/lte_ble_gateway/prj.conf:28: warning: attempt to assign the value 'n' to the undefined symbol BSD_LIBRARY_TRACE_ENABLED
    
    /Users/Watt/zephyrproject/ncs/nrf/samples/nRF9160/lte_ble_gateway/prj.conf:31: warning: attempt to assign the value 'y' to the undefined symbol NRF_CLOUD
    
    /Users/Watt/zephyrproject/ncs/nrf/samples/nRF9Parsing /Users/Watt/zephyrproject/ncs/nrf/samples/nRF9160/lte_ble_gateway/Kconfig
    Loaded configuration '/Users/Watt/zephyrproject/zephyr/boards/arm/nrf9160dk_nrf9160/nrf9160dk_nrf9160ns_defconfig'
    Merged configuration '/Users/Watt/zephyrproject/ncs/nrf/samples/nRF9160/lte_ble_gateway/prj.conf'
    160/lte_ble_gateway/prj.conf:45: warning: attempt to assign the value 'y' to the undefined symbol DK_LIBRARY
    
    /Users/Watt/zephyrproject/ncs/nrf/samples/nRF9160/lte_ble_gateway/prj.conf:46: warning: attempt to assign the value 'n' to the undefined symbol DK_LIBRARY_INVERT_LEDS
    
    /Users/Watt/zephyrproject/ncs/nrf/samples/nRF9160/lte_ble_gateway/prj.conf:58: warning: attempt to assign the value 'y' to the undefined symbol BT_GATT_DM
    
    /Users/Watt/zephyrproject/ncs/nrf/samples/nRF9160/lte_ble_gateway/prj.conf:59: warning: attempt to assign the value 'y' to the undefined symbol BT_SCAN
    
    /Users/Watt/zephyrproject/ncs/nrf/samples/nRF9160/lte_ble_gateway/prj.conf:60: warning: attempt to assign the value 'y' to the undefined symbol BT_SCAN_FILTER_ENABLE
    
    /Users/Watt/zephyrproject/ncs/nrf/samples/nRF9160/lte_ble_gateway/prj.conf:61: warning: attempt to assign the value '1' to the undefined symbol BT_SCAN_UUID_CNT
    
    error: Aborting due to Kconfig warnings
    
    CMake Error at /Users/Watt/zephyrproject/zephyr/cmake/kconfig.cmake:217 (message):
      command failed with return code: 1
    Call Stack (most recent call first):
      /Users/Watt/zephyrproject/zephyr/cmake/app/boilerplate.cmake:510 (include)
      /Users/Watt/zephyrproject/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:24 (include)
      /Users/Watt/zephyrproject/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:35 (include_boilerplate)
      CMakeLists.txt:20 (find_package)
    
    
    -- Configuring incomplete, errors occurred!
    FATAL ERROR: command exited with status 1: /usr/local/bin/cmake -DWEST_PYTHON=/Library/Frameworks/Python.framework/Versions/3.8/bin/python3 -B/Users/Watt/zephyrproject/ncs/nrf/samples/nrf9160/lte_ble_gateway/build -S/Users/Watt/zephyrproject/ncs/nrf/samples/nrf9160/lte_ble_gateway -GNinja -DBOARD=nrf9160dk_nrf9160ns
    Watts-MBP-2:lte_ble_gateway Watt$ 
    

Related