B
B
Bay12021-01-19 15:39:59
linux
Bay1, 2021-01-19 15:39:59

How to make a "postamat" that works on requests from the site?

Hello. I got the idea to make my own little postamat. I read on the forums that the best way to learn something is to make your own project. I think "postamat" is a good place to learn all the technologies I'm interested in (I hope I put in the right tags).
I think you have already understood what the essence of the device is and how it works, but I will try to explain how I see it (I will be glad if you correct me and supplement).
I want to do this:
1) There is a site, you need to register on it and press a button, for example, "I want lemonade" or "I want ice cream." The database system checks if you have access (for example, you can do this if you are over 18 years old) and displays a 4-digit code.
2) The site through the server (not sure how it works) sends the file to the device, which receives and processes it. As I understand it, this is easiest to implement on Linux running Raspberry. The device must only accept files via the Internet;
3) A person, when he needs to, approaches the device and enters his code. Raspberry is connected to Arduino and sends its command to it. The Arduino sends a signal to the servo, which opens the door.
4) This is all read and sent back to the site, where "lemonade taken" is displayed. +1 taken lemonade by this user is entered into the database.

I will be glad if someone responds and prompts something. Maybe someone knows useful links would be great too. Thank you!

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Armenian Radio, 2021-01-19
@Bay1

In order to give a command to the lock to open the door, it is not necessary to use a bunch of arduino and rpi. A small controller like ESP8266 is enough. He already has enough brains to keep in touch with the server and open the lock.
You take on a big task and want to tackle it all at once. So you risk drowning in the details. Now you have made a decomposition of the form "how in my opinion it should work".
A more productive decomposition is "what stages the development of a child prodigy will consist of."
It is broken down into three parts:
1) Hardware: lockbox, electronics, power
2) Server infrastructure - hosting, domain, SSL, security
3) Software that puts everything together.
In this regard, let's try to simplify the task to "I want to turn on the light bulb with a button on the site." Such a problem contains a bunch of all the same pieces from the original problem and can (by iterations) be brought to the original problem.
We look at what is needed for this task in terms of iron. This is esp-01 - a miniature module that is able to access the Internet. It has an LED on GPIO2, so it’s enough to power the module according to the scheme and upload a simple Arduino firmware to it. (Yes, Arduino-ide supports them).
In total, you need an esp-01, a 3.3 volt power supply (you can use two AA batteries), a USB-UART adapter for firmware, a breadboard and wires to put everything together.
You write a firmware that clings to wifi, pulls the script on the site via HTTPS and, depending on what the script issued, turns the GPIO on or off. Thus, you immediately provide the minimum level of information security - no one will be able to replace your site and command the device, for this you will need to forge an HTTPS certificate.
I believe that you can raise and write a website and a script yourself, the simplest hosting and domain will cost about 10 bucks a month, and you can get an HTTPS certificate for free through certbort.
And then it will be possible to supplement the design with power keys (in addition to the LED) and an electronic lock, and add control logic to the site that implements access.
Personal experience - at home I control household appliances through a telegram bot. Everything is self-written.

V
vanyamba-electronics, 2021-01-19
@vanyamba-electronics

The first question that arises is: why does this post office need a website?
The fact is that if a user makes an order on the site, then having come to the post office, he should be able to go to this site again.
For example, to clarify the numbers from several orders or something else.
Therefore, the main part of the interface of vending machines is order acceptance, payment acceptance, order cancellation, etc.
The buyer sees Pepsi and says to himself: I want Pepsi. Fits and buys.
And then he sees Pepsi, and he is told to go to the site.
Or he went to the site, sees Pepsi, and they tell him: go to the post office.
That is, instead of: "Here's your Pepsi", in both cases the buyer hears: "Nizzyayay". And accordingly, the purchase process turns into a process of filing a complaint in court.
But of course, things look completely different if the point of the project is to steal clients' money. Two sites are desirable here - one site makes an offer, the post office does not issue an order, and on the second site you can return the money, but it was banned by Roskomnadzor.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question