Search found 360 matches

by devnull
Fri Feb 24, 2017 1:52 am
Forum: General Discussion and Questions
Topic: MQTT check_msg() Assertion Error - Bug ?
Replies: 0
Views: 699

MQTT check_msg() Assertion Error - Bug ?

I am using the check_msg() to retrieve any waiting messages, and it crashes whenever it receives one. I suspect that the cause is the QOS which is set on the incoming message and the umqtt_simple library is not handling it ?? checking... Traceback (most recent call last): File "<stdin>", line 1, in ...
by devnull
Thu Feb 23, 2017 12:54 pm
Forum: ESP8266 boards
Topic: Reading VCC without external components
Replies: 7
Views: 3346

Re: Reading VCC without external components

Ahh, sorrie, I missed that at the beginning of the post.

So 2973 = 3277.4 mv

i.e. ADC(0).read() * 1.024
by devnull
Thu Feb 23, 2017 12:41 pm
Forum: ESP8266 boards
Topic: Fastest WLAN connect with AP fallback
Replies: 0
Views: 576

Fastest WLAN connect with AP fallback

Does anyone have a faster, more concise, low RAM WLAN connection routine that falls back to AP mode if it can't connect to the wlan ? def connect(timeout=10,ssid=None,passkey=None): from network import WLAN,STA_IF, AP_IF sta = WLAN(STA_IF) if not sta.isconnected(): sta.active(True) sta.connect(ssid,...
by devnull
Thu Feb 23, 2017 12:38 pm
Forum: ESP8266 boards
Topic: Reading VCC without external components
Replies: 7
Views: 3346

Re: Reading VCC without external components

Thanks, but the reading I am getting looks like a millivolt value and not a 0 - 1023 value ! >>> import machine >>> vcc = machine.ADC(1) >>> vcc.read() 2973 Update I have verified that if I change the supply voltage, this reading also changes, however comparing the VCC pin with a voltmeter provides ...
by devnull
Thu Feb 23, 2017 9:16 am
Forum: ESP8266 boards
Topic: Reading VCC without external components
Replies: 7
Views: 3346

Re: Reading VCC without external components

Thanks, but that just results in 65535

>>> from machine import ADC
>>> ADC(0).read()
65535
>>>

This link address specifically mentions reading channel #1 of the ADC ?

https://github.com/micropython/micropython/issues/2352
by devnull
Thu Feb 23, 2017 5:51 am
Forum: ESP8266 boards
Topic: Reading VCC without external components
Replies: 7
Views: 3346

Reading VCC without external components

The Board is ESP-12S. Is the method shown here the recommended method of setting the registers to allow reading the A/D value of the VCC pin, or has this now been integrated into the firmware ?? https://github.com/micropython/micropython/issues/2352 import esp from flashbdev import bdev import machi...
by devnull
Thu Feb 23, 2017 4:20 am
Forum: ESP8266 boards
Topic: TCP Socket Closes due to Small buffer
Replies: 3
Views: 1218

Re: TCP Socket Closes due to Small buffer

Hi; I know that I am not really answering your question, but I always use 1024 bytes in the receiving buffer: while True: conn, addr = self.sock.accept() raw = conn.recv(1024).decode('UTF-8') if not raw: print('Null Request.',addr) self.close(conn) else: self.request(conn,raw)
by devnull
Wed Feb 22, 2017 10:51 am
Forum: ESP8266 boards
Topic: GPIO16, deep sleep and pin interrupt
Replies: 4
Views: 6336

Re: GPIO16, deep sleep and pin interrupt

Thanks, but fortunately I found a solution. Previously, I had a button interrupt, that would detect the length of press while running and save the mode to a json file and then reset the system. Then, during startup I checked this file to get the mode and took the required action. Now what I am doing...
by devnull
Wed Feb 22, 2017 2:50 am
Forum: ESP8266 boards
Topic: GPIO16, deep sleep and pin interrupt
Replies: 4
Views: 6336

GPIO16, deep sleep and pin interrupt

My device goes into deep sleep and GPIO16 is connected to RESET in order to enable it to wake up. But I also need to be able to manually wake up the device before the sleep period has expired using a short/long press button interrupt. The reason is that a short press triggers the device to go into r...
by devnull
Tue Feb 21, 2017 1:45 pm
Forum: General Discussion and Questions
Topic: ticks_diff not behaving
Replies: 5
Views: 1646

Re: ticks_diff not behaving

Turns out that the cause of this is the interrupt routine pincb().

I had to change saving the values in the interrupt so that it does not save to dictionary items.

Once I did this everything behaved as expected.