These are chat archives for esp8266/Arduino

27th
Jan 2016
Martin Ayotte
@martinayotte
Jan 27 2016 00:27
@brutzler , in your final project, do you still use the UART ? Because TX/RX can be used as plain GPIOs too.
FWeinb
@FWeinb
Jan 27 2016 01:09
These touchscreens are as unreliable as shit. I
Aditya Tannu
@AdySan
Jan 27 2016 01:10
haha
Michael Miller
@Makuna
Jan 27 2016 01:17
@FWeinb put a ground plane behind them and see if that helps.
brutzler
@brutzler
Jan 27 2016 03:49
@martinayotte: No, no UART needed. Only "boot" -> "read temperature" -> "send over WiFi" -> "deepsleep".
You think, I should use RxD for switchable supply of the DS18B20 and TxD as OneWire-Pin? (Or the other way round).
tzapu
@tzapu
Jan 27 2016 05:49
@Links2004 thanks for the hint, i have tried, and this is a weird one
If i set a nodemcu 1.0 to the wrong flash size (i know i should set it to 4MB, but looking at what errors people report, i m starting to think this is a common mistake or misstep) it does not connect to wifi a second time, if ssid and password are set
i will post some sample serial output as well, one sec
tzapu
@tzapu
Jan 27 2016 05:55
load 0x4010f000, len 1264, room 16 
��9&��.scandone
state: 0 -> 2 (b0)
.state: 2 -> 3 (0)
state: 3 -> 5 (10)
add 0
aid 9
cnt 

connected with Router, channel 1
dhcp client start...
chg_B1:-40
..chg_B1:-80
.ip:10.0.1.5,mask:255.255.255.0,gw:10.0.1.1
.
WiFi connected
Server started
10.0.1.5
chg_B1:-120
rll��|�l�|�l�b|����r�b�b��nn�lnn���bp��lrlrlp�n��l��bn�|l����b��nn�l��l`�nnl`nr���n��l`r��n��l`��n�

Booting




Now . Connecting to Router
………..
and it keeps going, never connecting, also notice no debug...
then i change flash size to 4MB, and that s the only change i do , and it all starts working fine, with debug, and connecting, no matter how many times i reset
should i make this into an issue ?
andig
@andig
Jan 27 2016 09:14
This message was deleted
andig
@andig
Jan 27 2016 09:25
Morning gents. Does anyone know how to use system_show_malloc()? If enabled, still no output on serial?
xbary
@xbary
Jan 27 2016 11:34
I apologize for the confusion, here the day before yesterday I wrote about the problem of long wait by your browser on page served by the ESP :), it turned out that there was no 2 bytes declared in the Content-Length. Browser EDGE coped with it but Firefox is no longer ... but I am glad that the problem is solved :)
FWeinb
@FWeinb
Jan 27 2016 12:13
@AdySan The touchscreen is actually quite good. When reading the touch pressure and filtering for some more harder touches it is working great.
Martin Ayotte
@martinayotte
Jan 27 2016 13:33
@brutzler , Yes, you can use the RX pins as output to supply the DS18B20, for the TX, I would leave it to the UART since it can be handy for debug, and continue using GPIO2 for the OneWire data line since you need pullup for both boot process and OneWire.
don't make insecure IoT things people :D
Helio Machado
@crushedice2000
Jan 27 2016 14:08
@celsworth: I'm aware of, I enabled WPS on all my devices, created handlers to dump the PSK, even at 433MHz, Added a serial header in the door on my home and built the BSOD Windows firewall on the ESP. :smile:
Chris Elsworth
@celsworth
Jan 27 2016 14:10
hehe :D
that should cover it :)
Helio Machado
@crushedice2000
Jan 27 2016 14:12
@celsworth: Also I have a RPI with a wan-open no-login shell webpage indexed on Google :)
Chris Elsworth
@celsworth
Jan 27 2016 14:32
huh where did @igrr go.. wanted to show him https://github.com/cesanta/umm_malloc/blob/master/umm_malloc.c
my autocomplete seems broken, doesn't offer igrr, but he is here, oh well :)
anyway that malloc might be nice to incorporate into arduino core, its a much more permissive license than the one that was mentioned yesterday, and looks a lot better: https://blog.cesanta.com/embedded-heap-behaviour-analysis-and-improvement (from IRC)
Aditya Tannu
@AdySan
Jan 27 2016 14:34
@celsworth I did see him mentioning on Twitter this is gonna be available in the next core release
Chris Elsworth
@celsworth
Jan 27 2016 14:34
awesome :)
Ivan Grokhotkov
@igrr
Jan 27 2016 15:14
@celsworth I'm aware, thanks, I've been looking at umm_malloc independently from cesanta as well)
Aditya Tannu
@AdySan
Jan 27 2016 15:57
@FWeinb that's cool, you could use it to distinguish between mouse pointer tracking vs click.
brutzler
@brutzler
Jan 27 2016 16:17
@martinayotte : I think its a little bit different. When I use RxD for DS18B20-supply, then I switch it off before I go to deepsleep. To save battery-power, it makes sense to connect the pullup of the OneWire to this supply (GPIO2 <-> RxD). But then I have during deepsleep GPIO2 pulled down to GND and then boot process will be faulty. Or do I think wrong?
Martin Ayotte
@martinayotte
Jan 27 2016 16:23
@brutzler , why you are saying that GPIO2 will be pulled down, you will still keep the pullup on it, this one can't be avoided.
brutzler
@brutzler
Jan 27 2016 16:33
@martinayotte: sorry, do not really understand what you want to tell me.
Martin Ayotte
@martinayotte
Jan 27 2016 16:36
@brutzler , I mean you still need a pullup on GPIO2 for boot process, so why you are saying that it will be pulled-down ? pull-down by what ? during sleep, it will be high impedance, the pullup will bring it HIGH until wakeup, then you firmware will start and this pin can be used for OW data line.
henrik1235
@henrik1235
Jan 27 2016 16:38
does anyone know when 2.1 will be stable?
brutzler
@brutzler
Jan 27 2016 16:45
@martinayotte: ok. GPIO2 has a pullup resistor. This is used for boot and for OneWire. This pullup, I wanted to connect between GPIO2 and RxD (supply for the DS18B20). But when I switch off RxD before I send the ESP to sleep, in order to save power, then RxD has level LOW, or? And then the pullup cannot bring GPIO2 to High-level.
Or do I think totally confused?
fmgomes
@fmgomes
Jan 27 2016 16:46
Hi, is anyone using the I2S interface? Like in the following example using the SDK: https://github.com/espressif/esp8266_mp3_decoder
Me No Dev
@me-no-dev
Jan 27 2016 16:47
I am
or was..
mp3 decoder sucks
check i2s.h in the core for api (pretty basic :) )
fmgomes
@fmgomes
Jan 27 2016 16:49
Thanks @me-no-dev ! I'll check it :-)
Do you know any example to 'kick start'?
Martin Ayotte
@martinayotte
Jan 27 2016 16:53
@brutzler , No, I mean the PullUp on GPIO2 should be permanently to VCC, the RxD is only for DS18B20 VCC supply
Me No Dev
@me-no-dev
Jan 27 2016 16:53
here is how you can stream a file using ffmpeg to the ESP
fmgomes
@fmgomes
Jan 27 2016 16:53
@me-no-dev, thanke a lot!
Mario Mikočević
@mozgy
Jan 27 2016 16:56
hmm, interesting, with default ESP.deepSleep( sleepTimeSec * 1000000 ); I'm getting quite fluctuating results from Serial.printf( "Vcc: %u\n", ESP.getVcc() );
but with ESP.deepSleep( sleepTimeSec * 1000000, RF_NO_CAL ); it's steady line
Me No Dev
@me-no-dev
Jan 27 2016 16:56
when do you printf the vcc?
Mario Mikočević
@mozgy
Jan 27 2016 16:57
almost right after bootup
Me No Dev
@me-no-dev
Jan 27 2016 16:57
try after connection
Chris Elsworth
@celsworth
Jan 27 2016 16:57
power drops while the wifi is connecting I guess?
might need a beefier supply to keep the voltage up :)
Me No Dev
@me-no-dev
Jan 27 2016 16:57
you are reading it while the wifi is still calibrating and starting up
Mario Mikočević
@mozgy
Jan 27 2016 16:57
no no no @celsworth you misunderstood
@me-no-dev got it :)
Chris Elsworth
@celsworth
Jan 27 2016 16:58
oh, I thought we said almost the same thing to be honest :)
but ok :)
Me No Dev
@me-no-dev
Jan 27 2016 16:58
@celsworth it's not caused by power drop
Chris Elsworth
@celsworth
Jan 27 2016 16:59
getVCC is just crap then? :)
radio interference?
Me No Dev
@me-no-dev
Jan 27 2016 16:59
@mozgy will tell once he tests reading after the connection succeeds :)
not interference but rather they use the adc for other things at that time
Chris Elsworth
@celsworth
Jan 27 2016 17:00
ah ok
Mario Mikočević
@mozgy
Jan 27 2016 17:00
@me-no-dev I have that info too
brutzler
@brutzler
Jan 27 2016 17:09
@martinayotte: ok. my intention was to connect the OW-Pullup not to permanent Vcc, to save power during deepsleep. But now the OW-pullup has got a new (second) function. What do you think. how much current will go through this pullup-resistor? normally I would calculate I=3,3V/10k=0,33mA. But I am not sure, if the GPIO2 will pull this current.
Chris Elsworth
@celsworth
Jan 27 2016 17:12
check resistance of gpio2 to ground when in sleep and you have your answer
Martin Ayotte
@martinayotte
Jan 27 2016 17:14
@brutzler , yes, the goal is to reduce current at the minimum, using GPIO2 which has already a pullup, you save 1 pullup, using different pin, you still have pullup on GPIO2. But, this is all your choice ;-)
BTW, the current in the pullup is only present when the GPIO are turn LOW. If during sleep the GPIO are HiZ, there should not be much current
Looking at ESP8266 specs, the Iil (Input Leakage Current ) is 50nA
fmgomes
@fmgomes
Jan 27 2016 17:35
@me-no-dev , returning to I2S, when you put a sample using the i2s_write_sample function, it is pushed in a buffer for later DMA transfer?
Me No Dev
@me-no-dev
Jan 27 2016 17:44
yes
brutzler
@brutzler
Jan 27 2016 18:06
@martinayotte: 50nA. that is not much :-)
Just took a look at the DS18B20-datasheet. The sensor has a standby current of 750nA. Just guessing, if it is worth switching off the sensor-supply during sleep-periode. I am still a little bit cautious, because of my low Vcc of 3V. Think there will be less voltage coming out of the RxD-pin, and then it could be that the dallas-sensor won't work proper.
Chris Elsworth
@celsworth
Jan 27 2016 18:28
I think the drop between Vcc and RxD high will be miniscule if anything
I measured mine - 16mV drop
on 3.3v VCC
andig
@andig
Jan 27 2016 18:38
@igrr I've looked at the umm_alloc post at cesanta. Does the "weaking" of mem_manager.c symbols mean that we don't need to fully remove it?
brutzler
@brutzler
Jan 27 2016 19:01
@celsworth: less than I thought :-)
Martin Ayotte
@martinayotte
Jan 27 2016 19:07
@brutzler , yes, 50nA is almost nothing, so that's why after second thought, I think pullups are not an issue. For the VCC of DS18B20, I think that @celsworth is right, and also @mozgy told me yesterday that he was already doing so in his project.
brutzler
@brutzler
Jan 27 2016 19:15
ok boys. thx for your hints. solder-iron is heating up.....
misterdanb
@misterdanb
Jan 27 2016 19:58
hi, i ask my question from some days ago again, perhaps someone in here now has an idea (if you don't like something like this, because it's sort of double posting please tell me and i won't do it again :)):
my esp is listening to udp packets and as an answer to a packet it sends on broadcast multiple devices in the network may answer nearly at the same time. somehow often it happens that the esp does not receive all of those packets. one might argue that this is due to udp, but non-esp devices always receive all the packets. my question is: can anyone tell me, what reason this might have? i'm pretty sure the esp is not busy with too much stuff, a loop takes at most 3ms and contains a delay(2), so the sdk should have enough time, shouldnt it?
Me No Dev
@me-no-dev
Jan 27 2016 20:04
it should but that is not the reality :)
are you using udp client?
or have you rolled your own library for UDP
misterdanb
@misterdanb
Jan 27 2016 20:05
i use WifiUDP
part of the sdk
all packets send by the device are received by my server by the way
Me No Dev
@me-no-dev
Jan 27 2016 20:08
yeah, but the esp seems to often loose udp packets
even when implemented asynchronously
misterdanb
@misterdanb
Jan 27 2016 20:08
hm, okay, so i just have to deal with it?
Me No Dev
@me-no-dev
Jan 27 2016 20:12
it's kinda the purpose of UDP :) so yes
you are never guaranteed to get your packet
misterdanb
@misterdanb
Jan 27 2016 20:14
yeah that's fine with me, but those packets really often do not come in :(
(well fire and forget is why i chose udp actually ^^ no overhead and stuff)
(and no connections of course)
Me No Dev
@me-no-dev
Jan 27 2016 20:15
there you go. To be honest, TCP loses lots of packets too
but has retransmission so it works
and even then on sdk 1.4 I can make it loose a tcp packet
misterdanb
@misterdanb
Jan 27 2016 20:18
okay, thanks!
sending udp is in my case anyway much more important
:)
Michael Miller
@Makuna
Jan 27 2016 22:22
@misterdanb You have two choices for UDP to "try" to get more reliability.
1) Send the packet three times and include a unique id so the receiver can throw away duplicates and hope three is enough
2) Implement an Ack system like Coap.
Chris Elsworth
@celsworth
Jan 27 2016 22:23
udp with acks sounds an awful like tcp ;)
Michael Miller
@Makuna
Jan 27 2016 22:23
Nope, still far lighter than tcp.
I should say the Coap Ack is lighter than TCP ack system.
Aditya Tannu
@AdySan
Jan 27 2016 22:24
noob question: apart from the obvious overhead of needing a broker, what keeps MQTT from being a good candidate for such use cases?
Michael Miller
@Makuna
Jan 27 2016 22:26
The Broker! Its not a peer to peer system and its based on TCP rather than UDP. This doesn't sound like much, but if you have a single subnet with a lot of nodes on it, MQTT and TCP start to saturate.
Aditya Tannu
@AdySan
Jan 27 2016 22:28
i see
Michael Miller
@Makuna
Jan 27 2016 22:29
MQTT can actually run across other protocols than TCP, but it requires a one that is guaranteed; by the time you meet the MQTT requirements using UDP, you might as well just use TCP.
Aditya Tannu
@AdySan
Jan 27 2016 22:30
as a noob user, MQTT was rather simple to understand, no real knowledge of networking required.
Michael Miller
@Makuna
Jan 27 2016 22:30
One graph I had seen had shown you can 10 times the nodes on a network with Coap than you could with MQTT.
Aditya Tannu
@AdySan
Jan 27 2016 22:32
change of topic, any sense in adding a board definition for this Witty Cloud two layer board?
Michael Miller
@Makuna
Jan 27 2016 22:32
But setup is a little more complex with the broker abstraction.
Aditya Tannu
@AdySan
Jan 27 2016 22:33
lot of people buying this, since it's really cheap
Michael Miller
@Makuna
Jan 27 2016 22:37
isn't that just a 12F? Which is a 12e with different antenna and better ground plane?
right, but that detail isn't listed in the boards list.
Aditya Tannu
@AdySan
Jan 27 2016 22:38
yeah, pin names etc.
could be my first pull request haha
Michael Miller
@Makuna
Jan 27 2016 22:39
it looks like it has a neopixel on it, I wonder what pin that is on?
Aditya Tannu
@AdySan
Jan 27 2016 22:39
no its a RGB
directly connected to the pins i think, no driver, so can't really do PWM properly
an LDR, a user button too
const int LDR = A0;
const int BUTTON = 4;
const int RED = 15;
const int GREEN = 12;
const int BLUE = 13;
brutzler
@brutzler
Jan 27 2016 23:03
hi, stupid question: when I start "Serial.begin(115200)" and after this I define "pinmode(3, OUTPUT)" can I still use the Tx to send data over serial?
brutzler
@brutzler
Jan 27 2016 23:20
How accurate is ESP.getVcc() for you? I have 3,3V (measured with DMM) and get 3.52-3.53V back. Ok, I can calculate manually an offset to calibrate and get the right voltage. Is this the right way?
Chris Elsworth
@celsworth
Jan 27 2016 23:21
in a word, yeah. :)
I've seen the same thing, constant offset from reality
its different on every module, but on a given module, the offset is always constant
0.2v isn't that far off what I was seeing on most of mine
brutzler
@brutzler
Jan 27 2016 23:23
ok, then its no measuring, but estimating ;-)
is this only on measuring the internal voltage, or is the adc in every case as bad?
Chris Elsworth
@celsworth
Jan 27 2016 23:27
just internal voltage ime
Aditya Tannu
@AdySan
Jan 27 2016 23:30
any idea why Arduino IDE 1.6.5 you give such an error
DNSServer.h: No such file or directory
#include <dnsserver.h>
with release 2.0.0.0
brutzler
@brutzler
Jan 27 2016 23:33
DNSServer.h <-> dnsserver.h ? Only an idea....
Aditya Tannu
@AdySan
Jan 27 2016 23:36
could be, not sure, someone else trying to compile my code on windows, so dont have much visibility
brutzler
@brutzler
Jan 27 2016 23:38
Just tried. Windows 7/64

include <DNSServer.h> -> OK

include <dnsserver.h> -> dnsserver.h: No such file or directory

uupps big letters. dont know why...
Aditya Tannu
@AdySan
Jan 27 2016 23:38
ah thanks
brutzler
@brutzler
Jan 27 2016 23:41
u r welcome