Difference between revisions of "How to install Edge Connector"

From 42Q
Jump to navigation Jump to search
(Created page with " Introduction<br/> This document will teach users how to complete prerequisites as well as installation of Edge Device in the next operating systems: Ubuntu 20.04 and Centos 8...")
 
 
(23 intermediate revisions by 2 users not shown)
Line 1: Line 1:
  
Introduction<br/> This document will teach users how to complete prerequisites as well as installation of Edge Device in the next operating systems: Ubuntu 20.04 and Centos 8.5+ (and later versions).
+
= <span class="mw-headline" id="Summary"><span class="mw-headline" id="Summary"><span class="mw-headline" id="Introduction"><span class="mw-headline" id="Introduction"><span class="mw-headline" id="Introduction">Summary</span></span></span></span></span> =
  
Prerequisites<br/> Log in As a Root User<br/> To be able to execute installation commands into the computer’s Terminal, the user must log in as a root user to obtain permission to enter commands that will install new software. To do so, follow the steps below:
+
This document will teach users how to complete prerequisites as well as installation of '''Edge Device''' in the next operating systems: Ubuntu 20.04 and Centos 8.5+ (and later versions).
  
<br/> Open the Terminal.<br/> Enter the command: su, and then press Enter.<br/> Enter the root user’s password, and then press Enter.
+
&nbsp;
  
Note: If the word: root@ appears before the computer’s username as in the image below, it means that you are logged in as a root user.
+
= <span class="mw-headline" id="Prerequisites"><span class="mw-headline" id="Prerequisites"><span class="mw-headline" id="Prerequisites"><span class="mw-headline" id="Prerequisites">Prerequisites</span></span></span></span> =
  
<br/> Figure 1: User Logged In as a Root User
+
== <span class="mw-headline" id="Log_in_As_a_Root_User"><span class="mw-headline" id="Log_in_As_a_Root_User"><span class="mw-headline" id="Log_in_As_a_Root_User"><span class="mw-headline" id="Log_in_As_a_Root_User">Log in As a Root User</span></span></span></span> ==
  
Enable the ‘cgroups’ in the operating system<br/> To be able to install the Edge Connector, the user must enable the ‘cgroups’ in the operating system. To do so, follow the steps below:
+
To be able to execute installation commands into the computer’s Terminal, the user must log in as a root user to obtain permission to enter commands that will install new software. To do so, follow the steps below:
  
Open the Terminal.<br/> Login as a root user.<br/> Enter the command: cat /etc/default/grub, and then press Enter.<br/> Enter the command: reboot, and then press Enter. This command will reboot the operating system in order to apply the changes.
+
&nbsp;
  
<br/> How to install Python<br/> To be able to install the Edge Connector, the user’s computer must install the Python 3.8 version.<br/> To verify the current computer’s Python version follow the steps below:
+
#'''Open''' the '''Terminal'''.
 +
#'''Enter''' the command: '''su''', and then press Enter.
 +
#'''Enter''' the root user’s '''password''', and then press Enter.  
  
Open the Terminal.<br/> Login as a root user.<br/> Enter the command: python3 -V, and then press Enter.
+
<u>'''Note:'''</u> If the word: root@ appears before the computer’s username as in the image below, it means that you are logged in as a root user.
  
Note: If Python 3.8 is not installed, please refer to the following links to install Python 3.8:
+
&nbsp;
  
For users using the CentOS operating system: https://computingforgeeks.com/how-to-install-python-3-on-centos/
+
<br/> '''Figure 1: User Logged In as a Root User'''
  
For users using the Ubuntu operating system: https://linuxize.com/post/how-to-install-python-3-8-on-ubuntu-18-04/
+
[[File:User Logged In as a Root User.png|User Logged In as a Root User.png]]
  
<br/> How to install the package management system Pip (Python Package Index)<br/> To be able to install the Edge Connector, the user must install the package management system Pip. To do so, click on the next link and follow the instructions: https://linuxize.com/post/how-to-install-pip-on-ubuntu-18.04/.
+
&nbsp;
  
How to install the Python SDK (System Development Kit)<br/> To be able to install the Edge Connector, the user must install. To do so, follow the steps below:
+
&nbsp;
  
To install the Python SDK, enter the command: pip3 install awsiotsdk, and then press Enter.<br/> Next step is to install the necessary libraries.<br/> Enter the command: pip3 install awscrt, and then press Enter.<br/> Enter the command: pip3 install awsiot, and then press Enter.<br/> Enter the command: pip3 install tzlocal, and then press Enter.<br/> Enter the command: pip3 install pytz, and then press Enter.
+
== <span class="mw-headline" id="Enable_the_.E2.80.98cgroups.E2.80.99_in_the_operating_system"><span class="mw-headline" id="Enable_the_.E2.80.98cgroups.E2.80.99_in_the_operating_system"><span class="mw-headline" id="Enable_the_.E2.80.98cgroups.E2.80.99_in_the_operating_system"><span class="mw-headline" id="Enable_the_.E2.80.98cgroups.E2.80.99_in_the_operating_system"><span class="mw-headline" id="Enable_the_.E2.80.98cgroups.E2.80.99_in_the_operating_system"><span class="mw-headline" id="Enable_the_.E2.80.98cgroups.E2.80.99_in_the_operating_system">Enable the ‘cgroups’ in the operating system</span></span></span></span></span></span> ==
  
<br/> How to install Java<br/> To be able to install the Edge Connector, the user’s computer must have installed Java.<br/> To verify the current computer’s Java version follow the steps below:
+
To be able to install the Edge Connector, the user must enable the ‘cgroups’ in the operating system. To do so, follow the steps below:
  
Open the Terminal.<br/> Login as a root user.<br/> Enter the command: java -version, and then press Enter.
+
&nbsp;
  
Note: If Java is not installed, please refer to the following link to install Java:
+
To enable these cgroups options, boot the device with the following Linux kernel parameters.
  
For users using the CentOS operating system: https://linuxize.com/post/install-java-on-centos-8/
+
[https://docs.aws.amazon.com/greengrass/v2/developerguide/troubleshooting.html#lambda-cgroups-not-mounted https://docs.aws.amazon.com/greengrass/v2/developerguide/troubleshooting.html#lambda-cgroups-not-mounted] &nbsp;
  
How to install Edge Connector<br/> First of all, the user must create a new Edge Device to be able to download the Edge Connector installation package.<br/> Create a new Edge Device<br/> To create a new Edge Device, follow the steps below:
+
Step 1:&nbsp; sudo vi /etc/default/grub
  
Navigate to: Shop Floor Control > Configuration > IIoT Configuration > Edge Devices.<br/> Select CREATE EDGE DEVICE. A pop-up window will appear.
+
Find GRUB_CMDLINE_LINUX, and add the following command in it.
  
<br/> Figure 2: Edge Devices Portlet
+
[[File:Cgroup enable.png|800px]]
  
Enter the Edge Device Name.<br/> Select the Group Name:<br/> DataIngestionGroup:<br/> CloudPrintingGroup:<br/> MachineInterfaceGroup:
+
'''For Centos 8.5'''
  
Select the Group Version.<br/> Select SAVE to save changes or CANCEL to abort.
+
'''''cgroup_enable=memory cgroup_memory=1 systemd.unified_cgroup_hierarchy=0&nbsp; &nbsp;&nbsp; &nbsp;'''''
  
Figure 3: Create Edge Device Pop-up Window
+
'''For Ubuntu 22.04'''
  
Download and Install The Edge Device Installation Package
+
'''''cgroup_enable=memory cgroup_memory=1 systemd.unified_cgroup_hierarchy=false'''''
  
Navigate to: Shop Floor Control > Configuration > IIoT Configuration > Edge Devices.<br/> Hover the cursor over the Edge Device previously created.<br/> Select Download to download the zip file.
+
Step 2: Enter the command: sudo update-grub
  
<br/> Figure 4: Edge Devices Portlet
+
Step 3: Restart the system. sudo reboot
  
Right-click on the zip file.<br/> Select Extract Here.<br/> Open the downloaded folder.<br/> Make sure the file ggcV2.sh exists.
+
Then check the cgroup, response tmpfs is right.
  
Figure 5: Downloaded Folder Content
+
&nbsp;root@:~# stat -fc %T /sys/fs/cgroup/tmpfs
  
<br/> Open the Terminal.<br/> Login as a root user.
+
&nbsp;
  
Note: For the next two steps it is recommended to turn off the ZScaler Client Connector, otherwise.
+
= <span class="mw-headline" id="How_to_install_Edge_Connector"><span class="mw-headline" id="How_to_install_Edge_Connector"><span class="mw-headline" id="How_to_install_Edge_Connector"><span class="mw-headline" id="How_to_install_Edge_Connector"><span class="mw-headline" id="How_to_install_Edge_Connector">How to install Edge Connector</span></span></span></span></span> =
  
Enter the command: cd GreengrassV2, and then press Enter.<br/> Enter the command: sudo ./ggcV2.sh, and then press Enter to execute the shell script.
+
First of all, the user must create a new Edge Device to be able to download the Edge Connector installation package.
  
<br/> How to manage the Edge Connector service from Terminal<br/> To be able to execute any of the commands used to manage the Edge Connector service, the user must open the terminal and login as a root user.<br/> Stop The Service<br/> Open the Terminal.<br/> Login as a root user.<br/> Enter the next command: sudo systemctl stop greengrass.service, and then press Enter.
+
&nbsp;
  
Disable The Service<br/> Open the Terminal.<br/> Login as a root user.<br/> Enter the next command: sudo systemctl disable greengrass.service, and then press Enter.
+
&nbsp;
  
Remove The Service<br/> Open the Terminal.<br/> Login as a root user.<br/> Enter the next command: sudo rm /etc/systemd/system/greengrass.service, and then press Enter.
+
== <span class="mw-headline" id="Create_a_new_Edge_Device"><span class="mw-headline" id="Create_a_new_Edge_Device"><span class="mw-headline" id="Create_a_new_Edge_Device"><span class="mw-headline" id="Create_a_new_Edge_Device"><span class="mw-headline" id="Create_a_new_Edge_Device"><span class="mw-headline" id="Create_a_new_Edge_Device"><span class="mw-headline" id="Create_a_new_Edge_Device"><span class="mw-headline" id="Create_a_new_Edge_Device">Create a new Edge Device</span></span></span></span></span></span></span></span> ==
  
Verify That The Service Is Deleted<br/> Open the Terminal.<br/> Login as a root user.<br/> Enter the next command: sudo systemctl daemon-reload && sudo systemctl reset-failed, and then press Enter.
+
To create a new Edge Device, follow the steps below:
  
Delete Greengrass<br/> Open the Terminal.<br/> Login as a root user.<br/> Enter the next command: sudo rm -rf /greengrass/v2, and then press Enter.
+
#'''Navigate''' to: '''Shop Floor Control > Configuration > IIoT Configuration > Edge Devices'''.  
 +
#'''Select''' '''CREATE EDGE DEVICE'''. A pop-up window will appear.  
  
<br/> How to Reinstall an Edge Device<br/> It is possible for the &nbsp;user to reinstall an Edge Device, although the deployment job is already executed, it will not download the lambdas when executing the script, nevertheless, the user can trigger it on the portlet by removing it from the group, then adding it to the group that will deploy again.
+
<br/> '''Figure 2: Edge Devices Portlet'''
  
Testing Cases<br/> Server: https://portal-uat.42-q.com/<br/> Site: gbs_test<br/> Data Ingestion<br/> Create a new Edge Device whose Group Name belongs to DataIngestionGroup.<br/> Select an Edge Device.<br/> Select the Edit icon.
+
[[File:Edge device.png|border|700px|Edge Devices Portlet.png]]
  
<br/> Figure 6: Edit Icon
+
&nbsp;
 +
<ol start="3">
 +
<li>'''Enter''' the '''Edge Device Name'''.</li>
 +
<li>'''Select''' the '''Functionality Name''':</li>
 +
</ol>
 +
<ul style="margin-left: 40px;">
 +
<li>DataIngestionGroup</li>
 +
<li>CloudPrintingGroup</li>
 +
<li>MachineInterfaceGroup</li>
 +
<li>FileUploader</li>
 +
</ul>
 +
<ol start="5">
 +
<li>'''Select''' the '''Functionality Version'''.</li>
 +
<li>'''Select''' '''SAVE''' to save changes or '''CANCEL''' to abort.</li>
 +
</ol>
  
Select the CLIENT DEVICES tab.<br/> Select CREATE CLIENT DEVICES.
+
&nbsp;
  
<br/> Figure 7: Edge Device Info Pop-up Window
+
'''Figure 3: Create Edge Device Pop-up Window'''
  
<br/> Select the Client Device from the drop-down list.<br/> Select ASSOCIATE.
+
[[File:Create edge device.png|border|700px|Create Edge Device Pop-up Window.png]]
  
<br/> Figure 8: Associate Client Device Pop-up Window
+
&nbsp;
 +
<div class="eJOY__extension_root_class" id="eJOY__extension_root" style="all: unset;">&nbsp;</div>  
 +
&nbsp;
  
Select the Download icon to download the script.
+
== <span class="mw-headline" id="Download_and_Install_The_Edge_Device_Installation_Package"><span class="mw-headline" id="Download_and_Install_The_Edge_Device_Installation_Package"><span class="mw-headline" id="Download_and_Install_The_Edge_Device_Installation_Package"><span class="mw-headline" id="Download_and_Install_The_Edge_Device_Installation_Package"><span class="mw-headline" id="Download_and_Install_The_Edge_Device_Installation_Package"><span class="mw-headline" id="Download_and_Install_The_Edge_Device_Installation_Package">Download and Install The Edge Device Installation Package</span></span></span></span></span></span> ==
  
Figure 9: Download Client Device Icon
+
#'''Navigate''' to: '''Shop Floor Control > Configuration > IIoT Configuration > Edge Devices'''.
 +
#'''Hover''' the cursor over the '''Edge Device''' previously created.
 +
#'''Select''' '''Download''' to download the zip file.
 +
#'''Right-click''' on the zip '''file'''.
 +
#'''Select''' '''Extract Here'''.
 +
#'''Open''' the downloaded '''folder'''.
 +
#Make sure the file '''ggcV2.sh''' exists.
 +
#'''Open''' the '''Terminal'''.
 +
#'''Login''' as a '''root user'''.
 +
#'''Enter''' the command: '''sudo sh ggcV2.sh''',&nbsp;and then press Enter to execute the script.
  
<br/> Right-click on the zip file.<br/> Select Extract Here.<br/> Open the extracted folder.<br/> Open the file MqttTest.py.<br/> Find the line that contains: ‘# Change This’.<br/> Modify the data information to be sent; users may see an example below:
+
&nbsp;
  
&nbsp; message = {<br/> &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"measurements": [ {<br/> &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"timestamp": str(loc_dt),&nbsp;<br/> &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"quality": "true",&nbsp;<br/> &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"id": "GGC.V2.device.test001",&nbsp;<br/> &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"value": random.randint(0,40)}],&nbsp;<br/> &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"agent_id": "P88",&nbsp;<br/> &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"client_id": "P88",&nbsp;<br/> &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"data_acquisition_ts": str(loc_dt)<br/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br/> &nbsp;
+
= <br/> <span class="mw-headline" id="How_to_manage_the_Edge_Connector_service_from_Terminal"><span class="mw-headline" id="How_to_manage_the_Edge_Connector_service_from_Terminal"><span class="mw-headline" id="How_to_manage_the_Edge_Connector_service_from_Terminal"><span class="mw-headline" id="How_to_manage_the_Edge_Connector_service_from_Terminal">How to manage the Edge Connector service from Terminal</span></span></span></span> =
  
Open the Terminal.<br/> Login as a root user.<br/> Enter the command: python3 &nbsp;MqttTest.py, and then press Enter.
+
To be able to execute any of the commands used to manage the Edge Connector service, the user must open the terminal and login as a root user.
  
Machine Interface<br/> Create a new Edge Device whose Group Name belongs to MachineInterfaceGroup.<br/> Hover the cursor over the Edge Device previously created.<br/> Select Download to download the zip file.<br/> Right-click on the zip file.<br/> Select Extract Here.<br/> Open the downloaded folder.<br/> Make sure the file ggcV2.sh exists.<br/> Open the Terminal.<br/> Login as a root user.<br/> Enter the command: sudo sh ggcV2.sh, and then press Enter.<br/> Download the next file: tcpServer.py.<br/> Go to the Terminal.<br/> Enter the command: sudo python tcpServer.py.<br/> Use an API Client to simulate sending the below data by Postman or RESTful client, then it will return the result 200 and the message: “publish message to topic successfully.”
+
&nbsp;
  
Note: The red font part can be modified according to the actual situation.
+
== <br/> <span class="mw-headline" id="Stop_The_Service"><span class="mw-headline" id="Stop_The_Service"><span class="mw-headline" id="Stop_The_Service"><span class="mw-headline" id="Stop_The_Service">Stop The Service</span></span></span></span> ==
  
URL: https://portal-uat.42-q.com/mes-api/gbs_test/greengrass/v2/publish
+
#'''Open''' the '''Terminal'''.
 +
#'''Login''' as a '''root user'''.
 +
#'''Enter''' the next command: '''sudo systemctl stop greengrass.service''', and then press Enter.
 +
 
 +
&nbsp;
 +
 
 +
&nbsp;
 +
 
 +
== <span class="mw-headline" id="Disable_The_Service"><span class="mw-headline" id="Disable_The_Service"><span class="mw-headline" id="Disable_The_Service"><span class="mw-headline" id="Disable_The_Service">Disable The Service</span></span></span></span> ==
 +
 
 +
#'''Open''' the '''Terminal'''.
 +
#'''Login''' as a '''root user'''.
 +
#'''Enter''' the next command: '''sudo systemctl disable greengrass.service''', and then press Enter.
 +
 
 +
&nbsp;
 +
 
 +
&nbsp;
 +
 
 +
== <span class="mw-headline" id="Remove_The_Service"><span class="mw-headline" id="Remove_The_Service"><span class="mw-headline" id="Remove_The_Service"><span class="mw-headline" id="Remove_The_Service">Remove The Service</span></span></span></span> ==
 +
 
 +
#'''Open''' the '''Terminal'''.
 +
#'''Login''' as a '''root user'''.
 +
#'''Enter''' the next command: '''sudo rm /etc/systemd/system/greengrass.service''', and then press Enter.
 +
 
 +
&nbsp;
 +
 
 +
&nbsp;
 +
 
 +
== <span class="mw-headline" id="Verify_That_The_Service_Is_Deleted"><span class="mw-headline" id="Verify_That_The_Service_Is_Deleted"><span class="mw-headline" id="Verify_That_The_Service_Is_Deleted"><span class="mw-headline" id="Verify_That_The_Service_Is_Deleted">Verify That The Service Is Deleted</span></span></span></span> ==
 +
 
 +
#'''Open''' the '''Terminal'''.
 +
#'''Login''' as a '''root user'''.
 +
#'''Enter''' the next command: '''sudo systemctl daemon-reload && sudo systemctl reset-failed''', and then press Enter.
 +
 
 +
&nbsp;
 +
 
 +
&nbsp;
 +
 
 +
== <span class="mw-headline" id="Delete_Greengrass"><span class="mw-headline" id="Delete_Greengrass"><span class="mw-headline" id="Delete_Greengrass"><span class="mw-headline" id="Delete_Greengrass">Delete Greengrass</span></span></span></span> ==
 +
 
 +
#'''Open''' the '''Terminal'''.
 +
#'''Login''' as a '''root user'''.
 +
#'''Enter''' the next command: '''sudo rm -rf /greengrass/v2''', and then press Enter.
 +
 
 +
&nbsp;
 +
 
 +
&nbsp;
 +
 
 +
= <br/> <span class="mw-headline" id="How_to_Reinstall_an_Edge_Device"><span class="mw-headline" id="How_to_Reinstall_an_Edge_Device"><span class="mw-headline" id="How_to_Reinstall_an_Edge_Device"><span class="mw-headline" id="How_to_Reinstall_an_Edge_Device"><span class="mw-headline" id="How_to_Reinstall_an_Edge_Device">How to Reinstall an Edge Device</span></span></span></span></span> =
 +
 
 +
It is possible for the &nbsp;user to reinstall an Edge Device, although the deployment job is already executed, it will not download the lambdas when executing the script, nevertheless, the user can access the Edge Devices page, select the edge device, and then click the '''Redeploy''' icon to redeploy the edge device.
 +
 
 +
&nbsp;
 +
 
 +
= <span class="mw-headline" id="Testing_Cases"><span class="mw-headline" id="Testing_Cases"><span class="mw-headline" id="Testing_Cases"><span class="mw-headline" id="Testing_Cases">Testing Cases</span></span></span></span> =
 +
 
 +
Server: [https://portal-uat.42-q.com/ https://portal-uat.42-q.com/]<br/> Site: gbs_test
 +
 
 +
&nbsp;
 +
 
 +
&nbsp;
 +
 
 +
== <br/> <span class="mw-headline" id="Data_Ingestion"><span class="mw-headline" id="Data_Ingestion"><span class="mw-headline" id="Data_Ingestion"><span class="mw-headline" id="Data_Ingestion"><span class="mw-headline" id="Data_Ingestion"><span class="mw-headline" id="Data_Ingestion"><span class="mw-headline" id="Data_Ingestion">Data Ingestion</span></span></span></span></span></span></span> ==
 +
 
 +
#'''Create''' a '''new Edge Device''' whose functionality&nbsp;Name belongs to '''DataIngestionGroup'''.
 +
#'''Select''' an '''Edge Device'''.
 +
#'''Select''' the '''Edit''' icon.
 +
#'''Select''' the '''CLIENT DEVICES''' tab.
 +
#'''Select''' '''CREATE CLIENT DEVICES'''.
 +
 
 +
'''Figure 4: Edge Device Info Pop-up Window'''
 +
 
 +
[[File:Edge device infor.png|border|700px|Edge Device Info Pop-up Window.png]]
 +
 
 +
&nbsp;
 +
<ol start="6">
 +
<li>'''Select''' the '''Client Device''' from the drop-down list.</li>
 +
<li>'''Select''' '''ASSOCIATE'''.</li>
 +
<li>'''Select''' the '''Download''' icon to download the script.</li>
 +
<li>'''Right-click''' on the zip '''file'''.</li>
 +
<li>'''Select''' '''Extract Here'''.</li>
 +
<li>'''Open''' the extracted '''folder'''.</li>
 +
<li>'''Open''' the file '''MqttTest.py'''.</li>
 +
<li>'''Find''' the line that contains: '''‘# Change This’'''.</li>
 +
<li>'''Modify''' the '''data information''' to be sent; users may see an example below:</li>
 +
</ol>
 +
 
 +
&nbsp;
 +
 
 +
&nbsp; '''message = {<br/> &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"measurements": [ {<br/> &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"timestamp": str(loc_dt),&nbsp;<br/> &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"quality": "true",&nbsp;<br/> &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"id": "GGC.V2.device.test001",&nbsp;<br/> &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"value": random.randint(0,40)}],&nbsp;<br/> &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"agent_id": "P88",&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<br/> &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"data_acquisition_ts": str(loc_dt)<br/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }'''<br/> &nbsp;
 +
<ol start="15">
 +
<li>'''Open''' the '''Terminal'''.</li>
 +
<li>'''Login''' as a '''root user'''.</li>
 +
<li>'''Enter''' the command: '''''sudo -H -u ggc_user python3.8 MqttTest.py/sudo -H -u ggc_user python3.11 MqttTest.py''''', and then press Enter.</li>
 +
</ol>
 +
 
 +
&nbsp;
 +
 
 +
&nbsp;
 +
 
 +
&nbsp;
 +
 
 +
== <span class="mw-headline" id="Machine_Interface"><span class="mw-headline" id="Machine_Interface"><span class="mw-headline" id="Machine_Interface"><span class="mw-headline" id="Machine_Interface"><span class="mw-headline" id="Machine_Interface">Machine Interface</span></span></span></span></span> ==
 +
 
 +
#'''Create''' a '''new Edge Device''' whose Functionality Name belongs to '''MachineInterfaceGroup'''.
 +
#'''Hover''' the cursor over the '''Edge Device''' previously created.
 +
#'''Select''' '''Download''' to download the zip file.
 +
#'''Right-click''' on the zip '''file'''.
 +
#'''Select''' '''Extract Here'''.
 +
#'''Open''' the downloaded '''folder'''.
 +
#Make sure the file '''ggcV2.sh''' exists.
 +
#'''Open''' the '''Terminal'''.
 +
#'''Login''' as a '''root user'''.
 +
#'''Enter''' the command: '''sudo sh ggcV2.sh''', and then press Enter.
 +
#'''Go''' to the '''Terminal'''.
 +
#'''Enter''' the command: '''sudo -H -u ggc_user python3.8 tcpServer.py/sudo -H -u ggc_user python3.11 tcpServer.py'''.
 +
#Use an API Client to simulate '''sending''' the below '''data''' by Postman or RESTful client, then it will return the result 200 and the message: '''“publish message to topic successfully.”'''
 +
 
 +
<u>'''Note:'''</u> The red font part can be modified according to the actual situation.
 +
 
 +
&nbsp;
 +
 
 +
'''URL:''' [https://portal-uat.42-q.com/mes-api/gbs_test/greengrass/v2/publish https://portal-uat.42-q.com/mes-api/gbs_test/greengrass/v2/publish]
  
 
Method: Post
 
Method: Post
  
Data:<br/> {<br/> &nbsp; "topic": "snunv/machine-interface/snunv_E30_UAT_Demo_02",<br/> &nbsp; "payload":{<br/> &nbsp; "host": "127.0.0.1",<br/> &nbsp; "port": "9090",<br/> &nbsp; "content": {<br/> &nbsp; &nbsp; "event_id": 3,<br/> &nbsp; &nbsp; "event_name": "Part Re-Validation Pending",<br/> &nbsp; &nbsp; "data": [<br/> &nbsp; &nbsp; &nbsp; {<br/> &nbsp; &nbsp; &nbsp; &nbsp; "workstation": "WS1",<br/> &nbsp; &nbsp; &nbsp; &nbsp; "station": "1-1",<br/> &nbsp; &nbsp; &nbsp; &nbsp; "material": "",<br/> &nbsp; &nbsp; &nbsp; &nbsp; "board": "",<br/> &nbsp; &nbsp; &nbsp; &nbsp; "msg": ""<br/> &nbsp; &nbsp; &nbsp; },<br/> &nbsp; &nbsp; &nbsp; {<br/> &nbsp; &nbsp; &nbsp; &nbsp; "workstation": "WS1",<br/> &nbsp; &nbsp; &nbsp; &nbsp; "station": "1-2",<br/> &nbsp; &nbsp; &nbsp; &nbsp; "material": "",<br/> &nbsp; &nbsp; &nbsp; &nbsp; "board": "",<br/> &nbsp; &nbsp; &nbsp; &nbsp; "msg": ""<br/> &nbsp; &nbsp; &nbsp; }<br/> &nbsp; &nbsp; ]<br/> &nbsp; }<br/> }<br/> }
+
'''Data:<br/> {<br/> &nbsp; "topic": "snunv/machine-interface/snunv_E30_UAT_Demo_02",<br/> &nbsp; "payload":{<br/> &nbsp; "host": "127.0.0.1",<br/> &nbsp; "port": "9100",<br/> &nbsp; "content": {<br/> &nbsp; &nbsp; "event_id": 3,<br/> &nbsp; &nbsp; "event_name": "Part Re-Validation Pending",<br/> &nbsp; &nbsp; "data": [<br/> &nbsp; &nbsp; &nbsp; {<br/> &nbsp; &nbsp; &nbsp; &nbsp; "workstation": "WS1",<br/> &nbsp; &nbsp; &nbsp; &nbsp; "station": "1-1",<br/> &nbsp; &nbsp; &nbsp; &nbsp; "material": "",<br/> &nbsp; &nbsp; &nbsp; &nbsp; "board": "",<br/> &nbsp; &nbsp; &nbsp; &nbsp; "msg": ""<br/> &nbsp; &nbsp; &nbsp; },<br/> &nbsp; &nbsp; &nbsp; {<br/> &nbsp; &nbsp; &nbsp; &nbsp; "workstation": "WS1",<br/> &nbsp; &nbsp; &nbsp; &nbsp; "station": "1-2",<br/> &nbsp; &nbsp; &nbsp; &nbsp; "material": "",<br/> &nbsp; &nbsp; &nbsp; &nbsp; "board": "",<br/> &nbsp; &nbsp; &nbsp; &nbsp; "msg": ""<br/> &nbsp; &nbsp; &nbsp; }<br/> &nbsp; &nbsp; ]<br/> &nbsp; }<br/> }<br/> }'''
 +
 
 +
&nbsp;
 +
 
 +
'''Figure 5: Open Source API Client Insomnia'''
 +
 
 +
[[File:Open Source api.png|700px|Open Source API Client Insomnia.png]]
 +
 
 +
&nbsp;
 +
<ol start="15">
 +
<li>'''Navigate''' to the computer’s folder: '''/greengrass/v2/logs'''.</li>
 +
<li>'''Go''' to the '''Terminal'''.</li>
 +
<li>To view the log of the machine interface, '''enter''' the command: '''tail -f snsnv_MachineInterface.log'''</li>
 +
<li>'''View''' the message received in '''tcpServer'''.</li>
 +
</ol>
 +
 
 +
&nbsp;
 +
 
 +
&nbsp;
 +
 
 +
'''Figure 6: TCP Server Message (Machine Interface)'''
 +
 
 +
[[File:TCP Server message.png|700px|TCP Server Message (Machine Interface).png]]
 +
 
 +
&nbsp;
 +
 
 +
== <br/> <span class="mw-headline" id="Cloud_Printing"><span class="mw-headline" id="Cloud_Printing"><span class="mw-headline" id="Cloud_Printing"><span class="mw-headline" id="Cloud_Printing"><span class="mw-headline" id="Cloud_Printing">Cloud Printing</span></span></span></span></span> ==
 +
 
 +
#'''Create''' a '''new Edge Device''' whose Functionality&nbsp;Name belongs to '''CloudPrintingGroup'''.
 +
#'''Hover''' the cursor over the '''Edge Device''' previously created.
 +
#'''Select''' '''Download''' to download the zip file.
 +
#'''Right-click''' on the zip '''file'''.
 +
#'''Select''' '''Extract Here'''.
 +
#'''Open''' the downloaded '''folder'''.
 +
#Make sure the file '''ggcV2.sh''' exists.
 +
#'''Open''' the '''Terminal'''.
 +
#'''Login''' as a '''root user'''.
 +
#'''Enter''' the command: '''sudo sh ggcV2.sh''', and then press Enter.
 +
#'''Enter''' the command: '''sudo -H -u ggc_user python3.8 tcpServer.py/sudo -H -u ggc_user python3.11 tcpServer.py'''.
 +
#'''Request''' '''print''' either by LE Print or Postman:
 +
 
 +
&nbsp;
 +
 
 +
&nbsp;
 +
 
 +
=== <span class="mw-headline" id="By_LE_Print"><span class="mw-headline" id="By_LE_Print"><span class="mw-headline" id="By_LE_Print"><span class="mw-headline" id="By_LE_Print"><span class="mw-headline" id="By_LE_Print">By LE Print</span></span></span></span></span> ===
 +
 
 +
#'''Add''' a '''printer''' by navigating to: '''Administration > Label Engine Admin > Printer'''.
 +
#'''Select''' '''Add'''.
 +
 
 +
&nbsp;
 +
 
 +
'''Figure 7: Adding a Printer'''
 +
 
 +
[[File:Adding a Printer.png|border|Adding a Printer.png]]
 +
 
 +
&nbsp;
 +
 
 +
<u>'''Note:'''</u> The '''TCPIP Address''' should be the address of the printer. Or in case users want to start a TCP Server, users should access the Edge Devide&nbsp;downloaded folder, and then&nbsp;execute the command: '''‘''''''sudo -H -u ggc_user python3.8 tcpServer.py/sudo -H -u ggc_user python3.11 tcpServer.py''''''’''' as a simulator.
 +
 
 +
&nbsp;
 +
<ol start="3">
 +
<li>'''Create''' a '''print job''' by navigating to: '''Production > Label Engine Labels > LE Labels'''.</li>
 +
<li>'''Select''' a '''label'''.</li>
 +
<li>'''Select''' the '''Print''' button. A pop-up window will appear.</li>
 +
<li>'''Select''' the '''Printer Name''' created previously.</li>
 +
<li>'''Enter''' the '''Entry''' value.</li>
 +
<li>'''Select''' the '''Test Print''' button.</li>
 +
</ol>
 +
 
 +
&nbsp;
 +
 
 +
&nbsp;
 +
 
 +
'''Figure 8: Creating a Print Job'''
  
<br/> Figure 10: Open Source API Client Insomnia
+
[[File:Creating a Print Job.png|border|700px|Creating a Print Job.png]]
  
<br/> Navigate to the computer’s folder: /greengrass/v2/logs.<br/> Go to the Terminal.<br/> To view the log of the machine interface, enter the command: tail -f snsnv_MachineInterface.log<br/> View the message received in tcpServer.
+
&nbsp;
 +
<ol start="9">
 +
<li>'''Navigate''' to the computer’s folder: '''/greengrass/v2/logs'''.</li>
 +
<li>'''Open''' the '''Terminal'''.</li>
 +
<li>'''Login''' as a '''root user'''.</li>
 +
<li>'''Enter''' the command: '''tail -f snsnv_CloudPrinting.log'''.</li>
 +
<li>'''View''' the message received in '''tcpServer'''.</li>
 +
</ol>
  
Figure 11: TCP Server Message (Machine Interface)
+
&nbsp;
  
<br/> Cloud Printing<br/> Create a new Edge Device whose Group Name belongs to CloudPrintingGroup.<br/> Hover the cursor over the Edge Device previously created.<br/> Select Download to download the zip file.<br/> Right-click on the zip file.<br/> Select Extract Here.<br/> Open the downloaded folder.<br/> Make sure the file ggcV2.sh exists.<br/> Open the Terminal.<br/> Login as a root user.<br/> Enter the command: sudo sh ggcV2.sh, and then press Enter.<br/> Download the next file: tcpServer.py.<br/> Go to the Terminal.<br/> Enter the command: sudo python tcpServer.py.<br/> Request print either by LE Print or Postman:<br/> By LE Print<br/> Add a printer by navigating to: Administration > Label Engine Admin > Printer.<br/> Select Add.
+
&nbsp;
  
<br/> Figure 12: Adding a Printer
+
'''Figure 9: TCP Server Message (Cloud Printing Command)'''
  
Note: The TCPIP Address should be the address of the printer. Or in case users want to start a TCP Server, users should download the tcpServer.py file, and then execute the command: ‘sudo python3 tcpServer.py’ as a simulator.
+
[[File:TCP Server message.png|700px|TCP Server Message (Cloud Printing Command).png]]
  
Create a print job by navigating to: Production > Label Engine Labels > LE Labels.<br/> Select a label.<br/> Select the Print button. A pop-up window will appear.<br/> Select the Printer Name created previously.<br/> Enter the Entry value.<br/> Select the Test Print button.
+
<span class="mw-headline" id="">&nbsp;</span>
  
Figure 13: Creating a Print Job
+
&nbsp;
  
<br/> Navigate to the computer’s folder: /greengrass/v2/logs.<br/> Open the Terminal.<br/> Login as a root user.<br/> Enter the command: tail -f snsnv_CloudPrinting.log.<br/> View the message received in tcpServer.
+
== <span class="mw-headline" id="File_Uploader"><span class="mw-headline" id="File_Uploader"><span class="mw-headline" id="File_Uploader"><span class="mw-headline" id="File_Uploader"><span class="mw-headline" id="File_Uploader">File Uploader</span></span></span></span></span> ==
  
Figure 14: TCP Server Message (Cloud Printing Command)
+
&nbsp;
  
<br/> Troubleshooting<br/> Unable To Execute HTTP Request<br/> If while installing the Edge Connector the user gets the following error:<br/> Unable to execute HTTP request: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target.
+
#'''Create''' a new Edge Device whose Functionality Name belongs to FileUploader.
 +
#'''Hover''' the cursor over the '''Edge Device''' previously created.
 +
#'''Select Download''' to download the zip file.
 +
#'''Right-click''' on the zip '''file'''.
 +
#'''Select Extract Here'''.
 +
#'''Open''' the downloaded '''folder'''.
 +
#Make sure the file'''ggcV2.sh''' exists.
 +
#'''Open''' the '''Terminal'''.
 +
#'''Login''' as a'''root user'''.
 +
#Enter the command: '''sudo sh ggcV2.sh''', and then press Enter.  
 +
#'''Enter''' the command:'''sudo sh fileUploader.sh'''
 +
#Ask the 42Q mes-support team to provide a palindrome '''clientID''' and '''secret''' which can access the mes-api and PTSR database.Choose one of the following methods to modify the parameters ClientId and Secret.  
  
The user can solve this issue following the steps below:<br/> Open the Terminal.<br/> Login as a root user.<br/> Enter the command: cd /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.312.b07-1.amzn2.0.2.x86_64/jre/lib/security/java.security<br/> Use the keyboard arrows to find the next line: jdk.security.caDistrustPolicies=SYMANTEC_TLS<br/> Comment out the previous line by adding a hash symbol at the beginning of the line. It must look like this: #jdk.security.caDistrustPolicies=SYMANTEC_TLS<br/> Comment out the next line: /etc/pki/ca-trust/extracted/java keytool -trustcacerts -keystore "/etc/pki/ca-trust/extracted/java/cacerts" -storepass changeit -importcert -alias aws-trust -file "/etc/pki/ca-trust/source/amazontrust.crt"
+
&nbsp;
  
Fail to start cloud printing or receive messages
+
'''Option 1: Directly edit the core_config.json file'''.
  
If the user gets the following error:<br/> Fail to start cloud printing or receive messages.<br/> 2022-07-28T12:50:30.771Z [INFO] (pool-2-thread-18) sndnv_CloudPrinting: eventstreamrpc.py:308,<Connection at 0x7f3c6da7ea30 /socket/greengrassv2_ipc.sock:0> connected. {serviceInstance=0, serviceName=sndnv_CloudPrinting, currentState=RUNNING}<br/> 2022-07-28T12:50:38.068Z [ERROR] (pool-2-thread-19) sndnv_CloudPrinting: FATAL: lambda_runtime.py:146,Failed to import handler function "ggPrint.function_handler" due to exception: Error when retrieving credentials from container-role: Error retrieving metadata: Received non 200 response (500) from ECS metadata: Failed to get connection. {serviceInstance=0, serviceName=sndnv_CloudPrinting, currentState=RUNNING}<br/> 2022-07-28T12:50:38.069Z [ERROR] (pool-2-thread-19) sndnv_CloudPrinting: FATAL: lambda_runtime.py:426,Failed to initialize Lambda runtime due to exception: Error when retrieving credentials from container-role: Error retrieving metadata: Received non 200 response (500) from ECS metadata: Failed to get connection. {serviceInstance=0, serviceName=sndnv_CloudPrinting, currentState=RUNNING}<br/> 2022-07-28T12:51:28.784Z [INFO] (pool-2-thread-27) sndnv_CloudPrinting: shell-runner-start. {scriptName=services.sndnv_CloudPrinting.lifecycle.shutdown.script, serviceInstance=0, serviceName=sndnv_CloudPrinting, currentState=STOPPING, command=["/greengrass/v2/packages/artifacts/aws.greengrass.LambdaLauncher/2.0.10/lambda-..."]}<br/> 2022-07-28T12:51:28.834Z [INFO] (pool-2-thread-18) sndnv_CloudPrinting: Tearing down overlay tmpfs mounts. {serviceInstance=0, serviceName=sndnv_CloudPrinting, currentState=STOPPING}
+
Edit the /greengrass/v2/core_config.json file and add '''ClientId''' and '''Secret''' as shown below. The other parameters don’t need to be changed.<br/> {
 +
 
 +
&nbsp;&nbsp;&nbsp;&nbsp;"MaximumUploads":"3",
 +
 
 +
&nbsp;&nbsp;&nbsp;&nbsp;"PoolMaxWorkers":"10",
 +
 
 +
&nbsp;&nbsp;&nbsp;&nbsp;"RetentionDays":"7",
 +
 
 +
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"PlantCode":"****",
 +
 
 +
&nbsp;&nbsp;&nbsp;&nbsp;"ClientId":"****",
 +
 
 +
&nbsp;&nbsp;&nbsp;&nbsp;"Secret":"****",
 +
 
 +
&nbsp;&nbsp;&nbsp;&nbsp;"FileType":[
 +
 
 +
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{
 +
 
 +
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"SubFolder":"/",
 +
 
 +
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"MachineType":"panacim",
 +
 
 +
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"Processer":[
 +
 
 +
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{
 +
 
 +
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"Extension":".xml",
 +
 
 +
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"Parser":"panacim"
 +
 
 +
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}
 +
 
 +
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;]
 +
 
 +
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}
 +
 
 +
&nbsp;&nbsp;&nbsp;&nbsp;]
 +
 
 +
}
 +
 
 +
'''Option 2: Modify through the Edge device page'''. &nbsp; The ClientId and secret can be defined in the settings. Navigate to Settings. The ClientId and Secret correspond to the Token and Key on the Settings page. The Token and Key on the Settings page are site-level and will be applied to all edge devices within the site. The other parameters don’t require a change. &nbsp;
 +
 
 +
'''Figure 10: Settings&nbsp;'''
 +
 
 +
[[File:Settings 10.png|border]]
 +
<ol start="13">
 +
<li>'''Then''' restart Greengrass by running the next command: '''sudo systemctl restart greengrass.service''' &nbsp;</li>
 +
<li>'''Test Steps'''</li>
 +
</ol>
 +
 
 +
*&nbsp; &nbsp; &nbsp;Put the panacim xml file to the folder(step1 installed)
 +
*&nbsp; &nbsp; &nbsp;If the xml file is uploaded successfully, check the success folder.  
 +
*&nbsp; &nbsp;After xml file into the success folder,go to '''Mesweb''' portlet to check '''Material on board''', '''Material on board by batch''','''Material where used''' reports. &nbsp;
 +
*&nbsp; &nbsp;Go to&nbsp;'''Multimedia maintenance''' portlet, input Site( e.g SANM-E30) on Tenant Name input box,input PTS on Tag Name input box,click search button,will see the new uploaded xml file.
 +
 
 +
&nbsp;
 +
 
 +
= <br/> <span class="mw-headline" id="Troubleshooting"><span class="mw-headline" id="Troubleshooting"><span class="mw-headline" id="Troubleshooting"><span class="mw-headline" id="Troubleshooting"><span class="mw-headline" id="Troubleshooting">Troubleshooting</span></span></span></span></span> =
 +
 
 +
The Python, Python package index, SDK and Java are fully automated installed in installation script ggcV2.sh. Manual installation is only required if the installation fails. Please see the details below.
 +
 
 +
== <span class="mw-headline" id="How_to_install_Python"><span class="mw-headline" id="How_to_install_Python"><span class="mw-headline" id="How_to_install_Python"><span class="mw-headline" id="How_to_install_Python">How to install Python</span></span></span></span> ==
 +
 
 +
To be able to install the Edge Connector, the user’s computer must install the Python 3.8 version.<br/> To verify the current computer’s Python version follow the steps below:
 +
 
 +
&nbsp;
 +
 
 +
#'''Open''' the '''Terminal'''.
 +
#'''Login''' as a '''root user'''.  
 +
#'''Enter''' the command: '''python3 -V''', and then press Enter.
 +
#Users can execute the following two new scripts in the terminal to install Python 3.11 and Python 3.8.
 +
 
 +
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;sudo sh Install_Python3.8.sh
 +
 
 +
&nbsp; &nbsp; &nbsp; &nbsp; sudo sh Install_Python3.11.sh
 +
 
 +
&nbsp;
 +
 
 +
== <br/> <span class="mw-headline" id="How_to_install_the_package_management_system_Pip_.28Python_Package_Index.29"><span class="mw-headline" id="How_to_install_the_package_management_system_Pip_.28Python_Package_Index.29"><span class="mw-headline" id="How_to_install_the_package_management_system_Pip_.28Python_Package_Index.29"><span class="mw-headline" id="How_to_install_the_package_management_system_Pip_.28Python_Package_Index.29">How to install the package management system Pip (Python Package Index)</span></span></span></span> ==
 +
 
 +
To be able to install the Edge Connector, the user must install the package management system Pip. For installation, Browse to the folder where you unzipped the Edge device, right-click it, select Open in Terminal, and then type the following command in the Terminal.
 +
 
 +
*&nbsp;Ubuntu
 +
 
 +
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;sudo apt update
 +
 
 +
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;sudo apt-get install wget&nbsp;&nbsp;&nbsp;
 +
 
 +
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;wget --no-check-certificate [https://bootstrap.pypa.io/get-pip.py https://bootstrap.pypa.io/get-pip.py]&nbsp;
 +
 
 +
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;sudo python3.11 get-pip.py / sudo python3.8 get-pip.py
 +
 
 +
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;sudo -H -u ggc_user python3.11 -m pip install -r requirements.txt --user / sudo -H -u ggc_user python3.8 -m pip install -r requirements.txt --user &nbsp;
 +
 
 +
*&nbsp;Centos
 +
 
 +
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;sudo yum update -y
 +
 
 +
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;wget --no-check-certificate [https://bootstrap.pypa.io/get-pip.py https://bootstrap.pypa.io/get-pip.py]
 +
 
 +
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;sudo python3.11 get-pip.py / &nbsp; sudo python3.8 get-pip.py
 +
 
 +
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;sudo -H -u ggc_user python3.11 -m pip install -r requirements.txt --user / sudo -H -u ggc_user python3.8 -m pip install -r requirements.txt --user
 +
 
 +
&nbsp;
 +
 
 +
&nbsp;
 +
 
 +
== <span class="mw-headline" id="How_to_install_the_Python_SDK_.28System_Development_Kit.29"><span class="mw-headline" id="How_to_install_the_Python_SDK_.28System_Development_Kit.29"><span class="mw-headline" id="How_to_install_the_Python_SDK_.28System_Development_Kit.29"><span class="mw-headline" id="How_to_install_the_Python_SDK_.28System_Development_Kit.29">How to install the Python SDK (System Development Kit)</span></span></span></span> ==
 +
 
 +
To be able to install the Edge Connector, the user must install. To do so, follow the steps below:
 +
 
 +
&nbsp;
 +
 
 +
#To install the Python SDK, '''enter''' the command:'''python3.11 -m pip install awsiotsdk or python3.8 -m pip install awsiotsdk''', and then press Enter.
 +
#Next step is to install the necessary libraries.
 +
#'''Enter''' the command:'''python3.11 -m pip install awscrt or python3.8 -m pip install awscrt''', and then press Enter.
 +
#Enter the command:'''python3.11 -m pip install awsiot or python3.8 -m pip install awsiot''', and then press Enter.
 +
#Enter the command:'''python3.11 -m pip install tzlocal or python3.8 -m pip install tzlocal''' , and then press Enter.  
 +
#Enter the command:'''python3.11 -m pip install pytz or python3.8 -m pip install pytz ''', and then press Enter.
 +
 
 +
&nbsp;
 +
 
 +
== <br/> <span class="mw-headline" id="How_to_install_Java"><span class="mw-headline" id="How_to_install_Java"><span class="mw-headline" id="How_to_install_Java"><span class="mw-headline" id="How_to_install_Java">How to install Java</span></span></span></span> ==
 +
 
 +
To be able to install the Edge Connector, the user’s computer must have installed Java.<br/> To verify the current computer’s Java version follow the steps below:
 +
 
 +
&nbsp;
 +
 
 +
#'''Open''' the '''Terminal'''.  
 +
#'''Login''' as a '''root user.'''
 +
#'''Enter''' the command: '''java -version''', and then press Enter.  
 +
 
 +
&nbsp;
 +
 
 +
*Ubuntu:
 +
 
 +
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;sudo apt update
 +
 
 +
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;sudo apt install openjdk-11-jre &nbsp;
 +
 
 +
*Centos
 +
 
 +
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;sudo yum update -y
 +
 
 +
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;sudo yum install java-11-openjdk
 +
 
 +
&nbsp;
 +
 
 +
== <span class="mw-headline" id="Unable_To_Execute_HTTP_Request"><span class="mw-headline" id="Unable_To_Execute_HTTP_Request"><span class="mw-headline" id="Unable_To_Execute_HTTP_Request"><span class="mw-headline" id="Unable_To_Execute_HTTP_Request"><span class="mw-headline" id="Unable_To_Execute_HTTP_Request">Unable To Execute HTTP Request</span></span></span></span></span> ==
 +
 
 +
If while installing the Edge Connector the user gets the following error:<br/> '''Unable to execute HTTP request: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target.'''
 +
 
 +
&nbsp;
  
 
The user can solve this issue following the steps below:
 
The user can solve this issue following the steps below:
  
Open the Terminal.<br/> Login as a root user.<br/> Enter the command: pip3 config set global.cert /usr/lib/ZscalerRootCertificate-2048-SHA256.crt
+
#'''Open''' the '''Terminal'''.  
 +
#'''Login''' as a '''root user'''.
 +
#'''Enter''' the command: '''cd /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.312.b07-1.amzn2.0.2.x86_64/jre/lib/security/java.security'''
 +
#Use the keyboard arrows to find the next line: '''jdk.security.caDistrustPolicies=SYMANTEC_TLS'''
 +
#'''Comment out''' the previous line by adding a hash symbol at the beginning of the line. It must look like this: '''#jdk.security.caDistrustPolicies=SYMANTEC_TLS'''
 +
#'''Comment out''' the next line: '''/etc/pki/ca-trust/extracted/java keytool -trustcacerts -keystore "/etc/pki/ca-trust/extracted/java/cacerts" -storepass changeit -importcert -alias aws-trust -file "/etc/pki/ca-trust/source/amazontrust.crt"'''
 +
 
 +
&nbsp;
 +
 
 +
&nbsp;
 +
 
 +
&nbsp;
 +
 
 +
== <span class="mw-headline" id="Fail_to_start_cloud_printing_or_receive_messages"><span class="mw-headline" id="Fail_to_start_cloud_printing_or_receive_messages"><span class="mw-headline" id="Fail_to_start_cloud_printing_or_receive_messages"><span class="mw-headline" id="Fail_to_start_cloud_printing_or_receive_messages"><span class="mw-headline" id="Fail_to_start_cloud_printing_or_receive_messages"><span class="mw-headline" id="Fail_to_start_cloud_printing_or_receive_messages">Fail to start cloud printing or receive messages</span></span></span></span></span></span> ==
 +
 
 +
If the user gets the following error:<br/> '''Fail to start cloud printing or receive messages.<br/> 2022-07-28T12:50:30.771Z [INFO] (pool-2-thread-18) sndnv_CloudPrinting: eventstreamrpc.py:308,<Connection at 0x7f3c6da7ea30 /socket/greengrassv2_ipc.sock:0> connected. {serviceInstance=0, serviceName=sndnv_CloudPrinting, currentState=RUNNING}<br/> 2022-07-28T12:50:38.068Z [ERROR] (pool-2-thread-19) sndnv_CloudPrinting: FATAL: lambda_runtime.py:146,Failed to import handler function "ggPrint.function_handler" due to exception: Error when retrieving credentials from container-role: Error retrieving metadata: Received non 200 response (500) from ECS metadata: Failed to get connection. {serviceInstance=0, serviceName=sndnv_CloudPrinting, currentState=RUNNING}<br/> 2022-07-28T12:50:38.069Z [ERROR] (pool-2-thread-19) sndnv_CloudPrinting: FATAL: lambda_runtime.py:426,Failed to initialize Lambda runtime due to exception: Error when retrieving credentials from container-role: Error retrieving metadata: Received non 200 response (500) from ECS metadata: Failed to get connection. {serviceInstance=0, serviceName=sndnv_CloudPrinting, currentState=RUNNING}<br/> 2022-07-28T12:51:28.784Z [INFO] (pool-2-thread-27) sndnv_CloudPrinting: shell-runner-start. {scriptName=services.sndnv_CloudPrinting.lifecycle.shutdown.script, serviceInstance=0, serviceName=sndnv_CloudPrinting, currentState=STOPPING, command=["/greengrass/v2/packages/artifacts/aws.greengrass.LambdaLauncher/2.0.10/lambda-..."]}<br/> 2022-07-28T12:51:28.834Z [INFO] (pool-2-thread-18) sndnv_CloudPrinting: Tearing down overlay tmpfs mounts. {serviceInstance=0, serviceName=sndnv_CloudPrinting, currentState=STOPPING}'''
 +
 
 +
&nbsp;
 +
 
 +
The user can solve this issue following the steps below:
 +
 
 +
#'''Open''' the '''Terminal'''.
 +
#'''Login''' as a '''root user'''.  
 +
#'''Enter''' the command: '''pip3 config set global.cert /usr/lib/ZscalerRootCertificate-2048-SHA256.crt'''
 +
 
 +
&nbsp;
 +
 
 +
If it still do not work, do the following:
  
If it still do not work, do the following:<br/> Close Zscaler, then restart Greengrass by running the next command: sudo systemctl restart greengrass.service<br/> After restarting, open Zscaler again.
+
#'''Close''' '''Zscaler''', then restart Greengrass by running the next command: '''sudo systemctl restart greengrass.service'''
 +
#After restarting, '''open''' '''Zscaler''' again.

Latest revision as of 01:04, 15 October 2024

Summary

This document will teach users how to complete prerequisites as well as installation of Edge Device in the next operating systems: Ubuntu 20.04 and Centos 8.5+ (and later versions).

 

Prerequisites

Log in As a Root User

To be able to execute installation commands into the computer’s Terminal, the user must log in as a root user to obtain permission to enter commands that will install new software. To do so, follow the steps below:

 

  1. Open the Terminal.
  2. Enter the command: su, and then press Enter.
  3. Enter the root user’s password, and then press Enter.

Note: If the word: root@ appears before the computer’s username as in the image below, it means that you are logged in as a root user.

 


Figure 1: User Logged In as a Root User

User Logged In as a Root User.png

 

 

Enable the ‘cgroups’ in the operating system

To be able to install the Edge Connector, the user must enable the ‘cgroups’ in the operating system. To do so, follow the steps below:

 

To enable these cgroups options, boot the device with the following Linux kernel parameters.

https://docs.aws.amazon.com/greengrass/v2/developerguide/troubleshooting.html#lambda-cgroups-not-mounted  

Step 1:  sudo vi /etc/default/grub

Find GRUB_CMDLINE_LINUX, and add the following command in it.

Cgroup enable.png

For Centos 8.5

cgroup_enable=memory cgroup_memory=1 systemd.unified_cgroup_hierarchy=0      

For Ubuntu 22.04

cgroup_enable=memory cgroup_memory=1 systemd.unified_cgroup_hierarchy=false

Step 2: Enter the command: sudo update-grub

Step 3: Restart the system. sudo reboot

Then check the cgroup, response tmpfs is right.

 root@:~# stat -fc %T /sys/fs/cgroup/tmpfs

 

How to install Edge Connector

First of all, the user must create a new Edge Device to be able to download the Edge Connector installation package.

 

 

Create a new Edge Device

To create a new Edge Device, follow the steps below:

  1. Navigate to: Shop Floor Control > Configuration > IIoT Configuration > Edge Devices.
  2. Select CREATE EDGE DEVICE. A pop-up window will appear.


Figure 2: Edge Devices Portlet

Edge Devices Portlet.png

 

  1. Enter the Edge Device Name.
  2. Select the Functionality Name:
  • DataIngestionGroup
  • CloudPrintingGroup
  • MachineInterfaceGroup
  • FileUploader
  1. Select the Functionality Version.
  2. Select SAVE to save changes or CANCEL to abort.

 

Figure 3: Create Edge Device Pop-up Window

Create Edge Device Pop-up Window.png

 

 

 

Download and Install The Edge Device Installation Package

  1. Navigate to: Shop Floor Control > Configuration > IIoT Configuration > Edge Devices.
  2. Hover the cursor over the Edge Device previously created.
  3. Select Download to download the zip file.
  4. Right-click on the zip file.
  5. Select Extract Here.
  6. Open the downloaded folder.
  7. Make sure the file ggcV2.sh exists.
  8. Open the Terminal.
  9. Login as a root user.
  10. Enter the command: sudo sh ggcV2.sh, and then press Enter to execute the script.

 


How to manage the Edge Connector service from Terminal

To be able to execute any of the commands used to manage the Edge Connector service, the user must open the terminal and login as a root user.

 


Stop The Service

  1. Open the Terminal.
  2. Login as a root user.
  3. Enter the next command: sudo systemctl stop greengrass.service, and then press Enter.

 

 

Disable The Service

  1. Open the Terminal.
  2. Login as a root user.
  3. Enter the next command: sudo systemctl disable greengrass.service, and then press Enter.

 

 

Remove The Service

  1. Open the Terminal.
  2. Login as a root user.
  3. Enter the next command: sudo rm /etc/systemd/system/greengrass.service, and then press Enter.

 

 

Verify That The Service Is Deleted

  1. Open the Terminal.
  2. Login as a root user.
  3. Enter the next command: sudo systemctl daemon-reload && sudo systemctl reset-failed, and then press Enter.

 

 

Delete Greengrass

  1. Open the Terminal.
  2. Login as a root user.
  3. Enter the next command: sudo rm -rf /greengrass/v2, and then press Enter.

 

 


How to Reinstall an Edge Device

It is possible for the  user to reinstall an Edge Device, although the deployment job is already executed, it will not download the lambdas when executing the script, nevertheless, the user can access the Edge Devices page, select the edge device, and then click the Redeploy icon to redeploy the edge device.

 

Testing Cases

Server: https://portal-uat.42-q.com/
Site: gbs_test

 

 


Data Ingestion

  1. Create a new Edge Device whose functionality Name belongs to DataIngestionGroup.
  2. Select an Edge Device.
  3. Select the Edit icon.
  4. Select the CLIENT DEVICES tab.
  5. Select CREATE CLIENT DEVICES.

Figure 4: Edge Device Info Pop-up Window

Edge Device Info Pop-up Window.png

 

  1. Select the Client Device from the drop-down list.
  2. Select ASSOCIATE.
  3. Select the Download icon to download the script.
  4. Right-click on the zip file.
  5. Select Extract Here.
  6. Open the extracted folder.
  7. Open the file MqttTest.py.
  8. Find the line that contains: ‘# Change This’.
  9. Modify the data information to be sent; users may see an example below:

 

  message = {
                "measurements": [ {
                "timestamp": str(loc_dt), 
                "quality": "true", 
                "id": "GGC.V2.device.test001", 
                "value": random.randint(0,40)}], 
                "agent_id": "P88",             
                "data_acquisition_ts": str(loc_dt)
            }

 

  1. Open the Terminal.
  2. Login as a root user.
  3. Enter the command: sudo -H -u ggc_user python3.8 MqttTest.py/sudo -H -u ggc_user python3.11 MqttTest.py, and then press Enter.

 

 

 

Machine Interface

  1. Create a new Edge Device whose Functionality Name belongs to MachineInterfaceGroup.
  2. Hover the cursor over the Edge Device previously created.
  3. Select Download to download the zip file.
  4. Right-click on the zip file.
  5. Select Extract Here.
  6. Open the downloaded folder.
  7. Make sure the file ggcV2.sh exists.
  8. Open the Terminal.
  9. Login as a root user.
  10. Enter the command: sudo sh ggcV2.sh, and then press Enter.
  11. Go to the Terminal.
  12. Enter the command: sudo -H -u ggc_user python3.8 tcpServer.py/sudo -H -u ggc_user python3.11 tcpServer.py.
  13. Use an API Client to simulate sending the below data by Postman or RESTful client, then it will return the result 200 and the message: “publish message to topic successfully.”

Note: The red font part can be modified according to the actual situation.

 

URL: https://portal-uat.42-q.com/mes-api/gbs_test/greengrass/v2/publish

Method: Post

Data:
{
  "topic": "snunv/machine-interface/snunv_E30_UAT_Demo_02",
  "payload":{
  "host": "127.0.0.1",
  "port": "9100",
  "content": {
    "event_id": 3,
    "event_name": "Part Re-Validation Pending",
    "data": [
      {
        "workstation": "WS1",
        "station": "1-1",
        "material": "",
        "board": "",
        "msg": ""
      },
      {
        "workstation": "WS1",
        "station": "1-2",
        "material": "",
        "board": "",
        "msg": ""
      }
    ]
  }
}
}

 

Figure 5: Open Source API Client Insomnia

Open Source API Client Insomnia.png

 

  1. Navigate to the computer’s folder: /greengrass/v2/logs.
  2. Go to the Terminal.
  3. To view the log of the machine interface, enter the command: tail -f snsnv_MachineInterface.log
  4. View the message received in tcpServer.

 

 

Figure 6: TCP Server Message (Machine Interface)

TCP Server Message (Machine Interface).png

 


Cloud Printing

  1. Create a new Edge Device whose Functionality Name belongs to CloudPrintingGroup.
  2. Hover the cursor over the Edge Device previously created.
  3. Select Download to download the zip file.
  4. Right-click on the zip file.
  5. Select Extract Here.
  6. Open the downloaded folder.
  7. Make sure the file ggcV2.sh exists.
  8. Open the Terminal.
  9. Login as a root user.
  10. Enter the command: sudo sh ggcV2.sh, and then press Enter.
  11. Enter the command: sudo -H -u ggc_user python3.8 tcpServer.py/sudo -H -u ggc_user python3.11 tcpServer.py.
  12. Request print either by LE Print or Postman:

 

 

By LE Print

  1. Add a printer by navigating to: Administration > Label Engine Admin > Printer.
  2. Select Add.

 

Figure 7: Adding a Printer

Adding a Printer.png

 

Note: The TCPIP Address should be the address of the printer. Or in case users want to start a TCP Server, users should access the Edge Devide downloaded folder, and then execute the command: ‘'sudo -H -u ggc_user python3.8 tcpServer.py/sudo -H -u ggc_user python3.11 tcpServer.py' as a simulator.

 

  1. Create a print job by navigating to: Production > Label Engine Labels > LE Labels.
  2. Select a label.
  3. Select the Print button. A pop-up window will appear.
  4. Select the Printer Name created previously.
  5. Enter the Entry value.
  6. Select the Test Print button.

 

 

Figure 8: Creating a Print Job

Creating a Print Job.png

 

  1. Navigate to the computer’s folder: /greengrass/v2/logs.
  2. Open the Terminal.
  3. Login as a root user.
  4. Enter the command: tail -f snsnv_CloudPrinting.log.
  5. View the message received in tcpServer.

 

 

Figure 9: TCP Server Message (Cloud Printing Command)

TCP Server Message (Cloud Printing Command).png

 

 

File Uploader

 

  1. Create a new Edge Device whose Functionality Name belongs to FileUploader.
  2. Hover the cursor over the Edge Device previously created.
  3. Select Download to download the zip file.
  4. Right-click on the zip file.
  5. Select Extract Here.
  6. Open the downloaded folder.
  7. Make sure the fileggcV2.sh exists.
  8. Open the Terminal.
  9. Login as aroot user.
  10. Enter the command: sudo sh ggcV2.sh, and then press Enter.
  11. Enter the command:sudo sh fileUploader.sh
  12. Ask the 42Q mes-support team to provide a palindrome clientID and secret which can access the mes-api and PTSR database.Choose one of the following methods to modify the parameters ClientId and Secret.

 

Option 1: Directly edit the core_config.json file.

Edit the /greengrass/v2/core_config.json file and add ClientId and Secret as shown below. The other parameters don’t need to be changed.
{

    "MaximumUploads":"3",

    "PoolMaxWorkers":"10",

    "RetentionDays":"7",

      "PlantCode":"****",

    "ClientId":"****",

    "Secret":"****",

    "FileType":[

        {

            "SubFolder":"/",

            "MachineType":"panacim",

            "Processer":[

                {

                    "Extension":".xml",

                    "Parser":"panacim"

                }

            ]

        }

    ]

}

Option 2: Modify through the Edge device page.   The ClientId and secret can be defined in the settings. Navigate to Settings. The ClientId and Secret correspond to the Token and Key on the Settings page. The Token and Key on the Settings page are site-level and will be applied to all edge devices within the site. The other parameters don’t require a change.  

Figure 10: Settings 

Settings 10.png

  1. Then restart Greengrass by running the next command: sudo systemctl restart greengrass.service  
  2. Test Steps
  •      Put the panacim xml file to the folder(step1 installed)
  •      If the xml file is uploaded successfully, check the success folder.
  •    After xml file into the success folder,go to Mesweb portlet to check Material on board, Material on board by batch,Material where used reports.  
  •    Go to Multimedia maintenance portlet, input Site( e.g SANM-E30) on Tenant Name input box,input PTS on Tag Name input box,click search button,will see the new uploaded xml file.

 


Troubleshooting

The Python, Python package index, SDK and Java are fully automated installed in installation script ggcV2.sh. Manual installation is only required if the installation fails. Please see the details below.

How to install Python

To be able to install the Edge Connector, the user’s computer must install the Python 3.8 version.
To verify the current computer’s Python version follow the steps below:

 

  1. Open the Terminal.
  2. Login as a root user.
  3. Enter the command: python3 -V, and then press Enter.
  4. Users can execute the following two new scripts in the terminal to install Python 3.11 and Python 3.8.

         sudo sh Install_Python3.8.sh

        sudo sh Install_Python3.11.sh

 


How to install the package management system Pip (Python Package Index)

To be able to install the Edge Connector, the user must install the package management system Pip. For installation, Browse to the folder where you unzipped the Edge device, right-click it, select Open in Terminal, and then type the following command in the Terminal.

  •  Ubuntu

                sudo apt update

                sudo apt-get install wget   

                wget --no-check-certificate https://bootstrap.pypa.io/get-pip.py 

                sudo python3.11 get-pip.py / sudo python3.8 get-pip.py

                sudo -H -u ggc_user python3.11 -m pip install -r requirements.txt --user / sudo -H -u ggc_user python3.8 -m pip install -r requirements.txt --user  

  •  Centos

                sudo yum update -y

                wget --no-check-certificate https://bootstrap.pypa.io/get-pip.py

                sudo python3.11 get-pip.py /   sudo python3.8 get-pip.py

                sudo -H -u ggc_user python3.11 -m pip install -r requirements.txt --user / sudo -H -u ggc_user python3.8 -m pip install -r requirements.txt --user

 

 

How to install the Python SDK (System Development Kit)

To be able to install the Edge Connector, the user must install. To do so, follow the steps below:

 

  1. To install the Python SDK, enter the command:python3.11 -m pip install awsiotsdk or python3.8 -m pip install awsiotsdk, and then press Enter.
  2. Next step is to install the necessary libraries.
  3. Enter the command:python3.11 -m pip install awscrt or python3.8 -m pip install awscrt, and then press Enter.
  4. Enter the command:python3.11 -m pip install awsiot or python3.8 -m pip install awsiot, and then press Enter.
  5. Enter the command:python3.11 -m pip install tzlocal or python3.8 -m pip install tzlocal , and then press Enter.
  6. Enter the command:python3.11 -m pip install pytz or python3.8 -m pip install pytz , and then press Enter.

 


How to install Java

To be able to install the Edge Connector, the user’s computer must have installed Java.
To verify the current computer’s Java version follow the steps below:

 

  1. Open the Terminal.
  2. Login as a root user.
  3. Enter the command: java -version, and then press Enter.

 

  • Ubuntu:

            sudo apt update

            sudo apt install openjdk-11-jre  

  • Centos

            sudo yum update -y

            sudo yum install java-11-openjdk

 

Unable To Execute HTTP Request

If while installing the Edge Connector the user gets the following error:
Unable to execute HTTP request: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target.

 

The user can solve this issue following the steps below:

  1. Open the Terminal.
  2. Login as a root user.
  3. Enter the command: cd /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.312.b07-1.amzn2.0.2.x86_64/jre/lib/security/java.security
  4. Use the keyboard arrows to find the next line: jdk.security.caDistrustPolicies=SYMANTEC_TLS
  5. Comment out the previous line by adding a hash symbol at the beginning of the line. It must look like this: #jdk.security.caDistrustPolicies=SYMANTEC_TLS
  6. Comment out the next line: /etc/pki/ca-trust/extracted/java keytool -trustcacerts -keystore "/etc/pki/ca-trust/extracted/java/cacerts" -storepass changeit -importcert -alias aws-trust -file "/etc/pki/ca-trust/source/amazontrust.crt"

 

 

 

Fail to start cloud printing or receive messages

If the user gets the following error:
Fail to start cloud printing or receive messages.
2022-07-28T12:50:30.771Z [INFO] (pool-2-thread-18) sndnv_CloudPrinting: eventstreamrpc.py:308,<Connection at 0x7f3c6da7ea30 /socket/greengrassv2_ipc.sock:0> connected. {serviceInstance=0, serviceName=sndnv_CloudPrinting, currentState=RUNNING}
2022-07-28T12:50:38.068Z [ERROR] (pool-2-thread-19) sndnv_CloudPrinting: FATAL: lambda_runtime.py:146,Failed to import handler function "ggPrint.function_handler" due to exception: Error when retrieving credentials from container-role: Error retrieving metadata: Received non 200 response (500) from ECS metadata: Failed to get connection. {serviceInstance=0, serviceName=sndnv_CloudPrinting, currentState=RUNNING}
2022-07-28T12:50:38.069Z [ERROR] (pool-2-thread-19) sndnv_CloudPrinting: FATAL: lambda_runtime.py:426,Failed to initialize Lambda runtime due to exception: Error when retrieving credentials from container-role: Error retrieving metadata: Received non 200 response (500) from ECS metadata: Failed to get connection. {serviceInstance=0, serviceName=sndnv_CloudPrinting, currentState=RUNNING}
2022-07-28T12:51:28.784Z [INFO] (pool-2-thread-27) sndnv_CloudPrinting: shell-runner-start. {scriptName=services.sndnv_CloudPrinting.lifecycle.shutdown.script, serviceInstance=0, serviceName=sndnv_CloudPrinting, currentState=STOPPING, command=["/greengrass/v2/packages/artifacts/aws.greengrass.LambdaLauncher/2.0.10/lambda-..."]}
2022-07-28T12:51:28.834Z [INFO] (pool-2-thread-18) sndnv_CloudPrinting: Tearing down overlay tmpfs mounts. {serviceInstance=0, serviceName=sndnv_CloudPrinting, currentState=STOPPING}

 

The user can solve this issue following the steps below:

  1. Open the Terminal.
  2. Login as a root user.
  3. Enter the command: pip3 config set global.cert /usr/lib/ZscalerRootCertificate-2048-SHA256.crt

 

If it still do not work, do the following:

  1. Close Zscaler, then restart Greengrass by running the next command: sudo systemctl restart greengrass.service
  2. After restarting, open Zscaler again.