《電子技術應用》
您所在的位置:首頁 > 嵌入式技术 > 设计应用 > 基于ESP32嵌入式Web服务器的手机化仪表设计
基于ESP32嵌入式Web服务器的手机化仪表设计
电子技术应用
丁依,何岭松
华中科技大学 机械科学与工程学院
摘要: 随着物联网技术的发展,单片机性能升级且功能变得丰富,利用单片机创建Web服务器,使用浏览器作为客户端进行访问变得可行。借鉴其思路,提出一种嵌入式Web服务器+浏览器架构的无软件化手机仪表设计方法。先用JavaScript语言将常用的手机仪表元素设计为一个能嵌入到单片机存储系统中的50 KB大小的库,然后在其基础上形成C风格手机仪表HTML网页生成函数,最后再通过单片机Web服务器将封装后的C风格手机仪表HTML网页生成函数转换为手机浏览器支持的HTML网页进行显示和用户操作。该设计实现将仪表软件安装在下位机,客户端零安装、零配置访问仪表界面。
中圖分類號:TP311.1 文獻標志碼:A DOI: 10.16157/j.issn.0258-7998.256290
中文引用格式: 丁依,何嶺松. 基于ESP32嵌入式Web服務器的手機化儀表設計[J]. 電子技術應用,2025,51(11):107-115.
英文引用格式: Ding Yi,He Lingsong. Design of mobile phone instrument based on ESP32 embedded Web server[J]. Application of Electronic Technique,2025,51(11):107-115.
Design of mobile phone instrument based on ESP32 embedded Web server
Ding Yi,He Lingsong
School of Mechanical Science and Engineering, Huazhong University of Science and Technology
Abstract: With the development of Internet of Things technology, the performance of the single-chip microcontroller has been upgraded and the functions have become rich, and it has become feasible to use the single-chip microcontroller to create a web server and use the browser as a client to access. Drawing on its ideas, a mobile phone instrument design method that does not require software installation based on embedded Web server + browser architecture was proposed. First, the JavaScript language is used to design the commonly used mobile phone instrument elements as a 50KB library that can be embedded in the storage system of single-chip microcontroller. Then, on the basis of it, the C-style mobile phone instrument HTML web page generation function is formed. Finally, through the single-chip microcomputer web server, the encapsulated C-style mobile phone instrument HTML web page generation function is converted into the HTML web page supported by the mobile phone browser for display and user operation. It realizes the function of installing the instrument software on the lower computer, and accessing the instrument interface with zero installation and zero configuration on the client.
Key words : embedded;web server;mobile phone instrument;browser;JavaScript program;instrument library

引言

隨著社會需求不斷地信息化、自動化和智能化,基于單片機設計的智能儀表在不同領域中都發(fā)揮著重要作用[1-3]。目前主流的智能儀表大多需要在顯示模塊上預裝APP后才能使用[4-5],對安裝平臺也有一定的要求[6],當下位機儀器被更換時,需要重裝軟件進行適配,較為繁瑣,或者存在整個儀表的集成度太高導致二次開發(fā)的學習成本較大等問題,例如東輝的DY2000系列智能儀表,通常使用LCD、LED或OLED顯示屏作為顯示模塊,界面設計簡潔而直觀,但顯示的內(nèi)容有限且更改較為困難,用戶在某些應用場景下可能無法找到合適的功能設置;德能的智能水表采用藍牙技術與手機連接的設計模式,儀表界面更加豐富,實現(xiàn)了“抄表不入戶,繳費不出門”的智能供水服務,但需要下載并安裝APP后才能使用。隨著物聯(lián)網(wǎng)技術的迅速發(fā)展,目前許多單片機都集成了ESP32、ESP8266等Wi-Fi通信模塊,且ESP32的大部分性能優(yōu)于ESP8266[7-8],能夠輕松地在下位機運行嵌入式Web服務器,實現(xiàn)網(wǎng)頁托管與訪問等功能,網(wǎng)上已經(jīng)有了許多應用[9-11]。由于嵌入式系統(tǒng)資源有限且儀表庫封裝工作繁瑣,目前沒有能夠在嵌入式Web服務器中運行的小型儀表庫,缺少這類手機儀表的應用。

針對這些問題,本文提出一種基于ESP32嵌入式Web服務器的手機化儀表設計方法,采用嵌入式Web服務器與瀏覽器通信的模式,設計了一個可以自由組裝儀表界面的下位機標準庫,能夠?qū)x表界面存儲在單片機中,通過Web服務器方式運行,利用手機瀏覽器查看與操作儀表界面,不用安裝任何軟件,只需要連接與下位機相同的熱點,即可通過設備IP地址訪問不同儀器的儀表界面。該設計操作簡單且交互友好,學習成本低,儀表庫開源便于進一步拓展。


本文詳細內(nèi)容請下載:

http://www.ihrv.cn/resource/share/2000006848


作者信息:

丁依,何嶺松

(華中科技大學 機械科學與工程學院,湖北 武漢 430074)


subscribe.jpg

此內(nèi)容為AET網(wǎng)站原創(chuàng),未經(jīng)授權禁止轉(zhuǎn)載。

相關內(nèi)容