These are chat archives for esp8266/Arduino

2nd
Jan 2016
Stavros Korokithakis
@skorokithakis
Jan 02 2016 00:01
@brutzler np
Stavros Korokithakis
@skorokithakis
Jan 02 2016 00:11
@brutzler I've added an Amica NodeMCU R2 schematic: https://github.com/skorokithakis/kicad-lib
brutzler
@brutzler
Jan 02 2016 00:13
:+1: Top, will try it tomorrow. Or when I finished my tutorial. Parts placed, now its time to route....
hmmm... is there any autoroute? Yes i know, this is to be used careful, but is there any autoroute integrated? Only find an Export/Import to FreeRoute.
Stavros Korokithakis
@skorokithakis
Jan 02 2016 00:31
yeah, i think it only has freeroute capability
i was trying to autoroute the first time i tried it, too
try the manual router
it's MUCH better
press f11, then start routing
and press e while you're routing
it will give you the options
i use the walkaround router, but the shove router is also excellent
you can try autoroute as well if you want, though
Stavros Korokithakis
@skorokithakis
Jan 02 2016 01:26
what do you guys think about a pushbutton that grounds reset and GPIO0? would that work?
Chris Elsworth
@celsworth
Jan 02 2016 01:27
no, think you need to hold gpio0 a bit longer
hence two buttons on most boards
Stavros Korokithakis
@skorokithakis
Jan 02 2016 01:27
aw
two buttons suck though
Chris Elsworth
@celsworth
Jan 02 2016 01:32
maybe charge a capacitor which powers a transistor to hold gpio0 low for that extra few hundred ms? :)
Stavros Korokithakis
@skorokithakis
Jan 02 2016 01:33
that's pretty hacky :P
Chris Elsworth
@celsworth
Jan 02 2016 01:33
yep :)
Stavros Korokithakis
@skorokithakis
Jan 02 2016 01:33
i'm looking for an smd pushbutton but i'm not having much luck
apparently they're all huge
Martin Ayotte
@martinayotte
Jan 02 2016 01:47
Those are probably used by the FBI/CIA, there is a whole CPU inside that transmit things over G4 ... :smile: Don't use those, they sucks all your batteries ... :-)
@skorokithakis , joke apart, are those too big for you ? http://www.ebay.ca/itm/100pcs-New-Momentary-Tact-Tactile-Button-Switch-SMD-SMT-Surface-Mount-3x6x5mm-/111378949904 ... (Even if I have other format, I will order hose now, so cheap : 3 cents / switch)
Chris Elsworth
@celsworth
Jan 02 2016 01:55
electronics is so cheap its rude not to order a few of everything ;)
those buttons look nice, will look for some on the british ebay :)
Martin Ayotte
@martinayotte
Jan 02 2016 01:59
This New Year First Day cost me a lot, cumulative orders come up to $20 :-) lol
Markus
@Links2004
Jan 02 2016 12:00
I have stated to integrate the debug management in the IDE (#1350)
Helio Machado
@0x2b3bfa0
Jan 02 2016 12:40
@/all Would be possible to have a SSH server on ESP32?
Markus
@Links2004
Jan 02 2016 12:44
ssh is not a trivial think:
example: https://github.com/mkj/dropbear (~220k loc)
if someone has free time sure, but SSL shut do the jop too.
any use case where SSH is mandatory?
Chris Elsworth
@celsworth
Jan 02 2016 12:45
what would you want to do in this ssh server?
it doesn't exactly run bash :)
Helio Machado
@0x2b3bfa0
Jan 02 2016 13:31
@Links2004: Non mandatory, but a good idea for port tunneling/encryption :)
@celsworth: SSH to a listener ;) However would be great to have a basic shell on the ESP, like busybox. ;) https://github.com/jcmvbkbc/linux-xtensa
celsworth @celsworth thinks expectations may need some reigning in ;)
Chris Elsworth
@celsworth
Jan 02 2016 13:35
very ambitious, but I don't think it would have many practical uses
Helio Machado
@0x2b3bfa0
Jan 02 2016 13:36
@celsworth: Effectively, I can't find any practical use :smiling_imp: If I desire a wifi linux box, then I'll use a tiny router.
@celsworth @Links2004: https://blog.cesanta.com/esp8266-and-iot-smartjs-starter-guide This looks great.
Chris Elsworth
@celsworth
Jan 02 2016 13:56
javascript on an mcu, not my thing. but yeah, the concept of being able to write scripts and save and run them without so much as a reboot is quite neat
Helio Machado
@0x2b3bfa0
Jan 02 2016 13:58
@celsworth: ;)
FWeinb
@FWeinb
Jan 02 2016 14:38
Would it be better to allocate a uint8_t array with 1024 entries via malloc or just declare it on compile time?
Chris Elsworth
@celsworth
Jan 02 2016 14:41
static entries?
or generated at runtime?
FWeinb
@FWeinb
Jan 02 2016 14:41
Generated at runtime. It is the buffer for an small oled display.
Chris Elsworth
@celsworth
Jan 02 2016 14:41
I'd malloc that
FWeinb
@FWeinb
Jan 02 2016 14:42
I am experimenting with double buffering. Got 60fps via I2C on an ESP in 80Mhz mode.
Writing to the display via I2C is just slow with bit banging...
Chris Elsworth
@celsworth
Jan 02 2016 14:43
best you can do on the esp
FWeinb
@FWeinb
Jan 02 2016 14:44
It is insane that it is faster to calculate what has changed and only transfer changes.
But this means 2x the ram consumption.
Accessing heap is slower, right?
Markus
@Links2004
Jan 02 2016 14:55
heap is ram and has the same speed then the stack or static variables
FWeinb
@FWeinb
Jan 02 2016 14:59
That is awesome.
Going with buffer on the heap than.
Stavros Korokithakis
@skorokithakis
Jan 02 2016 18:38
@martinayotte those look great, you have an eye for these things
@martinayotte i can never find good ones
Martin Ayotte
@martinayotte
Jan 02 2016 18:40
@skorokithakis , you means finding things on eBay ? Simply question of spelling/naming things properly. Something like SMT or SMD doesn't give same results.
Stavros Korokithakis
@skorokithakis
Jan 02 2016 18:42
@martinayotte i don't know, i was searching for "smd button" and was getting back irrelevant listings
Martin Ayotte
@martinayotte
Jan 02 2016 18:42
If I remember, I use "SMT Push Button"
Stavros Korokithakis
@skorokithakis
Jan 02 2016 18:47
i think the smaller ones are perfect, less space is better, thank you
Stavros Korokithakis
@skorokithakis
Jan 02 2016 19:07
does anyone remember which gpio the led is on?
0?
Markus
@Links2004
Jan 02 2016 19:09
most modules have it on 3 or 1
simple use the BUILTIN_LED define :)
Stavros Korokithakis
@skorokithakis
Jan 02 2016 19:12
oh, it's defined? that's fantastic
does anyone know what i need to do to convert WiFi.localIP() to a char[]?
i'm having lots of trouble with char[] concatenations :(
Markus
@Links2004
Jan 02 2016 19:17
WiFi.localIP().toString().c_str()
Stavros Korokithakis
@skorokithakis
Jan 02 2016 19:18
oh i can convert strings to byte[] with just .c_str()?
sorry, char[]
what was the return type of localIP() originally?
Markus
@Links2004
Jan 02 2016 19:18
you get a ptr to a char * from this function.
localIP returns a IPAddress object
Stavros Korokithakis
@skorokithakis
Jan 02 2016 19:19
fantastic, thank you
do i need to free that afterwards?
Markus
@Links2004
Jan 02 2016 19:19
it lives as long you in the scope where you call toString
Stavros Korokithakis
@skorokithakis
Jan 02 2016 19:19
fantastic, that's what i want
thank you!
Stavros Korokithakis
@skorokithakis
Jan 02 2016 19:30
is there a better way to concatenate strings than String(" ") + String(var) + String(": ") etc?
Markus
@Links2004
Jan 02 2016 19:31
String new;
new += " ";
new += var;
....
Stavros Korokithakis
@skorokithakis
Jan 02 2016 19:32
hmm, let me try that
is that the same as:
String new;
new = new + "x" + "y";
oh, it compiles, great
thank you
Markus
@Links2004
Jan 02 2016 19:33
"new = new +" will need more ram
"new += " is better :)
Stavros Korokithakis
@skorokithakis
Jan 02 2016 19:34
oh, interesting
Chris Elsworth
@celsworth
Jan 02 2016 19:34
hm, really?
Stavros Korokithakis
@skorokithakis
Jan 02 2016 19:34
i'll do it that way, thanks
Chris Elsworth
@celsworth
Jan 02 2016 19:34
I always thought they compiled to the same thing
Stavros Korokithakis
@skorokithakis
Jan 02 2016 19:34
@celsworth i guess the former constructs the intermediate strings
Chris Elsworth
@celsworth
Jan 02 2016 19:34
would have thought the optimiser would just hide all that though
Markus
@Links2004
Jan 02 2016 19:34
@celsworth string is overloading this operator,
for normal variables like int its the same.
Chris Elsworth
@celsworth
Jan 02 2016 19:34
even at very low optimisation levels
ah of course
Stavros Korokithakis
@skorokithakis
Jan 02 2016 19:35
is WiFi.localIP() slow?
Markus
@Links2004
Jan 02 2016 19:36
its a call to the SDK shut be less then 1ms.
Stavros Korokithakis
@skorokithakis
Jan 02 2016 19:36
good, then no problem in using it in logging calls to print the IP
Chris Elsworth
@celsworth
Jan 02 2016 19:38
the printing to serial will be far slower than getting the IP
Stavros Korokithakis
@skorokithakis
Jan 02 2016 19:40
great
i'm actually sending it to mqtt, so even worse :smile:
Stavros Korokithakis
@skorokithakis
Jan 02 2016 19:49
god, programming the bare ESPs is such a drag
all the resistors...
thank god for OTA
Stavros Korokithakis
@skorokithakis
Jan 02 2016 20:09
how do you know if an ESP is toast? doesn't respond to serial?
Chris Elsworth
@celsworth
Jan 02 2016 20:12
not being able to programme it is probably a good indicator, assuming your pullups are right
check serial at 74880 on resetting it to see what it gives you, should always be some output regardless of what you've programmed into it
Stavros Korokithakis
@skorokithakis
Jan 02 2016 20:13
it would still produce junk at 115200, right?
Markus
@Links2004
Jan 02 2016 20:13
yes
Stavros Korokithakis
@skorokithakis
Jan 02 2016 20:13
hmm, i don't see anything. let me try again, thanks
Markus
@Links2004
Jan 02 2016 20:15
if you have pullup for reset + CH_PD it will always output at Serial +Serial1 at 74880 baud at power
Stavros Korokithakis
@skorokithakis
Jan 02 2016 20:16
hmm, it's sending SOMETHING when i ground reset
Chris Elsworth
@celsworth
Jan 02 2016 20:17
it lives!
Stavros Korokithakis
@skorokithakis
Jan 02 2016 20:17
there's no 74880 baud :P
wth?
Chris Elsworth
@celsworth
Jan 02 2016 20:17
there is.. its just not a standard :)
Stavros Korokithakis
@skorokithakis
Jan 02 2016 20:17
haha, well my terminal won't accept it
Chris Elsworth
@celsworth
Jan 02 2016 20:18
get a better one ;)
Stavros Korokithakis
@skorokithakis
Jan 02 2016 20:18
haha
which one do you use?
Chris Elsworth
@celsworth
Jan 02 2016 20:18
miniterm.py is my choice (linux)
(part of platformio also)
it is what platformio uses if you do platformio serialports monitor
Stavros Korokithakis
@skorokithakis
Jan 02 2016 20:18
oh, it's there, great
Chris Elsworth
@celsworth
Jan 02 2016 20:18
that will do 74880 np
Stavros Korokithakis
@skorokithakis
Jan 02 2016 20:19
hmm, still junk
Mario Mikočević
@mozgy
Jan 02 2016 20:19
screen can do term emu too (on linux)
Chris Elsworth
@celsworth
Jan 02 2016 20:19
not at that baud it can't :(
Mario Mikočević
@mozgy
Jan 02 2016 20:19
hmm, it works for me
Chris Elsworth
@celsworth
Jan 02 2016 20:20
hmm really? interesting
may have to revisit this then, I've previously confirmed with someone else (on #esp8266 on freenode) that screen doesn't work at 74880 for this
Stavros Korokithakis
@skorokithakis
Jan 02 2016 20:22
hm, nah, it doesn't want to be programmed
Chris Elsworth
@celsworth
Jan 02 2016 20:34
whoa thats small :)
Stavros Korokithakis
@skorokithakis
Jan 02 2016 20:34
@mozgy welp, now i have to buy those too :smile:
Mario Mikočević
@mozgy
Jan 02 2016 20:34
hehe
Stavros Korokithakis
@skorokithakis
Jan 02 2016 20:35
these stupid things are so cheap i can't help buying them :(
Mario Mikočević
@mozgy
Jan 02 2016 20:35
Stavros Korokithakis
@skorokithakis
Jan 02 2016 20:36
those look pretty good, although the small ones are fantastic
GPIO0 low to program, correct?
Markus
@Links2004
Jan 02 2016 20:37
yes
Stavros Korokithakis
@skorokithakis
Jan 02 2016 20:38
then the esp looks toast
espcomm_open failed
probably just throw it away then
good for on/off switches
Stavros Korokithakis
@skorokithakis
Jan 02 2016 20:38
@celsworth why do you hate me
Stavros Korokithakis
@skorokithakis
Jan 02 2016 20:38
oh those are expensive, i won't get them :P
Chris Elsworth
@celsworth
Jan 02 2016 20:38
they're through hole, but there's smd equivalents
but again pth
^ cheap :)
Mario Mikočević
@mozgy
Jan 02 2016 20:39
@celsworth hmm, I think I have better ones .. sec
Stavros Korokithakis
@skorokithakis
Jan 02 2016 20:39
are you kidding me with this :smile:
1 euro for 100?
Chris Elsworth
@celsworth
Jan 02 2016 20:39
I know :D
Stavros Korokithakis
@skorokithakis
Jan 02 2016 20:39
oh, $3
Chris Elsworth
@celsworth
Jan 02 2016 20:39
don't know how they make profit
£0.68 for 100 for me, no postage either
to UK
Stavros Korokithakis
@skorokithakis
Jan 02 2016 20:39
jesus
i bought two of these for a euro the other day
Markus
@Links2004
Jan 02 2016 20:42
they have a shipping flat rate
Stavros Korokithakis
@skorokithakis
Jan 02 2016 20:43
stop it you guys :smile:
hmm, the BUILTIN_LED seems to be defined for the red nodemcu led
it doesn't blink the blue on
one
Stavros Korokithakis
@skorokithakis
Jan 02 2016 20:45
ok i'm logging off :P
i will talk to you all later
i have a problem, possibly :(
Chris Elsworth
@celsworth
Jan 02 2016 20:48
are most of these standard dip-sizing do you know?
so 2.54mm spacing?
Stavros Korokithakis
@skorokithakis
Jan 02 2016 20:49
who cares, $1.3 buys
Mario Mikočević
@mozgy
Jan 02 2016 20:49
they do fit on my protoboard
those 5cm x 7cm ones
Chris Elsworth
@celsworth
Jan 02 2016 20:50
@skorokithakis well true, but its just nicer to buy things that I can find the package for in advance
for my pcb design
or ones that come with a proper datasheet :)
otherwise I'll end up measuring it with calipers and designing my own package ;)
Chris Elsworth
@celsworth
Jan 02 2016 20:59
well, I know the 6x6mm buttons fit anyway, I had some of those and my existing pcb had one on, so thats a safe bet :) but buying new ones, I just like being prepared that it will go straight on my pcb with no fiddling ;)
Martin Ayotte
@martinayotte
Jan 02 2016 21:17
Eh, guys, I was away for 2 hours, I've read all your posts about switch ... If it continue, China will be in switch shortage ... :smile:
Mario Mikočević
@mozgy
Jan 02 2016 21:17
hehehe
Martin Ayotte
@martinayotte
Jan 02 2016 21:17
@skorokithakis , about the 748800 rate, not all USB dongle support it, even your you terminal support it.
Markus
@Links2004
Jan 02 2016 21:18
with FTDI it works (fake and original) 74880.
Martin Ayotte
@martinayotte
Jan 02 2016 21:18
@skorokithakis , about on-board LED, some ESP-12(E), it is connected to TX, some newer ones (something named ESP-12Q) it is alone on GPIO3 (if I remember)
@Links2004 , yes, but not with Prolific
Markus
@Links2004
Jan 02 2016 21:19
GPIO3 is RX
Martin Ayotte
@martinayotte
Jan 02 2016 21:20
@Links2004 , then, maybe another one, I don't remember (it was one of the main difference discussed on the forum between "fake" and "not fake")
Mario Mikočević
@mozgy
Jan 02 2016 21:24
@Links2004 why is this awfully slow ->
  while ( ( jpegData != 0xD9 ) | ( jpegDataTmp != 0xFF )) {
    jpegDataTmp = jpegData;
    jpegData = SPI.transfer( x00 );
    httpServer.client().write( jpegData );
  }
opening SPIFFS file, reading SPI into that file, then reopen file and read it to httpServer is like 100 times faster
Markus
@Links2004
Jan 02 2016 21:28
you create one byte tcp packages thats bad
Mario Mikočević
@mozgy
Jan 02 2016 21:28
hmm, I did wrote 0x00 there
Markus
@Links2004
Jan 02 2016 21:28
load it in to a 1460 byte buffer and send it then
Mario Mikočević
@mozgy
Jan 02 2016 21:28
aah, crap, one byte TCP .. figures ..
Martin Ayotte
@martinayotte
Jan 02 2016 21:29
:-)
Markus
@Links2004
Jan 02 2016 21:29
spi support read more the one byte too
Mario Mikočević
@mozgy
Jan 02 2016 21:30
yeh, about that, what is out and what in ?
I saw that before but didn't know how to use it
Markus
@Links2004
Jan 02 2016 21:31
out will be send can be NULL if not need
in is what comes back can be NULL if not need, but your case sounds like a cam so its your buffer.
Mario Mikočević
@mozgy
Jan 02 2016 21:33
looks like I need to read on SPI ..
if I do SPI.transfer( 0x00 ); what exactly that do ?
Markus
@Links2004
Jan 02 2016 21:34
transfare a 0x00 byte out and one byte back (your return) at the same time.
Mario Mikočević
@mozgy
Jan 02 2016 21:34
is that number 0x00 like an I2C address ?
Markus
@Links2004
Jan 02 2016 21:34
SPI do in and out at the same time always :)
in your case its dummy data, i think
Mario Mikočević
@mozgy
Jan 02 2016 21:35
ah, ok, noted
so it'll be
uint8_t buffer[1024];
SPI.transferBytes( buffer, NULL, 1024 );
Markus
@Links2004
Jan 02 2016 21:38
no you want data from the cam or?
then you buffer need to be in :)
SPI.transferBytes( NULL, buffer, 1024 );
Mario Mikočević
@mozgy
Jan 02 2016 21:39
ah, ok
but
just figured it out, I might need to scan the data as I read it .. jpeg EOI
looking at this cam library, it seems like author did not trust it's uint32_t jpegLength = myCAM.read_fifo_length(); himself
Markus
@Links2004
Jan 02 2016 21:41
you may can read more then needed, and scan later.
check the datasheed, most SPI chips send 0x00 or 0xFF when you read more.
if you know the length is easier, may check the datasheet.
not trust any code blind ;)
Mario Mikočević
@mozgy
Jan 02 2016 21:42
good point
Markus
@Links2004
Jan 02 2016 21:43
no one write perfect code, but anyone tries (and this is good).
Mario Mikočević
@mozgy
Jan 02 2016 21:52
yep ->
SPI FIFO PIC length 19456
Actual PIC length 19032!
Mario Mikočević
@mozgy
Jan 02 2016 22:26
cam fifo is 256 bytes boundary