These are chat archives for esp8266/Arduino

19th
Aug 2016
Stavros Korokithakis
@skorokithakis
Aug 19 2016 00:02
can i add a pullup resistor to the gate, to 5V?
Ivan Grokhotkov
@igrr
Aug 19 2016 00:02
@gmag11 that was my plan until yesterday, when I learned that new version of axTLS has been released, with TLS 1.2 support.
Stavros Korokithakis
@skorokithakis
Aug 19 2016 00:02
are the ESP pins safe to pull up to 5V?
Ivan Grokhotkov
@igrr
Aug 19 2016 00:03
Regarding http server, there is an open issue, but noone is working on it at the moment.
Stavros Korokithakis
@skorokithakis
Aug 19 2016 00:09
esp pullup to 5v, anyone?
Stavros Korokithakis
@skorokithakis
Aug 19 2016 00:25
@igrr it won't be 5V to the pin, will it? i'm putting a pullup resistor in-between
although, if it's not 5V the PMOS won't switch off :/
hmm, it's 5V tolerant, but that's for input, right?
i want to output 5V somehow
Ivan Grokhotkov
@igrr
Aug 19 2016 00:27
If you are putting a resistor between a pin and another circuit, it is not a pullup resistor, it is a current limiting .
current limiting resistor
Stavros Korokithakis
@skorokithakis
Aug 19 2016 00:28
i am putting a resistor between the 5V rail and the output pin
is that current-limiting?
Ivan Grokhotkov
@igrr
Aug 19 2016 00:28
Hmm, that is pullup, I was confused when you said "it won't go to 5v"
Stavros Korokithakis
@skorokithakis
Aug 19 2016 00:28
basically i have a PMOS connected to the 5V rail and want to switch it on and off, but the 3.3V of the ESP are not strong enough to switch the PMOS off, it needs 5V
so i'm trying to think of a way to do that
Ivan Grokhotkov
@igrr
Aug 19 2016 00:31
Yes, I think you can add a pullup to 5V
Stavros Korokithakis
@skorokithakis
Aug 19 2016 00:33
ah, great, let me try it
Stavros Korokithakis
@skorokithakis
Aug 19 2016 00:39
hmm no, it doesn't work and it's making the module rather unstable, it keeps closing the serial connection
Ivan Grokhotkov
@igrr
Aug 19 2016 00:40
How strong is the pull up?
Stavros Korokithakis
@skorokithakis
Aug 19 2016 00:40
10k
Ivan Grokhotkov
@igrr
Aug 19 2016 00:40
Are you sure the pin is not driven high as output?
Stavros Korokithakis
@skorokithakis
Aug 19 2016 00:41
it is, how am i supposed to do it?
what should i do to make the voltage 5V? set it as input?
Ivan Grokhotkov
@igrr
Aug 19 2016 00:41
You put it in input mode
Stavros Korokithakis
@skorokithakis
Aug 19 2016 00:41
hmm, why does that make the voltage 5V?
Ivan Grokhotkov
@igrr
Aug 19 2016 00:42
Because pin becomes high-impedance sink and your pull up is connected to 5v
Stavros Korokithakis
@skorokithakis
Aug 19 2016 00:43
ahhh
that worked! thanks ivan
i just need to be careful never to output HIGH then
Ivan Grokhotkov
@igrr
Aug 19 2016 00:44
You can check software i2c driver for some code if you want
Because that's basically what i2c sda pin does
Stavros Korokithakis
@skorokithakis
Aug 19 2016 00:45
ah
it seems to be working okay, except for the fact that the USB connection keeps getting closed
Ivan Grokhotkov
@igrr
Aug 19 2016 00:46
What load does pmos drive? How much current?
Stavros Korokithakis
@skorokithakis
Aug 19 2016 00:48
it drives an A6 GSM module, it says 2 A but i don't believe it's that much
i had an NMOS switching ground before, but i didn't want to dirty up the GND connections
Stavros Korokithakis
@skorokithakis
Aug 19 2016 01:01
yeah, the serial connection is closing even without the pullup resistor... i may have fried something when i outputted HIGH
Stavros Korokithakis
@skorokithakis
Aug 19 2016 01:10
hm no, it seems to be because the ESP is relaying between serial and softserial... it relays something that makes it close the serial connection when negotiating with the softserial
Stavros Korokithakis
@skorokithakis
Aug 19 2016 01:20
@igrr to turn the PMOS on, do i output LOW?
Martin Ayotte
@martinayotte
Aug 19 2016 02:13
@skorokithakis , I missed the whole discussion during a souper. Yes, you need a pull up to 5V so that when gate isn't driven Vgs is 0V to make the OFF state. Then, to turn it ON, the gate must be bring to GND, using a GPIO directly with a diode since the GPIO isn't 5V tolerant, or with a second stage N-Chan MOSFET in between. With the diode solution ON will be done when GPIO is LOW, while with the second stage mosfet, it will be the reverse. Personally, I would rather prefer the second stage mosfet.
Ivan Grokhotkov
@igrr
Aug 19 2016 02:27
Aaand, axTLS on the esp8266 is about to get TLS 1.2 support: https://github.com/ikeyasu/axtls-8266/tree/merge-200
Akash Ashok
@thehellmaker
Aug 19 2016 05:22
Awesomeee
Tls1.2 is great...a lot of people have been asking for this
I myself have been waiting for this to use was IOT
Jan Chrillesen
@janchrillesen
Aug 19 2016 06:23
igrr: Great news
Stavros Korokithakis
@skorokithakis
Aug 19 2016 09:04
@martinayotte I'll use the MOSFET, thank you!
Germán Martín
@gmag11
Aug 19 2016 09:11
@skorokithakis May you share you schematics? Thank you.
Stavros Korokithakis
@skorokithakis
Aug 19 2016 09:12
@gmag11 yes, but it's not at all complete yet
Germán Martín
@gmag11
Aug 19 2016 09:12
@skorokithakis When it is done. I'd like to look at A6 supply control
Stavros Korokithakis
@skorokithakis
Aug 19 2016 09:13
@gmag11 you mean the MOSFET thing, or something else?
Germán Martín
@gmag11
Aug 19 2016 09:13
Yes, how to connect GPIO pin to control A6 power
Stavros Korokithakis
@skorokithakis
Aug 19 2016 09:55
@gmag11 I can show you that later today, can you remind me if I forget?
Stavros Korokithakis
@skorokithakis
Aug 19 2016 10:12
@martinayotte Ivan posted a link that said that the pins are 5V tolerant, and it seems to be working fine, except I'm setting the pin as input when I want the PMOS to switch off, and low output when I want it to switch on
Unfortunately I'm having a problem where the serial connection gets reset at some point for reasons unknown
Vyvojar123
@Vyvojar123
Aug 19 2016 11:59
hello what happens if I set parity for serial communication and then I send for example one char, this char will be transfered wrong (parity will not equal). what happen ? char will be deleted on the receiving side?
or recipient request transfer again and this will occur automatically ?
Clemens Kirchgatterer
@everslick
Aug 19 2016 12:10
@Vyvojar123 there is no standard way. normally the parity error will be just signaled (a flag in the UART register or driver) to the user code and it has to deal with the error itself.
look into Serial.h and see if you find something parity related
Martin Ayotte
@martinayotte
Aug 19 2016 12:12
@skorokithakis , I don't like this method of switching pin to input to avoid the 5V issue, I still prefer a second stage mosfet.
Stavros Korokithakis
@skorokithakis
Aug 19 2016 12:16
@martinayotte yeah, I'll add one, it's much safer
Vyvojar123
@Vyvojar123
Aug 19 2016 12:18
@everslick thanks and do you think it is useful using a parity or I can rely on error-free transmission if I have use short shielded cables ?
Vyvojar123
@Vyvojar123
Aug 19 2016 13:01
I am thinking about it. I have an idea: the ESP will send 24Bytes in one packet - 10 values, each value is 2B long, the last value is 4B and it is sum of these values. The recipient will do sum of these values too and then will make comparison between recieved sum and its sum, if it equals then data are OK if not then will send new request. is it a good idea or not?
Clemens Kirchgatterer
@everslick
Aug 19 2016 13:04
@Vyvojar123 that's a classic checksum protocol and frequently done this way. i'd prefer it over dealing with parity bits.
you could also google for CRC implementations, that are often used instead of simple sums.
Stavros Korokithakis
@skorokithakis
Aug 19 2016 14:12
@gmag11 this is the mosfet solution, @martinayotte does it look reasonable to you?
Martin Ayotte
@martinayotte
Aug 19 2016 14:18
@skorokithakis , no image attached ...
Stavros Korokithakis
@skorokithakis
Aug 19 2016 14:18
ahaha
sorry
Martin Ayotte
@martinayotte
Aug 19 2016 14:20
Yes, that is exactly it ! (note that the R4 is important to make sure the mosfets are turned OFF during Reset)
Stavros Korokithakis
@skorokithakis
Aug 19 2016 14:21
thank you! time to test it
Germán Martín
@gmag11
Aug 19 2016 14:45
Thanks @skorokithakis
Stavros Korokithakis
@skorokithakis
Aug 19 2016 14:45
no problem @gmag11
does anyone know what i might be getting so wrong that the ESP will be just closing the serial connection while i'm trying to negotiate a rate with the SoftSerial?
i guess i should try the FTDI programmer to see what's going on with the tx/rx ports
Stavros Korokithakis
@skorokithakis
Aug 19 2016 15:01
ah, i don't know what's going on, the ESP is freaking out and producing exceptions
Stavros Korokithakis
@skorokithakis
Aug 19 2016 15:39
damn, for some reason, i can't get my library to work any more... looks like this is it
Stavros Korokithakis
@skorokithakis
Aug 19 2016 15:52
@martinayotte could there be any difference if i'm using the mosfets or connecting power directly to VCC? the module seems more unstable if connecting through the MOSFETs
Martin Ayotte
@martinayotte
Aug 19 2016 15:57
I don't see why ... Did you measured the VCC output of the mosfet ?
Stavros Korokithakis
@skorokithakis
Aug 19 2016 16:00
yes, 4.49 V input, 4.41 V output
Stavros Korokithakis
@skorokithakis
Aug 19 2016 16:06
This is so odd... It worked fine every time the other day, now I reassembled it and it doesn't work
Maybe I'll change the cables
Martin Ayotte
@martinayotte
Aug 19 2016 16:16
So, it should be power issue. maybe something else ...
Stavros Korokithakis
@skorokithakis
Aug 19 2016 16:18
Why do you think it's a power issue? Isn't the power OK?
The module says > 3.6v
Although it's odd that my USB only puts out 4.5V, rather than 5
Martin Ayotte
@martinayotte
Aug 19 2016 16:30
Sorry, typo from my part : "It should NOT be power issue"
Stavros Korokithakis
@skorokithakis
Aug 19 2016 16:30
Ah yes
Angus Gratton
@projectgus
Aug 19 2016 16:31
skorokithakis: what type of FET is Q1, and what type of capacitor is C3?
Martin Ayotte
@martinayotte
Aug 19 2016 16:31
USB has some drop on my computer too. I have sometime issue with that.
Stavros Korokithakis
@skorokithakis
Aug 19 2016 16:38
@projectgus the NMOS is AO3400 and the p is AO3401
It doesn't looks like a power issue to me either, it's not working very reliably even when I connect it to the Vcc directly, whereas it was very solid a few days ago...
Angus Gratton
@projectgus
Aug 19 2016 17:16
OK :)
bbx10
@bbx10
Aug 19 2016 17:41
@igrr @martinayotte I tried the git version and it fixes the slow TCP/HTTP transfer problem. I suggested the OP try the git version. http://www.esp8266.com/viewtopic.php?f=32&t=11289&p=53179#p53179
Martin Ayotte
@martinayotte
Aug 19 2016 17:51
@bbx10 , @igrr , I still not understand how your workaround of sending 2*MTU behaves ... Did you add to do same workaround with plain github version ?
Ok ! I see your last post. Did you find which commit fixed it ?
bbx10
@bbx10
Aug 19 2016 19:11
@martinayotte @igrr I do not understand why 2MSS works. I tried big writes 2MSS with the hope it would flush output faster which it does. Disabling Nagle has no effect which is expected. Nagle affects small writes (< MSS). Also it appears Nagle on ESP is either not implemented or defaults off because I tried small writes and there is no Nagle delay. I think this is a good because Nagle can be a PITA.
@martinayotte @igrr When I tested the git version, I tried with 1MSS and 2MSS. Both are fast, that is, 2MSS is no longer needed to get fast performance. 2MSS just wastes RAM. I will take a closer look at which commit fixed the problem.
Me No Dev
@me-no-dev
Aug 19 2016 19:17
@bbx10 if you read the available space for sending data, the first time you will get usually 2xMSS and then 1xMSS on each ack, so 1xMSS is fine
bbx10
@bbx10
Aug 19 2016 20:03
@me-no-dev @martinayotte @igrr Ok, 1xMSS is good. commit 8db4dcea "WiFiClient::write refactoring..." fixes the TCP write performance issue. Associated issue: #2177 Thanks @igrr, the comments in the issue take the mystery out of why 2xMSS helps. Fortunately, this "black magic" value is no longer needed.
aug2uag
@aug2uag
Aug 19 2016 20:47
is there an option to choose flash style? i know the previous flash mechanism was based on esptool.py, however i'm facing an issue relating to persistence that may have to do with Running Cesanta flasher stub.. .
i'll try flashing the build w esptool.py
aug2uag
@aug2uag
Aug 19 2016 21:01
no luck, seems the build process may have also changed since those days ..
aug2uag
@aug2uag
Aug 19 2016 21:24
ok, i missed the point esptool.py is still doing the flashing. i wouldn't have arrived here w/out posting .. thanks
Stavros Korokithakis
@skorokithakis
Aug 19 2016 22:31
do you guys think 100 uF tantalum capacitors are worth it?
for voltage stabilization
Stavros Korokithakis
@skorokithakis
Aug 19 2016 22:38
although i'm using the big barrelly 470 uF ones now
Martin Ayotte
@martinayotte
Aug 19 2016 22:53
both are good, but you also need decoupling one such ceramic 0.1uF
Stavros Korokithakis
@skorokithakis
Aug 19 2016 22:59
hmm, why? doesn't the large capacitor work for that?
aug2uag
@aug2uag
Aug 19 2016 23:45
btw, soln for me was i had esp8266 2.0.0 on arduino 1.6.5. definitely better w esp8266 2.3.0!