@freemo Any advice here? Is there a better way to code these things?
Conversation
Notices
-
Embed this notice
Some Internet Person ✡︎ :ally: (admin@mastodon.ai8w.ddns.net)'s status on Saturday, 11-Nov-2023 02:33:20 JST Some Internet Person ✡︎ :ally: -
Embed this notice
🎓 Doc Freemo :jpf: 🇳🇱 (freemo@qoto.org)'s status on Saturday, 11-Nov-2023 02:33:18 JST 🎓 Doc Freemo :jpf: 🇳🇱 @admin The main issue I see is contention. When a client connects it will block the server and other clients from interacting until the client disconnects.
-
Embed this notice
🎓 Doc Freemo :jpf: 🇳🇱 (freemo@qoto.org)'s status on Saturday, 11-Nov-2023 02:41:05 JST 🎓 Doc Freemo :jpf: 🇳🇱 @admin perhaps im misunderstanding then... let me reread it
-
Embed this notice
Some Internet Person ✡︎ :ally: (admin@mastodon.ai8w.ddns.net)'s status on Saturday, 11-Nov-2023 02:41:07 JST Some Internet Person ✡︎ :ally: @freemo
Oh? I had my phone and a computer connected simultaneously and both were able to control the switches...at the same time.
What am I missing?
-
Embed this notice
🎓 Doc Freemo :jpf: 🇳🇱 (freemo@qoto.org)'s status on Saturday, 11-Nov-2023 02:42:52 JST 🎓 Doc Freemo :jpf: 🇳🇱 @admin hahah yea, i dunno i cant see how this would handle multiple connections simultaniously... As far as I can tell it should only be able to accept the next connection after the first one completes.
-
Embed this notice
Some Internet Person ✡︎ :ally: (admin@mastodon.ai8w.ddns.net)'s status on Saturday, 11-Nov-2023 02:42:53 JST Some Internet Person ✡︎ :ally: Fair enough.
This is Arduino "C" code...not Python... ;)
-
Embed this notice
🎓 Doc Freemo :jpf: 🇳🇱 (freemo@qoto.org)'s status on Saturday, 11-Nov-2023 02:52:47 JST 🎓 Doc Freemo :jpf: 🇳🇱 @admin Thats fine then. Though its an easy enough fix and generally good practice. So may be worth considering. Other than that no issues come to mind.
-
Embed this notice
Some Internet Person ✡︎ :ally: (admin@mastodon.ai8w.ddns.net)'s status on Saturday, 11-Nov-2023 02:52:48 JST Some Internet Person ✡︎ :ally: @freemo Here, that's all that's required.
also, the HTTP server in the "Ethernet" library can only handle 8 connections at once, anyway... Considering it's just me and the wife, and this is a "for my use" project...
I was just looking for a more elegant way of doing the HTML part of it.
The reload forces the "root" URL to pull the query off the URL so that the light doesn't constantly flip on and off with every reload.
I don't want to use Java or require (allow?) the arduino to go outside of the LAN to pick up libraries from anything... Looking for a simple, self-contained, stable solution.
I added the reload so that I could have a state written to the HTML.. Light is on/off sort of thing. I couldn't think of a better way to do it.
I will be adding a sensor (eventually) to determine if the door is up or down, but that's down the road.
So, that's the reason for my query.. is there a more elegant way to handle the "status" on the webpage that doesn't require a reload to a forced blank URL?
-
Embed this notice