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

How do I test example project iot mqtt publish and subscribe projects?

The example projects I am referring to is located here:

nRF5_SDK_15.2.0\examples\iot\mqtt\lwip\subscriber\pca10056\s140\ses\iot_lwip_mqtt_subscriber_pca10056_s140

nRF5_SDK_15.2.0\examples\iot\mqtt\lwip\publisher\pca10056\s140\ses\iot_lwip_mqtt_publisher_pca10056_s140

Using a window10 pc:

I have build and downloaded pub program to one nRF52840DK and sub to another nRF52840DK successfully. On my smart phone I can see both of them as Bluetooth devices.

As new to Nordics products and IDE it would be nice with guides/documentation as how to verify that this MQTT pub/sub projects works ( as well as all the other example projects ). 

Do I need another Linux board to work as the MQTT broker? Or does the subscriber board also works as a broker?

Appreciate a link to documentation/guides that explain the many example projects.

Thanks

Parents
  • Yes, you need a 3rd device that acts as the MQTT Broker, see Setting up the Mosquitto MQTT broker for information on how to set this up on a Windows, Linux or OS X device. 

    The MQTT examples are documented here, Experimental: IoT Examples / MQTT. Each example have a Testing subsection in their documentation, explaining step by step how to test the examples, see 

    MQTT Client - Publisher / Testing

    MQTT Client - Subscriber / Testing

    Best regards
    Bjørn

  • Thanks for your reply. If I don't have the option of a 3rd device MQTT broker, is there a preferred protocol / best way to send and receive data/commands between two BLE devices? I assume it has to be a master-slave relationship, and payload be structured as a JSON document, and it has to be BLE5 to have a payload size of 253 bytes.

    Thanks

  • Thank you Bjorn for links to example projects and test documentation. 

    Learned a lot from ATT_MTU example, returning to MQTT example

    I have a question to the "BLE enabled router"

    The nRF52840DK doesn't have wifi so it cannot act as the BLE/WIFI router unless I add a wifi module to it! Is that correct? Can I use a Raspberry Pi as BLE/WIFI router?

    What HW is best to test MQTT example project? 

    Thanks

  • Yes, that is correct. Yes, I have set up the Raspberry Pi as BLE/ Wifi Router, see Setting up BLE 6LoWPAN Border Router

  • Thanks again,

    Just a few more questions

    https://www.nordicsemi.com/DocLib/Content/SDK_Doc/nRF5_SDK/v15-2-0/iot_rpi_kernel

    What default kernel config command do I run if I am using RPi 3?

    If I should replace the RPi with other HW, what are the requirements? 

    Any Ubuntu/Debian system with min. same amount of Flash and RAM as RPi, WiFi radio and 

    a USB port for the BLE dongle?

  • Use the second kernel config command, it should be # If Raspberry Pi 2/3, see https://www.raspberrypi.org/documentation/linux/kernel/configuring.md.
     
    # If Raspberry Pi 2.
    pi@raspberry:~/raspbian/kernel/linux$ make bcm2709_defconfig
    I am afraid that I do not know the requirements for the Ubuntu/Debian OS with the required modules and I do not know which single board computers that are equivalent to the Raspberry Pi. 
  • Hi, 

    Still moving forward..but I ran into some issues starting the cross compiling step 5! First issue was "No rule to make target '--j5'

    I am using a Core i5 with 4 CPU cores, so it should be OK with --j5, anyway I tried again without --j5 and it resulted in GCC -option errors. see below.

    The first 4 steps seem to be successful, not sure where the chain dropped off. 

    Some system info:

    Ubuntu 16.04 LTS PC with 4 GB

    plp@toby:~$ uname -a
    Linux toby 4.4.0-141-generic #167-Ubuntu SMP Wed Dec 5 10:40:15 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

    Any feedback is appreciated

    Thanks.

    plp@toby:~/Nordic-Semi/rpikernel/linux$ ARCH=arm CROSS_COMPILE=${CCPREFIX} make bcm2709_defconfig HOSTCC scripts/basic/fixdep

    HOSTCC scripts/kconfig/conf.o

    SHIPPED scripts/kconfig/zconf.tab.c

    SHIPPED scripts/kconfig/zconf.lex.c

    HOSTCC scripts/kconfig/zconf.tab.o

    HOSTLD scripts/kconfig/conf

    #

    # configuration written to .config

    #

    plp@toby:~/Nordic-Semi/rpikernel/linux$ ARCH=arm CROSS_COMPILE=${CCPREFIX} INSTALL_MOD_PATH=${MODULES_TEMP} make –j5

    scripts/kconfig/conf --silentoldconfig Kconfig

    make: *** No rule to make target '–j5'. Stop.

    plp@toby:~/Nordic-Semi/rpikernel/linux$ ARCH=arm CROSS_COMPILE=${CCPREFIX} INSTALL_MOD_PATH=${MODULES_TEMP} make –j5 modules

    make: *** No rule to make target '–j5'. Stop.

    plp@toby:~/Nordic-Semi/rpikernel/linux$ ARCH=arm CROSS_COMPILE=${CCPREFIX} INSTALL_MOD_PATH=${MODULES_TEMP} make

    SYSHDR arch/arm/include/generated/uapi/asm/unistd-common.h

    SYSHDR arch/arm/include/generated/uapi/asm/unistd-oabi.h

    SYSHDR arch/arm/include/generated/uapi/asm/unistd-eabi.h

    CHK include/config/kernel.release

    UPD include/config/kernel.release

    WRAP arch/arm/include/generated/uapi/asm/bitsperlong.h

    WRAP arch/arm/include/generated/uapi/asm/errno.h

    WRAP arch/arm/include/generated/uapi/asm/ioctl.h

    WRAP arch/arm/include/generated/uapi/asm/ipcbuf.h

    WRAP arch/arm/include/generated/uapi/asm/msgbuf.h

    WRAP arch/arm/include/generated/uapi/asm/param.h

    WRAP arch/arm/include/generated/uapi/asm/poll.h

    WRAP arch/arm/include/generated/uapi/asm/resource.h

    WRAP arch/arm/include/generated/uapi/asm/sembuf.h

    WRAP arch/arm/include/generated/uapi/asm/shmbuf.h

    WRAP arch/arm/include/generated/uapi/asm/siginfo.h

    WRAP arch/arm/include/generated/uapi/asm/socket.h

    WRAP arch/arm/include/generated/uapi/asm/sockios.h

    WRAP arch/arm/include/generated/uapi/asm/termbits.h

    WRAP arch/arm/include/generated/uapi/asm/termios.h

    WRAP arch/arm/include/generated/asm/clkdev.h

    WRAP arch/arm/include/generated/asm/current.h

    WRAP arch/arm/include/generated/asm/early_ioremap.h

    WRAP arch/arm/include/generated/asm/emergency-restart.h

    WRAP arch/arm/include/generated/asm/exec.h

    WRAP arch/arm/include/generated/asm/extable.h

    WRAP arch/arm/include/generated/asm/irq_regs.h

    WRAP arch/arm/include/generated/asm/kdebug.h

    WRAP arch/arm/include/generated/asm/local.h

    WRAP arch/arm/include/generated/asm/local64.h

    WRAP arch/arm/include/generated/asm/mm-arch-hooks.h

    WRAP arch/arm/include/generated/asm/msi.h

    WRAP arch/arm/include/generated/asm/parport.h

    WRAP arch/arm/include/generated/asm/preempt.h

    WRAP arch/arm/include/generated/asm/rwsem.h

    WRAP arch/arm/include/generated/asm/seccomp.h

    WRAP arch/arm/include/generated/asm/segment.h

    WRAP arch/arm/include/generated/asm/serial.h

    WRAP arch/arm/include/generated/asm/simd.h

    WRAP arch/arm/include/generated/asm/sizes.h

    WRAP arch/arm/include/generated/asm/timex.h

    WRAP arch/arm/include/generated/asm/trace_clock.h

    CHK include/generated/uapi/linux/version.h

    UPD include/generated/uapi/linux/version.h

    CHK include/generated/utsrelease.h

    UPD include/generated/utsrelease.h

    HOSTCC scripts/basic/bin2c

    SYSNR arch/arm/include/generated/asm/unistd-nr.h

    GEN arch/arm/include/generated/asm/mach-types.h

    SYSTBL arch/arm/include/generated/calls-oabi.S

    SYSTBL arch/arm/include/generated/calls-eabi.S

    CC kernel/bounds.s

    gcc: error: unrecognized argument in option ‘-mabi=aapcs-linux’

    gcc: note: valid arguments to ‘-mabi=’ are: ms sysv

    gcc: error: unrecognized command line option ‘-mlittle-endian’

    gcc: error: unrecognized command line option ‘-mapcs’

    gcc: error: unrecognized command line option ‘-mno-sched-prolog’

    gcc: error: unrecognized command line option ‘-mfpu=vfp’

    Kbuild:21: recipe for target 'kernel/bounds.s' failed

    make[1]: *** [kernel/bounds.s] Error 1

    Makefile:1084: recipe for target 'prepare0' failed

    make: *** [prepare0] Error 2

    plp@toby:~/Nordic-Semi/rpikernel/linux$

Reply
  • Hi, 

    Still moving forward..but I ran into some issues starting the cross compiling step 5! First issue was "No rule to make target '--j5'

    I am using a Core i5 with 4 CPU cores, so it should be OK with --j5, anyway I tried again without --j5 and it resulted in GCC -option errors. see below.

    The first 4 steps seem to be successful, not sure where the chain dropped off. 

    Some system info:

    Ubuntu 16.04 LTS PC with 4 GB

    plp@toby:~$ uname -a
    Linux toby 4.4.0-141-generic #167-Ubuntu SMP Wed Dec 5 10:40:15 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

    Any feedback is appreciated

    Thanks.

    plp@toby:~/Nordic-Semi/rpikernel/linux$ ARCH=arm CROSS_COMPILE=${CCPREFIX} make bcm2709_defconfig HOSTCC scripts/basic/fixdep

    HOSTCC scripts/kconfig/conf.o

    SHIPPED scripts/kconfig/zconf.tab.c

    SHIPPED scripts/kconfig/zconf.lex.c

    HOSTCC scripts/kconfig/zconf.tab.o

    HOSTLD scripts/kconfig/conf

    #

    # configuration written to .config

    #

    plp@toby:~/Nordic-Semi/rpikernel/linux$ ARCH=arm CROSS_COMPILE=${CCPREFIX} INSTALL_MOD_PATH=${MODULES_TEMP} make –j5

    scripts/kconfig/conf --silentoldconfig Kconfig

    make: *** No rule to make target '–j5'. Stop.

    plp@toby:~/Nordic-Semi/rpikernel/linux$ ARCH=arm CROSS_COMPILE=${CCPREFIX} INSTALL_MOD_PATH=${MODULES_TEMP} make –j5 modules

    make: *** No rule to make target '–j5'. Stop.

    plp@toby:~/Nordic-Semi/rpikernel/linux$ ARCH=arm CROSS_COMPILE=${CCPREFIX} INSTALL_MOD_PATH=${MODULES_TEMP} make

    SYSHDR arch/arm/include/generated/uapi/asm/unistd-common.h

    SYSHDR arch/arm/include/generated/uapi/asm/unistd-oabi.h

    SYSHDR arch/arm/include/generated/uapi/asm/unistd-eabi.h

    CHK include/config/kernel.release

    UPD include/config/kernel.release

    WRAP arch/arm/include/generated/uapi/asm/bitsperlong.h

    WRAP arch/arm/include/generated/uapi/asm/errno.h

    WRAP arch/arm/include/generated/uapi/asm/ioctl.h

    WRAP arch/arm/include/generated/uapi/asm/ipcbuf.h

    WRAP arch/arm/include/generated/uapi/asm/msgbuf.h

    WRAP arch/arm/include/generated/uapi/asm/param.h

    WRAP arch/arm/include/generated/uapi/asm/poll.h

    WRAP arch/arm/include/generated/uapi/asm/resource.h

    WRAP arch/arm/include/generated/uapi/asm/sembuf.h

    WRAP arch/arm/include/generated/uapi/asm/shmbuf.h

    WRAP arch/arm/include/generated/uapi/asm/siginfo.h

    WRAP arch/arm/include/generated/uapi/asm/socket.h

    WRAP arch/arm/include/generated/uapi/asm/sockios.h

    WRAP arch/arm/include/generated/uapi/asm/termbits.h

    WRAP arch/arm/include/generated/uapi/asm/termios.h

    WRAP arch/arm/include/generated/asm/clkdev.h

    WRAP arch/arm/include/generated/asm/current.h

    WRAP arch/arm/include/generated/asm/early_ioremap.h

    WRAP arch/arm/include/generated/asm/emergency-restart.h

    WRAP arch/arm/include/generated/asm/exec.h

    WRAP arch/arm/include/generated/asm/extable.h

    WRAP arch/arm/include/generated/asm/irq_regs.h

    WRAP arch/arm/include/generated/asm/kdebug.h

    WRAP arch/arm/include/generated/asm/local.h

    WRAP arch/arm/include/generated/asm/local64.h

    WRAP arch/arm/include/generated/asm/mm-arch-hooks.h

    WRAP arch/arm/include/generated/asm/msi.h

    WRAP arch/arm/include/generated/asm/parport.h

    WRAP arch/arm/include/generated/asm/preempt.h

    WRAP arch/arm/include/generated/asm/rwsem.h

    WRAP arch/arm/include/generated/asm/seccomp.h

    WRAP arch/arm/include/generated/asm/segment.h

    WRAP arch/arm/include/generated/asm/serial.h

    WRAP arch/arm/include/generated/asm/simd.h

    WRAP arch/arm/include/generated/asm/sizes.h

    WRAP arch/arm/include/generated/asm/timex.h

    WRAP arch/arm/include/generated/asm/trace_clock.h

    CHK include/generated/uapi/linux/version.h

    UPD include/generated/uapi/linux/version.h

    CHK include/generated/utsrelease.h

    UPD include/generated/utsrelease.h

    HOSTCC scripts/basic/bin2c

    SYSNR arch/arm/include/generated/asm/unistd-nr.h

    GEN arch/arm/include/generated/asm/mach-types.h

    SYSTBL arch/arm/include/generated/calls-oabi.S

    SYSTBL arch/arm/include/generated/calls-eabi.S

    CC kernel/bounds.s

    gcc: error: unrecognized argument in option ‘-mabi=aapcs-linux’

    gcc: note: valid arguments to ‘-mabi=’ are: ms sysv

    gcc: error: unrecognized command line option ‘-mlittle-endian’

    gcc: error: unrecognized command line option ‘-mapcs’

    gcc: error: unrecognized command line option ‘-mno-sched-prolog’

    gcc: error: unrecognized command line option ‘-mfpu=vfp’

    Kbuild:21: recipe for target 'kernel/bounds.s' failed

    make[1]: *** [kernel/bounds.s] Error 1

    Makefile:1084: recipe for target 'prepare0' failed

    make: *** [prepare0] Error 2

    plp@toby:~/Nordic-Semi/rpikernel/linux$

Children
Related