Search found 41 matches

by eradicatore
Sun Apr 21, 2019 2:40 pm
Forum: ESP8266 boards
Topic: How to use main.py to deploy my code
Replies: 17
Views: 12506

Re: How to use main.py to deploy my code

Before making code run at power on, it's best to debug it at the REPL first. Say you have a module mymodule.py, created on a PC and containing a function run(). Copy the module to the ESP using WebRepl or otherwise, then at the REPL issue import mymodule mymodule.run() Once you have the module runn...
by eradicatore
Wed Mar 13, 2019 6:29 pm
Forum: ESP8266 boards
Topic: OSError: [Errno 103] ECONNABORTED using urequests
Replies: 7
Views: 985

Re: OSError: [Errno 103] ECONNABORTED using urequests

Ok, Just learned from the other thread a better solution: Thanks for this. I ended up going a different route, but I'll give this a try. The solution I found was to realise urequests.post() returns a response, so response = urequests.post(url) followed by response.close() appears to handle the clean...
by eradicatore
Sat Mar 09, 2019 3:03 pm
Forum: ESP8266 boards
Topic: OSError: [Errno 103] ECONNABORTED using urequests
Replies: 7
Views: 985

Re: OSError: [Errno 103] ECONNABORTED using urequests

Ok, garbage collection solved it. Now I can press the button and it works every time! I may tweak the delays to get as tight as possible. Would be nice to query the urequests if busy instead of just a crude delay, but hey... Here's the new loop at the end: gc.enable() while True: time.sleep_ms(250) ...
by eradicatore
Sat Mar 09, 2019 2:16 pm
Forum: ESP8266 boards
Topic: OSError: [Errno 103] ECONNABORTED using urequests
Replies: 7
Views: 985

Re: OSError: [Errno 103] ECONNABORTED using urequests

Hi, Thanks for this question! I'm just hitting the exact same failure. My code is tiny simple button press handling to trigger posts of json to control a music player, and even with some delays I hit this same ECONNABORTED. This fellow has the same issues it seems: https://stackoverflow.com/question...
by eradicatore
Fri Nov 17, 2017 8:31 pm
Forum: ESP8266 boards
Topic: Want to upload a file to slack (files.upload api)
Replies: 1
Views: 1352

Want to upload a file to slack (files.upload api)

Hi, So in normal python, I'm able to upload a file just fine to slack. here is the code: my_file = { 'file' : ('/tmp/myfile.pdf', open('/tmp/myfile.pdf', 'rb'), 'pdf') } payload={ "filename":"myfile.pdf", "token":token, "channels":['#random'], } r = requests.post("https://slack.com/api/files.upload"...
by eradicatore
Thu Nov 16, 2017 8:21 pm
Forum: ESP8266 boards
Topic: OSError: scan failed
Replies: 6
Views: 1431

Re: OSError: scan failed

I still can't get the try/except to work around this failure when there are no wifi scan results. Does anyone else see this failure if there are zero ap's visible when you try to scan? Why would code like this not work? try: scan_results = wifi.scan() except: ## for some odd reason OSERROR here mean...
by eradicatore
Tue Oct 03, 2017 7:59 pm
Forum: ESP8266 boards
Topic: OSError: scan failed
Replies: 6
Views: 1431

Re: OSError: scan failed

Hi, Were you able to confirm this happens if the scan results in no networks found? I was hitting OS error on scans in one location last night very repeatedly, so I would assume you're right. But I just expected the documentation to also mention this pretty interesting way of reporting nothing found...
by eradicatore
Tue Jul 25, 2017 2:06 am
Forum: Programs, Libraries and Tools
Topic: urlencode
Replies: 3
Views: 3586

Re: urlencode

Hi,
Sorry, dumb question. How/what do you import here? I tried "import urllib" which works but then help(urllib) shows no methods?
by eradicatore
Thu Jul 20, 2017 2:17 pm
Forum: ESP8266 boards
Topic: Credentials sticking around?
Replies: 7
Views: 1833

Re: Credentials sticking around?

Does the "erase_flash" command in the nodemcu esp8266 "getting started" instructions erase the esp8266's flash or just the node MCU? Does that wipe these last 5 or 6 credentials?
by eradicatore
Thu Jul 20, 2017 11:42 am
Forum: ESP8266 boards
Topic: Credentials sticking around?
Replies: 7
Views: 1833

Re: Credentials sticking around?

Thanks for the reply. Yea, I guess I sort of expected that, and of course most of the time we want that! Is there a "factory reset" type of operation for esp8266? I will go look on google. Anyway, what I have here is working for me to reset. Thanks again! I can't say enough about how much I love uPy...