Webserver

Questions and comments specific to a particular plugin should go here.
Foune
Experienced User
Posts: 96
Joined: Sun Jul 03, 2011 7:08 pm

Re: Webserver

Post by Foune » Thu May 24, 2018 10:53 am

By the way, thank you kgschlosser for your help, indeed it was another custom plugin that prevented Web Server from terminating properly. Now everything run fine.

User avatar
kgschlosser
Site Admin
Posts: 4952
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: Webserver

Post by kgschlosser » Thu May 24, 2018 6:18 pm

@snowbird

yeah there is. slow down how fast you are sending the get commands in :shock: :o


LOL

No seriously.. I am messing with ya. I believe that is a bug. i am not overly familiar with the webserver plugin
If you like the work I have been doing then feel free to Image

User avatar
kgschlosser
Site Admin
Posts: 4952
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: Webserver

Post by kgschlosser » Thu May 24, 2018 6:25 pm

@Foune

No worries. that's what I am here for. we need to come up with some kind of a better mechanism for shutting down EG. one that will not cause these kinds of issues. It has become increasingly difficult with windows 10 and is sensitivity to specific bits of the API being accessed from the same thread. I have been trying to think of a game plan on this to ensure how a plugin gets loaded, started, stopped, and closed. and also wrapping the threading module to make it so that every thread that is spawned is a daemon thread so threads can be shutdown. it is something that is going to be a very large change to how the core operates and requires a large amount of planning and thought.
If you like the work I have been doing then feel free to Image

Sem;colon
Experienced User
Posts: 609
Joined: Sat Feb 18, 2012 10:51 am
Location: Germany

Re: Webserver

Post by Sem;colon » Tue Jul 03, 2018 4:10 pm

Hey guys,

I have some strange issue with the Webserver plugin, I wonder if there is something I do wrong maybe..

When I use a certificate for the webserver, I get an error on each connection attempt!?
errorWithWebserver.PNG
Everything works fine btw. I just get this stupid error ALL THE TIME and I can't find the issue...

My plugin version is 3.13.3

Thank you very much in advance!

Sem;colon
Experienced User
Posts: 609
Joined: Sat Feb 18, 2012 10:51 am
Location: Germany

Re: Webserver

Post by Sem;colon » Thu Jul 05, 2018 1:35 pm

hmm, I just removed the line "self.wfile.close()" in the function "end_request" - now I don't get any error anymore...
I assume the file closes automatically?
At least it doesn't seem to have a negative impact for me to remove that line...

User avatar
kgschlosser
Site Admin
Posts: 4952
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: Webserver

Post by kgschlosser » Thu Jul 05, 2018 4:08 pm

did you remove that from the webserver plugin??
if so what the class that contains the method you removed the line from does that class subclass anything from the socket library?
If you like the work I have been doing then feel free to Image

Sem;colon
Experienced User
Posts: 609
Joined: Sat Feb 18, 2012 10:51 am
Location: Germany

Re: Webserver

Post by Sem;colon » Thu Jul 19, 2018 6:47 pm

Yes, I removed it in the plugin. It closes some pseudo-file, I don't know exactly to be honest ^^°

User avatar
kgschlosser
Site Admin
Posts: 4952
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: Webserver

Post by kgschlosser » Thu Jul 19, 2018 6:57 pm

hey Semi. what version of EG are ya running?
If you like the work I have been doing then feel free to Image

Sem;colon
Experienced User
Posts: 609
Joined: Sat Feb 18, 2012 10:51 am
Location: Germany

Re: Webserver

Post by Sem;colon » Mon Aug 06, 2018 8:43 am

0.5 rc4

User avatar
kgschlosser
Site Admin
Posts: 4952
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: Webserver

Post by kgschlosser » Mon Aug 06, 2018 10:43 am

OK i wanted to know if it is throwing the error because of an update that has been done to the socket library. if it was not closing the socket file properly in python 2.6 this could be the reason why it was there and they may have fixed it in python 2.7. and if that is the case the socket library would do what it is supposed to do and an error would be thrown up when trying to close the socket file because it has already been closed.

I know this is a lot to ask. but since you know how to replicate the issue any chance of getting ya to see if you can reproduce the problem using EG 0.4?? this way we will know how the webserver plugin needs to be modified.
If you like the work I have been doing then feel free to Image

Sem;colon
Experienced User
Posts: 609
Joined: Sat Feb 18, 2012 10:51 am
Location: Germany

Re: Webserver

Post by Sem;colon » Mon Aug 06, 2018 12:38 pm

Hi Kevin,
Thank you very much always for looking into this! Would make sense. I'll try it next week with 0.4 and let you know!

User avatar
kgschlosser
Site Admin
Posts: 4952
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: Webserver

Post by kgschlosser » Fri Aug 10, 2018 1:39 am

no worries m8 whenever you get the chance.
If you like the work I have been doing then feel free to Image

Sem;colon
Experienced User
Posts: 609
Joined: Sat Feb 18, 2012 10:51 am
Location: Germany

Re: Webserver

Post by Sem;colon » Mon Aug 20, 2018 5:33 pm

I can confirm, the issue doesn't exist with EG 0.4, so I think it's what you suspected ;)

User avatar
kgschlosser
Site Admin
Posts: 4952
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: Webserver

Post by kgschlosser » Tue Aug 21, 2018 4:59 am

OK cool. I am going to have to add it in a manner that will account for version checking.
If you like the work I have been doing then feel free to Image

phairplay
Posts: 12
Joined: Wed Jan 18, 2017 12:02 pm

Re: Webserver

Post by phairplay » Fri Jan 18, 2019 12:42 pm

Hi,
Is it possible to use the web server plug for internal use only?

I currently have it running which I use IFTTT to trigger a few custom scripts, I would like to switch this to internal use only.

I’m thinking having my home assistant which runs on a tablet on my wall execute the custom scripts without using an external http address.

Could someone please help?

Post Reply