CN113900637A - Web-based Arduino intelligent hardware control method and system - Google Patents

Web-based Arduino intelligent hardware control method and system Download PDF

Info

Publication number
CN113900637A
CN113900637A CN202111166878.9A CN202111166878A CN113900637A CN 113900637 A CN113900637 A CN 113900637A CN 202111166878 A CN202111166878 A CN 202111166878A CN 113900637 A CN113900637 A CN 113900637A
Authority
CN
China
Prior art keywords
intelligent hardware
web
arduino
arduino intelligent
graphical programming
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202111166878.9A
Other languages
Chinese (zh)
Other versions
CN113900637B (en
Inventor
刘汉军
彭鸿雁
陈坤和
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hainan Jiada Technology Co ltd
Original Assignee
Hainan Jiada Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hainan Jiada Technology Co ltd filed Critical Hainan Jiada Technology Co ltd
Priority to CN202111166878.9A priority Critical patent/CN113900637B/en
Publication of CN113900637A publication Critical patent/CN113900637A/en
Application granted granted Critical
Publication of CN113900637B publication Critical patent/CN113900637B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/34Graphical or visual programming
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44521Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading
    • G06F9/44526Plug-ins; Add-ons
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/448Execution paradigms, e.g. implementations of programming paradigms
    • G06F9/4488Object-oriented
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/02Total factory control, e.g. smart factories, flexible manufacturing systems [FMS] or integrated manufacturing systems [IMS]

Abstract

The invention provides a Web-based Arduino intelligent hardware control method and a Web-based Arduino intelligent hardware control system, wherein the method comprises the following steps: packaging an interface of a Web Serial API; setting an extension plug-in supporting Arduino intelligent hardware in a graphical programming tool virtual machine; setting a serial protocol supporting the communication between the Web browser and the Arduino intelligent hardware through an Arduino editor, compiling the serial protocol into a binary file and burning the binary file into the Arduino intelligent hardware; and editing a control instruction through a graphical programming tool on the Web browser, sending the control instruction to an interface of a Web Serial API by the extension plug-in, and acquiring and executing the control instruction by the Arduino intelligent hardware through the interface of the Web Serial API. According to the invention, when the Arduino intelligent hardware is controlled by the graphical programming tool, a third-party hardware assistant is not required to be installed and updated, and in the education and training scene, especially a school machine room with an automatic recovery system, the installation process is simplified, the Arduino teaching efficiency is improved, and the operation threshold and the complexity of students are reduced.

Description

Web-based Arduino intelligent hardware control method and system
Technical Field
The invention relates to the technical field of intelligent hardware control, in particular to a Web-based Arduino intelligent hardware control method and system.
Background
In order to facilitate the learning of the programming basic concept by children or adult programming beginners, researchers developed a number of simple graphical programming tools that can complete programming by simple operations such as clicking, dragging, etc., as compared to conventional programming tools with complex functions such as Eclipse, IntelliJ IDEA, etc. The Arduino is a convenient, flexible and convenient open-source electronic prototype platform and comprises hardware, Arduino boards of various types and software, Arduino IDE, wherein the Arduino can sense the environment through various sensors and feed back and influence the environment through controlling lamplight, motors and other devices. The traditional Arduino programming needs to write and burn after writing a C + + program through official Arduino software or write a C + + program through an official Web editor, but the burning needs a user to install an Arduino Create Agent hardware master hand first, controls Arduino intelligent hardware in a simple graphical programming tool in a real-time mode, and the official does not support. In many projects that are based on simple graphical programming tools for secondary development, Arduino hardware is connected to a computer, and a user is required to install a hardware connection assistant developed by the user, as shown in fig. 1. It can be seen that regardless of the manner of uploading and controlling Arduino by Arduino official burning and recording, or other manners of controlling Arduino in the project of simple graphical programming tool secondary development, users are required to install Arduino Create Agent or hardware assistant, which brings huge trouble to the teaching scene of the school, because the school machine room generally has a computer recovery system, all newly installed software and data of the restarting computer can be lost, so that it becomes extremely difficult to install and update Arduino Create Agent or hardware assistant.
Disclosure of Invention
Accordingly, the present invention is directed to a method and system for Web-based Arduino intelligent hardware control, which overcome or at least partially solve the above-mentioned problems of the prior art.
In order to achieve the above object, a first aspect of the present invention provides a Web-based Arduino intelligent hardware control method, which is applied to a Web-based Arduino intelligent hardware control system, where the system includes a Web browser installed with a Web serial API and a graphical programming tool, and Arduino intelligent hardware with firmware, and the method includes the following steps:
s101, packaging an interface of a Web Serial API;
s102, setting an extension plug-in supporting Arduino intelligent hardware in a virtual machine of a graphical programming tool;
s103, setting a serial protocol supporting the communication between the Web browser and the Arduino intelligent hardware through an Arduino editor, compiling the serial protocol into a binary file and burning the binary file into the Arduino intelligent hardware;
and S104, editing a control instruction through a graphical programming tool on the Web browser, sending the control instruction to an interface of a Web Serial API by the extension plug-in, and acquiring and executing the control instruction by the Arduino intelligent hardware through the interface of the Web Serial API.
Further, the method for setting the extension plug-in supporting the Arduino intelligent hardware in the virtual machine of the graphical programming tool specifically comprises the following steps:
s201, creating an extended plug-in folder supporting Arduino intelligent hardware in an extended tool directory under a source code directory of a graphical programming tool virtual machine;
s202, creating an index.js file in an extension plug-in folder;
s203, registering the extension plug-in an extension manager of the virtual machine of the graphical programming tool.
Further, the graphical programming tool comprises:
the interface construction module is used for constructing a human-computer interaction interface of the graphical programming tool;
the graph definition module is used for defining the splicing between the graphical program codes and different graphs;
a virtual machine for managing state, executing program logic, and customizing an extension plug-in;
the multi-language translation module is used for realizing the support of the graphical programming tool on a multi-language environment;
the rendering module is used for realizing animation rendering according to program logic;
and the sound processing module is used for realizing the management and control of the audio attached to the program.
Further, the graphical programming tool adopts Scratch software.
Further, Arduino intelligent hardware is installed through the USB connection the computer equipment of Web browser.
Further, the step S103 specifically includes the following steps:
s301, judging whether the computer equipment provided with the Web browser is connected with Arduino intelligent hardware or not, if so, executing a step S302, otherwise, executing a step S303;
s302, exporting the compiled binary file, and directly burning the compiled binary file into Arduino intelligent hardware through a USB;
and S303, exporting the compiled binary file and saving the compiled binary file as hex firmware.
Further, the output stream of the Web Serial API to the Arduino intelligent hardware is realized through a WritableStreamDefaultWriter interface.
A second aspect of the present invention provides a Web-based Arduino intelligent hardware control system, which is configured to implement the method of the first aspect, and includes a Web browser installed with a Web serial API and a graphical programming tool, and Arduino intelligent hardware with firmware.
Compared with the prior art, the invention has the beneficial effects that:
(1) the Arduino intelligent hardware extension plug-in unit of the simple graphical programming tool is constructed based on the browser Web Serial API, so that a third-party hardware assistant does not need to be installed and updated when the Arduino intelligent hardware is controlled by the graphical programming tool, and in an education and training scene, particularly a school machine room with an automatic recovery system, the installation process is simplified, the Arduino teaching efficiency is improved, and the operation threshold and the complexity of students are reduced;
(2) the communication between graphical programming tool and the Arduino intelligent hardware is realized through the interface of encapsulation Web Serial API, compares in traditional hardware assistant as the communication bridge, has improved the communication efficiency between host computer equipment and the Arduino intelligent hardware greatly.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is apparent that the drawings in the following description are only preferred embodiments of the present invention, and it is obvious for those skilled in the art that other drawings can be obtained based on these drawings without inventive efforts.
FIG. 1 is a schematic diagram illustrating the connection principle of a graphical programming tool controlling Arduino intelligent hardware in the prior art.
Fig. 2 is a schematic diagram of an overall structure of an Arduino intelligent hardware control method based on a Web according to an embodiment of the present invention.
Fig. 3 is a schematic view of an installation flow of an extension plug-in provided in the embodiment of the present invention.
Fig. 4 is a flowchart illustrating a serial protocol burning method according to an embodiment of the present invention.
Fig. 5 is a schematic diagram of a Web-based Arduino intelligent hardware control system according to another embodiment of the present invention.
Detailed Description
The principles and features of this invention are described below in conjunction with the following drawings, the illustrated embodiments are provided to illustrate the invention and not to limit the scope of the invention.
Referring to fig. 1, the present embodiment provides a Web-based Arduino intelligent hardware control method, which is applied to a Web-based Arduino intelligent hardware control system, where the system includes a Web browser installed with a Web serial API and a graphical programming tool, and Arduino intelligent hardware with firmware. The method comprises the following steps:
s101, packaging an interface of a Web Serail API so as to be convenient for a graphical programming tool or Arduino intelligent hardware calling. And the interface of the Web Serail API is used for realizing the communication between the Web browser and the Arduino intelligent hardware.
Users, particularly educational systems, hobbyists and industrial sectors, connect external devices to their computers, often requiring separate software for control, for example, robots are often used to teach computer programming and electronics in schools, which requires separate software to upload code to the robot via a serial connection for remote control.
Some web sites communicate with external devices, often requiring a user to manually install a localization assistant program or to package the web site and assistant program together into an offline local program through a framework such as an Electron. Either way, the operation is complicated, and the user experience is poor.
Web Serial APIs provide a path for websites to read and write Serial devices through Web scripts, and these APIs can serve as a bridge between the Web and the physical world, allowing Web documents to communicate with other Serial devices such as microcontrollers, 3D printers, and the like.
S102, an extension plug-in supporting Arduino intelligent hardware is arranged in the virtual machine of the graphical programming tool.
S103, setting a serial protocol supporting the communication between the Web browser and the Arduino intelligent hardware through the Arduino editor, compiling the serial protocol into a binary file and burning the binary file into the Arduino intelligent hardware.
And S104, editing a control instruction through a graphical programming tool on the Web browser, sending the control instruction to an interface of a Web Serial API by the extension plug-in, and acquiring and executing the control instruction by the Arduino intelligent hardware through the interface of the Web Serial API.
As a preferred implementation manner, referring to fig. 3, in step S102, the setting of an extension plug-in supporting Arduino intelligent hardware in a virtual machine of a graphical programming tool specifically includes the following steps:
s201, creating an extended plug-in folder supporting Arduino intelligent hardware in an extended tool directory under a source code directory of a graphical programming tool virtual machine.
And S202, creating an index.js file in the extension plug-in folder.
S203, registering the extension plug-in an extension manager of the virtual machine of the graphical programming tool. After the extension plug-in registration is completed, the graphical programming tool can realize the communication with the Arduino intelligent hardware by calling the extension plug-in.
As a preferred embodiment, the graphical programming tool comprises: the system comprises an interface construction module, a graphic definition module, a virtual machine, a multi-language translation module, a rendering module and a sound processing module.
The interface construction module is used for constructing a human-computer interaction interface of the graphical programming tool.
The graph definition module is used for defining graphical program codes and splicing among different graphs.
The virtual machine is used to manage state, execute program logic, and customize extension plug-ins.
The multi-language translation module is used for realizing the support of a graphical programming tool to a multi-language environment.
The rendering module is used for realizing animation rendering according to program logic and expressing a program running result through an animation effect.
The sound processing module is used for realizing the management and control of the audio attached to the program.
Illustratively, the graphical programming tool may employ Scratch software.
Specifically, Arduino intelligent hardware can be installed through the USB connection the computer equipment of Web browser also can adopt other serial port bus standards to connect computer equipment, and the skilled person in the art can select according to actual need when implementing the method of this embodiment.
As a preferred embodiment, referring to fig. 4, the step S103 specifically includes the following steps:
s301, judging whether the computer equipment provided with the Web browser is connected with Arduino intelligent hardware or not, if so, executing the step S302, otherwise, executing the step S303.
S302, exporting the compiled binary file, and directly burning the compiled binary file into Arduino intelligent hardware through a USB.
And S303, exporting the compiled binary file and saving the compiled binary file as hex firmware.
In this embodiment, support after the serial protocol setting of Web browser and Arduino intelligent hardware communication is accomplished, if install Web browser's computer equipment and Arduino intelligent hardware are being in connected state, then directly will be based on binary file that serial protocol compiled burns in Arduino intelligent hardware, otherwise will compile binary file save as hex firmware to be used for burning the firmware of Arduino intelligent hardware in preparation for.
As a preferred implementation, the output stream of the Web Serial API to the Arduino intelligent hardware is implemented via a WritableStreamDefaultWriter interface. In this embodiment, by means of the backpressure mechanism of the Web Serial API output stream writeable streamdefaultwriter, compared with the conventional hardware assistant as a communication bridge, the communication efficiency between the upper computer and Arduino hardware can be greatly improved.
Another embodiment of the present invention further provides a Web-based Arduino intelligent hardware control system, which includes a Web browser installed with a Web serial API and a graphical programming tool, and Arduino intelligent hardware with firmware, with reference to fig. 5. The system is used for implementing the method described in the foregoing method embodiment, and the working principle and technical effect of the system can refer to the foregoing method embodiment, which is not described herein again.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like that fall within the spirit and principle of the present invention are intended to be included therein.

Claims (8)

1. The utility model provides a Web-based Arduino intelligent hardware control method which characterized in that, the method is applied to Web-based Arduino intelligent hardware control system, the system is including installing Web SerailAPI and graphical programming tool's Web browser, the Arduino intelligent hardware that has the firmware, the method includes the following steps:
s101, packaging an interface of a Web Serial API;
s102, setting an extension plug-in supporting Arduino intelligent hardware in a virtual machine of a graphical programming tool;
s103, setting a serial protocol supporting the communication between the Web browser and the Arduino intelligent hardware through an Arduino editor, compiling the serial protocol into a binary file and burning the binary file into the Arduino intelligent hardware;
and S104, editing a control instruction through a graphical programming tool on the Web browser, sending the control instruction to an interface of a Web Serial API by the extension plug-in, and acquiring and executing the control instruction by the Arduino intelligent hardware through the interface of the Web Serial API.
2. The Web-based Arduino intelligent hardware control method according to claim 1, wherein the step of setting an extension plug-in supporting Arduino intelligent hardware in the virtual machine of the graphical programming tool specifically comprises the steps of:
s201, creating an extended plug-in folder supporting Arduino intelligent hardware in an extended tool directory under a source code directory of a graphical programming tool virtual machine;
s202, creating an index.js file in an extension plug-in folder;
s203, registering the extension plug-in an extension manager of the virtual machine of the graphical programming tool.
3. The Web-based Arduino intelligent hardware control method according to claim 1 or 2, wherein the graphic programming tool comprises:
the interface construction module is used for constructing a human-computer interaction interface of the graphical programming tool;
the graph definition module is used for defining the splicing between the graphical program codes and different graphs;
a virtual machine for managing state, executing program logic, and customizing an extension plug-in;
the multi-language translation module is used for realizing the support of the graphical programming tool on a multi-language environment;
the rendering module is used for realizing animation rendering according to program logic;
and the sound processing module is used for realizing the management and control of the audio attached to the program.
4. The Web-based Arduino intelligent hardware control method according to claim 1 or 2, wherein the graphical programming tool employs Scratch software.
5. The Web-based Arduino intelligent hardware control method according to claim 1, wherein said Arduino intelligent hardware is a computer device installed with said Web browser through USB connection.
6. The Web-based Arduino intelligent hardware control method according to claim 1, wherein the step S103 specifically comprises the following steps:
s301, judging whether the computer equipment provided with the Web browser is connected with Arduino intelligent hardware or not, if so, executing a step S302, otherwise, executing a step S303;
s302, exporting the compiled binary file, and directly burning the compiled binary file into Arduino intelligent hardware through a USB;
and S303, exporting the compiled binary file and saving the compiled binary file as hex firmware.
7. The Web-based Arduino intelligent hardware control method of claim 1 in which the output stream of the Web Serial API to Arduino intelligent hardware is implemented by a writeable streamdefaultwriter interface.
8. A Web-based Arduino intelligent hardware control system, characterized in that said system is adapted to implement the method of any of claims 1-7, said system comprising a Web browser, Arduino intelligent hardware with firmware, installed with a Web serial API and graphical programming tools.
CN202111166878.9A 2021-09-30 2021-09-30 Arduino intelligent hardware control method and system based on Web Active CN113900637B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111166878.9A CN113900637B (en) 2021-09-30 2021-09-30 Arduino intelligent hardware control method and system based on Web

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111166878.9A CN113900637B (en) 2021-09-30 2021-09-30 Arduino intelligent hardware control method and system based on Web

Publications (2)

Publication Number Publication Date
CN113900637A true CN113900637A (en) 2022-01-07
CN113900637B CN113900637B (en) 2023-08-01

Family

ID=79190163

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111166878.9A Active CN113900637B (en) 2021-09-30 2021-09-30 Arduino intelligent hardware control method and system based on Web

Country Status (1)

Country Link
CN (1) CN113900637B (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103197929A (en) * 2013-03-25 2013-07-10 中国科学院软件研究所 System and method for graphical programming facing children
WO2015166243A1 (en) * 2014-04-29 2015-11-05 Easysharepoint Limited Web site deployment system and method
CN105511860A (en) * 2015-11-30 2016-04-20 大连文森特软件科技有限公司 On-line graphical programming system
CN107423049A (en) * 2017-04-18 2017-12-01 南京凯蒙教育科技有限公司 Realize method, browser and the terminal device of online programming
CN109032573A (en) * 2018-06-20 2018-12-18 深圳市编玩边学教育科技有限公司 A kind of hardware programming system and method
CN111190588A (en) * 2018-11-14 2020-05-22 巴赫曼有限公司 Method and device for operating and controlling a machine installation and for generating a field bus configuration by means of a graphical development interface

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103197929A (en) * 2013-03-25 2013-07-10 中国科学院软件研究所 System and method for graphical programming facing children
WO2015166243A1 (en) * 2014-04-29 2015-11-05 Easysharepoint Limited Web site deployment system and method
CN105511860A (en) * 2015-11-30 2016-04-20 大连文森特软件科技有限公司 On-line graphical programming system
CN107423049A (en) * 2017-04-18 2017-12-01 南京凯蒙教育科技有限公司 Realize method, browser and the terminal device of online programming
CN109032573A (en) * 2018-06-20 2018-12-18 深圳市编玩边学教育科技有限公司 A kind of hardware programming system and method
CN111190588A (en) * 2018-11-14 2020-05-22 巴赫曼有限公司 Method and device for operating and controlling a machine installation and for generating a field bus configuration by means of a graphical development interface

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
风筝: "如何在Arduino开发板和Web浏览器之间建立通信连接", pages 1 *

Also Published As

Publication number Publication date
CN113900637B (en) 2023-08-01

Similar Documents

Publication Publication Date Title
WO2020248811A1 (en) Online graphical programming system based on blockly and raspberry pi and method for using same
CN111475155B (en) Graphical programming method for robot interaction based on image blocks
CN103513992B (en) A kind of general Edutainment robot application software development platform
CN112035101B (en) Method, device, medium and equipment for creating command library combining RPA and AI
WO2020134633A1 (en) Development method and device for application program, and integrated development tool
CN106484403A (en) A kind of cross-platform graphical developing system of robot
KR100988597B1 (en) Robot content authoring system having user Friendly form in web environments
CN103472743A (en) Visualized step programming method
CN103019702B (en) A kind of visualization of 3 d display and control editing system and method
CN112276943A (en) Robot teaching control method, teaching control system, computer device, and medium
CN110861085A (en) VxWorks-based mechanical arm instruction interpreter system
KR101916765B1 (en) Apparatus for 3d modeling and recording medium recording program for executing 3d modeling operation
CN113900637B (en) Arduino intelligent hardware control method and system based on Web
CN105843659B (en) Method and system for implementing embedded C compiler
CN111880793A (en) HMI configuration system and method based on binary file
Buchmann Towards tool support for agile modeling: sketching equals modeling
CN114571443A (en) System and method for teaching robot motion through mobile terminal wireless control low code
CN115344248A (en) RPA development field editing diversification method
CN104111823A (en) Online interactive block type editing method and editor
CN105335153A (en) Dynamic script automatic-generating method
CN109522009A (en) The write method of truss loading and unloading robot control program
CN108008945A (en) Device PCI drives development approach under a kind of LINUX system
CN220855475U (en) Composite on-line industrial intelligent control circuit
JP2003140714A (en) Graphic language program preparing program and its device
CN114683277A (en) Method for teaching robot motion through mobile terminal wireless control low code

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant