These are chat archives for esp8266/Arduino

11th
Dec 2015
that’s 240v DC input and output
i mean… 240v DC output
0-1.5V input == LOW
2.5V-5V input== HIGH
Tony
@toxuin
Dec 11 2015 05:10
Hey, quick question: if my ESP 12e has pin marked GPIO2 – should I reference it in Arduino as digital pin 2?
I know there’s a catch somewhere. Like, some GPIO is mared wrong or something.
Also, is it cool to use that pin for a push button? it isn’t part of something like SDIO or serial, isn’t it?..
Steve Nelson
@zenmanenergy
Dec 11 2015 05:14
Tony
@toxuin
Dec 11 2015 05:16
riiight.
Helio Machado
@crushedice2000
Dec 11 2015 09:40
@skandragon: In my circuit I only have 3.3V DC on the low side and 78V DC on the high side (I will not touch again 220V AC on the mains input). My MOSFET triggers at 4V and the logic of the ESP works at 3.3V. So the more obvious solution is to put a secondary driver to join gate and source (or gate and drain with a pull-up).
@martinayotte: They are OK for my project, but the local hardware store only have 4u28.
Helio Machado
@crushedice2000
Dec 11 2015 09:45
@zenmanenergy: Switching speed? I'll use it for PWM. Also if I buy something online (from China) it will take ~20 days to arrive here in Spain. So if I buy something online, will be a SFH640 or H11D4 as @martinayotte kindly suggested.
Harrison Mclean
@h4rm0n1c
Dec 11 2015 10:01
@crushedice2000 Easiest thing to do would be to throw a bipolar transistor in there as a level shifter, or if you have a 5v rail handy, you could just use a TTL part as one.
Helio Machado
@crushedice2000
Dec 11 2015 10:08
@h4rm0n1c: I don't have 5V. Also, could explain me why to use a bipolar transistor? I'm n00b on electronics.
Harrison Mclean
@h4rm0n1c
Dec 11 2015 10:24
They're the most readily available type, work well at low voltage and can switch at moderately high speeds.
The classic being the 2N2222, but anyway, I like my legacy parts, so others may have better suggestions.
Helio Machado
@crushedice2000
Dec 11 2015 10:27
This message was deleted
Helio Machado
@crushedice2000
Dec 11 2015 10:32
@h4rm0n1c: I used a tiny TO92 NPN transistor but it heats with 78V (and I suspect that it will end frying).
Harrison Mclean
@h4rm0n1c
Dec 11 2015 10:38
ah, right, 78v, yeah. that's getting up there.
wouldn't it be better to use a resistor divider to drop the voltage going into that transistor?
You don't need THAT much current just for switching, right? So voltage sag from a divider shouldn't be an issue.
Harrison Mclean
@h4rm0n1c
Dec 11 2015 10:43
At 78v, even drawing 500ma turns into 40w of power just like that, no wonder it's getting warm.
Helio Machado
@crushedice2000
Dec 11 2015 10:53
@h4rm0n1c: So what circuit? A resistor between transistor emitter and mosfet source?
Harrison Mclean
@h4rm0n1c
Dec 11 2015 10:54
This message was deleted
Harrison Mclean
@h4rm0n1c
Dec 11 2015 11:02
If you put Two resistors in series between the positive rail and ground, the middle point will be at half the positive rail, in this case, 39 volts.
You then use this to supply your bipolar transistor with power instead of the 78v rail itself, less voltage = less total power = less heat.
Obviously, don't use too small a value resistors, and you can change the ratio between your resistors to adjust the voltage you want.
Harrison Mclean
@h4rm0n1c
Dec 11 2015 11:08
Either that, or get a bigger transistor :p
Hassanbenlebsir
@Hassanbenlebsir
Dec 11 2015 11:13
i have the nodemcu esp-12 and i was working on a project yesterday and it was fine today i tried to open the same project that was working yesterday but it keep telling me dailed to open the port espcom-open failed
that this means that my esp died :(
@Hassanbenlebsir
Failed to open COM4
espcomm_open failed
this is what i'm getting
Harrison Mclean
@h4rm0n1c
Dec 11 2015 11:21
Sounds like the port is either in use (leaving a serial monitor or terminal open can do that), not being detected, or, has changed number.
Hassanbenlebsir
@Hassanbenlebsir
Dec 11 2015 11:24
i changed the ports i even restarted the computer but still the same error
Harrison Mclean
@h4rm0n1c
Dec 11 2015 11:30

Can you connect a serial terminal at 74880 baud and try rebooting the nodemcu? You should at least get some garbage, if not a boot message.

Is your OS detecting the COM port?

What about your power supply for the nodemcu? These things also hate brownouts, stable power is important.

Hassanbenlebsir
@Hassanbenlebsir
Dec 11 2015 11:34
my os is detecting the port and also the driver and for the power supply i just connected it to the computer the nodemcu esp-12 has a female out put so i just used my phone usb cable to connect it to the my laptop and it was working fine
and i can't even open the serial terminal
when i try to open it tells me that it's busy
beikeland
@beikeland
Dec 11 2015 11:37
@Hassanbenlebsir i find if i disconnect / reconnect serial bridges with open connections, they sometime give me a hard time, and sometime they show up as different ports. so to qoute the imfamous "the it crows", have you tried turning it off and on again?
Harrison Mclean
@h4rm0n1c
Dec 11 2015 11:37
Ok, usb power is ok, but I'd make sure your laptop is plugged in, it'll have a hard time supplying 5v at 500ma on batteries.
Hassanbenlebsir
@Hassanbenlebsir
Dec 11 2015 11:39
@beikeland i tried truning it off and on and i tried all diffrent port on laptop and i tried turning my laptop on and off nothing it's telling me busy
@h4rm0n1c i used my pc desktop also but still the same probleme so i dont think its a laptop problem
and what i'v noticed is when i leave it connected to my pc for a while my pc crashes it cant do anything cant mouve my mouse nothing
Harrison Mclean
@h4rm0n1c
Dec 11 2015 11:42
You may have a more serious issue, if we're talking about windows.
What you can try is "show all hidden devices" in device manager (it's in one of the menus IIRC), deleting EVERY com port device, reboot and then hit the detect hardware button.
Harrison Mclean
@h4rm0n1c
Dec 11 2015 11:49
That's as far as I can think of, I'm out of ideas past that at the moment.
Hassanbenlebsir
@Hassanbenlebsir
Dec 11 2015 11:52
ok i will try this
but when i did the step you said by showing the hidden ports
i saw some hidden ports using the esp
i deleted them ok now i'll restart my laptop
i hope this will work
Harrison Mclean
@h4rm0n1c
Dec 11 2015 11:55
So do I.
Hassanbenlebsir
@Hassanbenlebsir
Dec 11 2015 12:13
same probleme the port is busy :(
Hassanbenlebsir
@Hassanbenlebsir
Dec 11 2015 12:20
if some had this problem the esp Error opening serial port 'COM3'. (Port busy) pleas help me out
it just started to work
this electronic devices are going to drive me mad someday
Harrison Mclean
@h4rm0n1c
Dec 11 2015 12:27
gremlins, or pixies, take your pick lol
Hassanbenlebsir
@Hassanbenlebsir
Dec 11 2015 12:29
lol
Steve Nelson
@zenmanenergy
Dec 11 2015 14:18
@Hassanbenlebsir did you ever resolve that issue? Is that windows or mac? I’ve had some similar issues on my mac usually a reboot fixes it for me, but doing a repair permissions command often fixes it for me.
Hassanbenlebsir
@Hassanbenlebsir
Dec 11 2015 14:19
windows
what the message that you are getting?
Steve Nelson
@zenmanenergy
Dec 11 2015 14:21
what often happens for me on my mac is the esp, well technically the ftdi is no longer listed in the ports. It may be a totally different problem, but I find it happens fairly often for me.
Hassanbenlebsir
@Hassanbenlebsir
Dec 11 2015 14:22
are using the nodumcu lua on board esp?
Steve Nelson
@zenmanenergy
Dec 11 2015 14:32
I work with two devices, a nodemcu 1.0 and a 1 meg esp01. It happens with both of them. It happens far more often with the latest Mac update than it used to. They f’d something up.
“They” being apple.
Steve Nelson
@zenmanenergy
Dec 11 2015 16:30
Does anyone have an example of using httpClient to download a png/jpg and save it to SPIFFS? (sorry if this double posts, something funny is happening with Gitter)
siedi
@siedi
Dec 11 2015 16:49
Q: I'musing the Webserver library and post (put) a json via an ajax request. how can I retrieve it. I see the server.args for the get parameter, but how do I get the post/put content?
Martin Ayotte
@martinayotte
Dec 11 2015 16:51
Server.args() is the arguments count, you simply have to Server.arg(int) or Server.arg(char *) to get them, the first is by index, the second by name.
siedi
@siedi
Dec 11 2015 17:14
ok, cool, thanks. I had the impression it is for GET only
Martin Ayotte
@martinayotte
Dec 11 2015 17:22
it is for both GET and POST
You can use Server.hasArg(char *) to validate the field names
siedi
@siedi
Dec 11 2015 17:24
perfect