基于区块链的毕业设计Watson MQTT Demo – Watson MQTT演示

本文提供基于区块链的毕业设计国外最新区块链项目源码下载,包括solidity,eth,fabric等blockchain区块链,基于区块链的毕业设计Watson MQTT Demo – Watson MQTT演示 是一篇很好的国外资料

Watson MQTT Demo

This demo application connects to Watson IoT through MQTT and publishes messages.

It requires a registered device.

The following describes the various components and the configuration settings.

Once the application is configured you can:

  • Build the application.
  • Connect the debugger.
  • Run the application and view messages in a debug printf or terminal window.

Watson IoT Client

The file helloWorld.c configures the connection to Watson IoT with these settings:

  • ORG_ID: Organization ID
  • DEVICE_TYPE: Device Type
  • DEVICE_ID: Device ID
  • TOKEN: Authentication Token

Note: These settings need to be configured by the user!

The file IoTFoundation.pem provides the server certificate.

Note: The server certificate needs to be provided by the user and needs to exist on the file system drive M0!

RTOS: Keil RTX5 Real-Time Operating System

The real-time operating system Keil RTX5 implements the resource management.

It is configured with the following settings:

  • Global Dynamic Memory size: 24000 bytes
  • Default Thread Stack size: 3072 bytes
  • Event Recorder Configuration
    • Global Initialization: 1
      • Start Recording: 1

Refer to Configure RTX v5 for a detailed description of all configuration options.

Socket: Ethernet IoT Socket (MDK-Middleware Network)

This implementation uses an IoT socket layer that connects to a CMSIS-Driver Ethernet.

The IoT Socket is implemented using MDK-Middleware Network.

Board: NXP MIMXRT1064-EVK

The tables below list the device configuration for this board. The board layer for the NXP MIMXRT1064-EVK is using the software component ::Board Support: SDK Project Template: project_template (Variant: evkmimxrt1064) from NXP.EVK-MIMXRT1064_BSP.12.3.0 pack.

The heap/stack setup and the CMSIS-Driver assignment is in configuration files of related software components.

The example project can be re-configured to work on custom hardware. Refer to “Configuring Example Projects with MCUXpresso Config Tools” for information.

System Configuration

System Component Setting
Device MIMXRT1064DVL6A
Board MIMXRT1064-EVK
SDK Version ksdk2_0
Heap 64 kB (configured in linker script MIMXRT1064xxxxx_*.scf file)
Stack (MSP) 1 kB (configured in linker script MIMXRT1064xxxxx_*.scf file)

Clock Configuration

Clock Setting
AHB_CLK_ROOT 600 MHz
IPG_CLK_ROOT 150 MHz
PERCLK_CLK_ROOT 75 MHz
USDHC1_CLK_ROOT 198 MHz
UART_CLK_ROOT 80 MHz
ENET_125M_CLK 50 MHz
ENET_25M_REF_CLK 25 MHz
ENET_TX_CLK 50 MHz

Note: configured with Functional Group: BOARD_BootClockRUN

GPIO Configuration and usage

Functional Group Pin Peripheral Signal Identifier Pin Settings Usage
BOARD_InitDEBUG_UART K14 LPUART1 TX UART1_TXD default UART1 TX for debug console (GPIO_AD_B0_12)
BOARD_InitDEBUG_UART L14 LPUART1 RX UART1_RXD default UART1 RX for debug console (GPIO_AD_B0_13)
BOARD_InitENET A7 ENET MDC ENET_MDC default Ethernet KSZ8081RNB pin MDC (GPIO_EMC_40)
BOARD_InitENET C7 ENET MDIO ENET_MDIO default Ethernet KSZ8081RNB pin MDIO (GPIO_EMC_41)
BOARD_InitENET B13 ENET REF_CLK ENET_TX_CLK default Ethernet KSZ8081RNB pin XI (GPIO_B1_10)
BOARD_InitENET E12 ENET RX_DATA, 0 ENET_RXD0 default Ethernet KSZ8081RNB pin RXD0 (GPIO_B1_04)
BOARD_InitENET D12 ENET RX_DATA, 1 ENET_RXD1 default Ethernet KSZ8081RNB pin RXD1 (GPIO_B1_05)
BOARD_InitENET C12 ENET RX_EN ENET_CRS_DV default Ethernet KSZ8081RNB pin CRS_DV (GPIO_B1_06)
BOARD_InitENET C13 ENET RX_ER ENET_RXER default Ethernet KSZ8081RNB pin RXER (GPIO_B1_11)
BOARD_InitENET B12 ENET TX_DATA, 0 ENET_TXD0 default Ethernet KSZ8081RNB pin TXD0 (GPIO_B1_07)
BOARD_InitENET A12 ENET TX_DATA, 1 ENET_TXD1 default Ethernet KSZ8081RNB pin TXD1 (GPIO_B1_08)
BOARD_InitENET A13 ENET TX_EN ENET_TXEN default Ethernet KSZ8081RNB pin TXEN (GPIO_B1_09)
BOARD_InitUSDHC J2 USDHC1 DATA, 3 SD1_D3 default SD Card pin D3 (GPIO_SD_B0_05)
BOARD_InitUSDHC H2 USDHC1 DATA, 2 SD1_D2 default SD Card pin D2 (GPIO_SD_B0_04)
BOARD_InitUSDHC K1 USDHC1 DATA, 1 SD1_D1 default SD Card pin D1 (GPIO_SD_B0_03)
BOARD_InitUSDHC J1 USDHC1 DATA, 0 SD1_D0 default SD Card pin D0 (GPIO_SD_B0_02)
BOARD_InitUSDHC J4 USDHC1 CMD SD1_CMD default SD Card pin CMD (GPIO_SD_B0_00)
BOARD_InitUSDHC J3 USDHC1 CLK SD1_CLK default SD Card pin CLK (GPIO_SD_B0_01)
BOARD_InitARDUINO_UART J12 LPUART3 TX LPUART3_TX default Arduino UNO R3 pin D1 (GPIO_AD_B1_06)
BOARD_InitARDUINO_UART K10 LPUART3 RX LPUART3_RX default Arduino UNO R3 pin D0 (GPIO_AD_B1_07)
BOARD_InitUSER_LED F14 GPIO1 gpio_io, 09 USER_LED Direction Output, GPIO initial state 1, mode PullUp User LED (GPIO_AD_B0_09)
BOARD_InitUSER_BUTTON L6 GPIO5 gpio_io, 00 USER_BUTTON Direction Input, mode PullUp User Button SW8 (WAKEUP)

NVIC Configuration

NVIC Interrupt Priority
ENET 8
USDHC1 8
LPUART3 8

STDIO is routed to debug console through Virtual COM port (DAP-Link, peripheral = LPUART1, baudrate = 115200)

CMSIS-Driver mapping

CMSIS-Driver Peripheral
ETH_MAC0 ENET
ETH_PHY0 KSZ8081RNB (external)
MCI0 USDHC1
USART3 LPUART3
CMSIS-Driver VIO Physical board hardware
vioBUTTON0 User Button SW8 (WAKEUP)
vioLED0 User LED (GPIO_AD_B0_09)

Watson MQTT演示版

此演示应用程序通过MQTT连接到Watson IoT并发布消息

它需要注册的设备

下面介绍各种组件和配置设置

配置应用程序后,您可以:

  • 构建应用程序
  • 连接调试器
  • 运行应用程序并在调试printf或终端窗口中查看消息

Watson IoT客户端

文件helloWorld.c使用以下设置配置到Watson IoT的连接:

  • 组织标识:组织标识
  • 设备类型:设备类型
  • 设备标识:设备标识
  • 令牌:身份验证令牌

注意:这些设置需要由用户配置

文件IoTFoundation.pem 提供服务器证书

注意:服务器证书需要由用户提供,并且需要存在于文件系统驱动器M0上

RTOS:Keil RTX5实时操作系统

实时操作系统keilrtx5实现了资源管理

它配置有以下设置:

  • 全局动态内存大小:24000字节
  • 默认线程堆栈大小:3072字节
  • 事件记录器配置全局初始化:1开始录制:1

有关所有配置选项的详细说明,请参阅配置RTX v5

Socket:Ethernet IoT Socket(MDK中间件网络)

此实现使用连接到CMSIS驱动程序以太网的IoT套接字层

物联网套接字使用MDK中间件网络实现

Board:NXP MIMXRT1064-EVK

下表列出了该板的设备配置。NXP MIMXRT1064-EVK的板层使用来自的软件组件::board Support:SDK Project Template:Projectu Template(变量:evkmimxrt1064)NXP.EVK-MIMXRT1064璝BSP.12.3.0包

堆/堆栈设置和CMSIS驱动程序分配在相关软件组件的配置文件中

示例项目可以重新配置为在自定义硬件上工作。有关信息,请参阅“使用MCUXpresso配置工具配置示例项目”

系统配置

System Component Setting
25MHz ENETu TXu CLK
50MHz BOARDu InitDEBUGu UART
BOARDu InitDEBUGu UART 板初始化以太网KSZ8081RNB引脚MDIO(GPIOU EMCU 41)
默认值,0 ENETu RXD0
默认值 以太网KSZ8081RNB引脚RXD0(GPIOu B1u 04)

时钟配置

Clock Setting
板初始数据,1 ENETu RXD1
默认值 以太网KSZ8081RNB引脚RXD1(GPIOu B1u 05)
线路板初始化RXu ER ENETu RXER
默认值 以太网KSZ8081RNB引脚RXER(GPIOu B1u 11)
线路板初始数据,0 ENETu TXD0
默认值 以太网KSZ8081RNB引脚TXD0(GPIOu B1u 07)
板u InitENET A12
ENET TXu数据,1

注:配置功能组:BOARDu BootClockRUN

GPIO配置和使用

Functional Group Pin Peripheral Signal Identifier Pin Settings Usage
ENETu TXD1 默认值 以太网KSZ8081RNB引脚TXD1(GPIOu B1u 08) 线路板初始化数据,3 SD1U D3 默认 SD卡插脚D3(GPIOU SDU B0U 05)
BOARDU InitUSDHC USDHC1 数据,2 SD1U D2 默认 BOARDU InitUSDHC 数据,1
SD1U D1 默认值 SD卡引脚D1(GPIOU SDU B0U 03) 主板初始化USDHC J1 USDHC1 数据,0
SD1U D0 默认值 SD卡pin D0(GPIOU SDU B0U 02) BOARDU InitUSDHC BOARDU InitUSDHC 默认值 SD卡插脚CLK(GPIOU SDU B0U 01)
主板INITARDUNOU UART LPUART3 默认值 主板UNO R3插脚D1(GPIOU ADU B1U 06) 主板INITARDUNOU UART 默认值 Arduino UNO R3引脚D0(GPIOu ADu B1u 07)
板初始用户指示灯 F14 GPIO1 GPIO,09 用户指示灯 方向输出,GPIO初始状态1,模式上拉 用户LED(GPIOU ADU B0U 09)
板初始用户按钮 L6 GPIO5 GPIO,00 用户按钮 方向输入,模式上拉 用户按钮SW8(唤醒)
vioLED0 用户LED(GPIOU ADU B0U 09) ENET RX_EN ENET_CRS_DV default Ethernet KSZ8081RNB pin CRS_DV (GPIO_B1_06)
BOARD_InitENET C13 ENET RX_ER ENET_RXER default Ethernet KSZ8081RNB pin RXER (GPIO_B1_11)
BOARD_InitENET B12 ENET TX_DATA, 0 ENET_TXD0 default Ethernet KSZ8081RNB pin TXD0 (GPIO_B1_07)
BOARD_InitENET A12 ENET TX_DATA, 1 ENET_TXD1 default Ethernet KSZ8081RNB pin TXD1 (GPIO_B1_08)
BOARD_InitENET A13 ENET TX_EN ENET_TXEN default Ethernet KSZ8081RNB pin TXEN (GPIO_B1_09)
BOARD_InitUSDHC J2 USDHC1 DATA, 3 SD1_D3 default SD Card pin D3 (GPIO_SD_B0_05)
BOARD_InitUSDHC H2 USDHC1 DATA, 2 SD1_D2 default SD Card pin D2 (GPIO_SD_B0_04)
BOARD_InitUSDHC K1 USDHC1 DATA, 1 SD1_D1 default SD Card pin D1 (GPIO_SD_B0_03)
BOARD_InitUSDHC J1 USDHC1 DATA, 0 SD1_D0 default SD Card pin D0 (GPIO_SD_B0_02)
BOARD_InitUSDHC J4 USDHC1 CMD SD1_CMD default SD Card pin CMD (GPIO_SD_B0_00)
BOARD_InitUSDHC J3 USDHC1 CLK SD1_CLK default SD Card pin CLK (GPIO_SD_B0_01)
BOARD_InitARDUINO_UART J12 LPUART3 TX LPUART3_TX default Arduino UNO R3 pin D1 (GPIO_AD_B1_06)
BOARD_InitARDUINO_UART K10 LPUART3 RX LPUART3_RX default Arduino UNO R3 pin D0 (GPIO_AD_B1_07)
BOARD_InitUSER_LED F14 GPIO1 gpio_io, 09 USER_LED Direction Output, GPIO initial state 1, mode PullUp User LED (GPIO_AD_B0_09)
BOARD_InitUSER_BUTTON L6 GPIO5 gpio_io, 00 USER_BUTTON Direction Input, mode PullUp User Button SW8 (WAKEUP)

NVIC配置

NVIC Interrupt Priority
ENET 8
USDHC1 8
LPUART3 8

STDIO通过虚拟COM端口(DAP Link,peripheral=LPUART1,波特率=115200)

CMSIS驱动程序映射

CMSIS-Driver Peripheral
ETH_MAC0 ENET
ETH_PHY0 KSZ8081RNB (external)
MCI0 USDHC1
USART3 LPUART3
CMSIS-Driver VIO Physical board hardware
vioBUTTON0 User Button SW8 (WAKEUP)
vioLED0 User LED (GPIO_AD_B0_09)

部分转自网络,侵权联系删除区块链源码网

www.interchains.cc

https://www.interchains.cc/21810.html

区块链毕设网(www.interchains.cc)全网最靠谱的原创区块链毕设代做网站 部分资料来自网络,侵权联系删除! 最全最大的区块链源码站 ! QQ3039046426
区块链知识分享网, 以太坊dapp资源网, 区块链教程, fabric教程下载, 区块链书籍下载, 区块链资料下载, 区块链视频教程下载, 区块链基础教程, 区块链入门教程, 区块链资源 » 基于区块链的毕业设计Watson MQTT Demo – Watson MQTT演示

提供最优质的资源集合

立即查看 了解详情