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

  • 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$ 
    

  • Rod, it looks like it's still fetching information from the zehpyrproject folder (Including boilerplate (Zephyr base): /Users/Watt/zephyrproject/zephyr/cmake/app/boilerplate.cmake)

    Have you set zephyr base?

  • Watts-MBP-2:~ Watt$ printenv ZEPHYR_BASE
    /Users/Watt/zephyrproject/zephyr
    

    Where should I be pointing?

Reply Children
  • It should be pointing to the Zephyr folder inside of the NCS folder that you initiated. e.g. /Users/Watt/NCS/zephyr

  • I have created 

    /Users/Watt/zephyrproject

    in here I have

         bootloader 

         modules

          ncs

         tools

         zephyr

    I have set up ZEPHYR_BASE as follows

    ZEPHYR_BASE=/Users/Watt/zephyrproject/ncs/zephyr

    then when I try to build

    Watts-MBP-2:lte_ble_gateway Watt$ west build -b nrf9160dk_nrf9160ns
    -- west build: generating a build system
    Including boilerplate (Zephyr base (cached)): /Users/Watt/zephyrproject/ncs/zephyr/cmake/app/boilerplate.cmake
    -- Application: /Users/Watt/Documents/Switch_That/ZEPHYR_Code/nRF9160DK/lte_ble_gateway
    -- Zephyr version: 2.3.99 (/Users/Watt/zephyrproject/ncs/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")
    CMake Error at /Users/Watt/zephyrproject/ncs/zephyr/cmake/generic_toolchain.cmake:64 (include):
      include could not find load file:
    
        /Users/Watt/zephyrproject/ncs/zephyr/cmake/toolchain//Users/Watt/armgnuemb/generic.cmake
    Call Stack (most recent call first):
      /Users/Watt/zephyrproject/ncs/zephyr/cmake/app/boilerplate.cmake:509 (include)
      /Users/Watt/zephyrproject/ncs/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:24 (include)
      /Users/Watt/zephyrproject/ncs/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:40 (include_boilerplate)
      CMakeLists.txt:20 (find_package)
    
    
    -- Found BOARD.dts: /Users/Watt/zephyrproject/ncs/zephyr/boards/arm/nrf9160dk_nrf9160/nrf9160dk_nrf9160ns.dts
    -- Found devicetree overlay: /Users/Watt/Documents/Switch_That/ZEPHYR_Code/nRF9160DK/lte_ble_gateway/nrf9160dk_nrf9160ns.overlay
    CMake Error at /Users/Watt/zephyrproject/ncs/zephyr/cmake/dts.cmake:153 (message):
      command failed with return code: No such file or directory
    Call Stack (most recent call first):
      /Users/Watt/zephyrproject/ncs/zephyr/cmake/app/boilerplate.cmake:510 (include)
      /Users/Watt/zephyrproject/ncs/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:24 (include)
      /Users/Watt/zephyrproject/ncs/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 -DWEST_PYTHON=/Library/Frameworks/Python.framework/Versions/3.8/bin/python3 -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
    Watts-MBP-2:lte_ble_gateway Watt$ 
    

  • Hi Øyvind,

    I deleted everything and started again. I followed this 

    https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/gs_installing.html#setting-up-the-command-line-build-environment

    All very straight forward until I try this.

    Watts-MBP-2:ncs Watt$ pwd
    /Users/Watt/zephyrproject/ncs
    Watts-MBP-2:ncs Watt$ west init -m https://github.com/nrfconnect/sdk-nrf --mr v1.3.0
    FATAL ERROR: already initialized in /Users/Watt/zephyrproject, aborting.
    

    What am I doing wrong here?

    I know this is difficult to debug remotely, I was hoping  clean install would fix it. If you have instructions for a complete reinstall please let me know, happy to start again 

    Rod

  • I have carried out a clean install, installed NCS version 1.3.0  and have tried to build as below. Still seeing errors.

    Watts-MBP-2:lte_ble_gateway Watt$ pwd
    /Users/Watt/zephyrproject/ncs/nrf/samples/nrf9160/lte_ble_gateway
    Watts-MBP-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/zephyrproject/ncs/nrf/samples/nrf9160/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/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
    Parsing /Users/Watt/zephyrproject/zephyr/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'
    
    warning: UART_2_NRF_FLOW_CONTROL (defined at drivers/serial/Kconfig.nrfx:195) was assigned the value
    'y' but got the value 'n'. Check these unsatisfied dependencies: UART_2_NRF_UARTE (=n). See
    http://docs.zephyrproject.org/latest/reference/kconfig/CONFIG_UART_2_NRF_FLOW_CONTROL.html and/or
    look up UART_2_NRF_FLOW_CONTROL in the menuconfig/guiconfig interface. The Application Development
    Primer, Setting Configuration Values, and Kconfig - Tips and Best Practices sections of the manual
    might be helpful too.
    
    
    /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/nrf9160/lte_ble_gateway/prj.conf:34: warning: attempt to assign the value 'y' to the undefined symbol GPS_USE_SIM
    
    /Users/Watt/zephyrproject/ncs/nrf/samples/nrf9160/lte_ble_gateway/prj.conf:37: warning: attempt to assign the value '30' to the undefined symbol GPS_SEARCH_INTERVAL
    
    /Users/Watt/zephyrproject/ncs/nrf/samples/nrf9160/lte_ble_gateway/prj.conf:38: warning: attempt to assign the value '15' to the undefined symbol GPS_SEARCH_TIMEOUT
    
    /Users/Watt/zephyrproject/ncs/nrf/samples/nrf9160/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: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/zephyrproject/ncs/nrf/samples/nrf9160/lte_ble_gateway/build -S/Users/Watt/zephyrproject/ncs/nrf/samples/nrf9160/lte_ble_gateway -GNinja
    Watts-MBP-2:lte_ble_gateway Watt$ 
    

  • I have tried to build another application to see if I can get a clue to what's wrong. (I am managing to build basic stuff such as "blinky" and "button".

    I have tried to build "at_client", I can only get this to build when I remove the following lines from the prj.conf file

    CONFIG_AT_HOST_LIBRARY=y
    CONFIG_LTE_NETWORK_MODE_NBIOT=y
    CONFIG_LTE_NETWORK_MODE_LTE_M=n
    CONFIG_BSD_LIBRARY=y
    
     

    Looking at other tickets, most have had success when they recreate a brand new work space. So, I unset the ZEPHYR_BASE variable and carry out the following.

    https://raw.githubusercontent.com/Homebrew/install/master/install)"
    
    brew install cmake ninja gperf python3 ccache qemu dtc
    
    pip3 install west
    west init ~/newinstall
    cd ~/newinstall
    west update
    
    west zephyr-export
    
    pip3 install -r ~/newinstall/zephyr/scripts/requirements.txt
    
    pip3 install -U west
    
    Watts-MBP-2:newinstall Watt$ pwd
    /Users/Watt/newinstall
    Watts-MBP-2:newinstall Watt$ ls
    bootloader	modules		tools		zephyr
    
    Watts-MBP-2:newinstall Watt$ mkdir ncs
    Watts-MBP-2:ewinstall Watt$ cd ncs
    
    Watts-MBP-2:ncs Watt$ west init -m https://github.com/nrfconnect/sdk-nrf --mr v1.3.0
    
    FATAL ERROR: already initialized in /Users/Watt/newinstall, aborting.
    
    
     

    Unfortunately this reports and error, even though this is a new workspace.

    Would appreciate your thoughts?

    Thanks,

    Rod

Related