These are chat archives for esp8266/Arduino

4th
Dec 2015
Michael Miller
@Makuna
Dec 04 2015 05:19
@onkelfunny @projectgus the neopixel library is based on my first version, so it does have the same issue as mine in not supporting io16. That pin is just special.
If you are running at 160mhz then the if inside the loop should not be a problem. At 80mhz it can be an issue. But the code in the loop is so small, just put the if outside and duplicate the loop for a pin 16 and it's specific calls. Note, with the last sdk, if you run the non uart version and have active network calls, you can hit exceptions. This is why I comment about the uart version which does work in this case. Adafruit has not fixed this issue in their library.
Michael Miller
@Makuna
Dec 04 2015 05:26
@me-no-dev note gpio runs at a different clock than the cpu. Just swapping back and forth may not actually change the output pin. Maybe this doesn't pertain to gpio16, but the others update at 80mhz I believe, no matter what your code does.
8mhz, not 80mhz.
Endre Karlson
@ekarlso
Dec 04 2015 08:51
many of you using OTA updates or ?
Helio Machado
@crushedice2000
Dec 04 2015 09:25
@me-no-dev: It happens me immediately after uploading the data folder with the arduino plugin. Are you saying me that my partition is broken without doing nothing?
It's so strange.
My project is here (one code file + data files):
I'm using this for uploading:
curl -F "file=@/path/to/my/file"   192.168.1.1
Hassanbenlebsir
@Hassanbenlebsir
Dec 04 2015 09:40
did somebody already used an esp with a rfid reader
Me No Dev
@me-no-dev
Dec 04 2015 10:08
@Hassanbenlebsir there is a chance the plugin you have is outdated maybe...
you can upload the data dir contents also using curl and see if that will make the files single.
I know things in SPIFFS changed recently with addition of folder support
so that might be it
Hassanbenlebsir
@Hassanbenlebsir
Dec 04 2015 10:09
@me-no-dev i think you are talking to @crushedice2000
Me No Dev
@me-no-dev
Dec 04 2015 10:09
yes sorry :(
Hassanbenlebsir
@Hassanbenlebsir
Dec 04 2015 10:09
no worries
i'm trying to connect my rfid to an esp do you know wich pins i'll need to commect
Me No Dev
@me-no-dev
Dec 04 2015 10:11
what king of RFID reader are youy trying?
I have one that runs on SPI and one on Serial
Hassanbenlebsir
@Hassanbenlebsir
Dec 04 2015 10:12
RFID rc-522
and i have an nodemcu esp8266
Me No Dev
@me-no-dev
Dec 04 2015 10:12
oh I have that one too, but have not gone to copnnect it to the ESP yet
this RFID is really complicated
I think it needs some magic in order to see it go
Hassanbenlebsir
@Hassanbenlebsir
Dec 04 2015 10:13
i connected it my uno and it's working fine but i'm not sure how to connect it to the esp
Me No Dev
@me-no-dev
Dec 04 2015 10:16
connecting is easy, getting the lib to work will be hard
use the SPI bus
Endre Karlson
@ekarlso
Dec 04 2015 10:22
@me-no-dev Getting RC522 to work with the ESP is easy...
@me-no-dev all you gotta do is use the right pins ;)
@igrr is there TLS support yet in ESP?
Ivan Grokhotkov
@igrr
Dec 04 2015 10:23
There is, check HTTPSRequest sample
Me No Dev
@me-no-dev
Dec 04 2015 10:23
@ekarlso can you point me to a lib that works on the ESP?
Endre Karlson
@ekarlso
Dec 04 2015 10:24
@me-no-dev https://github.com/miguelbalboa/rfid worked for me :)
Me No Dev
@me-no-dev
Dec 04 2015 10:24
what I had failed numerous times
Ivan Grokhotkov
@igrr
Dec 04 2015 10:24
you can also do https via ESP8266HTTPRequest library
Endre Karlson
@ekarlso
Dec 04 2015 10:24
@igrr I dont you need to give it a key and so on ?
Ivan Grokhotkov
@igrr
Dec 04 2015 10:25
the private key is currently pre-defined, i will add support for setting private key in the next release.
you can verify the certificate of the other end by matching its signature
Endre Karlson
@ekarlso
Dec 04 2015 10:26
@igrr predefined like ?
baked into the library
so don't rely on it for security
but as a proof of concept, it works
Endre Karlson
@ekarlso
Dec 04 2015 10:30
@igrr awe ;)
@igrr how hard is it to make it configurable ? :)
Ivan Grokhotkov
@igrr
Dec 04 2015 10:35
Not hard. You want to take a stab?
basically, redefine default_private_key, default_private_key_len, default_certificate, and default_certificate_len as extern
(that's on axTLS side of things)
and then define them in WiFiClientSecure
and expose static functions in WiFiClientSecure so user can set them
Ivan Grokhotkov
@igrr
Dec 04 2015 10:41
@ekarlso opened igrr/axtls-8266#3
Helio Machado
@crushedice2000
Dec 04 2015 10:57
@me-no-dev Updating all... (third time in one week)
Hassanbenlebsir
@Hassanbenlebsir
Dec 04 2015 10:58
library rfid-master claims to run on [avr architecture(s) and may be incompatible with your current board which runs on STM32F1] architecture(s).
Me No Dev
@me-no-dev
Dec 04 2015 10:59
@crushedice2000 that's not it then... strnge
Hassanbenlebsir
@Hassanbenlebsir
Dec 04 2015 10:59
idk why i get this warning
Helio Machado
@crushedice2000
Dec 04 2015 11:00
@me-no-dev: Downloading arduino-1.6.6-macosx.zip
Endre Karlson
@ekarlso
Dec 04 2015 11:00
that library works fine @Hassanbenlebsir for the esp and the rc522
@igrr what editor you use for libraries ?
Ivan Grokhotkov
@igrr
Dec 04 2015 11:03
Most of the time I use Atom, although I do have an XCode project set up for the whole thing (core + libraries) for the times when I need code completion and refactorings.
But any editor will do, really.
Endre Karlson
@ekarlso
Dec 04 2015 11:06
@igrr kk
@igrr is there a way you can verify that the code works without using arduino ide ?
Ivan Grokhotkov
@igrr
Dec 04 2015 11:07
I.e. build the sketch and upload to the device? You can use arduino-builder command line tool which is actually a part of Arduino installation
Or use Eclipse Arduino plugin
Here's a python snippet that I use as part of my automated test suite to build Arduino sketches:
ide_path='/Users/igrokhotkov/projects/esp8266/arduino.cc/master/build/macosx/work/Arduino.app/Contents/Java'
tmp_dir = os.getcwd() + '/tmp'

def compile(tmp_dir, sketch):
    f = open(tmp_dir + '/build.log', 'w')
    cmd = ide_path + '/arduino-builder '
    cmd += '-compile -logger=machine '
    cmd += '-build-path "' + tmp_dir + '" '
    cmd += '-hardware "' + ide_path + '/hardware" '
    cmd += '-hardware hardware '
    cmd += '-tools "' +  ide_path + '/tools-builder" '
    cmd += '-fqbn=esp8266com:esp8266:generic:UploadTool=esptool,CpuFrequency=80,FlashFreq=40,FlashMode=dio,UploadSpeed=115200,FlashSize=512K64,ResetMethod=nodemcu '
    cmd += '-ide-version=10607 '
    cmd += '-warnings=none '
    cmd += '-verbose '
    cmd += sketch
    print('Building: ' + cmd, file=f)
    cmds = cmd.split(' ')
    p = subprocess.Popen(cmds, stdout=f, stderr=subprocess.STDOUT)
    p.wait()
    f.close()
    return p.returncode
Helio Machado
@crushedice2000
Dec 04 2015 11:11
@me-no-dev: What URL should I use?
Me No Dev
@me-no-dev
Dec 04 2015 11:12
stable
then I use this from within the sketch data folder
curl [ESP_IP]/format && for file in `ls -A1`; do echo "Uploading $file..."; curl -F "file=@$PWD/$file" [ESP_IP]/edit; done
I did give you the format handler right?
Hassanbenlebsir
@Hassanbenlebsir
Dec 04 2015 11:15
guys i managed to connect the rfid to the esp but when i scan the card i get something like this ŽŽŽŽŽsdfaŽŽŽŽ
Endre Karlson
@ekarlso
Dec 04 2015 11:19
@Hassanbenlebsir are you using correct baudrate for serial ?
Helio Machado
@crushedice2000
Dec 04 2015 11:20
Downloading stable...
Hassanbenlebsir
@Hassanbenlebsir
Dec 04 2015 11:26
115200
Endre Karlson
@ekarlso
Dec 04 2015 11:28
@Hassanbenlebsir sure your sketch isnt doing 9600 ?
Me No Dev
@me-no-dev
Dec 04 2015 11:29
@ekarlso should the examples works as is?
Endre Karlson
@ekarlso
Dec 04 2015 11:30
@me-no-dev uh, dunno : p
Alexandro Todeschini
@asetyde
Dec 04 2015 11:31
Hi , thanks @igrr to suggest me this to ask my fast question , Someone uses this funtion ? Can it tell me something about this ? ESP.X... eraseConfig ?flasherasesector ?getresetinfo ?reset ?wdtfeed ?
Hassanbenlebsir
@Hassanbenlebsir
Dec 04 2015 11:32
iv set uploqd speed to 512000 qnd serial.begin( 512000) baudrate for serial 115200
are those the correct setting
Helio Machado
@crushedice2000
Dec 04 2015 11:33
@me-no-dev: Can you check my repo? Now it doesn't upload the file.
Me No Dev
@me-no-dev
Dec 04 2015 11:37
you have not defined an upload location in your sketch
what do you upload to?
Hassanbenlebsir
@Hassanbenlebsir
Dec 04 2015 11:37
@ekarlso ??
Me No Dev
@me-no-dev
Dec 04 2015 11:38
you need
server.on("/upload", HTTP_POST, [](){ server.send(200, "text/plain", ""); });
replace upload with whatever location you use
@Hassanbenlebsir 512000 or 115200 ?
all speeds to 115200 should work
Helio Machado
@crushedice2000
Dec 04 2015 11:39
@me-no-dev: Can't I do uploads on the root?
Without using a upload URL?
Me No Dev
@me-no-dev
Dec 04 2015 11:41
it should work
are you uploading to /
curl -F "file=@$PWD/$file" [ESP_IP]
should work
Helio Machado
@crushedice2000
Dec 04 2015 11:46
@me-no-dev: Hooray! Now it works correctly!
Hassanbenlebsir
@Hassanbenlebsir
Dec 04 2015 11:47
@me-no-dev and the serial monitor speed ?
Me No Dev
@me-no-dev
Dec 04 2015 11:47
@Hassanbenlebsir all at that same speed
if you do Serial.begin(speed1) and open the monitor with different speed, you will not be able to see the data
@crushedice2000 was it the command?
Helio Machado
@crushedice2000
Dec 04 2015 11:49
webServer.on("/", HTTP_POST, [](){ server.send(200, "text/plain", ""); });
@me-no-dev: The above line was the fail.
I was using this (wrong):
webServer.on("/", HTTP_POST, [](){ webServer.send(200, "text/plain", ""); }, handleFileUpload);
Me No Dev
@me-no-dev
Dec 04 2015 11:51
you know what! i know why it was not working before
webServer.onFileUpload(handleFileUpload);
webServer.onNotFound(handleRoot);
webServer.on("/", handleRoot);
in this order it should work
Hassanbenlebsir
@Hassanbenlebsir
Dec 04 2015 11:52
its works
Me No Dev
@me-no-dev
Dec 04 2015 11:52
onFileUplaod needs to be defined before any on() calls
Helio Machado
@crushedice2000
Dec 04 2015 11:53
@me-no-dev: I never suspected that!
Me No Dev
@me-no-dev
Dec 04 2015 11:54
it's a recent change
Helio Machado
@crushedice2000
Dec 04 2015 11:54
@me-no-dev: Are these things documented anywhere?
Me No Dev
@me-no-dev
Dec 04 2015 11:54
was required to make upoadHandlers separate for different locations
I don;t think that made it to the docs yet
it's really recent
last week maybe :)
Helio Machado
@crushedice2000
Dec 04 2015 11:55
@me-no-dev: Ok, I'll keep in mind. Until now, I placed all the events sorted by length to make ascii art ;-)
Me No Dev
@me-no-dev
Dec 04 2015 11:56
 webServer.on("/", HTTP_POST, [](){ webServer.send(200, "text/plain", ""); }, handleFileUpload);
 webServer.on("/", HTTP_GET, handleRoot);
webServer.onNotFound(handleRoot);
this will handle uploads only on the root
Helio Machado
@crushedice2000
Dec 04 2015 11:57
@me-no-dev: What a intelligent chat: It replaces **;-)** by ;-)
@me-no-dev: Thanks!
Endre Karlson
@ekarlso
Dec 04 2015 11:58
@igrr hmmm, can't find the arduin-builder that you say
Ivan Grokhotkov
@igrr
Dec 04 2015 11:58
which IDE version?
Me No Dev
@me-no-dev
Dec 04 2015 11:58
@ekarlso what version IDE are yo using
Ivan Grokhotkov
@igrr
Dec 04 2015 11:58
it only appeared in 1.6.6
1.6.5 doesn't have it
Endre Karlson
@ekarlso
Dec 04 2015 11:58
@igrr does esp8266 work with 1.6.5 yet then ?
thought it didnt yet
Helio Machado
@crushedice2000
Dec 04 2015 11:58
@me-no-dev: Should I also include webServer.onFileUpload?
Ivan Grokhotkov
@igrr
Dec 04 2015 11:58
the core works with both 1.6.5 and 1.6.6
Endre Karlson
@ekarlso
Dec 04 2015 11:58
ok: )
Me No Dev
@me-no-dev
Dec 04 2015 12:01
@crushedice2000 webServer.onFileUpload handles upload to all locations that can hande POST and have not defined their own uploadHandler
if you are going to use only one location for uploads, then you do not need it and will ensure only at that locations an upload can be received
Helio Machado
@crushedice2000
Dec 04 2015 12:03
@me-no-dev: I only need uploads on /, so I'll nt use it.
.
Endre Karlson
@ekarlso
Dec 04 2015 12:07
@igrr is there a sketch that uses the secureclient and so on ?
Helio Machado
@crushedice2000
Dec 04 2015 12:07
@AllTheProjectContributors: Why Arduino prompts me for a (ever wrong) password when using OTA? I will embed my ESP in a difficult-access location and I need OTA to update SPIFFS/sketch on it.
Ivan Grokhotkov
@igrr
Dec 04 2015 12:07
libraries/ESP8266WiFi/examples/HTTPSRequest
Me No Dev
@me-no-dev
Dec 04 2015 12:08
@crushedice2000 what version IDE?
Helio Machado
@crushedice2000
Dec 04 2015 12:08
@me-no-dev 1.6.6
Ivan Grokhotkov
@igrr
Dec 04 2015 12:08
see esp8266/Arduino#959
Helio Machado
@crushedice2000
Dec 04 2015 12:09
@igrr: When should be committed the PR?
Is there any workaround?
Me No Dev
@me-no-dev
Dec 04 2015 12:10
not for 1.6.6
we have thumbs up on the merge but not merged yet
Helio Machado
@crushedice2000
Dec 04 2015 12:10
@me-no-dev @me-no-dev: Is there any workaround for another version?
Ivan Grokhotkov
@igrr
Dec 04 2015 12:11
there isn't any workaround other than to use espota.py script manually
Helio Machado
@crushedice2000
Dec 04 2015 12:11
@igrr: Where is it? On Arduino15?
Searching...
Ivan Grokhotkov
@igrr
Dec 04 2015 12:12
something like arduino15/packages/esp8266/version/tools/
Helio Machado
@crushedice2000
Dec 04 2015 12:15
$ ls /Users/casa/Library/Arduino15/packages/esp8266/tools/
esptool            mkspiffs        xtensa-lx106-elf-gcc
Me No Dev
@me-no-dev
Dec 04 2015 12:15
@crushedice2000 that looks old
Helio Machado
@crushedice2000
Dec 04 2015 12:15
@igrr: Should it be on my installation?
Ivan Grokhotkov
@igrr
Dec 04 2015 12:16
sorry actually its in Arduino15/packages/esp8266/hardware/esp8266/2.0.0/tools/espota.py
Helio Machado
@crushedice2000
Dec 04 2015 12:16
@me-no-dev: Fresh installed at 12:15 today
@igrr: 302 Found
;-)
Endre Karlson
@ekarlso
Dec 04 2015 12:18
@igrr how in the sketch then do you include axtls to be able to set the key ?
Helio Machado
@crushedice2000
Dec 04 2015 12:18
/Users/casa/Library/Arduino15/packages/esp8266/hardware/esp8266/2.0.0/tools/espota.py
How ´espota.py` specifies the flash size? (mine is 1M)
Me No Dev
@me-no-dev
Dec 04 2015 12:21
it does not. that is done at build and then on the ESP side
the ESP knows what to do
Helio Machado
@crushedice2000
Dec 04 2015 12:22
@me-no-dev Ok. How can i get the compiled file (SPIFFS or program) to pass it to espOTA.py?
@me-no-dev Could I make a wrapper in BASH/Python to espOTA.py to use from GUI?
Me No Dev
@me-no-dev
Dec 04 2015 12:24
//upload sketch
python espota.py -r -i [esp-ip] -p 8266 -f [path-to-bin]
//upload spiffs
python espota.py -r -i [esp-ip] -p 8266 -s -f [path-to-image]
Helio Machado
@crushedice2000
Dec 04 2015 12:25
@me-no-dev How can I determine [path-to-bin]? Should I press [BUILD] on the IDE first?
Me No Dev
@me-no-dev
Dec 04 2015 12:25
yes and have build debug enabled in settings
Ivan Grokhotkov
@igrr
Dec 04 2015 12:26
@ekarlso libaxtls is included in the build by default
part of linker command line
Endre Karlson
@ekarlso
Dec 04 2015 12:27
@igrr kk, so where do I need to place the library or so that I have cloned to get my version included ?
Me No Dev
@me-no-dev
Dec 04 2015 12:27
@crushedice2000 path should look like:
/var/folders/b_/2gy4g72944359d2vj4htbtwm0000gn/T/build6c445534217ff306d2c48161a213eacf.tmp/[sketch-name].ino.bin
Helio Machado
@crushedice2000
Dec 04 2015 12:27
@me-no-dev: I can't find the program path on the build debug:
/Applications/Arduino.app/Contents/Java/arduino-builder -dump-prefs -logger=machine -hardware "/Applications/Arduino.app/Contents/Java/hardware" -hardware "/Users/casa/Library/Arduino15/packages" -hardware "/Users/casa/Documents/Arduino/hardware" -tools "/Applications/Arduino.app/Contents/Java/tools-builder" -tools "/Applications/Arduino.app/Contents/Java/hardware/tools/avr" -tools "/Users/casa/Library/Arduino15/packages" -built-in-libraries "/Applications/Arduino.app/Contents/Java/libraries" -libraries "/Users/casa/Documents/Arduino/libraries" -fqbn=esp8266:esp8266:generic:UploadTool=esptool,CpuFrequency=80,FlashFreq=40,FlashMode=dio,UploadSpeed=115200,FlashSize=1M512,ResetMethod=nodemcu -ide-version=10606 -build-path "/var/folders/ys/s95vnvz506j2p7444t6wr4mw0000gn/T/build383813e8bbd2e72e120045967d4118be.tmp" -warnings=none -prefs=build.warn_data_percentage=75 -verbose "/Users/casa/Documents/GitHub/ESP8266Brightness/brightness/brightness.ino"
/Applications/Arduino.app/Contents/Java/arduino-builder -compile -logger=machine -hardware "/Applications/Arduino.app/Contents/Java/hardware" -hardware "/Users/casa/Library/Arduino15/packages" -hardware "/Users/casa/Documents/Arduino/hardware" -tools "/Applications/Arduino.app/Contents/Java/tools-builder" -tools "/Applications/Arduino.app/Contents/Java/hardware/tools/avr" -tools "/Users/casa/Library/Arduino15/packages" -built-in-libraries "/Applications/Arduino.app/Contents/Java/libraries" -libraries "/Users/casa/Documents/Arduino/libraries" -fqbn=esp8266:esp8266:generic:UploadTool=esptool,CpuFrequency=80,FlashFreq=40,FlashMode=dio,UploadSpeed=115200,FlashSize=1M512,ResetMethod=nodemcu -ide-version=10606 -build-path "/var/folders/ys/s95vnvz506j2p7444t6wr4mw0000gn/T/build383813e8bbd2e72e120045967d4118be.tmp" -warnings=none -prefs=build.warn_data_percentage=75 -verbose "/Users/casa/Documents/GitHub/ESP8266Brightness/brightness/brightness.ino"
"/Users/casa/Library/Arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/1.20.0-26-gb404fb9-2/bin/xtensa-lx106-elf-g++" -w -x c++ -M -MG -MP -DF_CPU=80000000L -DARDUINO=10606 -DARDUINO_ESP8266_ESP01 -DARDUINO_ARCH_ESP8266  -DESP8266 "-I/Users/casa/Library/Arduino15/packages/esp8266/hardware/esp8266/2.0.0/cores/esp8266" "-I/Users/casa/Library/Arduino15/packages/esp8266/hardware/esp8266/2.0.0/variants/generic" "/var/folders/ys/s95vnvz506j2p7444t6wr4mw0000gn/T/build383813e8bbd2e72e120045967d4118be.tmp/sketch/brightness.ino.cpp"
"/Users/casa/Library/Arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/1.20.0-26-gb404fb9-2/bin/xtensa-lx106-elf-g++" -w -x c++ -M -MG -MP -DF_CPU=80000000L -DARDUINO=10606 -DARDUINO_ESP8266_ESP01 -DARDUINO_ARCH_ESP8266  -DESP8266 "-I/Users/casa/Library/Arduino15/packages/esp8266/hardware/esp8266/2.0.0/cores/esp8266" "-I/Users/casa/Library/Arduino15/packages/esp8266/hardware/esp8266/2.0.0/variants/generic" "-I/Users/casa/Documents/Arduino/libraries/ArduinoJson/src" "-I/Users/casa/Library/Arduino15/packages/esp8266/hardware/esp8266/2.0.0/libraries/DNSServer/src" "-I/Users/casa/Library/Arduino15/packages/esp8266/hardware/esp8266/2.0.0/libraries/ESP8266WiFi/src" "-I/Users/casa/Library/Arduino15/packages/esp8266/hardware/esp8266/2.0.0/libraries/ESP8266mDNS" "-I/Users/casa/Library/Arduino15/packages/esp8266/hardware/esp8266/2.0.0/libraries/ESP8266WebServer/src" "-I/Users/casa/Library/Arduino15/packages/esp8266/hardware/esp8266/2.0.0/libraries/ArduinoOTA" "/var/folders/ys/s95vnvz506j2p7444t6wr4mw0000gn/T/build383813e8bbd2e72e120045967d4118be.tmp/sketch/brightness.ino.cpp"
"/Users/casa/Library/Arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/1.20.0-26-gb404fb9-2/bin/xtensa-lx106-elf-g++" -w -x c++ -M -MG -MP -DF_CPU=80000000L -DARDUINO=10606 -DARDUINO_ESP8266_ESP01 -DARDUINO_ARCH_ESP8266  -DESP8266 "-I/Users/casa/Library/Arduino15/packages/esp8266/hardware/esp8266/2.0.0/cores/esp8266" "-I/Users/casa/Library/Arduino15/packages/esp8266/hardware/esp8266/2.0.0/variants/generic" "-I/Users/casa/Library/Arduino15/packages/esp8266/hardware/esp8266/2.0.0/libraries/ArduinoOTA" "-I/Users/casa/Documents/Arduino/libraries/A
Me No Dev
@me-no-dev
Dec 04 2015 12:30
last line before "Using library..." and size info
Helio Machado
@crushedice2000
Dec 04 2015 12:30
@me-no-dev Found!
Disconnecting WIFI to try...
(no ethernet now)
$ python espota.py -r -i 192.168.1.1 -p 8266 -f /var/folders/ys/s95vnvz506j2p7444t6wr4mw0000gn/T/build383813e8bbd2e72e120045967d4118be.tmp/brightness.ino.bin
13:33:31 [ERROR]: No response from device
@me-no-dev: Why?
Ivan Grokhotkov
@igrr
Dec 04 2015 12:36
@ekarlso i clone libaxtls into a separate directory, build it (by running make clean all), and then copy libaxtls.a in place of hardware/tools/sdk/lib/libaxtls.a
Endre Karlson
@ekarlso
Dec 04 2015 12:37
@igrr aha, btw to my limited c knowledge
extern unsigned char default_private_key[];
extern unsigned int default_private_key_len;
but that gives that len is of unknown length :D
Endre Karlson
@ekarlso
Dec 04 2015 12:44
@igrr ping me when you got a clue for me ;)
Me No Dev
@me-no-dev
Dec 04 2015 12:53
@crushedice2000 are you connected to the ESP through it's AP? is the ESP's IP 192.168.1.1?
do you have ArduinoOTA.begin() and ArduinoOTA.handle() in your sketch?
Endre Karlson
@ekarlso
Dec 04 2015 12:58
@igrr I realy wanna get this going ;)
Helio Machado
@crushedice2000
Dec 04 2015 13:04
@me-no-dev: You can check the latest version of my sketch here
Me No Dev
@me-no-dev
Dec 04 2015 13:23
@crushedice2000 your sketch, my mac:
~ $ espota -r -i 192.168.1.1 -p 8266 -f /var/folders/b_/2gy4g72944359d2vj4htbtwm0000gn/T/builded9a275731ad689317ca82679db2cdaf.tmp/sketch_dec04a.ino.bin
Uploading: [============================================================] 100% Done...
Ivan Grokhotkov
@igrr
Dec 04 2015 13:48
@ekarlso ok, just a sec, will check
Helio Machado
@crushedice2000
Dec 04 2015 13:56
@me-no-dev: I finally uploaded it via OTA. It worked after changing 1M/512 SPIFFS to 1M/128 SPIFFS, but after upload, it stops the AP and it behaves like a brick. Here you're the boot loader info:
Me No Dev
@me-no-dev
Dec 04 2015 13:56
that is OK, just reset it
it happens after serial upload
Helio Machado
@crushedice2000
Dec 04 2015 13:56
ets Jan  8 2013,rst cause:2, boot mode:(3,6)

load 0x4010f000, len 1264, room 16 
tail 0
chksum 0x42
csum 0x42
~ld
e:
ets Jan  8 2013,rst cause:3, boot mode:(3,6)

ets_main.c 
Me No Dev
@me-no-dev
Dec 04 2015 13:56
if you manually reset after serial upload it will not happen
something is wrong
you sure chip size is correct and all
Ivan Grokhotkov
@igrr
Dec 04 2015 13:57
ets_main.c means that image is corrupted
Helio Machado
@crushedice2000
Dec 04 2015 13:57
This message was deleted
beikeland
@beikeland
Dec 04 2015 13:58
is it possible to optian the IP of the client requesting a web page on my esp? I have some code that crashes when a page is requested by an client i fail to identify
Me No Dev
@me-no-dev
Dec 04 2015 13:59
i can't explain the image corruption
Ivan Grokhotkov
@igrr
Dec 04 2015 13:59
@beikeland something like IPAddress addr = server.client().remoteIP()
beikeland
@beikeland
Dec 04 2015 14:01
@igrr thanks; i'll try that and see if I can track down the client and find out whats wrong with the request
Helio Machado
@crushedice2000
Dec 04 2015 14:01
What can happen?
Ivan Grokhotkov
@igrr
Dec 04 2015 14:09
@ekarlso here you go: igrr/axtls-8266@1551076
Endre Karlson
@ekarlso
Dec 04 2015 14:10
@igrr now u made it look too easy :)
Endre Karlson
@ekarlso
Dec 04 2015 14:19
@igrr did you add it to the arduin code too or ?
Ivan Grokhotkov
@igrr
Dec 04 2015 14:19
in progress
trying to figure out how to use openssl to generate my own key/cert in DER format now
Dmitry Kireev
@kireevco
Dec 04 2015 14:21
@igrr you can do .cer and then convert to der
or .pem to .der
openssl x509 -outform der -in certificate.pem -out certificate.der
(most people have certs in .pem
are we saying that Arduino Esp will support SSL in good way very very soon?
Ivan Grokhotkov
@igrr
Dec 04 2015 14:23
most things are already in place. just need to add a good API for people to set their key/cert
Dmitry Kireev
@kireevco
Dec 04 2015 14:24
shouldn't that be just a file in eeprom/spiffs?
Helio Machado
@crushedice2000
Dec 04 2015 14:25
@me-no-dev Solved! It was only a timing problem. Once I upload the OTA, it delays ~10 seconds to flash.
Thanks for your patience!
Ivan Grokhotkov
@igrr
Dec 04 2015 14:28
this will be one option, yes. but i don't want to make people use spiffs just to use TLS, so the other way would be to specify these keys inline as C arrays.
Dmitry Kireev
@kireevco
Dec 04 2015 14:29
@igrr yeah, completely makes sense.
maybe some day Arduino IDe will have a gui for rudimetrary managing SSL certs (at least converting pem to der)
or something like that
Ivan Grokhotkov
@igrr
Dec 04 2015 14:30
I was just thinking that we need a plugin for that
Dmitry Kireev
@kireevco
Dec 04 2015 14:31
it will clearly simplify lifes for "normal" people
Ivan Grokhotkov
@igrr
Dec 04 2015 14:31
I can't imagine an average Arduino user doing what I just had to do from the command line just to run the example...
Dmitry Kireev
@kireevco
Dec 04 2015 14:31
yep
Ivan Grokhotkov
@igrr
Dec 04 2015 14:32
The issue with plugins is that the IDE is not giving an easy way to distribute them (i.e. along with the board manager package)
Dmitry Kireev
@kireevco
Dec 04 2015 14:32
Yeah...
Endre Karlson
@ekarlso
Dec 04 2015 14:32
what's the reason for it having to be in DER ?
Dmitry Kireev
@kireevco
Dec 04 2015 14:33
oh, btw, I think my cross-platform build finally worked
Ivan Grokhotkov
@igrr
Dec 04 2015 14:33
That's what axTLS expects by default. But it can handle PEM as well i think
@kireevco oh wow
do you have a plan to build the ESP32 toolchains as well?
Dmitry Kireev
@kireevco
Dec 04 2015 14:33
Ivan Grokhotkov
@igrr
Dec 04 2015 14:34
I did the initial port of arduino core for the ESP32 and now i need to build the toolchains again...
Dmitry Kireev
@kireevco
Dec 04 2015 14:34
now I need to push it to bintray...
@igrr I probably could include extra stuff
Endre Karlson
@ekarlso
Dec 04 2015 14:34
@kireevco what's the bonus of using a alt sdk vs the espressif?
Dmitry Kireev
@kireevco
Dec 04 2015 14:34
I also discovered that travis now has macos :)
so appveyor+travis would replace my cluster :-D
(to the free extent)
Ivan Grokhotkov
@igrr
Dec 04 2015 14:35
oh really? they used so have you request os x specifically via an email to support
that's cool
Dmitry Kireev
@kireevco
Dec 04 2015 14:35
@igrr yep. I just checked yesterday (of course, only after my build worked
I'm trying to make this work, that would be awesome. downside of travis - time limit
but I think I'm good within time
@ekarlso well,a) libraries are still coming from espressif
Ivan Grokhotkov
@igrr
Dec 04 2015 14:36
does it have an option for not including the SDK?
Dmitry Kireev
@kireevco
Dec 04 2015 14:37
@ekarlso b) espressif doesn't produce full toolchain+sdk for crossplatform stuff
Ivan Grokhotkov
@igrr
Dec 04 2015 14:37
and do you intend to upload such builds to bintray? (i.e. without the SDK)
Dmitry Kireev
@kireevco
Dec 04 2015 14:37
@igrr 2) yep. it will live here.
1) I think so, make STANDALONE=n should work.
Endre Karlson
@ekarlso
Dec 04 2015 14:38
@kireevco the bonus being vs the original ?
Dmitry Kireev
@kireevco
Dec 04 2015 14:38
Well, and I can add ESP32
Endre Karlson
@ekarlso
Dec 04 2015 14:38
not that I am that familiar with it :smile:
Dmitry Kireev
@kireevco
Dec 04 2015 14:38
@ekarlso there is no original toolchain (Xtensa-gcc), from what I know
it's just a set of buildscripts that people use
Ivan Grokhotkov
@igrr
Dec 04 2015 14:39
@ekarlso Espressif only has a Linux toolchain in a form of a VM image
they don't provide Windows or OS X toolchains
Dmitry Kireev
@kireevco
Dec 04 2015 14:39
there is esp-open-sdk, that kinda does everyhting, and that inspired me... but it uses crosstool-ng to build toolchain, so pita for MAC and Windows
(After 3Months trying I gave up). So maybe @pfalcon will accept my PR to switch from crosstool to simple build (but I doubt it)
I have a crazy day today, but I'll try to upload stuff to bintray. (running my build again, should take less time, and push it up there).
Chris Elsworth
@celsworth
Dec 04 2015 14:42
yummy, 13bit adc on the esp32 :D
this thing is starting to look really nice
Dmitry Kireev
@kireevco
Dec 04 2015 14:42
@celsworth do you know how many analogue pins?
probably one?
Chris Elsworth
@celsworth
Dec 04 2015 14:42
8, allegedly
Dmitry Kireev
@kireevco
Dec 04 2015 14:42
whaaaaaat
even 2 is so much better
well, can't wait even more then
beikeland
@beikeland
Dec 04 2015 14:43
@igrr IPAddress addr = server.client().remoteIP() did indeed get me the IP of the connecting client. Thanks again! Now just to find my bug.. :)
Ivan Grokhotkov
@igrr
Dec 04 2015 15:09
@ekarlso now i need to find a server which will actually request my client certificate :)
most don't.
Ivan Grokhotkov
@igrr
Dec 04 2015 15:15
@ekarlso does the site which you wanted to use actually require client certificates?
beikeland
@beikeland
Dec 04 2015 15:16
when doing sketch->export compiled binary would it be possible to get a set of files made for different flash sizes and configurations?
Ivan Grokhotkov
@igrr
Dec 04 2015 15:16
@beikeland i don't think so
for each size and flash config you need to do the full build
and in Arduino IDE export simply gets you the latest generated file
beikeland
@beikeland
Dec 04 2015 15:22
@igrr that actually looks even better! Off to make an update server :+1: :smile:
Steve Nelson
@zenmanenergy
Dec 04 2015 15:34
I just saw this message popup in my serial monitor:
[W]sec fe error
[W]sec fe error
[W]sec fe error
[W]sec fe error
What does that mean?
Hassanbenlebsir
@Hassanbenlebsir
Dec 04 2015 15:34
guys can i use websockets for a deskop app
Steve Nelson
@zenmanenergy
Dec 04 2015 15:35
I assume it came from WiFi.printDiag(Serial);
Of course, I can’t reproduce it. *le sigh.
Markus
@Links2004
Dec 04 2015 15:35
every modern web browser support it, and there also library for almost any language you like.
Steve Nelson
@zenmanenergy
Dec 04 2015 15:53
Is there a way to disconnect a client device without doing a full WiFi.disconnect()? I.e. if my laptop is connected to the esp, and my esp is connected to my internet router, I want to force my laptop to disconnect from the esp, but I don’t want the esp to disconnect from the router.
Ivan Grokhotkov
@igrr
Dec 04 2015 16:03
@ekarlso arduino part done, you can now set client key/certificate from char array or from SPIFFS file
torntrousers
@torntrousers
Dec 04 2015 16:11
Howdy. Can anyone help with how to set the mac address from a sketch? I found issue 413 and an associated commit and from that adding this bit of code at the top of a sketch compiles ok but the mac address doesnt seem to change:
extern "C++" void __run_user_rf_pre_init(void) {
  #include "user_interface.h"
  wifi_set_opmode(STATION_MODE); // station + softAP mode
  uint8_t mac[] = {0x77, 0x01, 0x02, 0x03, 0x04, 0x05};
  wifi_set_macaddr(STATION_IF, &mac[0]);
}
Endre Karlson
@ekarlso
Dec 04 2015 16:23
.
Chris Elsworth
@celsworth
Dec 04 2015 16:28
sdk docs say you must call wifi_set_macaddr in user_init()
also as a sidenote, mac is equivalent to &mac[0] and looks a bit neater
Markus
@Links2004
Dec 04 2015 16:29

you can create

void initVariant() {
  uint8_t mac[] = {0x77, 0x01, 0x02, 0x03, 0x04, 0x05};
  wifi_set_macaddr(STATION_IF, &mac[0]);
}

in the code to run function in user_init

Hassanbenlebsir
@Hassanbenlebsir
Dec 04 2015 16:48
guys i need your help how do i send a message from an esp to a server
Markus
@Links2004
Dec 04 2015 16:49
what kind of server?
Hassanbenlebsir
@Hassanbenlebsir
Dec 04 2015 16:49
java application
so basically i need to do it this sockets
but i have no clue where to begin i'n new to esp
Markus
@Links2004
Dec 04 2015 16:51
you can start a tcp server in you java code.
and use the WiFiClient class to connect to it.
Hassanbenlebsir
@Hassanbenlebsir
Dec 04 2015 16:51
i already started tcp server in my java code
and i created a java client and it works fine
but how do i creat a wificlient in esp
Markus
@Links2004
Dec 04 2015 16:52
take a look here:
Endre Karlson
@ekarlso
Dec 04 2015 16:53
@igrr mqtt tls ..
Markus
@Links2004
Dec 04 2015 16:53
this example connects to a tcp server and sends a http header to it,
you can replace the "header" message with your message and it will send it.
Hassanbenlebsir
@Hassanbenlebsir
Dec 04 2015 16:57
sorry but where can i change the header
and to connect to my server i normally need just the ipaddresse here is see other variables privatekey and steam id
hope that is better to understand for you.
Markus
@Links2004
Dec 04 2015 19:47
have someone ever seen a similar behavior with tcp sockets? Links2004/arduinoWebSockets#23
Chris Elsworth
@celsworth
Dec 04 2015 20:01
the only similar thing I've seen is if the read buffer fills up and I don't read from it, I can't write to the socket anymore, I think
so I ended up throwing a while (client.available()) client.read(); in one of my sketches where I don't care about incoming data, its just an outgoing data stream
that seemed to fix it
but before adding that I was easily able to block the data from coming out by just sending any old garbage to the esp and it would get stuck
I can't remember if it was a certain number of unread bytes that stopped it, or even just 1, I can re-test it later and see for sure
beikeland
@beikeland
Dec 04 2015 20:15
Is there a clever way to serve long urls with shorter file names? I just tried adding some .css and .js; but it called for /fonts/glyphicons-halflings-regular.woff2 and it took a while to figure out that SPIFFS has max file name length of 32.
Markus
@Links2004
Dec 04 2015 20:55
@beikeland you can create a CRC32 of it for example.
may a truncated sha1 is easier since the function is implemented allready
@celsworth i think in your case you end up with LmacRxBlk:1 or?
Chris Elsworth
@celsworth
Dec 04 2015 20:59
LmacRxBlk:1?
looking that up :)
Markus
@Links2004
Dec 04 2015 20:59
thats the error message of the SDK for internal rx buffer full.
may only visible with Serial.setDebugOutput(true);
Chris Elsworth
@celsworth
Dec 04 2015 20:59
yes probably
Chris Elsworth
@celsworth
Dec 04 2015 21:13
just looking at your websockets library, looks very nice - I think I'll migrate one of my apps to this instead of accepting a new http client for every json reply :)
d-anders
@d-anders
Dec 04 2015 21:14
ive been using it wo problems but my clients behace nicely
beikeland
@beikeland
Dec 04 2015 21:22
@Links2004 i'll make a note of the sha1 hash and see if I can't automate the renaming as well. Thanks! Although serving css and fonts needs cache handling and 302 headers as well. Quite slow, but i'm thinking i need to prepare for cases without internett access.