question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Noob question - how to access 'pyhtml' pages?

See original GitHub issue

Hello,

I’m trying the MicroWebSrv engine and it seems that serving static pages works fine. Using the controller methods also works fine. However, I have a serious issue with the pyhtml engine.

That’s what I did:

  • I copied microWebSocket.py, microWebSrv.py and microWebTemplate.py in /flash/lib
  • I created simple static HTML page in /flash/www/index.pyhtml
  • I used the same initializiation code as from the provided sample

The initialization code:

from microWebSrv import MicroWebSrv
mws = MicroWebSrv()
mws.Start()

The issue is that whenever I try to access http://my-host, my WiPy device hangs for a while and then it seems to restart itself. This happens only when I hit pyhtml pages. Like I said, there is no problem serving static HTML files and there is no problem serving pages from controller methods. I guess I’m missing something. I’m using the latest ‘master’ source code. Could you please explain what I might be missing in my setup?

Thanks!

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:11 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
ivandavidovcommented, Jul 2, 2018

FYI - I rebooted my device and suddenly my sample ‘pyhtml’ page worked. 😃

I guess there has been a lot of garbage in the RAM and after reboot it cleared. It’s strange, considering I should have approximately 4MB RAM according to the specs.

Anyway, problem solved.

1reaction
ivandavidovcommented, Jul 2, 2018

I updated the firmware earlier today, so updating the firmware is not an option until new firmware comes out. Regarding the MicroPyhon options - I have no idea what you’re talking about but I’ll dig it further. I admit I’m still quite new to both WiPy and MicroPython.

For now I’m more than happy with the ability to process HTTP requests by using controller methods and that’s enough for my use cases. Thank you for the assistance on this matter!

Read more comments on GitHub >

github_iconTop Results From Across the Web

The most noob question you will ever read on HTML
The most noob question you will ever read on HTML ... Use index.html for your home page as when a user just types...
Read more >
HTML5 Noob Question - HTML & CSS - SitePoint
Hey Everyone! Complete noob post here... I'm just getting started with HTML5. I'm reading a book on the subject.
Read more >
Noob question, javascript - Codecademy
Once you get some HTML and CSS under your belt, you will be ready to introduce JavaScript to its intended environment, the web...
Read more >
blank page when opening html file on localhost - Google Groups
I get a blank screen when I open elm-generated htlm files on localhost. Take a simple Elm program, such as. Module Test where....
Read more >
(Noob Question) How to upload html files as webpages
Hello! I'm almost certain that this has been asked, but I could not find any other threads that answer my question. How do...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found