These are chat archives for esp8266/Arduino

17th
Nov 2015
Angus Gratton
@projectgus
Nov 17 2015 00:39
igrr: nice work!
igrr: did you end up doing anything about wifi packet flow control in order to maintain TCP connections while writing to flash? or has that not been a problem for you?
Ivan Grokhotkov
@igrr
Nov 17 2015 00:41
@projectgus thanks! what about your experience with mbedTLS, does it fit into RAM with full 16k fragments?
regarding writing to flash: it turned out WiFi interrupts do not interfere with flash operation. I just mask some interrupts which may call cached user code during flash operations, and this seems to be enough.
i.e. i mask GPIO, UART, and timer interrupts
Angus Gratton
@projectgus
Nov 17 2015 00:43
igrr: nice, i hadn't actually considered that approach. might be possible for us as well.
haven't managed to get mbedtls to work with bidirectional 16k buffers, at least not yet.
so arduino can fit the full size buffers?
Ivan Grokhotkov
@igrr
Nov 17 2015 00:45
axTLS is half-duplex, so it needs only one buffer :)
Angus Gratton
@projectgus
Nov 17 2015 00:46
ah, i didn't realise that
mbedtls currently assumes tx & rx buffers are the same size, so something i want to investigate is having asymmetric buffer sizes
because you need 16k on the receive side if the server doesn't support fragment size negotiation, but you don't really need it on the tx size
tx side*
Ivan Grokhotkov
@igrr
Nov 17 2015 00:47
i just realized today that during handshake it only needs around 6k buffer size, so I can expand it to 16k after handshake is done, and all RAM allocated for certificate storage can be freed
Angus Gratton
@projectgus
Nov 17 2015 00:48
that's neat
have you had any interaction with Cameron Rich (the axtls author/maintainer), do you think any of your work might get merged upstream?
Ivan Grokhotkov
@igrr
Nov 17 2015 00:51
i haven't; i feel some of these changes need refactoring to be accepted upstream. also i'm not a crypto guy, perhaps i have introduced some timing/side channel attack vectors with these changes...
frankly polishing everything and submitting my changes upstream is a bit over my bandwidth at the moment. perhaps some day...
Angus Gratton
@projectgus
Nov 17 2015 00:52
fair enough :)
i'm not sure it's very actively maintained anyhow, so there might not be much point
Ivan Grokhotkov
@igrr
Nov 17 2015 00:52
yeah, and with esp32 around the corner, even more so...
Angus Gratton
@projectgus
Nov 17 2015 00:53
true, be interesting to see how well espressif do their implementation there though
tzapu
@tzapu
Nov 17 2015 08:24
@igrr is this configTime(3 * 3600, 0, "pool.ntp.org"); part of the core now?
Ivan Grokhotkov
@igrr
Nov 17 2015 08:25
yes, i've merged it a few days ago
haven't documented yet...
Mario Mikočević
@mozgy
Nov 17 2015 08:34
@igrr any ETA on new staging release or even stable ?
Ivan Grokhotkov
@igrr
Nov 17 2015 08:35
https://github.com/esp8266/Arduino/milestones
it should have been yesterday :)
sorry, didn't make it. some issues with boards manager package generation, will sort out today and push.
the only blocker now is apparently broken Eclipse plugin support
Mario Mikočević
@mozgy
Nov 17 2015 08:37
I saw 'milestones', hence me asking :)
no worries tho, awesome work
Ivan Grokhotkov
@igrr
Nov 17 2015 08:38
thanks
Luc
@luc-github
Nov 17 2015 10:10
Hi - I have some issue with IE 11 - it cache everything and so do not take update in json file, I found adding the header Cache-Control: no-cache solve the problem.
What is the best method to inject it when using void send(int code, const String& content_type, const String& content); function ?
As I see _responseHeaders is private, should we create a new function to allow extra headers like void send(int code, const String& content_type, const String& content, const String& extra_headers); or there is another way ?
Ivan Grokhotkov
@igrr
Nov 17 2015 10:12
it's already there:
  void sendHeader(const String& name, const String& value, bool first = false);
call it before calling send
Luc
@luc-github
Nov 17 2015 10:18
Ok thanks my mistake I though sendHeader("Content-Type", content_type, true); will reset the content but I read wrong ... sorry
Thank you
tzapu
@tzapu
Nov 17 2015 10:34
@igrr thank you very much
Ivan Grokhotkov
@igrr
Nov 17 2015 12:47
esp8266/Arduino@39cf5d6 😒
Me No Dev
@me-no-dev
Nov 17 2015 12:54
anyone interested in using their ESP as web radio? VS1053B anyone?
currently listening to HLS live stream of mtv-rocks but lazy to wrap in a lib
plus the VS uses 7 pins
Ivan Grokhotkov
@igrr
Nov 17 2015 13:00
what kind of bitrate can you stream?
Me No Dev
@me-no-dev
Nov 17 2015 13:01
i'm using HLS because streaming did not work well at all
you get lots of packets at once and no memory for them
HLS is HTTP so it's more pull like
read playlist, get the chunk, parse it and play the data parts
no clue what is the current bitrate, but with 10 second chunks, I have lots of time not doing anything
Ivan Grokhotkov
@igrr
Nov 17 2015 13:04
yeah, usually hls playlists have several quality levels
Me No Dev
@me-no-dev
Nov 17 2015 13:04
I generate the HLS so I have one and have not defined anything but encoding to mp3
ffmpeg -fifosize 1m -overrun_nonfatal 1 -i udp://239.100.10.141:5000 -strict -2 -threads 0 -vn -c:a mp3 -f hls -hls_allow_cache 0 -hls_time 10.0 -hls_list_size 2 -hls_wrap 5 -start_number 0 -hls_flags +round_durations -hls_segment_filename /var/www/streams/mtv_rocks_radio%d.ts /var/www/streams/mtv_rocks_radio.m3u8
Ivan Grokhotkov
@igrr
Nov 17 2015 13:05
oh, okay
Me No Dev
@me-no-dev
Nov 17 2015 13:05
Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, stereo, s16p, 256 kb/s comes in
Audio: mp3 (libmp3lame), 48000 Hz, stereo, s16p goes out
parsing playlists is trivial
parsing the TS is what's fun
Juppit
@Juppit
Nov 17 2015 16:16
@me-no-dev My first idea for the ESP8266 was a radio, it's already months ago. But there was too much else. I'm still interrested. Do you have one or two links?
Me No Dev
@me-no-dev
Nov 17 2015 16:35
@Juppit there are no links but I don't mind sharing the code :)
fighting with async ota auth at the moment
because streaming get's in the way
then I'll pastebin what I have and how to get it going
Juppit
@Juppit
Nov 17 2015 16:57
@me-no-dev Great, I'm curious, but do not let yourself rush.
tzapu
@tzapu
Nov 17 2015 17:17
this might be a side effect of the updates and could be fixed automatically, but figured i d mention it anywa: the staging docs link takes you to a 404 currently http://arduino.esp8266.com/versions/2.0.0-rc1/doc/reference.html
Ivan Grokhotkov
@igrr
Nov 17 2015 19:11
yeah, docs are down. I haven't had time to figure out the new system which involves github.io yet, decided to update staging and leave docs for later.
onkelfunny
@onkelfunny
Nov 17 2015 22:55
i receive this in the Serial console after uploading load 0x
esptool v0.4.6-1-g6de5ee5 - (c) 2014 Ch. Klippel <ck@atelier-klippel.de>
    setting board to nodemcu
    setting baudrate from 115200 to 921600
    setting port from /dev/tty.usbserial to /dev/cu.SLAB_USBtoUART
    setting address from 0x00000000 to 0x00000000
    espcomm_upload_file
    stat TEST.cpp.bin success
opening port /dev/cu.SLAB_USBtoUART at 921600
    tcgetattr
warning: serialport_set_baudrate: baud rate 921600 may not work
    tcsetattr
    serial open
opening bootloader
resetting board
trying to connect
    setting character timeout 0
    done
    setting character timeout 1
    done
    espcomm_send_command: sending command header
    espcomm_send_command: sending command payload
trying to connect
    setting character timeout 0
    done
    setting character timeout 1
    done
    espcomm_send_command: sending command header
    espcomm_send_command: sending command payload
    espcomm_send_command: receiving 2 bytes of data
    espcomm_send_command: receiving 2 bytes of data
    espcomm_send_command: receiving 2 bytes of data
    espcomm_send_command: receiving 2 bytes of data
    espcomm_send_command: receiving 2 bytes of data
    espcomm_send_command: receiving 2 bytes of data
    espcomm_send_command: receiving 2 bytes of data
    espcomm_send_command: receiving 2 bytes of data
    espcomm_open
Uploading 221920 bytes from Test.cpp.bin to flash at 0x00000000
    erasing flash
    size: 0362e0 address: 000000
    first_sector_index: 0
    total_sector_count: 55
    head_sector_count: 16
    adjusted_sector_count: 39
    adjusted_size: 027000
    espcomm_send_command: sending command header
    espcomm_send_command: sending command payload
    setting timeout 15000
    setting character timeout 150
    done
    setting timeout 1
    setting character timeout 1
    done
    espcomm_send_command: receiving 2 bytes of data
    writing flash
.........................................................................................................................................................................................................................
starting app without reboot
    espcomm_send_command: sending command header
    espcomm_send_command: sending command payload
    espcomm_send_command: receiving 2 bytes of data
closing boot loader
is my esp died?
onkelfunny
@onkelfunny
Nov 17 2015 23:05
ok, the upload speed was to height.