Search found 41 matches

by lukesky333
Tue Mar 12, 2019 8:19 am
Forum: General Discussion and Questions
Topic: Something like Threading/Queue in MicroPython?
Replies: 7
Views: 780

Something like Threading/Queue in MicroPython?

Hi guys,

I've a script at my desktop and I'll try to port it to MicroPython (esp. ESP32). Therefore I need libraries like "threading" and "Queue".
Is there something similar in MicroPython?
by lukesky333
Wed Sep 28, 2016 4:05 pm
Forum: ESP8266 boards
Topic: Server for basic setup
Replies: 11
Views: 6510

Re: Server for basic setup

Thanks a lot, I'll try it at home.

Is your miniservet able to handle POST and GET vars?
by lukesky333
Wed Sep 28, 2016 3:40 pm
Forum: ESP8266 boards
Topic: Server for basic setup
Replies: 11
Views: 6510

Re: Server for basic setup

If you're new to socket code play with it on normal (heavyweight OSs) computers first. But understand TCP is a pipe. You cannot guarantee how much you'll get when you suck (once,briefly) on a pipe. Only that you will get all the data eventually, in order and uncorrupted. You're also trying to imple...
by lukesky333
Wed Sep 28, 2016 3:16 pm
Forum: ESP8266 boards
Topic: Server for basic setup
Replies: 11
Views: 6510

Re: Server for basic setup

I changed my code and I'm using now readline. cl, addr = s.accept() print("Client address:", addr) print("Client socket:", cl) print("Request:") print("READLINE:") length = 0 while True: req = cl.readline() length = length + len(req) if req == b"": break print(req) print("size of request: " + str(le...
by lukesky333
Wed Sep 28, 2016 2:22 pm
Forum: ESP8266 boards
Topic: Server for basic setup
Replies: 11
Views: 6510

Re: Server for basic setup

How can I increase the MTU size or how can I get the full request?
by lukesky333
Fri Sep 23, 2016 3:44 pm
Forum: ESP8266 boards
Topic: Server for basic setup
Replies: 11
Views: 6510

Re: Server for basic setup

I was playing arround a little bit - here my example code: addr = socket.getaddrinfo('0.0.0.0', 80)[0][-1] s = socket.socket() s.bind(addr) s.listen(1) log('listening on'+str( addr)) cl, addr = s.accept() print("Client address:", addr) print("Client socket:", cl) print("Request:") req = cl.recv(1024...
by lukesky333
Fri Sep 23, 2016 1:12 pm
Forum: ESP8266 boards
Topic: Server for basic setup
Replies: 11
Views: 6510

Server for basic setup

Hi, I've my first ESP8266 board and try to create an simple webserver for communication with the board. Is it possible to create a simple HTTP server for this board, to send and receive json? What I want to do is, upload a json, process it on the board and download json with sensor data... I've foun...
by lukesky333
Mon Sep 05, 2016 9:56 am
Forum: ESP8266 boards
Topic: main.py don't start after poweron
Replies: 11
Views: 6305

Re: main.py don't start after poweron

Do you see the message printed "main entered", e.g. after reboot with Ctrl-D? Yes, I see... After fixing the code everything is working like expected. ;-) How do you tell that main() is not executed. Did you try a print statement inside main(), just to sort our any connection issue with the LED? No...
by lukesky333
Mon Sep 05, 2016 9:38 am
Forum: ESP8266 boards
Topic: main.py don't start after poweron
Replies: 11
Views: 6305

Re: main.py don't start after poweron

For file transfer I'm using mpfshell.

The problem is, that main.py is loaded but main() not executed... Any idea why???

EDIT: OK, sorry for that stupid question/problem.
wrong:

Code: Select all

if __name__ == 'main':
correct:

Code: Select all

if __name__ == '__main__':
by lukesky333
Mon Sep 05, 2016 8:51 am
Forum: ESP8266 boards
Topic: main.py don't start after poweron
Replies: 11
Views: 6305

Re: main.py don't start after poweron

Yes, of course... At first I installed the firmware esp8266-20160901-v1.8.3-81-g9c04ef2.bin and then I create a new boot.py and main.py file with Vi. here the content of "boot.py": import webrepl print("boot.py loaded...") webrepl.start() content of "main.py": import esp import machine import time d...