esp8266和dht11温湿度传感器 数据采集mqtt入库完成

master
修改密码漏洞修复完成 4 months ago
parent 607666f395
commit eaddd51d9f

@ -10,7 +10,9 @@
<configuration>
<setting name="validation-enabled" value="true" />
<setting name="provider-name" value="Hibernate" />
<datasource-mapping />
<datasource-mapping>
<factory-entry name="entityManagerFactory" />
</datasource-mapping>
<naming-strategy-map />
</configuration>
</facet>

@ -59,14 +59,14 @@ public class AdminClientTemperatureApplication implements CommandLineRunner, App
log.info(entry.getKey());//demo1Controller
}
try {
// if (temperatureService != null) {
// log.info("------------------------");
// log.info("TemperatureController is not empty");
// MqttRSAClient client = new MqttRSAClient();
// client.start(temperatureService);
// }else {
// log.info("temperatureService is empty");
// }
if (temperatureService != null) {
log.info("------------------------");
log.info("TemperatureController is not empty");
MqttRSAClient client = new MqttRSAClient();
client.start(temperatureService);
}else {
log.info("temperatureService is empty");
}
if (temperatureEspService != null) {
log.info("------------------------");
log.info("temperatureEspService is not empty");

@ -36,9 +36,9 @@ public class TemperatureEspController {
*/
@GetMapping("/saveEspTemperature")
private String save(@Param("temperature")String temperature, @Param("humidity")String humidity) {
// log.info(temperature);
// log.info(humidity);
// this.temperatureEspService.saveTemperature(temperature,humidity);
log.info(temperature);
log.info(humidity);
this.temperatureEspService.saveTemperature(temperature,humidity);
return "success";
}
}

@ -39,10 +39,10 @@ public class TemperatureEspServiceImpl implements TemperatureEspService {
temperatureEsp.setDataMinute(dataMinute);
temperatureEsp.setSource("http");
String topic = "BF9D7939ND2N";
String topic = "/device/esp8266/001";
if(topic!=null){
temperatureEsp.setTopic(topic);
if(topic.equals("BF9D7939ND2N")){
if(topic.equals("/device/esp8266/001")){
temperatureEsp.setLocationDesc("广东省珠海市高新区唐家湾镇南方软件园B2栋4楼珠海瑞洪智能系统工程有限公司");
}
if(topic.equals("WifiSHT/7C87CE9F5CBF/SHT20")){

Loading…
Cancel
Save