【米尔-全志 T527 开发板-试用评测】第四篇 楼控网关展示平台
<div class='showpostmsg'> 本帖最后由 JerryZhen 于 2024-6-5 14:17 编辑<p>最近一直在忙着设计楼控网关的展示箱,用于展会宣传,现在不同以往,好酒也怕巷子深,卖点宣传很重要。从设计到硬件到软件等一系列工作,其实很繁琐的,经过一个月的奋战,现在已经基本完工,先上张图和视频,展示下效果。</p>
<div style="text-align: center;"></div>
<p> </p>
<p> </p>
<p>f8042271f3c205391deb54aecec5bd13<br />
</p>
<p>项目硬件部分设计思路如下,T527作为数据采集网关,显示部分通过HDMI接显示屏,数据采集部分通过bacnet协议读取楼控DDC设备中的逻辑点位信息,进而将网络中的设备状态在屏幕上进行可视化。项目的原理图如下。可以看到,我们是通过DDC控制两个电机,两个led灯,以及两个温湿度传感器。主控T527会每秒去采集一次DDC中的点位信息,然后将采集到的数据可视化到屏幕上。</p>
<div style="text-align: center;"></div>
<p> </p>
<p>项目的软件部分:软件的核心就是数据采集,具体代码如下:</p>
<pre>
<code class="language-python">import BAC0
from app.services.cache import redis_client
points = {
"led1": {
"read":'192.168.20.51:47808 binaryOutput 501 presentValue',
"default":"inactive",
},
"led2":{
"read": '192.168.20.51:47808 binaryOutput 502 presentValue',
"default":"inactive",
},
"motor1": {
"read": '192.168.20.108:47808 binaryOutput 501 presentValue',
"default":"inactive",
},
"motor2": {
"read": '192.168.20.108:47808 binaryOutput 502 presentValue',
"default":"inactive",
} ,
"temperature": {
"read": '192.168.20.108:47808 analogInput 301 presentValue',
"default": "0.0"
},
"humidity": {
"read": '192.168.20.108:47808 analogInput 302 presentValue',
"default": "0.0"
},
# "switch1": '192.168.20.51:47808 binaryInput 201 presentValue',
# "switch2": '192.168.20.51:47808 binaryInput 202 presentValue',
# "switch3": '192.168.20.108:47808 binaryInput 201 presentValue',
# "switch4": '192.168.20.108:47808 binaryInput 202 presentValue',
}
class BacnetClient:
def __init__(self, host:str):
self.conn = BAC0.connect(host)
def close(self):
self.conn.disconnect()
def read_points(self):
for point, pointinfo in points.items():
try:
point_value = self.conn.read(pointinfo["read"])
if point in ["temperature", "humidity"]:
point_value = '%.1f'%point_value
redis_client.set(point, point_value)
except Exception as e:
print("read error", e)
bacnet_client = BacnetClient("192.168.20.65/24")
if __name__ == "__main__":
ret = bacnet_client.read_points()
print(ret)
bacnet_client.close()</code></pre>
<p> </p>
<p>总结:米尔-全志 T527,配备八核A55高性能处理器,RISC-V协处理器,支持2Tops NPU,拥有丰富的通讯接口,功能强大。非常适合工控行业,本次采用米尔的这款板卡用于原型设计,由于米尔配套的资料齐全,大大缩短了项目周期,为米尔和全志芯点赞。</p>
<p> </p>
</div><script> var loginstr = '<div class="locked">查看本帖全部内容,请<a href="javascript:;" style="color:#e60000" class="loginf">登录</a>或者<a href="https://bbs.eeworld.com.cn/member.php?mod=register_eeworld.php&action=wechat" style="color:#e60000" target="_blank">注册</a></div>';
if(parseInt(discuz_uid)==0){
(function($){
var postHeight = getTextHeight(400);
$(".showpostmsg").html($(".showpostmsg").html());
$(".showpostmsg").after(loginstr);
$(".showpostmsg").css({height:postHeight,overflow:"hidden"});
})(jQuery);
} </script><script type="text/javascript">(function(d,c){var a=d.createElement("script"),m=d.getElementsByTagName("script"),eewurl="//counter.eeworld.com.cn/pv/count/";a.src=eewurl+c;m.parentNode.insertBefore(a,m)})(document,523)</script>
页:
[1]