These are chat archives for esp8266/Arduino

18th
Jan 2016
tzapu
@tzapu
Jan 18 2016 05:21
@mart
@martinayotte saw they ve merged, already used it. I am using it for reading from a json string
and will use it to read an updated input field
thanks
the example was how you use it, not the way to use it, if that makes sense :P as you can t use a string constructor like on most stuff, or at least i haven't seen how else you d read the ip from a string with it
tzapu
@tzapu
Jan 18 2016 05:43
and @Links2004 "but currently working on my LED light control server / managment
including support for kodi/xbmc screen capture ;) " i would love to hear more of that... the stuff you seem to be able to do with the esps is nothing short of wizardry at this point
ystrem
@ystrem
Jan 18 2016 08:54
Anybody using visual studio with Makefile ?
Michael Miller
@Makuna
Jan 18 2016 08:56
There is visual micro for visual studio that builds any arduino, including esp8266
ystrem
@ystrem
Jan 18 2016 08:58
That's not free
Michael Miller
@Makuna
Jan 18 2016 08:59
Yes it is? Was?
ystrem
@ystrem
Jan 18 2016 08:59
Paid
but looks nice
Michael Miller
@Makuna
Jan 18 2016 09:00
Front page states free, I have never paid. I have installed.
ystrem
@ystrem
Jan 18 2016 09:01
Buy the Pro version?
a 45 day trial of the Pro version is included with the standard plugin
Michael Miller
@Makuna
Jan 18 2016 09:01
I didn't say pro version.
ystrem
@ystrem
Jan 18 2016 09:02
:)
I see
Michael Miller
@Makuna
Jan 18 2016 09:04
The pro gives you line level debugging, which eats code and memory to bootstrap their debug featues and consumes the serial output, so not compatible where you need to share with those without, so I stuck with the nonpro.
ystrem
@ystrem
Jan 18 2016 09:06
hmm I'm trying to install it on VS2015 but won't work
Helio Machado
@0x2b3bfa0
Jan 18 2016 10:09

Guys, I'll be traveling until 21:00 CET. See you soon!

@ystrem @Makuna: Maybe PlatformIO does the same thing better and is free and Open Source. http://docs.platformio.org/en/latest/ide/visualstudio.html
ystrem
@ystrem
Jan 18 2016 10:10
I'm reinstalling VS2015 now, then I try it again
Alexey Andreyev
@a-andreyev
Jan 18 2016 11:31
Hello!
I've got an electricity consumption sensor with rs-485 output (2 wires) and led indicator.
Could somebody recommend some ways to collect the data with the esp8266 (esp01)? Should I get photoresistor, or some rs485-uart interface? Or maybe I could connect rs-485 wires directly to some GPIO pins and use it with additional arduino library?
beikeland
@beikeland
Jan 18 2016 11:32
if you don't need the uart, i'd get a max485 and put between the meter and you uart
(or maybe even a max485 (or similar) and software serial)
Alexey Andreyev
@a-andreyev
Jan 18 2016 11:34
@beikeland, thank you!
beikeland
@beikeland
Jan 18 2016 11:38
but i don't know what data you would be getting from the rs-485
or if you have to query it like a modbus or something.
it would howver be the most accurate, even if a photo(resistor/diode) might be easier to implement
Me No Dev
@me-no-dev
Jan 18 2016 13:35
@Juppit oh man ... :D my toolchain is actually working fine, once I had cygwin in my PATH
I feel such a noob ;)
Juppit
@Juppit
Jan 18 2016 14:54
@me-no-dev I try no for over one year. Hopfully at the end. I will change my script to support esp32.
Somthing like BRANCH=esp108-1.21.0 will do it.
Me No Dev
@me-no-dev
Jan 18 2016 14:59
yup I think it should do
the biggest advantage of your script is apt-cyg :)
man I hate that gui thing they have
ystrem
@ystrem
Jan 18 2016 15:00
anybody using ESP8266 with 18650 battery ?
tzapu
@tzapu
Jan 18 2016 15:01
i am
Mario Mikočević
@mozgy
Jan 18 2016 15:02
only LiFePO4 here
ystrem
@ystrem
Jan 18 2016 15:02
how do y use them ?
tzapu
@tzapu
Jan 18 2016 15:03
speaking of which, it seems to be at 2.45v as reported by getVcc and still working :o
Mario Mikočević
@mozgy
Jan 18 2016 15:03
18650 is usually LiPo but not always
ystrem
@ystrem
Jan 18 2016 15:03
thru voltage stabilizator ?
:D
tzapu
@tzapu
Jan 18 2016 15:03
yup
ystrem
@ystrem
Jan 18 2016 15:03
I want use battery from laptop to power my esp node
but it has 4.2 - 3.3 V
So I though to add diode to lower the voltage
tzapu
@tzapu
Jan 18 2016 15:04
this is what i use
ystrem
@ystrem
Jan 18 2016 15:04
what do you think
tzapu
@tzapu
Jan 18 2016 15:04
but, from laptop cell, you should add some protection i think, otherwise they will drain too low and get damaged
or so i read
Juppit
@Juppit
Jan 18 2016 15:24
@me-no-dev Now you have the cygwin setup, and it will be (more) easy, to use it. Try only type somthing new you want in the search field. And see, what it finds. If you really want new libs or apps, change only a single one (or more single ones) from 'skip' to 'install'. After the first, you become familier...
ystrem
@ystrem
Jan 18 2016 15:26
@tzapu
protection for over current ?
Me No Dev
@me-no-dev
Jan 18 2016 15:38
@Juppit many thanks for all your help :) I am starting to feel more comfortable :) I gathered all the needed assurance and know-how from your gists
Juppit
@Juppit
Jan 18 2016 16:41
@me-no-dev Just uploaded a version for esp32 / 8266:
https://gist.github.com/Juppit/2cc0b9a340f1c8fbfd39
only small changes
Markus
@Links2004
Jan 18 2016 16:52
@tzapu old version (arduino nano + serial only) https://www.youtube.com/watch?v=wM4uaByDmH0
the new one will have WS8212 and ESP and 140 LEDs (420 Channel) ;)
will also couple all the LED strips in the room with it, the effect is pretty amassing when watching TV
Sven Eliasson
@comino
Jan 18 2016 17:48
I assume its only working if you connect a laptop, right?
looks amazing - wanted to build something like that, too.
Markus
@Links2004
Jan 18 2016 17:49
yes, you need a external PC or raspberry pi running kodi (old name xbmc).
in my case its a old intel atom board.
Domingo
@domingosl
Jan 18 2016 17:56
Hello. I'm sorry if this is not the right place to ask this, I've been playing for the last 2 months with the nodeMCU firmware and I find it slow and clumsy. I was thinking about start using the Arduino version instead, since the program gets compiled and it is not a Lua script it is safe to assume the Arduino version is faster than the nodeMCU
Chris Elsworth
@celsworth
Jan 18 2016 17:56
yes :)
orders of magnitude faster
Domingo
@domingosl
Jan 18 2016 17:57
And how about the stability?
Chris Elsworth
@celsworth
Jan 18 2016 17:57
we wouldn't use it if it was unstable ;)
its fine :)
you sometimes need to take a little care wiht yielding control back to the chip so it can run wifi housekeeping but if you do everything right, your chip will run just fine for weeks on end
some of my simplest modules (just monitoring some 1wire sensors) have been running months without a reboot or crash
Domingo
@domingosl
Jan 18 2016 17:58
Yielding control? Can you explain please? ☺
Remember that there is a lot of code that needs to run on the chip besides the sketch when WiFi is connected. WiFi and TCP/IP libraries get a chance to handle any pending events each time the loop() function completes, OR when delay is called. If you have a loop somewhere in your sketch that takes a lot of time (>50ms) without calling delay, you might consider adding a call to delay function to keep the WiFi stack running smoothly.
don't worry if it sounds complicated now, it will become second nature ;)
Domingo
@domingosl
Jan 18 2016 18:00
I understand. It does not sounds complicate, just something to keep in mind
Chris Elsworth
@celsworth
Jan 18 2016 18:00
yep.
Domingo
@domingosl
Jan 18 2016 18:00
Thanks a lot!
Chris Elsworth
@celsworth
Jan 18 2016 18:00
dive in, ask questions, we're helpful :D
Domingo
@domingosl
Jan 18 2016 18:02
Wow! I promise you if I get rich with my product based on the Arduino esp I'm gonna give you a percentage 😂
Chris Elsworth
@celsworth
Jan 18 2016 18:02
:thumbsup:
ystrem
@ystrem
Jan 18 2016 18:29
So I installed VS2015 + Visual Micro and it's very nice, but I can't turn off some "debug" so I can't use serial port :D
can anybody point me, how to disable it
?
:D sry guys I got it :D
Ivan Kravets
@ivankravets
Jan 18 2016 18:38
@crushedice2000 @probonopd We are working on the own PlatformIO IDE for Atom text editor. I hope that 0.1.0 will be released this week. See https://github.com/platformio/platformio-atom
Stavros Korokithakis
@skorokithakis
Jan 18 2016 18:52
that looks sexy
mkokotovich
@mkokotovich
Jan 18 2016 18:59
Followup to previous question regarding slow performance using WifiClient to write to philips hue bridge. I found that using client.println and client.readuntil is MUCH slower than using client.write and client.read. I'm not sure why exactly, but when you use the basic write/read APIs for WifiClient you get much better performance. The examples use client.println, I wonder if they should be changed to use write/read.
Markus
@Links2004
Jan 18 2016 19:12
print use based on the action many writes this slow down the connection.
better use a String as buffer for all data and use write one.
println for example needs at minimum 2 TCP packets for every call which is very inefficient.
https://github.com/esp8266/Arduino/blob/master/cores/esp8266/Print.cpp#L134-L135
based on what you print may more.
mkokotovich
@mkokotovich
Jan 18 2016 19:27
Yeah, that's exactly what I did. I'm done most of my network programming using C, so it was more natural for me anyways.
While we're on the subject of writing to the philips hue bridge, it expects PUT commands. It seems the HttpClient doesn't support PUT? GET, POST, etc, but not PUT. Any reason, or just still on the TODO list
?
Markus
@Links2004
Jan 18 2016 19:34
it is supported, you can use the generic function
mkokotovich
@mkokotovich
Jan 18 2016 19:37
Ah, I didn't think of just using "sendRequest" (guess I figured it wasn't exported). That makes sense, thanks!
d-anders
@d-anders
Jan 18 2016 20:33
just saw a new seller on ali selling nodemcu v2 for $2.15
sounds too good to be true so probably is
ystrem
@ystrem
Jan 18 2016 20:33
@d-anders I bought for $3.5 and it works :D
d-anders
@d-anders
Jan 18 2016 20:34
hehe yeah
normal "low" price on ali is now around 3.3 for v3
ystrem
@ystrem
Jan 18 2016 20:35
but the headers are crooked
d-anders
@d-anders
Jan 18 2016 20:35
bent?
or just poor?
ystrem
@ystrem
Jan 18 2016 20:36
yeah bend but it fit to breadboard
w8
d-anders
@d-anders
Jan 18 2016 20:37
ah, i almost always use female duponts to connect to my nodemcu boards
ystrem
@ystrem
Jan 18 2016 20:38
blob
:D
d-anders
@d-anders
Jan 18 2016 20:38
if i dont need a breadboard it is nice not to have one and when i want one i get annoyed that the nodemcu taks up so much space
so i use duponts
i cant tell from the pictures - are the pins bent or did they fail when they soldered the pin strips?
almost looks like the row to the far right is tilted to the right not in full contact with the board
ystrem
@ystrem
Jan 18 2016 20:45
the pins are tilted to one side
d-anders
@d-anders
Jan 18 2016 20:47
too much work to heat up all the joints in order to straighten it i guess :)
also maybe not worth the risk
Mario Mikočević
@mozgy
Jan 18 2016 20:47
not really, hot air gun ftw
d-anders
@d-anders
Jan 18 2016 20:52
heh really, do you use a hot air gun to solder?
or do you mean only to desolder?
Chris Elsworth
@celsworth
Jan 18 2016 20:56
hot air gun is the only way to solder some of the smaller smd stuff :)
Mario Mikočević
@mozgy
Jan 18 2016 20:56
you can do both
Martin Ayotte
@martinayotte
Jan 18 2016 20:56
I've seen worst than that ... in your case, I would simply take a plier and bend them a bit to the center
d-anders
@d-anders
Jan 18 2016 20:56
hm, do you modify the air flow somehow?
Chris Elsworth
@celsworth
Jan 18 2016 20:57
alter it on the unit? :)
d-anders
@d-anders
Jan 18 2016 20:57
or how do you keep everything in place? :)
Chris Elsworth
@celsworth
Jan 18 2016 20:57
the air flow can be low
just hot
we don't mean like.. a hairdryer ;)
you'd never see your smd stuff again :D
d-anders
@d-anders
Jan 18 2016 20:58
heh, i must try it. i have pipe-soldering with mine, but thats a completely different thing :)
aaah
my hot air gun is a different beast
Chris Elsworth
@celsworth
Jan 18 2016 20:59
like a crafting one?
d-anders
@d-anders
Jan 18 2016 20:59
it will wake up the dead
Chris Elsworth
@celsworth
Jan 18 2016 20:59
they're good for heatshrink
but not this :)
d-anders
@d-anders
Jan 18 2016 21:00
yeah, i use it for heatshrink
yeah, sounded a bit too strange, haha
probonopd
@probonopd
Jan 18 2016 21:34
duh. OTA still giving me headaches. are there issues when running some bigger loads in main() such as driving neopixels?
I am trying to OTA'ify the NeoPixels demo sketch
as soon as I do, OTA stops working
@ivankravets I'm using platformio-atom atm
tzapu
@tzapu
Jan 18 2016 21:48
@ystrem for over charge and over discharge i think.
@Links2004 looks amazing, i may have seen/read about your project before
ystrem
@ystrem
Jan 18 2016 21:52
@tzapu I want to connect it thru diode to lower voltage and fuse for safety :D, charging would be seperate
tzapu
@tzapu
Jan 18 2016 21:54
But you can still drain it too much and damage the cell
ystrem
@ystrem
Jan 18 2016 21:54
how much is safe ?
tzapu
@tzapu
Jan 18 2016 21:54
I guess you can do a readVcc, see if voltage too low, notify and shutdown for a long period
Mario Mikočević
@mozgy
Jan 18 2016 21:55
for LiPo anthing under 3.0 is damaging cell chemistry
ystrem
@ystrem
Jan 18 2016 21:56
ok
I thought that I have to use ADC to read voltage
tzapu
@tzapu
Jan 18 2016 21:57
If you re not using the analog pin you can read internal voltage
ystrem
@ystrem
Jan 18 2016 21:58
I didnt know that there is such fnc
:D
Stavros Korokithakis
@skorokithakis
Jan 18 2016 22:10
how do you do that on the ESP?
tzapu
@tzapu
Jan 18 2016 22:12
One sec
Mario Mikočević
@mozgy
Jan 18 2016 22:13
@skorokithakis do what on ESP ?
Stavros Korokithakis
@skorokithakis
Jan 18 2016 22:13
read the internal voltage
Mario Mikočević
@mozgy
Jan 18 2016 22:13
it's in any of my sketches :)
ADC_MODE(ADC_VCC);
Mario Mikočević
@mozgy
Jan 18 2016 22:14
Serial.printf( "Vcc: %u\n", ESP.getVcc() );
tzapu
@tzapu
Jan 18 2016 22:14

ESP8266 has a single ADC channel available to users. It may be used either to read voltage at ADC pin, or to read module supply voltage (VCC).

To read external voltage applied to ADC pin, use analogRead(A0). Input voltage range is 0 — 1.0V.

To read VCC voltage, ADC pin must be kept unconnected. Additionally, the following line has to be added to the sketch:

ADC_MODE(ADC_VCC);
This line has to appear outside of any functions, for instance right after the #include lines of your sketch.

Ah, too late
Stavros Korokithakis
@skorokithakis
Jan 18 2016 22:14
daaamn, that's pretty handy
tzapu
@tzapu
Jan 18 2016 22:15
Indeed
Chris Elsworth
@celsworth
Jan 18 2016 22:15
its one or the other though
no analog input if you want the Vcc
Stavros Korokithakis
@skorokithakis
Jan 18 2016 22:15
yeah
tzapu
@tzapu
Jan 18 2016 22:15
I think it could do with a calibration
Stavros Korokithakis
@skorokithakis
Jan 18 2016 22:15
what are the values?
0-1023 again?
Chris Elsworth
@celsworth
Jan 18 2016 22:15
yeah, 10bit
tzapu
@tzapu
Jan 18 2016 22:15
doesn t agree with my meter
but close
Stavros Korokithakis
@skorokithakis
Jan 18 2016 22:16
so how many volts is 1023?
Chris Elsworth
@celsworth
Jan 18 2016 22:16
1
this is in the docs, dude ;)
seriously ;)
tzapu
@tzapu
Jan 18 2016 22:16
hmm, is it 0-1023? I remember it being voltage
Stavros Korokithakis
@skorokithakis
Jan 18 2016 22:16
yeah i'm confused
tzapu
@tzapu
Jan 18 2016 22:16
On readVcc
Stavros Korokithakis
@skorokithakis
Jan 18 2016 22:16
the internal voltage should be 3.3V, no?
Chris Elsworth
@celsworth
Jan 18 2016 22:16
no, thats what the ADC_MODE define does
swaps between measuring 3.3v vcc rail, or 0-1v on the adc
quite why its 1v is anyones guess, bit odd
Stavros Korokithakis
@skorokithakis
Jan 18 2016 22:17
but what if the rail is 3.7V?
do you get 1023 again?
Chris Elsworth
@celsworth
Jan 18 2016 22:17
then you'll blow it up
Stavros Korokithakis
@skorokithakis
Jan 18 2016 22:17
no i won't :P
Chris Elsworth
@celsworth
Jan 18 2016 22:17
oh, no - you don't use analogRead then
Stavros Korokithakis
@skorokithakis
Jan 18 2016 22:17
i've been running it on 4.2V pretty happily
Chris Elsworth
@celsworth
Jan 18 2016 22:17
you use ESP.getVCC
tzapu
@tzapu
Jan 18 2016 22:17
3411
Chris Elsworth
@celsworth
Jan 18 2016 22:17
and yes it returns millivots
tzapu
@tzapu
Jan 18 2016 22:18
Is a value i just got from it
Stavros Korokithakis
@skorokithakis
Jan 18 2016 22:18
@tzapu ah
so it is, indeed, millivolts
tzapu
@tzapu
Jan 18 2016 22:18
Yup
Stavros Korokithakis
@skorokithakis
Jan 18 2016 22:18
16 bit then
tzapu
@tzapu
Jan 18 2016 22:19
Meter i think says 3.3.. Something
Chris Elsworth
@celsworth
Jan 18 2016 22:19
yeah don't rely on that being 16bit accurate
Stavros Korokithakis
@skorokithakis
Jan 18 2016 22:19
sure
Chris Elsworth
@celsworth
Jan 18 2016 22:19
in practise its more like the nearest 0.1v :)
its not great
Stavros Korokithakis
@skorokithakis
Jan 18 2016 22:19
that works though
i just meant it's not 10 bits
tzapu
@tzapu
Jan 18 2016 22:19
I concur :)
Mario Mikočević
@mozgy
Jan 18 2016 22:20
it's 10bit resolution when you use ADC pin
Chris Elsworth
@celsworth
Jan 18 2016 22:22
@skorokithakis I would be interested to see the readings at 4.2v
I tested mine from 2.7v to 3.6v and found a fairly consistent offset - the good news is once you know the offset for a particular module you can calibrate it out
Stavros Korokithakis
@skorokithakis
Jan 18 2016 22:22
@celsworth i'm trying to figure out the right code to turn it into a string, and i'll post it
Ivan Kravets
@ivankravets
Jan 18 2016 22:23

@probonopd

I'm using platformio-atom atm

What do you mean? :)

Stavros Korokithakis
@skorokithakis
Jan 18 2016 22:24
volts=3964
Chris Elsworth
@celsworth
Jan 18 2016 22:25
at 4.2? wow, quite far out
Stavros Korokithakis
@skorokithakis
Jan 18 2016 22:26
not sure it's 4.2 any more
it's a battery
let me measure
multimeter says 3.87
not that bad
Chris Elsworth
@celsworth
Jan 18 2016 22:27
about 0.1v then, par for the course :)
PyB
@PyBerger
Jan 18 2016 23:34
@igrr @kelnofunny
I also see to have the erase timeout issue when loading an SPIFFS file.
(as you discussed in november)
would you have a version compiled with the 15s timeout
if not I would try to compile one...