Files
ess-moxa-configuration-tools/Moulinette/README.md
Quentin WEPHRE fe82b3962f Initial commit
2024-06-18 14:59:46 +02:00

96 lines
3.6 KiB
Markdown

# ORIGINAL README FROM MOXA
# COMPLETELY OUTDATED AS OF 06/2024
# DOES NOT WORK WITH CURRENT VERSION
# KEPT FOR INFORMATION AND HISTORICAL DATA
## Moxa AIG-301- Data Path Configuration
## Pre-requisites
The following two Excel files from Saft are required
- [ ] 0000123704_SAFT_Generic_Data_Model.xlsx
- [ ] I-Sight_Project_Communication_Network_Config.xlsx
Python Script to generate shell sript from Execel files
data_path_config.py
Note: The python script and the excel files must be kept in the same directory. The files generated by the python script will be present inside the "Generated_Files" folder.
Also, make sure the data provided in the Excel sheet is correct. Else it can affect the configuration process.
## Step1
- [ ] The Python Version used for the project development is:
'''
3.10.9
'''
- [ ] Install all dependencies of the python by running following command:
```
sudo pip3 install -r requirements.txt
```
- [ ] Execute python script in the directory where Execl files are located
```
python3 data_path_config.py
```
OUTPUT:
On successfull execution of the script, it generates the folder "Generated_Files". The folder contains:
1. data_path_configuration_shell_script.sh
2. data_config_debug.log
The "data_path_configuration_shell_script.sh" is the script that needs to be executed in the Moxa device for configuring the ThingsPro Edge software.
The "data_config_debug.log" is the log file generated after running the python script and it performs some basic error checks on the given excel files.
## Step2
- [ ] Copy shell script into Moxa gateway in home directory via File Transfer tool example [winscp](https://winscp.net/download/WinSCP-5.21.7-Setup.exe) files
## Step3
- [ ] Change file mode of shell script to make it executable by executing the following commands:
```
sudo sed -i -e 's/\r$//' data_path_configuration_shell_script.sh
sudo chmod +x data_path_configuration_shell_script.sh
```
## Step4
- [ ] Execute shell script in root directory, otheriwse tpfunc will not deployed
```
sudo su
```
```
./data_path_configuration_shell_script.sh
```
## Step5
- [ ] A log report "data_shell_script.log" is generated in the same directory after executing the shell script "data_path_configuration_shell_script.sh". This log report provides information on whether the commands of the shell script were successful or not based on HTTP status codes. Some most common HTTP requests from the log are:
```
HTTP request 200 or 201 means that command was successfully executed
HTTP request 400 and above means that the command was NOT executed successfully
```
Note: An HTTP request of 400 and above can either mean that the data (which is obtained from the provided excel sheets) within the command is Incorrect or that the ThingsPro Edge software is already configured with that data.
- [ ] Verify results on ThingsPro Edge webGUI
1) Check Modbus Configuration
2) Check Azure IoT Edge Telemetry
- A seperate topic will be created for each slave
3) Tpfunc under Function
## Additional Information
The "Generated_Files" folder in this repository was created by running the python script with the excel sheets in the same repository. It can be used for reference.
The Folder "Screenshots" has images that can be used for reference.
Also, each data model in "0000123704_SAFT_Generic_Data_Model.xlsx" file needs to be modified to include an additional column that provides information regarding which commands must be configured for TP function as shown in the screenshot below:
![Screenshot](Screenshots/tpfunc.png)