These are chat archives for esp8266/Arduino

11th
Sep 2015
d-anders
@d-anders
Sep 11 2015 07:14
@Links2004 A strange problem has happened. I used to be able to connect multiple clients to an esp8266 running your websocketserver. Now I've changed some things in the code and right now I am only able to have one client connected at a time. When the second tries to connect I get WStype_CONNECTED but on the client i see 'invalid status line' in the console
the changes i did should really not be related to this
Alexey Andreyev
@a-andreyev
Sep 11 2015 10:30
Hello!
Is that possible to access esp8266 connected to arduino board with WiFi Shield API?
(I mean I know it is possible to flash esp8266 with arduino firmware and use <ESP8266WiFi.h> but I want to use esp8266 as modem for other arduino board).
Steve Nelson
@zenmanenergy
Sep 11 2015 12:36

Absolutely. The original firmware had the AT commands that did that. It was fairly limited, but you could do things like connect to an access point and do http gets etc.

Another thing you could try...I haven’t tried this, but you could flash the esp with the arduino firmware and then come up with your own set of serial commands that another arduino could send that would allow you to run arduino functions on the esp. That would be a far more flexible solution.

Alexey Andreyev
@a-andreyev
Sep 11 2015 12:41
@zenmanenergy, thank you! I know about AT-commands-based libraries, but I'm wondering why there's no wrapper libraries for the default firmwares to provide unified access via WiFi Shiled API :\ For me it sounds handy, but I've discovered that several manufacturers (not only for the esp8266) providing only AT-based firmwares.
Steve Nelson
@zenmanenergy
Sep 11 2015 12:42
i think it’s mainly because people are bypassing the need for a second arduino as it makes the projects cheaper. these esp boards are very powerful. while they only have a few gpios out of the box, it’s fairly straight forward to add more gpios for more advanced projects.
d-anders
@d-anders
Sep 11 2015 13:23
havent tested it, but is it something like this you want? https://github.com/beckdac/ESP8266-transparent-bridge
Alexey Andreyev
@a-andreyev
Sep 11 2015 14:45
@d-anders, thank you for the answer, but it's not exactly that I want to implement.
Let's say I'm writing software which is sending data via network somehow.
I do not want to implement separated code for every modem device (every shield), just want to use unified wifi or ethernet shield API.
I'm wondering why simple wrapper for AT-commands-library to Shield API is still not there. I want to make sure it makes sense before implementing it by myself.
Steve Nelson
@zenmanenergy
Sep 11 2015 14:47
What do you mean? The AT commands is available out of the box. It’s a different firmware than the Arduino IDE firmware though.
Ivan Grokhotkov
@igrr
Sep 11 2015 14:50
@a-andreyev yeah, i actually was planning to write a library like the one you are describing: to use the 8266 via WiFi Shield-compatible API
But in the process of doing so I realized that it would actually be cooler to program the 8266 itself... And switched to writing this core instead.
Alexey Andreyev
@a-andreyev
Sep 11 2015 14:52
@igrr, got it! :) Thank you!
Ivan Grokhotkov
@igrr
Sep 11 2015 14:52
@a-andreyev but i think SparkFun has what you need here: https://github.com/sparkfun/SparkFun_ESP8266_AT_Arduino_Library/tree/master/src
looks like it will fit the bill
the *WiFi part is not compatible with WiFi shield, but at least they have the Client which is...
Alexey Andreyev
@a-andreyev
Sep 11 2015 14:55
@igrr , looks like they don't have separated UDP class, but I will look at this project, thank you!
Ivan Grokhotkov
@igrr
Sep 11 2015 14:56
Perhaps you can contribute that back to them if you plan to write it anyway...
Michael Miller
@Makuna
Sep 11 2015 16:14
When I got started with the ssp, I was annoyed with the AT commands, they were missing too much, scattered implementatiins, and poorly documented. I started to write a wrapper also, found this project and forgot all about doing that.
Markus
@Links2004
Sep 11 2015 16:19
@d-anders where you see "invalid status line" the library itself has no place where its output this
d-anders
@d-anders
Sep 11 2015 16:37
sorry, i mean in the browser
first browser client works perfectly
second errors and gets nothing
i used to be able to have many running
d-anders
@d-anders
Sep 11 2015 16:45
it sounds like it gets an incorrect response from the server, but i have no idea why
maybe it broke when i updated the esp8266 arduino libs a few days ago
in my javascript client the onerror and onclose events are triggered
Steve Nelson
@zenmanenergy
Sep 11 2015 17:09
i’m struggling getting a DC motor controller to work. The motor spins for about 1/4 of a second, then the esp board crashes and reboots. if the motor is disconnected, the esp doesn’t crash. any ideas?
d-anders
@d-anders
Sep 11 2015 17:10
overloading the psu
maybe
Steve Nelson
@zenmanenergy
Sep 11 2015 17:10
so it’s a wiring issue? do i need a capacitor somewhere?
d-anders
@d-anders
Sep 11 2015 17:11
what controller board/circuitry are you using?
d-anders
@d-anders
Sep 11 2015 17:12
is the motor powered by the same supply as the esp8266?
Steve Nelson
@zenmanenergy
Sep 11 2015 17:13
no. i’m using two 18650 batteries, they’re about 7v combined. the esp is powered through my laptop.
the ground between the controller and the esp are connected though
d-anders
@d-anders
Sep 11 2015 17:14
so if just the controller is connected it still works?
Steve Nelson
@zenmanenergy
Sep 11 2015 17:14
yes. i’ll double check. one sec.
so i disconnected one of the wires to the dc motor. and restarted the esp and i’m getting my serial messages that I’m expecting. i.e. forward, wait 1 second, stop wait 1 second etc.
d-anders
@d-anders
Sep 11 2015 17:15
anyway, powering the esp through an usb->serial adapter is absolutely not to be recommended
Steve Nelson
@zenmanenergy
Sep 11 2015 17:15
and the esp doesnt crash
d-anders
@d-anders
Sep 11 2015 17:15
you are very lucky to have had decent results doing that at all
Steve Nelson
@zenmanenergy
Sep 11 2015 17:16
oh… no, the esp is running through a voltage regulator
from the usb
but the motors and the esp have different power supplies
d-anders
@d-anders
Sep 11 2015 17:16
ah
so usb 5v-->regulator--->esp?
Steve Nelson
@zenmanenergy
Sep 11 2015 17:17
yes, with a 100uf capacitor too. that seems to work best for me.
d-anders
@d-anders
Sep 11 2015 17:17
that should usually work, but you could use an usb charger instead of connecting it to the laptop
some laptops are not happy suppling too much current through usb
Steve Nelson
@zenmanenergy
Sep 11 2015 17:19
sure. but that’s not whats causing the crash though. 5v from the laptop should be the same 5v as a charger
i’ll try… 1 sec
d-anders
@d-anders
Sep 11 2015 17:19
probablh
but some motherboards will only give stable 5v if the current drawn is low enough
Steve Nelson
@zenmanenergy
Sep 11 2015 17:23
i plugged it into a 5v outlet in the wall. it did make a tiny difference. i think i may need a smaller capacitor on my 7v supply going to the controller. i only had a 1uf and from what I can read of the circuit on the page it’s probably taking too long to charge/discharge.
although those caps could be built into the board. it’s so friggin tiny i need a microscope to read it
d-anders
@d-anders
Sep 11 2015 17:41
i doubt it will work but try a small cap (10-100nf) between the gnd and vcc pins of the esp
d-anders
@d-anders
Sep 11 2015 17:49
are you using high freq pwm?
then adding the cap i mentioned might actually be what is needed
Steve Nelson
@zenmanenergy
Sep 11 2015 18:42
Ive just tried caps between the vcc/gnd of the motor’s battery, no luck. i tried a cap between the leads of the motor. no luck. i do have a cap on the vcc/gnd from the voltage regulator going into the esp, that hasn’t changed.
i’m not sure about high freq pwm. i’m doing: pinMode(12, OUTPUT);
pinMode(13, OUTPUT); analogWrite(12, 255);
analogWrite(13, 0);
Markus
@Links2004
Sep 11 2015 18:56
the ESP dont like EMV, try to add a free run cap between your motor pins, Motors does make big EMV pulses with out a cap.
Steve Nelson
@zenmanenergy
Sep 11 2015 19:07
1000pf, that’s a tiny one, isn’t it?
Markus
@Links2004
Sep 11 2015 19:08
also called 1nF yes its not that big, its only for catching the voltage spices on switching moment
really big motors need more
Steve Nelson
@zenmanenergy
Sep 11 2015 19:25
these are tiny motors. i’ll have to go find a little one then! the smallest i have are 1 uf, 1000pf is 0.001uf.
Markus
@Links2004
Sep 11 2015 19:27
dont use elkos you need ceramic ones, as SMD you can find them on almost any Product today so you may can rip some of from a defect pcb.
older ones are mostly labeled with 102