Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
en:sw:01-mervis:connecting-to-unipi-via-mervis-proxy-hidden [2021/07/13 15:28]
avsetula
en:sw:01-mervis:connecting-to-unipi-via-mervis-proxy-hidden [2022/09/06 08:19] (current)
avsetula
Line 19: Line 19:
   * Unipi controller running [[en:​files:​software:​os-images:​00-start|Mervis OS]]   * Unipi controller running [[en:​files:​software:​os-images:​00-start|Mervis OS]]
   * Temperature regulator project from the [[en:​sw:​01-mervis:​attaching-1-wire-devices-hidden#​download|Attaching 1-Wire devices]] tutorial.   * Temperature regulator project from the [[en:​sw:​01-mervis:​attaching-1-wire-devices-hidden#​download|Attaching 1-Wire devices]] tutorial.
-  * 24V power supply+  * 24 V⎓ power supply
   * 1-Wire temperature sensor   * 1-Wire temperature sensor
   * [[en:​sw:​01-mervis:​04-mervis-proxy|Mervis Proxy]] credentials ([[en:​sw:​01-mervis:​getting-mervis-licence-hidden|tutorial]] how to obtain it)   * [[en:​sw:​01-mervis:​04-mervis-proxy|Mervis Proxy]] credentials ([[en:​sw:​01-mervis:​getting-mervis-licence-hidden|tutorial]] how to obtain it)
Line 26: Line 26:
 </​WRAP>​ </​WRAP>​
  
-===== Setting the Proxy =====+===== 1. Setting the Proxy =====
 If you followed the **Prerequisites**,​ your workspace should look like this: If you followed the **Prerequisites**,​ your workspace should look like this:
  
Line 57: Line 57:
 {{ :​en:​sw:​01-mervis:​connecting-to-unipi-via-mervis-proxy-05-debug-session-1.png?​direct |}} {{ :​en:​sw:​01-mervis:​connecting-to-unipi-via-mervis-proxy-05-debug-session-1.png?​direct |}}
  
-===== Connecting to the PLC via Proxy ===== +===== 2. Connecting to the PLC via Proxy ===== 
-To use the power of proxy connections,​ it is time to learn about **Profiles**. **Profile** are used in situations, where you need to switch between different settings of the **Solution**. In this tutorial, we need to switch between two connection parameters settings: first, when we are connecting to UniPi via local LAN and secondwhen we are connecting ​via proxy.+To use the power of proxy connections,​ it is time to learn about **Profiles**. **Profile** are used in situations, where you need to switch between different settings of the **Solution**. In this tutorial, we need to switch between two connection parameters settings ​- the settings for connecting to the PLC on the local networkand the settings for remote access ​via proxy server.
  
-Every solution ​is automatically ​created with default profile, which you can see in the **Left panel** under the **System** ​option+Each newly created ​solution automatically ​includes a main (defaultprofile ​called "​**Profile**"​, which you can see in the **Left panel** under the **System** ​item. The main profile name cannot be changed.
  
-To create new profile, right click on the default **Profile** and select **Add Child Profile**+To create new profile, right-click on the default **Profile** and select **Add Child Profile**
  
 {{ :​en:​sw:​01-mervis:​connecting-to-unipi-via-mervis-proxy-06-add-child-profile.png?​direct |}} {{ :​en:​sw:​01-mervis:​connecting-to-unipi-via-mervis-proxy-06-add-child-profile.png?​direct |}}
  
-A new profile ​called Profile ​will appear ​under the default oneSelect it by clicking on it and move over to the **Properties panel**Change ​to name of the profile to **proxy**.+A new sub-profile will appear ​below the main profileEach sub-profile is offset ​to the right of the parent profile, indicating a hierarchy 
 + 
 +Click to select ​the newly created ​profile ​and change its name to **proxy** in the **Properties panel**.
  
 {{ :​en:​sw:​01-mervis:​connecting-to-unipi-via-mervis-proxy-07-profile-name.png?​direct |}} {{ :​en:​sw:​01-mervis:​connecting-to-unipi-via-mervis-proxy-07-profile-name.png?​direct |}}
  
-And repeat the process for another profile and let's call it **lan**. ​You should have this workspace ​afterwards:+You should have this workspace ​afterward:
  
 {{ :​en:​sw:​01-mervis:​connecting-to-unipi-via-mervis-proxy-08-both-profiles.png?​direct |}} {{ :​en:​sw:​01-mervis:​connecting-to-unipi-via-mervis-proxy-08-both-profiles.png?​direct |}}
  
-As you can see, the default Profile has colorized icon and the text is bold. This indicates the active profile. Any changes in the solution parameters will be stored into the active profile. To set another profile as active, double click on the profile name+As you can see, the default Profile has colorized icon and the text is bold. This indicates the active profile. Any changes in the solution parameters will be stored into the active profile. ​
  
-So double click on the **proxy** profile ​and it will become activeAs you can see, the default ​profile is still active ​as wellThis is due to the fact the **proxy** profile is a child profile of the default ​profile and therefor are active both.+To select another profile, ​double-click on its name to set it as active and all changes to the solution parameters will now be saved to this profile. 
 + 
 +Do this for the **proxy** profile. ​However, the main profile remains active because the **proxy** ​profile is based on the main profile. Therefore, both will be active. 
 + 
 +---- 
 + 
 +As we have not yet made any changes ​to the **proxy** ​sub-profile, it is now taking over all data from the parent ​profile. If we now change any parameter ​of the solution, it will be set only in the **proxy** sub-profile and the parent (main) profile will not be affected
  
 Now we can change the connection parameters to use the proxy. Select the PLC in the **Left panel** and move over to the **Properties panel**. In the section **PLC Connection Parameters** change the **Connection Type** to **Proxy**. Now we can change the connection parameters to use the proxy. Select the PLC in the **Left panel** and move over to the **Properties panel**. In the section **PLC Connection Parameters** change the **Connection Type** to **Proxy**.
Line 84: Line 92:
 In the section **Connection parameters** change the values accordingly:​ In the section **Connection parameters** change the values accordingly:​
   * **URI**: for PLCs using Mervis OS and Mervis IDE 2.3.0 or newer, set the URI to ''<​nowiki>​tcps://​proxy.unipi.technology:​12349</​nowiki>''​. For the rest, use ''<​nowiki>​tcp://​proxy.unipi.technology:​12348</​nowiki>''​   * **URI**: for PLCs using Mervis OS and Mervis IDE 2.3.0 or newer, set the URI to ''<​nowiki>​tcps://​proxy.unipi.technology:​12349</​nowiki>''​. For the rest, use ''<​nowiki>​tcp://​proxy.unipi.technology:​12348</​nowiki>''​
-  * **Proxy ID**: fill the proxy ID which you obtained in your account on [[http://​unipi.technology|unipi.technology]]+  * **Proxy ID**: fill in the proxy ID which you obtained in your account on [[http://​unipi.technology|unipi.technology]]
  
 {{ :​en:​sw:​01-mervis:​connecting-to-unipi-via-mervis-proxy-10-connection-parameters.png?​direct |}} {{ :​en:​sw:​01-mervis:​connecting-to-unipi-via-mervis-proxy-10-connection-parameters.png?​direct |}}
  
-Simply ​start the debugging session and the Mervis IDE will connect to the UniPi controller over the Mervis Proxy. +Now all that remains is to start the **debugging session** and the Mervis IDE will connect to the PLC through a proxy server. To switch ​back to the LAN connection, all you have to do is turn off debugging, ​set the main **Profile** as active, and start **debugging session** again.
- +
-To change the connection parameters ​back to LAN settings simply ​set the **lan** profile ​active.+
  
 <WRAP center round important>​ <WRAP center round important>​
-__**Caution:​**__ ​When working with profiles ​you need to make sure all changes ​in the project are applied only to the parent ​profile ​(**Profile**). Changes performed on parent profiles are written into child profilesbut any change in a child profile will cause a permanent loss of parent profile ​dependent attributes in all items changed ​in the child profile ​(including ​the above-mentioned **Connection parameters** setting).+__**Caution:​**__ ​If you changed the wrong value in the sub-profile, ​or you wanted to make the change in the parent profile, it is possible to reset the value in the sub-profile ​using the {{:​files:​dialog-reset2_button.png?​nolink|}} button next to the value. Clicking this button deletes the value and retrieves it from the parent profile.
 </​WRAP>​ </​WRAP>​