Please enable JavaScript to view this site.

Waijung 2 User Guide

How this block appears in a Simulink model?

mqtt_file_sync_1

What can be configured?

mqtt_file_sync_2

 

Configuration Parameter

Selectable Option/Value

Description

File path to the file contains file info in the SD card

 

The file sync is based on the filepath+hash info file. This  filepath+hash info file for the folder which is in the SD card should be in the SD card. Specify the file path of that file. e.g. filepath_hash_info1.csv

File path to the file contains file info in the server

 

Specify the file name of filepath+hash info in the MQTT client (server) which you need to sync the files from. e.g. filepath_hash_info2.csv

Get data from inputs

Check--Uncheck

Check to get above data from input ports

MQTT topic for file status

 

Specify the topic to send and receive file status. This is used to handle the file sync process between the ESP32 and the server

MQTT topic for file data

 

Specify the topic to receive file content

Get data from inputs

Check--Uncheck

Check to get above MQTT topic from input ports

Enable firmware update

Check--Uncheck

This will enable the firmware update from the SD card

Firmware bin folder path

 

Specify the bin file location in the SD card. If this is enabled, this will update the firmware using bin file if that specific file is updated through the file sync process.

Sample time

 

Specify the sample time

OUTPUT Port

Port Name

Port Type

Date Type

Description

Status

Scalar

int32

 

When to use this block?

This block is used to transfer file do the file synchronization (one way) in ESP32 using MQTT protocol. For this a MQTT broker and another MQTT client should be required to initiate the file sync process.

How does this block work?

This block requires WiFi setup Block and the MQTT setup block to function. The sync process should be initiated from the MQTT client side not from ESP32 side. After it is initiated, ESP32 will start with downloading the filepath+hash info file from the MQTT client and compare with the filepath+hash info file in SD card. According to it, the ESP32 will request files, delete files in the SD card.

 

Sample python script for MQTT client which is used to sync the files from: filesyncpy_client.zip

Python script file for generating filepath+hash info file: path_hash_file_gen.zip

 

Copyright 2024 Aimagin Co.,Ltd. Rev.1670