These are chat archives for esp8266/Arduino

12th
Dec 2015
Tony
@toxuin
Dec 12 2015 06:17
so quiet here…
What’s the project you’re working on, guys? ^_^
Rohit Yermalkar
@romuye123
Dec 12 2015 08:08
Is there any way to make Esp.deepSleep work forever until you press RESET button.?
Chris Elsworth
@celsworth
Dec 12 2015 14:19
the underlying sdk function says pass 0 as the time to sleep forever, I assume that'll work
yes its passed straight through, just ESP.deepSleep(0, mode)
beikeland
@beikeland
Dec 12 2015 15:05
so thats the equivalent of shutting down?
Hassanbenlebsir
@Hassanbenlebsir
Dec 12 2015 15:29
can the esp be programmed through wifi like the arduino yun
Chris Elsworth
@celsworth
Dec 12 2015 15:30
yeah there's OTA libraries
ystrem
@ystrem
Dec 12 2015 17:28
Hello guys, how to update IDE to new sdk 1.4.0 ?
Chris Elsworth
@celsworth
Dec 12 2015 17:34
current stable release uses sdk 1.4.0, just update in boards manager
oh i lie, its 1.3.0 maybe
in which case you pretty much just wait unless you want to dive in deep yourself ;)
seems to be a github branch for sdk 1.4 but I don't know how useful that is, focus is probably on getting 1.5 to work now
Chris Elsworth
@celsworth
Dec 12 2015 17:48
actually now I think about it there were issues with 1.4 so it was skipped in favour of waiting for 1.5 I think
ystrem
@ystrem
Dec 12 2015 17:49
I see, ok
Hassanbenlebsir
@Hassanbenlebsir
Dec 12 2015 18:15
is their a way to choose between OTA or normal use of the esp without using a button to tell that i'm in the programming mode or normal mode?
Chris Elsworth
@celsworth
Dec 12 2015 18:17
ota works in normal mode, you don't reboot to programming mode to flash ota
its just part of your normal code, a hook in loop() checks if an upload is running
Hassanbenlebsir
@Hassanbenlebsir
Dec 12 2015 18:19
is it automatically detects if a sketch is uploaded
Me No Dev
@me-no-dev
Dec 12 2015 18:19
It's a service that runs from the sketch, like the web server or mDNS
you need to include the required code and have that as part of your sketch
then the ESP will respond on OTA requests from the IDE/computer
Chris Elsworth
@celsworth
Dec 12 2015 18:20
very slick it is too :D
Hassanbenlebsir
@Hassanbenlebsir
Dec 12 2015 18:20
to be honest that's awesome
i'll try it
Hassanbenlebsir
@Hassanbenlebsir
Dec 12 2015 18:30
why must pyhton 2.7 be installed?
Chris Elsworth
@celsworth
Dec 12 2015 18:33
the ota uploading script is python, espota.py
if you're using that method anyway (I do) :)
you can do it over http too, have the esp check for a new update over http every so often
Hassanbenlebsir
@Hassanbenlebsir
Dec 12 2015 18:37
ok get it thanx
so the ota lib is using the ip addresse of the eso to load the sketch to it but the ip adresse of the esp is not static
esp*
Chris Elsworth
@celsworth
Dec 12 2015 18:39
yeah but there's some mdns code in there so the ide can find it, iirc
it announces itself to the network
Hassanbenlebsir
@Hassanbenlebsir
Dec 12 2015 18:42
okeeey
Hassanbenlebsir
@Hassanbenlebsir
Dec 12 2015 19:18
when can i find the DNS_SD_ARDUINO_OTA sketch i'm using the ardui ide 1.6 and it's not in the examples directory
M0ebiu5
@M0ebiu5
Dec 12 2015 19:19
Anyone tried ota with 512k flash? Here (pr-4107, latest git), it does not work, if i select 512k flash (ota_begin_error). But if i select a larger flash size, it works (basicota sketch).
Me No Dev
@me-no-dev
Dec 12 2015 19:20
512K is not enough
Markus
@Links2004
Dec 12 2015 19:20
512k flash is to limited for OTA
M0ebiu5
@M0ebiu5
Dec 12 2015 19:26
ok, but there is something wrong, cause the basicota sketch works with a larger flash size selected. I assume it works until the sketch is smaller than 256k?
Me No Dev
@me-no-dev
Dec 12 2015 19:27
@Hassanbenlebsir add this to the BasicOTA sketch
WiFiServer ota_fix(8266);
void setup(){
  ...
  ota_fix.begin();
}

void loop(){
  if(ota_fix.hasClient()) ota_fix.available().stop();
  ...
}
@M0ebiu5 you have 4KB EEPROM, 12KB ESP Settings and probably 64KB SPIFFS
Steve Nelson
@zenmanenergy
Dec 12 2015 19:28
This may be a silly idea, but what about some sort of temporary sketch that has nothing but OTA in it so it’s a very small sketch <200K? So if you flash it twice, the first time with the small sketch, then use the small sketch to flash the bigger one. That might allow for OTA on a 512K chip.
Me No Dev
@me-no-dev
Dec 12 2015 19:28
@zenmanenergy that will still be one time only
empty sketch is as low as you can go and that is basically only the libs that come with the SDK
Chris Elsworth
@celsworth
Dec 12 2015 19:29
is an empty sketch with the wifi library even under 200k
Me No Dev
@me-no-dev
Dec 12 2015 19:29
so we can not go lower than that
Steve Nelson
@zenmanenergy
Dec 12 2015 19:30
well, let’s say it were possible to make a OTA-only sketch at 150K. Then if your original sketch was 300K and your new sketch was 301K, 300+301>512 so that wouldn’t work. but 300+150 < 512, then 150+301<512. That might work.
M0ebiu5
@M0ebiu5
Dec 12 2015 19:30
basicota uses 222kb.
Me No Dev
@me-no-dev
Dec 12 2015 19:30
but even if possible, still it will be a one time only OTA
best chance is small sketch and no SPIFFS
Chris Elsworth
@celsworth
Dec 12 2015 19:31
or just upgrade to 4MB modules, they're so cheap
Me No Dev
@me-no-dev
Dec 12 2015 19:31
then only 16KB are deducted from the 512
Chris Elsworth
@celsworth
Dec 12 2015 19:32
I guess I'm fortunate that I came to the esp late enough that 4MB modules were already in wide supply so I never had to deal with the 512k ones
Markus
@Links2004
Dec 12 2015 19:32
or replace the flash chip you can get them very cheap
Steve Nelson
@zenmanenergy
Dec 12 2015 19:33
on a slightly different topic… on a larger 4mb chip. Is it possble to have a second OTA sketch that always remains in SPIFF and/or somewhere that can’t be deleted so if the OTA fails, it rolls back to the second sketch? The idea being that a device in the field isn’t bricked from an update.
M0ebiu5
@M0ebiu5
Dec 12 2015 19:34
yea, i found the problem cause i assumed that my module has 4MB...
Me No Dev
@me-no-dev
Dec 12 2015 19:34
the new sketch replaces the old one only after many checks have been performed
that means the transfer was correct and the bootloader recognized the sketch correctly
it is really easy to save a sketch to the SPIFFS and roll it back when you want, given that a sketch is running
else you need to make changes to the eboot bootloader
Chris Elsworth
@celsworth
Dec 12 2015 19:36
can you boot from any location, or only the two locations that the sketches are saved at by ota?
Me No Dev
@me-no-dev
Dec 12 2015 19:36
you can boot from any location
Chris Elsworth
@celsworth
Dec 12 2015 19:36
ie could you have 3 or more sketches saved into flash, ready to boot at any time?
Me No Dev
@me-no-dev
Dec 12 2015 19:36
you can and such things have been done before
Markus
@Links2004
Dec 12 2015 19:37
the ESP boot every time at 0x0000 from there you can jump to any code thats stored at the first 1MB
Me No Dev
@me-no-dev
Dec 12 2015 19:37
but that means that the sketch have to be compiled to run atthat lcation
so you need to know where you want to upload that sketch and compile it for that slot
makes it not very practical in our case
Chris Elsworth
@celsworth
Dec 12 2015 19:38
oh, does espota actually change the sketch when it uploads it then? or how does it know which slot it will run from
depending on which slot is currently running, it uses the other to upload to, right?
Markus
@Links2004
Dec 12 2015 19:38
no there are no slots
Hassanbenlebsir
@Hassanbenlebsir
Dec 12 2015 19:38
Me No Dev
@me-no-dev
Dec 12 2015 19:39
espota writes the new sketch after the old one then the eboot replaces the current sketch and boots the new one
Chris Elsworth
@celsworth
Dec 12 2015 19:39
oh, I see, ok
that image shut explain it.
Steve Nelson
@zenmanenergy
Dec 12 2015 19:40
Links do you know if igrr had a chance to look at the eboot issue that requires a physical reboot after an update?
Me No Dev
@me-no-dev
Dec 12 2015 19:40
@Hassanbenlebsir ota_fix.begin() after the while()....
@zenmanenergy I do not think that is related to eboot at all
Markus
@Links2004
Dec 12 2015 19:41
@zenmanenergy no infos there, and its not a eboot issue, its a general reboot problem, and has to do with how the sketch is started the first time after serial upload.
Chris Elsworth
@celsworth
Dec 12 2015 19:41
because it starts without a reboot or something?
Markus
@Links2004
Dec 12 2015 19:41
yes
Steve Nelson
@zenmanenergy
Dec 12 2015 19:41
oh. gotcha. i’m still trying to understand the eboot does :-)
i thought the issues were related
Me No Dev
@me-no-dev
Dec 12 2015 19:42
replaces the current sketch if there is update pending or runs the current one
Chris Elsworth
@celsworth
Dec 12 2015 19:48
has anyone tried rboot on the esp? is it worth replacing eboot with?
Helio Machado
@crushedice2000
Dec 12 2015 19:53
Hi! I have a really n00b question about a N-channel FET and the ESP8266. Anybody can help me?
Markus
@Links2004
Dec 12 2015 19:53
whats the problem?
Helio Machado
@crushedice2000
Dec 12 2015 19:54
I have a IRF1404 attached to a LED strip to control it.
The gate voltage is 4v
The ESP-01 delivers 3.3v on it's pins
So, I need to shift it to 5v. I have a 5V rail.
Me No Dev
@me-no-dev
Dec 12 2015 19:55
use another small transistor in between
Markus
@Links2004
Dec 12 2015 19:56
no the gate is like a capacitor.
Helio Machado
@crushedice2000
Dec 12 2015 19:56
Yes, I've tried it, but then the led strip starts dimming like when a capacitor discharges.
Markus
@Links2004
Dec 12 2015 19:56
and the mos can handle 2 to 4V
blob
Helio Machado
@crushedice2000
Dec 12 2015 19:57
@Links2004: Ok, I've seen the datasheet, but the crude reality is that with 3v3 it doesn't trigger.
Me No Dev
@me-no-dev
Dec 12 2015 19:57
2-4 at 10V maybe that matters?
Helio Machado
@crushedice2000
Dec 12 2015 19:57
When I supply with 3v3, I get a dimmed light
Markus
@Links2004
Dec 12 2015 19:58
blob
Helio Machado
@crushedice2000
Dec 12 2015 19:58
@me-no-dev: Yes
Markus
@Links2004
Dec 12 2015 19:58
what voltage your stripe uses? 12V?
Helio Machado
@crushedice2000
Dec 12 2015 19:59
@Links2004: But when I input 3v3 the FET behaves like a huge resistor
the light brights less than when I use 5V
@Links2004 @me-no-dev: I've read a wikipedia article about gate drivers. Should I pick one of these?
Markus
@Links2004
Dec 12 2015 20:03
you are sure that you wired correctly, normal a MOSFET not is like a resistor.
Helio Machado
@crushedice2000
Dec 12 2015 20:04
@Links2004: Joining Source and Gate, puts the LED strip at full brightness.
Markus
@Links2004
Dec 12 2015 20:05
source is normal connected to GND.
and connecting to gate shut make that the LED goes off.
Helio Machado
@crushedice2000
Dec 12 2015 20:05
@Links2004: Also I have a pull-down to reset the MOSFET to low.
Markus
@Links2004
Dec 12 2015 20:06
can you draw a picture of your schematic.
Helio Machado
@crushedice2000
Dec 12 2015 20:06
@Links2004: Sorry, I meant Drain...
@Links2004: Fritzing-like one?
Markus
@Links2004
Dec 12 2015 20:07
Fritzing ?
Me No Dev
@me-no-dev
Dec 12 2015 20:08
@crushedice2000 fritzing will do
@Links2004 proto board view type of thing
Markus
@Links2004
Dec 12 2015 20:09
@me-no-dev ok, thanks i only use eagle ;)
Chris Elsworth
@celsworth
Dec 12 2015 20:10
:thumbsup: for eagle, I tried a few packages includiing Fritzing before settling on that
Me No Dev
@me-no-dev
Dec 12 2015 20:10
@Links2004 me too, but fritzing is really user-friendly and does not require a degree in electronics :)
Chris Elsworth
@celsworth
Dec 12 2015 20:10
some learning curve but fritzing seemed very limiting
I have no degree in electronics and I can work eagle, it just takes some time to learn.. not hard if you put in an hour or two of patience :)
Me No Dev
@me-no-dev
Dec 12 2015 20:11
@celsworth I for example design my 3D objects in ThinkerCad which is much like fritzing but for 3D
can not handle more matrure 3D software
Helio Machado
@crushedice2000
Dec 12 2015 20:13
Untitled Sketch_bb.png
@me-no-dev @Links2004 : Something like this
Me No Dev
@me-no-dev
Dec 12 2015 20:15
looks OK to me
Markus
@Links2004
Dec 12 2015 20:16
looks good to me.
I only habe realize that I am not used to read this ;)
if the LED not light correct in this setup, the NFET is not suitable for this use case.
Hassanbenlebsir
@Hassanbenlebsir
Dec 12 2015 20:18
@me-no-dev i uploaded the sketch to the esp but i cant see the esp in the port section so i can use the OTA
Me No Dev
@me-no-dev
Dec 12 2015 20:18
@Hassanbenlebsir restart the IDE
Markus
@Links2004
Dec 12 2015 20:19
unfortunately the datasheet is miss the graph for RDS on to VGS
so i can not verify it.
Helio Machado
@crushedice2000
Dec 12 2015 20:19
@Links2004: It lights OK, the problem is when I attach a ESP8266 GPIO to drain and ESP8266 GND to GND.
As 3v3 is not enough to trigger the FET N, the led strip lights up poorly.
Markus
@Links2004
Dec 12 2015 20:20
yes 12V at Gate vs 3V3 can make a differences to RDS on.
Helio Machado
@crushedice2000
Dec 12 2015 20:20
I'm hand-drawing a sketch of the circuit
Markus
@Links2004
Dec 12 2015 20:21
this differences can make the problem. the datasheed only say for 10V the RDSon is 0.0035Ohm
blob
but what is will be vor 3.3V is not noted there.
It can be many time more.
Helio Machado
@crushedice2000
Dec 12 2015 20:26
@Links2004: I have a 5V part. How can I join +5V and Gate when I give a 3V3 pulse?
2015-12-12-212649.jpg
Markus
@Links2004
Dec 12 2015 20:27
a other smaller mosfet, or a Optokoppler, based on what you have around (will invert the signal)
the mos is only designed for 40V, 78V is way over it.
Helio Machado
@crushedice2000
Dec 12 2015 20:28
@Links2004: I've burned all my optocouplers doing silly things...
Me No Dev
@me-no-dev
Dec 12 2015 20:29
wait...
Helio Machado
@crushedice2000
Dec 12 2015 20:29
@Links2004: The mos is supporting the load perfectly (only 18w). However, is this abusing the ratings?
Me No Dev
@me-no-dev
Dec 12 2015 20:29
is the 5V and 3.3V ground common?
Helio Machado
@crushedice2000
Dec 12 2015 20:29
I have a good aluminum heatsink on it.
@me-no-dev: yes, the grounds are all common.
Markus
@Links2004
Dec 12 2015 20:31
the mos can "break through" and kill the ESP, the watts are ok, but never go over the ratet voltage.
Helio Machado
@crushedice2000
Dec 12 2015 20:31
@Links2004: But with that watt consumption and a good heatsink, really can happen that?
Markus
@Links2004
Dec 12 2015 20:33
yes, its not a overheating problem, the isolation inside the MOS is designet for max 40V, 78V will damage the isolation and at one point it will be a short, and then good by ESP.
Helio Machado
@crushedice2000
Dec 12 2015 20:37
@Links2004: do you refer to power-on time?
Markus
@Links2004
Dec 12 2015 20:38
power on time?
Helio Machado
@crushedice2000
Dec 12 2015 20:42
@Links2004: I refer to a possible disaster after so much time powered on.
@Links2004 @me-no-dev: I've found some CNY17-2.
Markus
@Links2004
Dec 12 2015 20:43
this info will not profited by any manufacturer.
will draw you something on moment.
Helio Machado
@crushedice2000
Dec 12 2015 20:44
@Links2004 The pity is that the (by some obscure reason), they (CNY17-2) have a threshold (i.e they remain off until certain PWM level, then they go on 100%)
Markus
@Links2004
Dec 12 2015 20:45
This message was deleted
blob
the CNY17-2 can handle 100khz
Helio Machado
@crushedice2000
Dec 12 2015 20:47
@Links2004: What is the default PWM freq. on the ESP8266 with Arduino?
@Links2004: May be that the PWM freq. is higher than the CNY17-2 response time?
Markus
@Links2004
Dec 12 2015 20:48
i think its 1KHz.
but you can change it by using analogWriteFreq
Helio Machado
@crushedice2000
Dec 12 2015 20:49
@Links2004: then, what can be the problem?
Also what units for analogWriteFreq?
Markus
@Links2004
Dec 12 2015 20:49
Hz
what resistor (R2) do you use for the CNY17-2?
Helio Machado
@crushedice2000
Dec 12 2015 20:50
@Links2004: R2=0Ω
Markus
@Links2004
Dec 12 2015 20:51
for 3V3 is shut be 160Ω or you will kill the LED inside the opto
Helio Machado
@crushedice2000
Dec 12 2015 20:52
ESP-GPIO -------------- |-----------|    --------------- PIN 1
                        | CNY        |
  GND    ------------- -|-----------|   ---------------- PIN 2
@Links2004: The LED seems good...
Markus
@Links2004
Dec 12 2015 20:55
may the ESP not supply enough to kill it, good for you, but better add a resistor.
This message was deleted
blob
Helio Machado
@crushedice2000
Dec 12 2015 20:59
@Links2004: Without it works well, however I'll consider adding one in the final design.
@Links2004: What amazes me is why the led strip powers on after some threshold instead of dimming smoothly.
Markus
@Links2004
Dec 12 2015 21:01
you go over the ratings of the MOS, may this is a side affect of this.
or do you try to dimm with the CNY?
Helio Machado
@crushedice2000
Dec 12 2015 21:02
@Links2004: I'm PWMing the CNY LED.
Markus
@Links2004
Dec 12 2015 21:03
yes what do you have at pin 4 and 5 of the CNY
Helio Machado
@crushedice2000
Dec 12 2015 21:05
@Links2004: Drain and Gate of the mos.
Markus
@Links2004
Dec 12 2015 21:06
do you have a pulldown on Gate?
Helio Machado
@crushedice2000
Dec 12 2015 21:08
@Links2004: I mistaken. I have 5V and Gate and not Drain and Gate. However, I have a pulldown between Gate and Source (470kΩ)
Markus
@Links2004
Dec 12 2015 21:10
you can try somethink like this to see if its the CNY or the MOS how makes the problem
blob
or try to use 10V instead of 5V, 10V is recommended in the datasheet.
Helio Machado
@crushedice2000
Dec 12 2015 21:18
@Links2004: Ok, I'll try later. Dinner time ;-)
Thank you for your help!
Bye!
Hassanbenlebsir
@Hassanbenlebsir
Dec 12 2015 21:19
error: Failed to open 192.168.0.15
error: espcomm_open failed
i get this error while trying OTA
Martin Ayotte
@martinayotte
Dec 12 2015 23:00
I see those talks about CNY17-2, but this opto-coupler still has a BVceo of 70V ... I mentioned SFH60 and H11D1, but there is also SFH619 with darlington output.
Martin Ayotte
@martinayotte
Dec 12 2015 23:34
BTW, since you only need a Vgs about 10V for making the MOSFET satured, you can add zener diode to avoid using a high BVceo optocoupler