📜 ⬆️ ⬇️

Create your site to manage Arduine

Once, I received a letter in the mail, a person was interested in the possibility of implementing his own site for working with Arduina. Well, I thought, and in fact, it would be nice to automate the process of creating such sites. Said, did, well, bad, judge for yourself.

To put the necessary emphasis on the main points of my implementation , I built the content of this article in the style of questions and answers. The question itself came up with - he answered it himself (such is the pseudo-dialogue).

How long does it take to create a simple site and a working sketch for arduin?
It depends on the task, if you just need to remotely blink a light bulb, then in 15 minutes you can cope (provided that the tool has already been studied).
... I know, I know, there are tools that will make this work faster, but what you get will surely be a ready-made application (for example, for android). Yes, for someone ready android application is great. But still, a personal site is a personal site, because you yourself determine its appearance and content. He will be your child, your author's work, and for someone, and a source of pride (pah-pah, this will not happen to me).
')
What elements will the entire working system consist of?
1) A running intermediary service program through which the arduin will work.
2) Arduin, which will connect to this utility program.
3) The simplest web server to host files.

What is the route of data exchange?
Webpage >> Broker >> Arduin.
Arduina >> broker >> web page.

Why do we need a "blacksmith" (mediator in the form of a utility program)?

Is it safe to manage arduine via the Internet?
Yes, safely, all data is encrypted. Although the bottleneck is the access to the contents of the website itself, but this is already solved by a secure HTTPS connection.

How to get all the necessary software components?
1) On my website, create the configuration of your system. How to do this, see the previous article on Habré.
2) Download the archive with the source for Arduin.
3) Download the archive with the files for your website (you can also embed these files in an already existing website).
4) Download the archive with the intermediary utility (“blacksmith”).

How to run the broker utility?
1) Run this program on a Windows machine, to which the arduin can connect to an IP address.
2) Enter your username, press Enter
3) Enter your password, press Enter

How to start the site?
For speed, you can use the hosting "bitballoon.com" (authorization through GitHab). By dragging the archive with your site to the image “Drag & drop a new site” on the browser page, you will immediately receive a link to your work site. Follow this link to your created website, enter your username / password, and make sure that the page is linked to the broker's utility program. In this case, the arduin itself will not be detected, which is not surprising, because not everything has been done yet.

How to program arduin?
Unpack the archive with the source code, connect the library and open the project. In the sketch, correct the default address (hostname) to the IP address of your intermediary (if this address is not changed, then arduin will work through the cloud service).
Compile and download the program to the device. After connecting to the network, Arduin will contact the already running intermediary program. Go to the site and make sure that there is a connection with your arduine (yeah, the mediator is doing his job).
Now do what it was all about. Fill in the sketch all the signal handlers with the logic you need (I hope you can program?), And reload the program into the device.

Well, now you have your own website that manages your arduine.

Probably you may have other questions, I will try to guess them.

How to choose a hosting?
The site can be placed on any hosting, PHP and database are not used.

Can I manage multiple devices through one site?
Can.

Can the site store multiple control panels for arduino?
Can.

What to do if there is no possibility / desire to use the service program of an intermediary?
Use the cloud "blacksmith."

PS
And yet, why not place your website directly into the arduin itself?
In part, I have already answered this question. But in general, of course, you are right. Many people do this, draw interfaces themselves, invent data exchange protocols themselves. And this way for real homemade ... and someone, anyhow, and in production.
:)

Source: https://habr.com/ru/post/257451/


All Articles