Search found 211 matches

by liudr
Wed Dec 01, 2021 5:58 am
Forum: ESP32 boards
Topic: Questions about ntptime
Replies: 9
Views: 4768

Questions about ntptime

I'm looking for ways to get time with ntptime and this is the only official reference I found: http://docs.micropython.org/en/latest/esp8266/quickref.html#real-time-clock-rtc So here is how to do it: ntptime.settime() # set the rtc datetime from the remote server The issue is, this function calls an...
by liudr
Sun Nov 28, 2021 5:25 pm
Forum: General Discussion and Questions
Topic: Resolving local network domain name
Replies: 8
Views: 4955

Re: Resolving local network domain name

Thanks @karfas for raising the issues for me. From my tests, calling getaddrinfo() if the host name is just "debian" caused exceptions so I went for a dotted name and that got me past getaddrinfo(). So I first call this and then extract the number-dot IP address and use that to call request(). It wo...
by liudr
Sat Nov 27, 2021 4:30 am
Forum: General Discussion and Questions
Topic: Browser won't send upload file if enctype="text/plain"
Replies: 0
Views: 1505

Browser won't send upload file if enctype="text/plain"

I'm making a web server on my ESP32 MP board so it will accept file uploads, simple text-only files as config files. Sounds great! I couldn't find examples so I started to hammer out my own code. I got a web page with a form to upload. And my browser only sends the file to my ESP32 if I choose encty...
by liudr
Fri Nov 26, 2021 10:54 pm
Forum: General Discussion and Questions
Topic: Resolving local network domain name
Replies: 8
Views: 4955

Re: Resolving local network domain name

1.17 released version for ESP32 generic with SPIRAM
Thanks for looking over it.
by liudr
Thu Nov 25, 2021 8:02 pm
Forum: General Discussion and Questions
Topic: Resolving local network domain name
Replies: 8
Views: 4955

Re: Resolving local network domain name

.local is a mDNS/DNS-SD thing (aka Bonjour). Trying to resolve it from a client that doesn't know these protocols won't work. Your Debian box will have avahi running, which is doing all the multicast DNS magic for you. Thanks scruss. I figured out the issue was the return values of getaddrinfo ai[1...
by liudr
Thu Nov 25, 2021 7:50 pm
Forum: General Discussion and Questions
Topic: Resolving local network domain name
Replies: 8
Views: 4955

Re: Resolving local network domain name

OK, so I was going through the source code of urequests, specifically request(): https://github.com/micropython/micropython-lib/blob/master/python-ecosys/urequests/urequests.py I followed its logic in REPL more or less but didn't do the " s = ussl.wrap_socket(s, server_hostname=host)" line. That mig...
by liudr
Thu Nov 25, 2021 6:02 pm
Forum: General Discussion and Questions
Topic: Resolving local network domain name
Replies: 8
Views: 4955

Re: Resolving local network domain name

One improvement: I renamed my debian machine to debian.local. This passed the getaddinfo() >>> import usocket >>> usocket.getaddrinfo('debian.local', 80, 0, usocket.SOCK_STREAM) [(2, 0, 0, 'debian.local', ('192.168.0.191', 80))] But I still can't get requests.get() to work: >>> import urequests as r...
by liudr
Thu Nov 25, 2021 5:38 pm
Forum: General Discussion and Questions
Topic: Resolving local network domain name
Replies: 8
Views: 4955

Resolving local network domain name

I have an ESP32 board running MP 1.17. I use urequests to get and post to a server on my local network So far if I give it an ip address such as 192.168.0.123, it works. If I post to a remote host with address like abc.duckdns.org, it works too. This means MP successfully did domain name lookup, I g...
by liudr
Mon Nov 22, 2021 8:57 pm
Forum: General Discussion and Questions
Topic: How to make urllib.parse work?
Replies: 0
Views: 1252

How to make urllib.parse work?

I cloned micropython-lib in order to add necessary modules to my board (ESP32). One of the modules I wish to use is urllib.parse for my web server. I copied a urllib/parse.py to my board /lib/urllib/parse.py. While importing, I got complaints about defaultdict so I found collections/defaultdict.py a...
by liudr
Mon Nov 15, 2021 3:22 pm
Forum: ESP32 boards
Topic: Expand the file system on FLASH to occupy whole FLASH
Replies: 2
Views: 1141

Re: Expand the file system on FLASH to occupy whole FLASH

Also, since this default has no otadata partition at 0xd000, or any ota partitions, does it mean I can't use OTA features unless I compile micropython with my desired partition table?

Thanks.