Search found 1960 matches

by pythoncoder
Sat Nov 18, 2017 9:48 am
Forum: General Discussion and Questions
Topic: Noggin: A simple web framework that will run on your esp8266 boards.
Replies: 9
Views: 159

Re: Noggin: A simple web framework that will run on your esp8266 boards.

...Hrmpf... I agree. It seems to me that a major use case for the Unix build is to enable people to test code before porting it to a baremetal target. This particularly comes into its own for web-based coding (because unlike many firmware applications it may have few - or zero - hardware interfaces...
by pythoncoder
Sat Nov 18, 2017 9:35 am
Forum: Programs, Libraries and Tools
Topic: PicoWeb Shared Processing
Replies: 5
Views: 80

Re: PicoWeb Shared Processing

OK, we're talking at cross purposes. I did indeed mean you to add a single line to the run() routine, and you'd also need a line to import the module containing your code. What I meant was that no changes would be needed to the PicoWeb logic. But on reflection there is a better and cleaner way which...
by pythoncoder
Sat Nov 18, 2017 9:22 am
Forum: Programs, Libraries and Tools
Topic: ws: tiny asynchronous webserver framework without uasyncio
Replies: 22
Views: 389

Re: ws: tiny asynchronous webserver framework without uasyncio

...I'll open an issue on the micropython github repo when I get a chance... That would be very useful. ......the discrepancy goes away in the simplest of examples where there aren't any function calls in the loop... Worth pointing out when you raise the issue; also the point about the resultant hea...
by pythoncoder
Fri Nov 17, 2017 6:49 pm
Forum: Programs, Libraries and Tools
Topic: PicoWeb Shared Processing
Replies: 5
Views: 80

Re: PicoWeb Shared Processing

I see no need to modify PicoWeb as the two tasks are essentially independent (unless I'm missing something in what you're trying to do). Whether the ESP8266 has enough RAM to accomplish both tasks concurrently is another matter.
by pythoncoder
Fri Nov 17, 2017 6:45 pm
Forum: General Discussion and Questions
Topic: Problem entering (¨)
Replies: 2
Views: 43

Re: Problem entering (¨)

Your message is showing backticks (`)... Actually it's showing an odd character - a front-tick :? My keyboard doesn't even have this character. I can copy and paste it into a text editor or into the Python3 REPL but not into MicroPython which ignores it. Python3 shows it to be chr(180) while a back...
by pythoncoder
Fri Nov 17, 2017 11:17 am
Forum: ESP8266 boards
Topic: OSError: scan failed
Replies: 3
Views: 306

Re: OSError: scan failed

Hmm. That's a hard one to test unless you live in Greenland ;) My Faraday cage (AKA microwave oven) is too small for my laptop. Ideas anyone?
by pythoncoder
Fri Nov 17, 2017 11:09 am
Forum: Programs, Libraries and Tools
Topic: PicoWeb Shared Processing
Replies: 5
Views: 80

Re: PicoWeb Shared Processing

You need to do something along these lines async def my_dns_server(args): while True: # code # In the picoweb run() routine loop.create_task(asyncio.start_server(self._handle, host, port)) loop.create_task(my_dns_server(args)) loop.run_forever() I assume some familiarity with uasyncio here. There is...
by pythoncoder
Fri Nov 17, 2017 10:58 am
Forum: Development of MicroPython
Topic: help is appreciated - memory allocated by m_malloc() is automatically free'ed
Replies: 3
Views: 79

Re: help is appreciated - memory allocated by m_malloc() is automatically free'ed

The gc will de-allocate a memory block if there is no Python reference to it which is currently in scope. So I think you need a Python function which allocates the RAM and returns a reference to it, which you can store in a variable.

Have you considered using the official framebuf module?
by pythoncoder
Fri Nov 17, 2017 10:35 am
Forum: Programs, Libraries and Tools
Topic: ws: tiny asynchronous webserver framework without uasyncio
Replies: 22
Views: 389

Slow performance. But is uasyncio the culprit?

@jacob19 My interest in uasyncio is primarily in hardware interfacing rather than web applications; I have benchmarked and tested it fairly extensively and it is highly efficient. On the Pyboard it can task switch in 288μs. On an ESP8266 it takes 2.2ms. I'm sure you'll agree that in the context of w...
by pythoncoder
Thu Nov 16, 2017 12:11 pm
Forum: Programs, Libraries and Tools
Topic: ws: tiny asynchronous webserver framework without uasyncio
Replies: 22
Views: 389

Re: ws: tiny asynchronous webserver framework without uasyncio

... I am going to prove that it is possible to use MicroPython without uasyncio for non-trivial asynchronous applications. It's always possible to rewrite code based on cooperative multi-tasking in a way which doesn't use it. A library like uasyncio facilitates an event-driven programming paradigm ...