doncoop / pico-web-server

A Pico W startpage running on a webserver
GNU General Public License v3.0
23 stars 3 forks source link

Trial pico-web-server #1

Closed bf194 closed 2 years ago

bf194 commented 2 years ago

Hello, I loaded this application on a pico W and started the webserver.py. It is not working as expected. Reading the micropython code and adding some print statements, I see the pico W connecting and listen on the obtained address. Upon client connecting (in my case Firefox 103), it stucks. OSError 2 is raised (no such file), which is because the client request is none of the file types programmed. The request is b'GET / HTTP/1.1\r\nHost: 192.168.178.26\r\nUser-Agent: Mozilla/5.0.....etc. That should be split and extracted from index 2 of the list. Howerever, the request is not of the MIME type worked out in this application. I tried the same with EDGE, but with the same error. Do I miss something? Regards, bf194

doncoop commented 2 years ago

Hi, if you confirm whether you've added or removed any of the files in your version and you post the full output I might be able to see whats going on and suggest something.

bf194 commented 2 years ago

Hi Don,

Thanks for your reply. I’am still working on the project. Yes I did load all the files except the readme, the licence and the .gitattributes. To my opinion in your webserver.py there is no send of the html index file just after successfull connecting to the socket, so upon connecting the client there are no requests yet. I am not a programming guru (yet), but an electronics engineer with plc and microprocessor skills. Micropython and html is at this moment in the steap part of my learning curve. I appriciate examples of others, like you, since they are very well to improve my knowledge. I will post you as soon as my project is improved.

Thank you for helping already,

bf194

Verzonden vanuit Mailhttps://go.microsoft.com/fwlink/?LinkId=550986 voor Windows

Van: @.> Verzonden: woensdag 17 augustus 2022 09:31 Aan: @.> CC: @.>; @.> Onderwerp: Re: [doncoop/pico-web-server] Trial pico-web-server (Issue #1)

Hi, if you confirm whether you've added or removed any of the files in your version and you post the full output I might be able to see whats going on and suggest something.

— Reply to this email directly, view it on GitHubhttps://github.com/doncoop/pico-web-server/issues/1#issuecomment-1217578827, or unsubscribehttps://github.com/notifications/unsubscribe-auth/A2RPKP7GSGEHZQ44OFHJADDVZSIOLANCNFSM56UYPUZA. You are receiving this because you authored the thread.Message ID: @.***>

doncoop commented 2 years ago

No the code does not send the html on successful connection. But when you go to the url the connection makes (looks like it's 192.168.178.26 in your case), that requests the files and the pico web server responds with them.

Feel free to reply with full extracts of the errors if you're still unable to work

bf194 commented 2 years ago

Well, just using the project on a PICO-W with all the files from you project installed, everything stays the same as in my first issue. Upon connect, the client (Firefox) answers with b'GET / HTTP/1.1... This is not a request for an html to my opinion, so the pico server does not serve anything.