Search found 13 matches

by jamesb
Sun Feb 26, 2017 10:57 pm
Forum: ESP8266 boards
Topic: esp.deepsleep() overflow
Replies: 3
Views: 4496

Re: esp.deepsleep() overflow

This seems to work: rtc = RTC() rtc.irq(trigger=rtc.ALARM0, wake=machine.DEEPSLEEP) # check if the device woke from a deep sleep if machine.reset_cause() == machine.DEEPSLEEP_RESET: print('woke from a deep sleep') # set RTC.ALARM0 to fire after 60 mins (waking the device) rtc.alarm(rtc.ALARM0, 1000*...
by jamesb
Thu Jan 12, 2017 2:12 am
Forum: ESP8266 boards
Topic: ssl_handshake_status: -256
Replies: 3
Views: 4378

Re: ssl_handshake_status: -256

I get this response trying to post to Google sheets. Reading around, I think it's something to do with the ssl certificate size filling up memory. I'm looking for a solution to post to an intermediate non-secure API that can then forward on using ssl - appreciate any pointers. Maybe something like p...
by jamesb
Wed Jan 04, 2017 2:11 am
Forum: ESP8266 boards
Topic: Where is documentation on u* libs like urequests?
Replies: 1
Views: 2868

Re: Where is documentation on u* libs like urequests?

I don't know in general, but the urequests code is here:
https://github.com/micropython/micropyt ... /urequests
by jamesb
Thu Dec 22, 2016 10:24 pm
Forum: ESP8266 boards
Topic: WDT
Replies: 4
Views: 7931

Re: WDT

Very helpful, thanks @warren! I like the way you structure your code.
I'm about to give some devices as Christmas presents, so won't have time to get the timers in and tested for them, but I'll play around with the techniques you've suggested for my next deployment. Thanks!
by jamesb
Thu Dec 22, 2016 5:25 am
Forum: ESP8266 boards
Topic: WDT
Replies: 4
Views: 7931

Re: WDT

Thanks @warren! Is this the idea? def countAndSleep(arg): count = count + 1; print ("Current count is " + str(count)) if (count >= timeout/5): #30 seconds sleepTime() #go to deep sleep from machine import Timer count=0 timer = Timer(-1) tim.init(period=5000, mode=Timer.ONE_SHOT, callback=countAndSle...
by jamesb
Sun Dec 18, 2016 3:00 am
Forum: ESP8266 boards
Topic: OSError: scan failed
Replies: 6
Views: 5633

OSError: scan failed

wifi.scan() gives:

Code: Select all

>>> interface.scan()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
OSError: scan failed
I think it's when it can't see any wifi networks. I guess I'll enclose it in a try-except block, unless someone know a smart way around this?
by jamesb
Sun Dec 18, 2016 2:23 am
Forum: ESP8266 boards
Topic: WDT
Replies: 4
Views: 7931

WDT

Intermittently, a call to urequests to do an http post causes a hang in my setup. I'd like to set a timeout, or a watchdog to reset or deepsleep the device if this happens. Looks like there is a WDT: https://docs.micropython.org/en/latest/esp8266/library/machine.WDT.html?highlight=wdt But WDT(timeou...
by jamesb
Mon Dec 12, 2016 12:31 am
Forum: ESP8266 boards
Topic: Making sounds
Replies: 12
Views: 21766

Re: Making sounds

Thanks @dhylands and @pythoncoder. I ended up using the hardware SPI, the clock output was good enough for what I needed.
by jamesb
Tue Dec 06, 2016 12:03 am
Forum: ESP8266 boards
Topic: wlan.connect timeout
Replies: 9
Views: 8657

Re: wlan.connect timeout

I'm having much better success now after adding a socket.close() after each post. I'm no expert on networking, but I guess the router was becoming unhappy with sockets being opened but not closed.
by jamesb
Mon Dec 05, 2016 8:20 pm
Forum: ESP8266 boards
Topic: Making sounds
Replies: 12
Views: 21766

Re: Making sounds

Given the PWM output max freq of 1000Hz, with duty cycle down below 1%, just wondering if there is any way to get a square wave of higher frequency. Should be possible to get 50% at 100000Hz I would've thought, but I don't know if there are any hooks in the OS to do this?