These are chat archives for esp8266/Arduino

1st
Dec 2015
Stavros Korokithakis
@skorokithakis
Dec 01 2015 00:00
ah :( does that make it less stable?
i would have liked a capacitor over the vcc/gnd while they were at it
what's everyone's preferred board? i'm liking the nodemcu but it's too big, the huzzah looks better... it's missing USB, but with FOTA and an FTDI programmer, i don't care that much
Dmitry Kireev
@kireevco
Dec 01 2015 00:03
@skorokithakis I like nodemcu v2
"slim one"
Stavros Korokithakis
@skorokithakis
Dec 01 2015 00:03
@kireevco isn't that about the same as the v1?
This message was deleted
Martin Ayotte
@martinayotte
Dec 01 2015 00:16
Those boards can be unstable the same way as any other ESPs if GPIO2/GPIO0 are not pulled-up, depending of ESR environment. Yes, a big capacitor on VCC/GND is also missing, although there plenty of free space on the PCB.
brutzler
@brutzler
Dec 01 2015 00:51
but huzzah is "only ESP12". NodMCU V2 slim (my favourite) is ESP12-E
Chris Elsworth
@celsworth
Dec 01 2015 00:54
doesn't the E only get you those extra pins along the bottom that you can't really use anyway?
is it the F which has the better antenna?
I'm liking the slim nodemcu as well for tinkering with, I have a few of the boards skorokithakis linked as well, save some space but a bit more faff to hook up to usb, need to dig out usb-serial
got a fat nodemcu once and didn't make that mistake twice
Aditya Tannu
@AdySan
Dec 01 2015 01:08
Yes NodeMCU 1.0 is the slimmer version (breadboard friendly)
The yellow one is NodeMCU 0.9
The v1 v2 and v3 are just names given by eBay/aliexpress sellers
Dmitry Kireev
@kireevco
Dec 01 2015 01:10
ah, yeah, 0.9 vs 1… I thought it was 1
I like it
brutzler
@brutzler
Dec 01 2015 01:12
The Lolin board is wide too... http://www.ebay.de/itm/V3-NodeMcu-Lua-WIFI-Development-Board-/371460855945?hash=item567ccad889:g:qEcAAOSwAKxWVoki
and has a different USB-serial (CH3400-chip)
Aditya Tannu
@AdySan
Dec 01 2015 01:15
Yes that's an unofficial nodeMCU, the original 0.9 had a minidip package serial chip and the 1.0 has a square shaped cp2102
This one's a mish mash of both
But significantly cheaper, can get it for $4 or so
brutzler
@brutzler
Dec 01 2015 01:15
But I think there is NO official NodeMCU
Look at the first link from kireevco. This is very cheap, and a cp2101 (my favourite)
Chris Elsworth
@celsworth
Dec 01 2015 01:17
mine seem to be CH340G, they do the job
is CP2101 better at anything? faster speeds?
Yeah all of them work fine, mostly
Ch340 driver need disabling kernel extensions on OSX
Some may not like that
brutzler
@brutzler
Dec 01 2015 01:30
Just orderd one from Aliexpress. USD 4,30 incl. shiping to germany. Not much lost in case.
But if you order more than one, there are costs for shiping.....
Stavros Korokithakis
@skorokithakis
Dec 01 2015 01:31
@brutzler i found some for $4ish each with no shipping, i think
i ordered 3, they're good
brutzler
@brutzler
Dec 01 2015 01:31
link?
Stavros Korokithakis
@skorokithakis
Dec 01 2015 01:32
hm, can't find them right now, unfortunately
they were pretty much the same as that one
brutzler
@brutzler
Dec 01 2015 01:34
only know CH340 for about USD 4
Chris Elsworth
@celsworth
Dec 01 2015 01:34
they get a lot cheaper if you don't want them on a dev board, just the bare esp12e is more like $1.30, but then you need to break it out yourself
Stavros Korokithakis
@skorokithakis
Dec 01 2015 01:35
yeah, i bought like 10 of those as well, but the nodemcu seems much better
Chris Elsworth
@celsworth
Dec 01 2015 01:35
or if you're rolling your own pcbs I guess
brutzler
@brutzler
Dec 01 2015 01:35
no way. too much work for little money
Stavros Korokithakis
@skorokithakis
Dec 01 2015 01:35
i'll use the raw chip to make an amazon dash button
Me No Dev
@me-no-dev
Dec 01 2015 01:36
any eclipse users around?
silence :D
Stavros Korokithakis
@skorokithakis
Dec 01 2015 01:53
does anyone know if the "V2" nodemcu is slimmer than the "V3"?
Chris Elsworth
@celsworth
Dec 01 2015 01:54
I didn't know there were 3 :/
I have two versions, one of them fills a 5-wide breadboard, the other one leaves one row of pins either side
I don't think it could get much slimmer than that or the esp wouldn't fit on it
v3 looks the same as v2, but with CP2102?
Stavros Korokithakis
@skorokithakis
Dec 01 2015 01:56
yeah, i'm wondering whether it leaves two rows of pins
but i think that's unlikely
the huzzah is good, i have an ftdi cable and with FOTA i don't need USB
Chris Elsworth
@celsworth
Dec 01 2015 01:57
I don't think so.. the esp didn't get any thinner, and the gap between the edge and the chip looks the same on the v3 as my v2s
Stavros Korokithakis
@skorokithakis
Dec 01 2015 01:57
right, thanks
Chris Elsworth
@celsworth
Dec 01 2015 01:57
doh, first OTA try crashed the chip :(
Me No Dev
@me-no-dev
Dec 01 2015 01:57
if you did not manually reboot after the serial upload that is normal
Chris Elsworth
@celsworth
Dec 01 2015 01:58
that may be it
Me No Dev
@me-no-dev
Dec 01 2015 01:58
known bug not in OTA but in the bootloader
reboot the chip then try OTA
Chris Elsworth
@celsworth
Dec 01 2015 01:58
hm, second try did the same, I'll enable OTA_DEBUG for more info
Me No Dev
@me-no-dev
Dec 01 2015 01:58
what versions are you running?
Chris Elsworth
@celsworth
Dec 01 2015 01:59
git HEAD
Me No Dev
@me-no-dev
Dec 01 2015 01:59
BasicOTA running fine?
Chris Elsworth
@celsworth
Dec 01 2015 02:00
I'll try that next
Me No Dev
@me-no-dev
Dec 01 2015 02:00
if that works then you probably keep your loop too busy so you can not call ArduinoOTA.handle(); on time
but that is hard to do
Chris Elsworth
@celsworth
Dec 01 2015 02:03
yeah my loop is basically empty, just some serial printing inside a 500ms delay check.. I'll try BasicOTA.
Me No Dev
@me-no-dev
Dec 01 2015 02:03
so you delay 500ms? do you call ArduinoOTA.handle(); in the loop?
Chris Elsworth
@celsworth
Dec 01 2015 02:05
ok, BasicOTA does the same thing
hmm:
402083f8 g F .irom0.text 00000091 lmacProcessTXStartData
Me No Dev
@me-no-dev
Dec 01 2015 02:07
i run OTA like 20 times tonight
Chris Elsworth
@celsworth
Dec 01 2015 02:08
what's ProcessTXStartData, is that some sdk function
Me No Dev
@me-no-dev
Dec 01 2015 02:09
that is something we know hnothing of
we can guess from the name
what does arduino say about it?
Chris Elsworth
@celsworth
Dec 01 2015 02:16
right, 2.0.0 stable in the Arduino IDE is fine, so its something in my build environment
Stavros Korokithakis
@skorokithakis
Dec 01 2015 02:24
is arduino ide 1.6.5 still the recommended version?
Chris Elsworth
@celsworth
Dec 01 2015 02:28
hm, these nodemcu boards can run at 160MHz? the IDE has 80MHz selected
Stavros Korokithakis
@skorokithakis
Dec 01 2015 02:28
you can overclock them to 160
default is 80
Chris Elsworth
@celsworth
Dec 01 2015 02:28
aha
Stavros Korokithakis
@skorokithakis
Dec 01 2015 02:38
where can i find the ota sample?
ah got it, nm
Chris Elsworth
@celsworth
Dec 01 2015 02:40
I believe my ota issues are due to functions being put in rom rather than ram, because of platformio's ldscripts. hopefully they'll fix this tomorrow with pulling 2.0.0 in properly
Stavros Korokithakis
@skorokithakis
Dec 01 2015 02:43
@celsworth i don't think it's ready yet, yeah
i wanted to test 2.0.0 and they said i should try tomorrow
Chris Elsworth
@celsworth
Dec 01 2015 02:45
yep, thats the conclusion I'm reaching ;)
I don't understand ldscripts well enough to get it building, I'm getting iram1_0_seg space issues if I try and build BasicOTA in platformio with 2.0.0
Stavros Korokithakis
@skorokithakis
Dec 01 2015 02:47
hm
i have a different problem, i'm not getting "upload using ota" for the nodemcu 0.9
Me No Dev
@me-no-dev
Dec 01 2015 02:48
you should maybe wait till they update that platformio thing
Stavros Korokithakis
@skorokithakis
Dec 01 2015 02:49
i'm using the ide
although platformio is awesome
Me No Dev
@me-no-dev
Dec 01 2015 02:49
which IDE
Stavros Korokithakis
@skorokithakis
Dec 01 2015 02:49
arduino ide
Me No Dev
@me-no-dev
Dec 01 2015 02:49
which version
Stavros Korokithakis
@skorokithakis
Dec 01 2015 02:50
oh never mind, it's not connecting to wifi
oops
Me No Dev
@me-no-dev
Dec 01 2015 02:50
i got eclips to do OTA tonight as well
Stavros Korokithakis
@skorokithakis
Dec 01 2015 02:50
really? you develop in eclipse?
interesting
Me No Dev
@me-no-dev
Dec 01 2015 02:51
it's java... all the same :D
Stavros Korokithakis
@skorokithakis
Dec 01 2015 02:51
haha, true
Chris Elsworth
@celsworth
Dec 01 2015 02:51
@me-no-dev : yeah I was trying to bodge the update into platformio myself but I'll jsut wait for them to do it properly tomorrow ;)
Me No Dev
@me-no-dev
Dec 01 2015 02:51
made the Arduino plugin work like the IDE does for OTA
Chris Elsworth
@celsworth
Dec 01 2015 02:52
I didn't think it'd be that tricky, all they do is pull your repo in and use that
and string it together with some python
Me No Dev
@me-no-dev
Dec 01 2015 02:52
maybe they used some old linkers and did not update everything... no clue really
Chris Elsworth
@celsworth
Dec 01 2015 02:52
yes, I think so
Me No Dev
@me-no-dev
Dec 01 2015 02:52
heard about it from you guys
Stavros Korokithakis
@skorokithakis
Dec 01 2015 02:57
hmm, is ota not available for nodemcu 0.9 or what?
i see the module but no "upload using ota" menu entry
hmm, where does the arduino ide put images?
i mean built binaries
ah, /tmp/
Stavros Korokithakis
@skorokithakis
Dec 01 2015 03:04
hah, goddamn, OTA is awesome
Chris Elsworth
@celsworth
Dec 01 2015 03:05
got it working? :D
Stavros Korokithakis
@skorokithakis
Dec 01 2015 03:05
it works with espota.py
although now Serial just says "progress: 0%"
Chris Elsworth
@celsworth
Dec 01 2015 03:06
it should count up to 100 then restart with your new binary
Stavros Korokithakis
@skorokithakis
Dec 01 2015 03:06
it's stuck at 0, sadly
Stavros Korokithakis
@skorokithakis
Dec 01 2015 03:22
bleh, the chip reboots after OTA and crashes
oh, oops
it works
!
Chris Elsworth
@celsworth
Dec 01 2015 03:36
yeah tahts not a crash, its rebooting to the new firmware :)
Stavros Korokithakis
@skorokithakis
Dec 01 2015 03:36
yay! this is amazing
no more usb cables!
i love this
Chris Elsworth
@celsworth
Dec 01 2015 03:37
:thumbsup:
Ivan Grokhotkov
@igrr
Dec 01 2015 08:34
Me No Dev
@me-no-dev
Dec 01 2015 09:44
so it's real?
where is the hardware?
Me No Dev
@me-no-dev
Dec 01 2015 10:18
from their forum: _I think what daflippers means is binary compatibility, that is, you can use the ESP8266 SDK to build programs for the ESP32. That, unfortunately, is not possible because the hardware is pretty different: we have a different CPU core, address map, changed peripherals etc. Code that is written for the FreeRTOS SDK of the ESP8266 will be mostly compatible with the ESP32 core, but you will need to switch toolchain/SDKs and recompile.
crap...
@igrr you on the beta?
Ivan Grokhotkov
@igrr
Dec 01 2015 10:28
i'm in, but no hardware yet. just compiled the toolchain today and started playing with the sdk.
Me No Dev
@me-no-dev
Dec 01 2015 10:29
they have any documentations?
and I'm so jelaous ... :(
send us a picture at least when you get it
Ivan Grokhotkov
@igrr
Dec 01 2015 10:30
i haven't got anything yet, but looking at core config file and other SDK parts reveals a bunch of things
Me No Dev
@me-no-dev
Dec 01 2015 10:30
I see 39 GPIOs defined
Ivan Grokhotkov
@igrr
Dec 01 2015 10:31
honestly, you should just send a letter to beta@espressif.com. at least you will get into second batch.
just let them know that you wrote a whole bunch of things for esp8266/Arduino...
Me No Dev
@me-no-dev
Dec 01 2015 10:32
will give it a go :)
and btw I made the eclipse plugin do OTA just like the PR for the IDE
this is my repo
Ivan Grokhotkov
@igrr
Dec 01 2015 10:33
cool
Me No Dev
@me-no-dev
Dec 01 2015 10:33
eclipse users can enjoy the same benefits
will build the sketch data tool as well
Me No Dev
@me-no-dev
Dec 01 2015 10:46
got autoresponse from the email :(
Dear All,

Thank you for your interest in our beta program. The response has been overwhelming! 
We are now closing the registration for beta program. 

Stay tuned to esp32.com for more upcoming news!

Regards,
The Espressif Team
Sven Eliasson
@comino
Dec 01 2015 10:47
I got told mine is on its ways - cant wait to play with it :)
Did someone already received one?
Chris Elsworth
@celsworth
Dec 01 2015 11:02
not yet, haven't received an email saying its on its way either, just that I'd been selected
Me No Dev
@me-no-dev
Dec 01 2015 11:02
how many of you will get this evil thing?
SPI registers are missing
there is hardware PWM though
Me No Dev
@me-no-dev
Dec 01 2015 11:08
and IR control
Sven Eliasson
@comino
Dec 01 2015 11:08
I dont think I get more than one - otherwise I can share one with u
Me No Dev
@me-no-dev
Dec 01 2015 11:08
you will get one :)
Sven Eliasson
@comino
Dec 01 2015 11:09
maybe I sounded desperate enough :P
Chris Elsworth
@celsworth
Dec 01 2015 11:09
I was surprised to get one quite honestly, my email was pretty much just "I'd love one, can I have one?" and they said "ok".
Me No Dev
@me-no-dev
Dec 01 2015 11:09
I don't think they even read my email, the response was about equal to the roundtrip + my mail servers protection delay
Chris Elsworth
@celsworth
Dec 01 2015 11:09
I didn't justify it or say anything about what I'd done or anything
Sven Eliasson
@comino
Dec 01 2015 11:10
Its always the "easy pick up lines" that work :P
Me No Dev
@me-no-dev
Dec 01 2015 11:10
well I just wrote them too late
heard just now ;)
Mario Mikočević
@mozgy
Dec 01 2015 11:21
@celsworth I wrote that too, and got rejected
Chris Elsworth
@celsworth
Dec 01 2015 11:21
it was just a bit of a lottery from what I understand, random selection
Mario Mikočević
@mozgy
Dec 01 2015 11:21
something about distributor and shipping blablah
Sven Eliasson
@comino
Dec 01 2015 11:22
I assume they got hundreds and picking 200 is a lot of work in the end. I assume it was pretty random
Are u living on the northpole oO?
Mario Mikočević
@mozgy
Dec 01 2015 11:24
<-- Croatia
Chris Elsworth
@celsworth
Dec 01 2015 11:38
no esp32 sdk doc yet, just headers and ldscripts and stuff?
Me No Dev
@me-no-dev
Dec 01 2015 11:39
api should be the same
but there are no hardware docs
and that sucks, but can manage with the headers somewhat
Chris Elsworth
@celsworth
Dec 01 2015 11:42
still only one adc, but looks like it has an adjustable voltage range now
Sven Eliasson
@comino
Dec 01 2015 11:43
just one ?!?!
Chris Elsworth
@celsworth
Dec 01 2015 11:44
nice, system_deep_sleep now takes a uint64, but reserved for future use - they still only actually use the lower 32bit of it
sorry, this is a bit offtopic for here, is it ok? :)
@comino hm well actually, there is system_adc1_read() but it has an argument for "pad", which is an enum with 8 possible options, that is interesting :D
can't wait for these things to turn up!
Chris Elsworth
@celsworth
Dec 01 2015 11:56
@skorokithakis fantastic news - ota now works in platformio, no trouble at all :)
Me No Dev
@me-no-dev
Dec 01 2015 12:00
Generate related files successully in folder /Users/ficeto/Desktop/ESP32/Workspace/ESP32_BIN
boot.bin------------------>0x00000
irom1.bin----------------->0x04000
irom0_flash.bin----------->0x40000
user.ota------------------>(used for OTA)
it took some minutes though... i hope it's not like that from now on
Chris Elsworth
@celsworth
Dec 01 2015 12:01
just the toolchain took 20 minutes here, its only just finished
Me No Dev
@me-no-dev
Dec 01 2015 12:02
tc is ok to take a while
Chris Elsworth
@celsworth
Dec 01 2015 12:02
yeah only have to do it occasionally
you mean building the firmware took minutes too?
Me No Dev
@me-no-dev
Dec 01 2015 12:02
combining the buid into bins took a whole lot
the very last command
xtensa-esp108-elf-gcc  -L/Users/ficeto/Desktop/ESP32/Workspace/ESP32_RTOS_SDK/lib -nostdlib -T/Users/ficeto/Desktop/ESP32/Workspace/ESP32_RTOS_SDK/ld/eagle.pro.v7.ld -Wl,--no-check-sections -u call_user_start -Wl,-static -Wl,--start-group -lc -lgcc -lhal -lm -lcrypto -lfreertos -llwip -lmain -lnet80211 -lphy -lpp -lrtc -lwpa user/.output/eagle/debug/lib/libuser.a sample_lib/.output/eagle/debug/lib/libsample.a -Wl,--end-group -o .output/eagle/debug/image/eagle.app.v7.out
and that is a blank sketch...
Chris Elsworth
@celsworth
Dec 01 2015 12:04
about to try the same.. you used project_template?
Me No Dev
@me-no-dev
Dec 01 2015 12:05
yup, just ran a build to see if it will compile at all
blank size close to 300K... SDK got fat
Chris Elsworth
@celsworth
Dec 01 2015 12:06
took two seconds here
Me No Dev
@me-no-dev
Dec 01 2015 12:06
maybe Mac related then...
Chris Elsworth
@celsworth
Dec 01 2015 12:07
1.4s on my linux box to make the example project
-rw-r--r-- 1 chris chris 241124 Dec 1 12:06 irom0_flash.bin
Me No Dev
@me-no-dev
Dec 01 2015 12:07
run xtensa-esp108-elf-size .output/eagle/debug/image/eagle.app.v7.out
Chris Elsworth
@celsworth
Dec 01 2015 12:08
244862 4872 43616 293350 479e6 .output/eagle/debug/image/eagle.app.v7.out
yep, 293k
Chris Elsworth
@celsworth
Dec 01 2015 12:15
128k ram according to the ldscript, and blank sketch is using 55k
Me No Dev
@me-no-dev
Dec 01 2015 12:17
we'll see how it will go once things are rewritten for it
Chris Elsworth
@celsworth
Dec 01 2015 12:26
there will be an arduino port I hope :)
Ivan Grokhotkov
@igrr
Dec 01 2015 12:27
a basic one is almost ready :)
Chris Elsworth
@celsworth
Dec 01 2015 12:27
very fast :)
Ivan Grokhotkov
@igrr
Dec 01 2015 12:28
i started building qemu for esp108 to try out a few things, but then realized it would be pointless without having the code of ROM bootloader.
Me No Dev
@me-no-dev
Dec 01 2015 12:28
how did you build the toolchain?
Ivan Grokhotkov
@igrr
Dec 01 2015 12:28
crosstool-NG
Me No Dev
@me-no-dev
Dec 01 2015 12:29
as in their RTOS SDK instructions?
Ivan Grokhotkov
@igrr
Dec 01 2015 12:29
and i did some mucking about building it on Windows as well
yes, pretty much
Me No Dev
@me-no-dev
Dec 01 2015 12:29
did you build the example?
Ivan Grokhotkov
@igrr
Dec 01 2015 12:29
but i did this on Linux, not OS X
example was the first thing that i did
Me No Dev
@me-no-dev
Dec 01 2015 12:29
oh, then nevermind :D
we'll talk again once you do it on the mac
I have a problem where the image generation takes forever
and that seems to be mac related
Ivan Grokhotkov
@igrr
Dec 01 2015 12:30
i'll build one for os x eventually, but i'm currently on a an underpowered macbook pro 13", so decided to do that on a linux server instead.
i think it might be due to their python script
need to tweak a few things to make esptool compatible with these ESP32 images...
Me No Dev
@me-no-dev
Dec 01 2015 12:32
i'll ditch the script and see what will happen
let me know when you have something ready so I can test it on the X
Ivan Grokhotkov
@igrr
Dec 01 2015 12:32
mkay
Me No Dev
@me-no-dev
Dec 01 2015 12:33
they did not give all hardware so far though
SPI is missing
that is the more important thing missing
Me No Dev
@me-no-dev
Dec 01 2015 12:44
@igrr objdump -S is what takes ages
Chris Elsworth
@celsworth
Dec 01 2015 12:46
I'll try it on my mac
Ivan Grokhotkov
@igrr
Dec 01 2015 12:46
i wonder why they do it, when nm gives all the necessary info and is much faster
Chris Elsworth
@celsworth
Dec 01 2015 12:47
on Linux the objdump -S is only 0.3s
Me No Dev
@me-no-dev
Dec 01 2015 12:47
it's not needed to build the firmware anyway, but why does it take different time on the Mac
it's minutes
thst dump.S is 100000 lines :D
Stavros Korokithakis
@skorokithakis
Dec 01 2015 13:29
does everything stop when OTA starts?
Sven Eliasson
@comino
Dec 01 2015 13:30
The Matrix will never stop
Stavros Korokithakis
@skorokithakis
Dec 01 2015 13:30
haha
Ivan Grokhotkov
@igrr
Dec 01 2015 13:30
we close all tcp connections, because they can interfere with the OTA
Stavros Korokithakis
@skorokithakis
Dec 01 2015 13:30
hmm, thanks
so i should disable my mqtt connection checker
@celsworth doesn't work for me :(
@celsworth how are you doing the FOTA?
Dimitris Lampridis
@gnulabis
Dec 01 2015 14:13
Hello everyone, just a heads up, I created a new repository for the UTFT display library with preliminary ESP8266 support (also hardware SPI). Tested with an ILI9341 display. Thanks for all your great work!
Ivan Grokhotkov
@igrr
Dec 01 2015 14:18
@gnulabis you can add a link to the libraries list if you want :)
Dimitris Lampridis
@gnulabis
Dec 01 2015 14:20
@igrr yes, I'd like to do that, I just want to do a bit more testing and perhaps receive some feedback from other users first
Chris Elsworth
@celsworth
Dec 01 2015 14:52
@skorokithakis BasicOTA example with espota.py works for me
all I did was change ssid/password in it, build in platformio with all default options, upload over serial, do a manual reboot (known issue for the first upload, apparently) and then after that, espota.py -i 192.168.0.xxx -f .pioenvs/esp12/firmware.bin
(esp12 obviously may change depending on your platformio.ini)
Stavros Korokithakis
@skorokithakis
Dec 01 2015 15:09
@celsworth firmware.bin or firmware.elf?
Ivan Grokhotkov
@igrr
Dec 01 2015 15:10
bin
Stavros Korokithakis
@skorokithakis
Dec 01 2015 15:10
:(
yeah, that works
Chris Elsworth
@celsworth
Dec 01 2015 15:18
you been trying the elf?
that won't work :)
Me No Dev
@me-no-dev
Dec 01 2015 15:20
if you use terminal to run espota.py, you might want to add -r to the arguments
Chris Elsworth
@celsworth
Dec 01 2015 15:20
I guess.. I get a dot while its uploading, good enough for me :)
Stavros Korokithakis
@skorokithakis
Dec 01 2015 15:20
doesn't it do that by default?
yeah
oh, nice
much better
Chris Elsworth
@celsworth
Dec 01 2015 15:21
oh yes :)
the only thing missing is a speed display :)
it feels a bit faster than serial, but not a whole lot
Me No Dev
@me-no-dev
Dec 01 2015 15:22
if you run serial at 1Mbps then yes
it's not a whole lot faster than that
the speed bump comes from the fact that espota.py wait for response from the ESP after each data packet
and that os there because otherwise the computer floods the ESP with packets that it can not handle so fast
Chris Elsworth
@celsworth
Dec 01 2015 15:24
the convenience is more important than speed, its only a few seconds anyway
no serial cable is great.. or if I am debugging, not having to disconnect my serial terminal while it runs is nice too
Stavros Korokithakis
@skorokithakis
Dec 01 2015 15:25
@me-no-dev can't it just send N packets before a confirmation?
Me No Dev
@me-no-dev
Dec 01 2015 15:26
no, the ESP does not ack before it has completed the work with the current packet
Stavros Korokithakis
@skorokithakis
Dec 01 2015 15:26
ah
Me No Dev
@me-no-dev
Dec 01 2015 15:26
you can get a few at a time but like 2
I think the buffer is 4K
and full data packet is 1460
Chris Elsworth
@celsworth
Dec 01 2015 15:27
does the esp write 1460 bytes at a time then?
Me No Dev
@me-no-dev
Dec 01 2015 15:27
now it's reliable
yes
that is how they are set for both espota.py and ArduinoOTA
we can try higher but risk getting into trouble
speed difference will not be much
Stavros Korokithakis
@skorokithakis
Dec 01 2015 15:29
i'm not really bothered about the speed
it's fine either way
Chris Elsworth
@celsworth
Dec 01 2015 17:17
@skorokithakis platformio 2.4.1 has now hit pip fwiw :)
Sven Eliasson
@comino
Dec 01 2015 17:30
Arduino 1.6.5 + OTA_mDNS-SPIFFS example + latest githib version throws: "[Errno 11004] getaddrinfo failed"
Stavros Korokithakis
@skorokithakis
Dec 01 2015 18:07
@celsworth awesome, thanks!
Oh, can anyone point me to the place in the code where FOTA authentication is done?
Me No Dev
@me-no-dev
Dec 01 2015 18:08
@comino ArduinoOTA from now on
@skorokithakis it's done in ArduinoOTA on the ESP side and in espota.py on the computer side
why? you have a problem?
Steve Nelson
@zenmanenergy
Dec 01 2015 18:42
For those that have had USB problems on El Capitan… check out this thread: http://www.insanelymac.com/forum/topic/306777-guide-usb-fix-el-capitan-1011/
Chris Elsworth
@celsworth
Dec 01 2015 19:19
hm, ESP.getVcc() doesn't seem terribly accurate :( getting readings around 2900 when DMM is saying there's 3.29V across VCC/GND
github tickets seem to reveal its pretty much thats as good as it gets too
Harrison Mclean
@h4rm0n1c
Dec 01 2015 19:27
are your readings linear to the voltage? I was wondering if an offset might work with that.
Chris Elsworth
@celsworth
Dec 01 2015 19:28
I'll see if I can get a few readings and plot it
Chris Elsworth
@celsworth
Dec 01 2015 19:34
tricky given its a nodemcu and I'm powering it over the same usb I'm debugging over, maybe better doing this on a bare board I can use wiht my bench supply
Chris Elsworth
@celsworth
Dec 01 2015 19:41
oh how annoying, a bare board is actually far more accurate than the nodemcu at this :)
I'm not seeing inaccuracies of more than 50mV or so on a bare ESP12-E
Harrison Mclean
@h4rm0n1c
Dec 01 2015 19:41
Ah yeah, I was going to say, usb power = no es bueno
Chris Elsworth
@celsworth
Dec 01 2015 19:42
well, I suppose its the regulator on the nodemcu board thats converting 5v to 3.3v for the esp, but why then would getVcc be inaccurate for that
to test further on the nodemcu I'd need to rig up my bench supply to the usb power-in and then get serial through a different pinout probably, so I can turn "usb power" up and down and see how the regulator and getVcc react
Harrison Mclean
@h4rm0n1c
Dec 01 2015 19:46
Got a usb cable you can destroy? Just wire your power to the usb power wires.
leave the data ones connected.
that'd be the easiest way, no fiddling around with the board required.
Chris Elsworth
@celsworth
Dec 01 2015 19:53
I'm already a little short on micro-usb :( guess I can order a bunch from ebay ;)
Harrison Mclean
@h4rm0n1c
Dec 01 2015 19:54
yeah, at least they don't cost much...
Sven Eliasson
@comino
Dec 01 2015 20:16
Arduino 1.6.5 + OTA_mDNS-SPIFFS example OR Arduino_OTA/BASIC_OTA + latest githib version and did everything according to github description - throws : "[Errno 11004] getaddrinfo failed"
I can not select the chip like shown in the screenshots
Me No Dev
@me-no-dev
Dec 01 2015 20:18
what throws : "[Errno 11004] getaddrinfo failed"?
Sven Eliasson
@comino
Dec 01 2015 20:18
espota
blob
Me No Dev
@me-no-dev
Dec 01 2015 20:19
what is the actual command that it executes?
and use only the latest BasicOTA
the other one will not work
Sven Eliasson
@comino
Dec 01 2015 20:20
everything up to date
Me No Dev
@me-no-dev
Dec 01 2015 20:20
the line above your screenshot has the command
Sven Eliasson
@comino
Dec 01 2015 20:20
I used to do it via http server, but that gets quite old after a while
there is noting relevant before that : Global variables use 34,380 bytes (41%) of dynamic memory, leaving 47,540 bytes for local variables. Maximum is 81,920 bytes.
Me No Dev
@me-no-dev
Dec 01 2015 20:21
oh, enable upload debug then please
from IDE Settings
Sven Eliasson
@comino
Dec 01 2015 20:21
oh didnt know there is something like that ^^ I only use arduino for compiling
mom
Me No Dev
@me-no-dev
Dec 01 2015 20:22
have you selected the board in the ports like onthe picture?
Sven Eliasson
@comino
Dec 01 2015 20:22
it doesnt appear where its shown in the picture.. is it still like that or is the picture just old?
Me No Dev
@me-no-dev
Dec 01 2015 20:23
then that is what we need to take care of first
it can't possibly know where is your board if it does not see it
now there are two ways to go
Sven Eliasson
@comino
Dec 01 2015 20:23
espota from command line?
Me No Dev
@me-no-dev
Dec 01 2015 20:23
one is to change the IDE with one build for OTA
the other is to add some code to the sketch and waste a TCP server connection
and yes, third would be command line
which one do you want to go?
Sven Eliasson
@comino
Dec 01 2015 20:24
the one which is easier :D
Me No Dev
@me-no-dev
Dec 01 2015 20:24
third one sounds like hastle
Sven Eliasson
@comino
Dec 01 2015 20:24
yeah ^^
I did that and there is no benefit ffrom my http server solution
Me No Dev
@me-no-dev
Dec 01 2015 20:25
I would advise getting the new IDE, but adding a few lines is probably the easiest
Sven Eliasson
@comino
Dec 01 2015 20:26
I have 1.6.5 - there is a newer one?
1.6.6 is out - that one works?
Me No Dev
@me-no-dev
Dec 01 2015 20:28
WiFiServer ota_fix(8266);
void setup(){
  ota_fix.begin();
}
void loop(){
  if (ota_fix.hasClient()) ota_fix.available().stop();
}
I am running 1.6.7 PR 4107
you need either the one I have or this fix
Sven Eliasson
@comino
Dec 01 2015 20:30
wonderful :) thanks a lot for you help. I will updating first -- and otherwise the fix ;)
port 8266 :D I like details like that
Me No Dev
@me-no-dev
Dec 01 2015 20:31
the IDE is trying to connect to the board through TCP and OTA runs on UDP so it needs this cheat
in PR 4107 I have "fixed" that
now I use this:
Screen Shot 2015-12-01 at 22.33.23.png
Chris Elsworth
@celsworth
Dec 01 2015 20:34
does that use udp or tcp now?
ArduinoOTA.hande() that is
Me No Dev
@me-no-dev
Dec 01 2015 20:34
the cheat runs a TCP server that tricks the IDE to see the board
the actual update part runs TCP but the server is the PC
Sven Eliasson
@comino
Dec 01 2015 20:35
ah got it!
Me No Dev
@me-no-dev
Dec 01 2015 20:35
the part that tels the ESP tha there is OTA pending and goes through authentication runs on UDP and the ESP is the server
Sven Eliasson
@comino
Dec 01 2015 20:55
I used the newest 1.6.7 Hourly Build still same issue. But the tcp fix worked! Thanks!
Strangely it asks for a password eventhough that part is uncommented in the sketch oO
Sven Eliasson
@comino
Dec 01 2015 21:11
Deam... still doesnt want to work. I guess I will just stay with http server ota ;)
its not that much slower
Me No Dev
@me-no-dev
Dec 01 2015 21:16
@comino see the docs, they have a link to the correct release
it's not official yes so you can not get it from elsewhere
we are waiting for the PR to be merged upstream
brutzler
@brutzler
Dec 01 2015 21:20
@me-no-dev : what IDE is this in your screenshot?
Me No Dev
@me-no-dev
Dec 01 2015 21:31
my go at arduino-for-eclipse
with OTA support
brutzler
@brutzler
Dec 01 2015 21:33
??? heard about eclipse, but the rest? Think I should stay at Arduino IDE.
Stavros Korokithakis
@skorokithakis
Dec 01 2015 21:37
@me-no-dev no problems, i just want to audit it for a timing attack
yeah, looks like there's a timing attack in there if i'm understanding the code correctly
Me No Dev
@me-no-dev
Dec 01 2015 21:42
timing attack?
someone can discover the auth secret
by sending enough packets
Me No Dev
@me-no-dev
Dec 01 2015 21:45
I think the ESP will reset way before that :D
Stavros Korokithakis
@skorokithakis
Dec 01 2015 21:45
why reset?
Me No Dev
@me-no-dev
Dec 01 2015 21:45
cuz the network will get overloaded
Stavros Korokithakis
@skorokithakis
Dec 01 2015 21:45
it's only a few thousand packets
Me No Dev
@me-no-dev
Dec 01 2015 21:46
so you thinksomeone will sit down and measure time in order to hack into ESP?
Stavros Korokithakis
@skorokithakis
Dec 01 2015 21:47
i think it's possible that someone can discover the auth secret and flash their own firmware if they have network access to an esp
Me No Dev
@me-no-dev
Dec 01 2015 21:47
surely there are way more advanced methods
Stavros Korokithakis
@skorokithakis
Dec 01 2015 21:47
more advanced methods to what?
Me No Dev
@me-no-dev
Dec 01 2015 21:47
to auth
Stavros Korokithakis
@skorokithakis
Dec 01 2015 21:47
it's an easy fix
Me No Dev
@me-no-dev
Dec 01 2015 21:47
what do you propose?
that post has a constant-time string compare function
you just xor all the characters and check the end result, it's only a few more lines of code
Me No Dev
@me-no-dev
Dec 01 2015 21:51
I would like to see you break it first :)
we use md5_digest based mostly on always changing stuff
Stavros Korokithakis
@skorokithakis
Dec 01 2015 21:51
are five lines of code really that much of a burden that i have to demonstrate the practical feasibility of a timing attack specifically on the ESP?
Me No Dev
@me-no-dev
Dec 01 2015 21:53
i really do not want to argue :)
github is open :) feel free to send a request
Stavros Korokithakis
@skorokithakis
Dec 01 2015 21:54
will do!
Me No Dev
@me-no-dev
Dec 01 2015 21:55
I think that someone will have better chance at hacking the esp by reading the public open source of it all than do time attacks
Stavros Korokithakis
@skorokithakis
Dec 01 2015 21:55
probably, does that mean we shouldn't close all the holes we can find?
Me No Dev
@me-no-dev
Dec 01 2015 21:56
and the string length in our case stays the same
it's md5
does not matter what you enter as password it will always be 32 chars
Angus Gratton
@projectgus
Dec 01 2015 21:58
the comparison function is the problem for timing attacks, not the length of the compared string.
this is an example of where someone has read the publically available source code, seen an exploitable problem, and reported it for you to fix
the exact way in which open source becomes more secure than security by obscurity
Me No Dev
@me-no-dev
Dec 01 2015 22:00
I'll read those links again and try to understand how is this possible in our case
I just don;t understand it
even though you talk about the comapre function, it happens way after some md5s
Angus Gratton
@projectgus
Dec 01 2015 22:11
I hadn't looked at the code, juse the Issue and the chat. but on reading it I can't see how it's exploitable.
if you had infinite attempts at sending challenge responses then you could potentially use a timing attack to decode what the response hash should be, because everything is constant time up to the result.equals()
however each time it fails it goes back to the idle state, and will generate a new nonce the next time around
so i don't think you can exploit it because every time you run your timing attack you're running it with a new nonce
also i think wifi timing might be a lot jitterier than String.equals() timing, but that might be a dangerous assumption idk
Me No Dev
@me-no-dev
Dec 01 2015 22:14
another way is to know exactly what the MCU time is to fabricate something close
since we compute the nonce base on that
Angus Gratton
@projectgus
Dec 01 2015 22:15
yeah, I'd noticed using micros() there. that's probably more risky
Me No Dev
@me-no-dev
Dec 01 2015 22:15
but I think that would be really hard when put together withthe rest of the stuff
Ivan Grokhotkov
@igrr
Dec 01 2015 22:15
i think micros may be replaced with CCOUNT
Me No Dev
@me-no-dev
Dec 01 2015 22:15
you could not know if you have the right password and your time is a bit off or what
Angus Gratton
@projectgus
Dec 01 2015 22:15
well, everything else you know
and you can calculate md5sums at a very high rate indeed
but, again, you only get one shot each time.
Angus Gratton
@projectgus
Dec 01 2015 22:21
igrr: you might want to consider CCOUNT XORed with the output of the "random number generator" register http://esp8266-re.foogod.com/wiki/Random_Number_Generator
Stavros Korokithakis
@skorokithakis
Dec 01 2015 22:21
@projectgus that is a risky assumption indeed, you can estimate timings to the level of individual instructions over wifi
Angus Gratton
@projectgus
Dec 01 2015 22:21
I'm using "random number generator" in quotes because it's undocumented but it is a very high entropy source of something
Stavros Korokithakis
@skorokithakis
Dec 01 2015 22:21
besides, the fix is so simple that it's not even worth arguing over, just xor each character in the two strings and check if the result is 0
and you're safe, even if it's an unlikely danger
Angus Gratton
@projectgus
Dec 01 2015 22:22
skorokithakis: really? I'd be interested in reading about that (fine grained wifi timing attacks)
Stavros Korokithakis
@skorokithakis
Dec 01 2015 22:23
yeah, let me find the link
bleh, i need to save that somewhere, i keep looking for it
but it's something crazy, on the same lan, you can time individual instructions, on the internet, it's still enough to break a password
still looking though
Ivan Grokhotkov
@igrr
Dec 01 2015 22:29
@projectgus interesting, thanks. i was looking at espressif's libssl disassembly, trying to figure out where it takes entropy from.
Angus Gratton
@projectgus
Dec 01 2015 22:29
I actually think it takes it from somewhere else again
as far as we can tell noone is using this entropy source (except esp-open-rtos now), foogod found it randomly poking at registers
although I haven't looked at the latest libssl, so maybe it does
the last time I looked that were using some internal MAC counter registers
before that they were using nothing...
well, almost nothing :)
Ivan Grokhotkov
@igrr
Dec 01 2015 22:31
it would be really stunning if they had a perfect RNG on chip and were not using it...
Angus Gratton
@projectgus
Dec 01 2015 22:31
they definitely weren't to begin with. they were using the default axTLS approach for taking the address of the stack frame and then computing md5s out of it, until I reported that as a bug...
(address of the initial stack frame, ie same sequence of random values every time you reset...)
so, yeah, that RNG thing is... odd
Ivan Grokhotkov
@igrr
Dec 01 2015 22:34
Could be used for WPA though
Angus Gratton
@projectgus
Dec 01 2015 22:34
WPA had the same problem, the WPA rng called back into the axtls rng IIRC
I have wifi dumps where the ESP used the same nonce value every time you pressed reset
this was all fixed >6 months ago though
Stavros Korokithakis
@skorokithakis
Dec 01 2015 22:35
"We have shown that, even though the Internet induces significant timing jitter, we can reliably distinguish remote timing differences as low as 20 μs. A LAN environment has lower timing jitter, allowing us to reliably distinguish remote timing differences as small as 100ns (possibly even smaller)."
Ivan Grokhotkov
@igrr
Dec 01 2015 22:35
Yes i remember reading that in their bounty program notes. Good find :)
Stavros Korokithakis
@skorokithakis
Dec 01 2015 22:35
Angus Gratton
@projectgus
Dec 01 2015 22:35
igrr: well i thought it was a painfully depressing find, actually :/
it's not like that was some hardcore crypto hacking, that was entry level obvious stuff
skorokithakis: thanks, that is very interesting. WiFi is a lot more timing intrusive than Ethernet, but that paper does go to show that with enough samples you can derive almost anything!
Stavros Korokithakis
@skorokithakis
Dec 01 2015 22:40
@projectgus yeah, the jitter averages right out
Angus Gratton
@projectgus
Dec 01 2015 22:48
igrr: looks like they've updated it since I last looked
the random calls all end up in libphy phy_get_rand()
which takes the value of 'adc_rand_noise' (a symbol defined inside libphy) and xors it with that "random number" register
looks like they first started doing that in SDK v1.1.0
and the adc_rand_noise value is updated in pm_wakeup_init, whih calls a function get_adc_rand() and writes the result to adc_rand_noise
Stavros Korokithakis
@skorokithakis
Dec 01 2015 22:56
how can i iterate over an array in steps of two?
i have:
```
damnit
        for (i = 0; i < MAX_MESSAGE_LENGTH; i = i + 2) {
but that loops forever
Chris Elsworth
@celsworth
Dec 01 2015 22:57
that looks fine to me
sure its not getting stuck somewhere else in the loop?
Stavros Korokithakis
@skorokithakis
Dec 01 2015 22:58
yeah, this is odd, i changed a potential bug and compiled/flashed and the code got reverted
that's why i asked, before i noticed the code revert
Angus Gratton
@projectgus
Dec 01 2015 22:59
can MAX_MESSAGE_LENGTH be odd?
Chris Elsworth
@celsworth
Dec 01 2015 22:59
shouldn't matter, its <, not ==
Stavros Korokithakis
@skorokithakis
Dec 01 2015 22:59
it's 600 right now
but yeah
    for (i = 0; i < MAX_MESSAGE_LENGTH; i = i + 2) {
        if (message[i] == 0 || message[i+1] == 0) {
            break;
        }
        out = (message[i] << 8) + message[i+1];
        Serial.print(out, DEC);
        Serial.print(" ");
    }
Angus Gratton
@projectgus
Dec 01 2015 22:59
celsworth: if it's odd then you'll probably walk one off the end of the array internally
Stavros Korokithakis
@skorokithakis
Dec 01 2015 23:00
that just keeps echoing things forever
Angus Gratton
@projectgus
Dec 01 2015 23:00
is 'i' an 8 bit type?
Stavros Korokithakis
@skorokithakis
Dec 01 2015 23:00
unsigned char i
oops :(
thanks
Angus Gratton
@projectgus
Dec 01 2015 23:00
:)
Stavros Korokithakis
@skorokithakis
Dec 01 2015 23:00
haha :(
Chris Elsworth
@celsworth
Dec 01 2015 23:00
good catch
Stavros Korokithakis
@skorokithakis
Dec 01 2015 23:01
good catch indeed
damn C!
Angus Gratton
@projectgus
Dec 01 2015 23:01
surprised compiler didn't warn on that
Stavros Korokithakis
@skorokithakis
Dec 01 2015 23:01
<- python developer
maybe platformio silenced the warning?
i am so loving OTA
hm, ota just failed
it sometimes fails randomly
@projectgus that fixed it, thanks
every message i tried was < 256 chars
this one was longer, it seems
why are microcontrollers so awesome?
Stavros Korokithakis
@skorokithakis
Dec 01 2015 23:06
hey, can anyone here see infrared?
xbary
@xbary
Dec 01 2015 23:17
Hi
He wants to share insights
Using Arduino serial.print in callbacks from the SDK crashes type of panic __yield ...
Stavros Korokithakis
@skorokithakis
Dec 01 2015 23:20
i don't think you're supposed to do that
xbary
@xbary
Dec 01 2015 23:20
if you use os_printf person ... it's no longer fails :)