Skip to content

Latest commit

 

History

History
83 lines (58 loc) · 3.73 KB

File metadata and controls

83 lines (58 loc) · 3.73 KB

NETPIE-2020 Interfacing Example on Universal Remote Terminal Unit (uRTU)

This is an example for NETPIE-2020 application developed under PIC32MZ plus Microchip's Harmony platform. You can find the original version of this source code at AWS-IoT repository where the WolfMQTT library plays on top of the Network Presentation Layer (NET_PRES). For further information, they could be found at the Microchip's Harmony v1 website. Additionally, the device under test is named Universal Remote Terminal Unit, also called uRTU, which is a product of R&D lab inside NECTEC -- Intelligent SCADA Technology laboratory.

Requirements

The work on this project requires a lot of modification on the Harmony v1.11. It includes the code that was transfered from Harmony v2.06 and the latest version of WolfMQTT. Please use the attached files, crypto.tar.gz and tcpip.tar.gz, for comformation. They must be installed inside the Harmony v1.11 installed directory, in ./framework/crypto and ./third_party/tcpip repectively.

From MQTT to MQTTS

In the earlier revision, the project has already worked with MQTT version. The need to upgrade to MQTTS is required some additional steps:

  1. I suggest revising the Harmony 1.11 configuration as following:

  2. Following files are required to be updated with the files in recent version:

    • In firmware/src/system_config/default/framework/net/pres:

Quick Setup

  1. Use the Harmony v1 configurator to generate, or import at least, a new project from the following Harmony configuration file:

    • firmware/netpie_pic32mz.hconfig
  2. Re-configure and re-generate the project with the configurator:

    • Name the first generated application code as app_uart_term.
    • Name the second generated application code as app_mqtt_client.
  3. Copy these files and folder to your project:

    • firmware/src/app_mqtt_client.c (overwrite the existing)
    • firmware/src/app_mqtt_client.h (overwrite the existing)
    • firmware/src/app_uart_term.c (overwrite the existing)
    • firmware/src/app_uart_term.h (overwrite the existing)
    • firmware/src/netpie2020_config.h
    • firmware/src/aux
  4. Add the following files into the project by their types -- by right-clicking on the folders in Project Window:

    • Header:
      • firmware/src/netpie2020_config.h
      • firmware/src/aux/parson.h
    • Source:
      • firmware/src/aux/parson.c
  5. Get your NETPIE-2020 device's configuration from the dash board as shown below, then revise the file firmware/src/netpie2020_config.h.

NETPIE-2020 Dashboard

  1. In your own generated application, follow the example as leading in firmware/src/app_tester.c.

Related Contributions

Notes