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

  • Have you exported the CCPREFIX correctly? You could try to replace ${CCPREFIX} with the actual path of the toolchain. See the two forum posts below:

    https://www.raspberrypi.org/forums/viewtopic.php?t=76850

    https://www.raspberrypi.org/forums/viewtopic.php?f=26&t=39592

  • Thanks, CCPREFIX was the problem. I exported in one terminal and I ran the build command from another terminal. It build successfully!

    I hit the next error in step 6 Generate .deb packages.

    plp@toby:~/Nordic-Semi/rpikernel/linux$ CONCURRENCY_LEVEL=5 DEB_HOST_ARCH=armhf fakeroot make-kpkg --append-to-version -plp --revision `date +%Y%m%d%H%M%S` --ARCH=arm --cross-compile ${CCPREFIX} kernel_image kernel_headers

    ...

    install -p -o root -g root -m 644 REPORTING-BUGS /home/plp/Nordic-Semi/rpikernel/linux/debian/linux-headers-4.14.95-plp-v7+/usr/share/doc/linux-headers-4.14.95-plp-v7+/

    install: cannot stat 'REPORTING-BUGS': No such file or directory

    debian/ruleset/targets/headers.mk:40: recipe for target 'debian/stamp/install/linux-headers-4.14.95-plp-v7+' failed

    make[1]: *** [debian/stamp/install/linux-headers-4.14.95-plp-v7+] Error 1

    make[1]: Leaving directory '/home/plp/Nordic-Semi/rpikernel/linux'

    debian/ruleset/local.mk:102: recipe for target 'kernel_headers' failed

    make: *** [kernel_headers] Error 2

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

    One solution is just to create an empty REPORTING-BUGS file and it will compile, 

    but what do you say about it? Is there a better way to fix the error??

Related