Chat freely about anything...

User avatar
By Belthazor
#87160 So Basically I made an IOT.. a doll claw machine that can be controlled through website using ESP8266 + port forwarding . But I got problem that I can't limit my clients. If there are more than 1 clients who give the command to the ESP8266, it will listen to both commands..( it will just listen to any Https Get Command sent )

I am thinking another page before user can get into to "control access of my claw machines" but i need to make that page to display "machine is BUSY " if ESp8266 is currently got connected by other user..

Hope somebody can help me.. :D :D :D :D
User avatar
By btidey
#87167 You could do something like have a variable to hold the ip address of the client that connects to the server and a variable that holds the time when this first connected. The client ip is an easily accessible property of the server during a request.

You then check subsequent requests and if they match you allow control and update the time variable.

If they don't then you respond with a busy message unless the time exceeds some timeout from the last access. This allows another client to take over after an idle period..

This scheme would not stop two clients run on the same platform from conflicting.
User avatar
By Belthazor
#87272 Can We Do something like this ??

There is a page before connecting to the machine (esp8266) ..something like landing page contains a clickable Icon of machine1, machine 2, machine3 etc.
This landing page will constantly send a Get Request to check the esp8266 status.

If currently there is a client connected to the esp8266 the return will be "Busy " ,and its will be displayed on the landing page, also "Machine icon" will disabled.( Cant be click) .. however if the machine is available..the icon on the landing page will show available and enabled to be clicked.

Anybody have idea how to implement it ? With example and some code if possible.