Browse Source

大屏MQTT

样式分支
NXX 2 years ago
parent
commit
ee610c9125
2 changed files with 19 additions and 3 deletions
  1. +12
    -2
      BPASmartClient.Business/LocalMqtt.cs
  2. +7
    -1
      BPASmartClient/App.config

+ 12
- 2
BPASmartClient.Business/LocalMqtt.cs View File

@@ -24,6 +24,11 @@ namespace BPASmartClient.Business

ScreenDeviceType LocDeviceType;

string MQTT_IP;
string MQTT_PORT;
string MQTT_USERNAME;
string MQTT_PASSWORD;

public void Init(ScreenDeviceType DeviceType)
{
MqttPushs.Name = DeviceType;
@@ -32,8 +37,13 @@ namespace BPASmartClient.Business
{
mQTTProxy.Subscrib(ScreenTOPIC.GetInstance.GetTopic(DeviceType)) ;
});
mQTTProxy.Connect("emqx_u_block", "emqx_p_admin3658765490789", "47.108.65.220", 1883, $"{DeviceType}_设备监听数据{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}");//"10.2.1.254""admin", "public"
});
MQTT_IP = System.Configuration.ConfigurationManager.AppSettings["MQTT_DevieScreem_IP"].ToString();
MQTT_PORT = System.Configuration.ConfigurationManager.AppSettings["MQTT_DevieScreem_Port"].ToString();
MQTT_USERNAME = System.Configuration.ConfigurationManager.AppSettings["MQTT_DevieScreem_User"].ToString();
MQTT_PASSWORD = System.Configuration.ConfigurationManager.AppSettings["MQTT_DevieScreem_Password"].ToString();

mQTTProxy.Connect(MQTT_USERNAME, MQTT_PASSWORD, MQTT_IP, int.Parse(MQTT_PORT), $"{DeviceType}_设备监听数据{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}");//"10.2.1.254""admin", "public"
}

public void Start()


+ 7
- 1
BPASmartClient/App.config View File

@@ -29,7 +29,7 @@
<add key="DeviceName" value="qsqdzklb"/>
<add key="DeviceSecret" value="e2b300892c3e21469c8dc6c7c5c4430d"/>
<add key="PasswordBox" value="6WrKhYmTIhLV7g24jIH/lg=="/>

<!--外设配置-->
<add key="COM_Coffee" value="COM3"/>
@@ -39,6 +39,12 @@
<add key="IceCream_CXB_Threshold" value="90"/>
<add key="COM_ICChip" value="COM6"/>
<add key="BAUD_IChip" value="9600"/>
<!--大屏MQTT-->
<add key="MQTT_DevieScreem_IP" value="171.221.208.23"/>
<add key="MQTT_DevieScreem_Port" value="11883"/>
<add key="MQTT_DevieScreem_User" value="admin"/>
<add key="MQTT_DevieScreem_Password" value="public1"/>


</appSettings>

Loading…
Cancel
Save