These are chat archives for esp8266/Arduino

16th
Nov 2015
Sven Eliasson
@comino
Nov 16 2015 00:07
Hey!
Is there no http library or did I just didnt find it? Or is there a compatible arduino one?
Sven Eliasson
@comino
Nov 16 2015 00:12
I know there is "WifiClient" but some http abstraction would make it more handy ;)
Me No Dev
@me-no-dev
Nov 16 2015 00:34
there is a huge HTTP library, check in libraries
has all kinds of examples, serving stuff from spiffs and more
Sven Eliasson
@comino
Nov 16 2015 00:47
Oh yeah the HttpServer stuff is nice - I meant a more abstracted HttpClient library. Right now I do it with client.print("GET..") etc.
Or maybe you can point me to a like, if Im just blind/too stupid to see :D Thanks!
like = link
Me No Dev
@me-no-dev
Nov 16 2015 00:52
oh you need a HTTP Client library?
I don't think we have that yet
Sven Eliasson
@comino
Nov 16 2015 01:08
yeah my question was a bit misleading ;) Thanks!
Markus
@Links2004
Nov 16 2015 17:17
@comino i have started working on a HttpClient library but it is not ready for usage yet.
Sven Eliasson
@comino
Nov 16 2015 18:18
@Links2004 great :D
Markus
@Links2004
Nov 16 2015 18:31
I uploaded a first version here:
https://github.com/Links2004/Arduino/tree/httpClient/libraries/ESP8266httpClient/src
but there are still thinks to do.
I also plan a wget / wput like class to easy up and download files from the flash chip, but the basic Http comes first.
https inside is untested yet. GET shut work already
Me No Dev
@me-no-dev
Nov 16 2015 19:02
@Links2004 are you planning to add a form post to the class? So files and other form data can be sent
Markus
@Links2004
Nov 16 2015 19:07
@me-no-dev yes that is what i mean be "wput", posting normal form shut work then to.
the idea is to implement the basic header handling and so on in the http Client class, which then is extended for post forms or downloading files to file system and so on.
if the class is working i also will rewrite the http Updater, to use the class in this step I also plan to add a check sum check.
Me No Dev
@me-no-dev
Nov 16 2015 19:09
great :) I wander how is it possible that I hear about wput now :D
for me only wget and curl existed up until now
Markus
@Links2004
Nov 16 2015 19:09
the current source is a first start, hope my idea of ssl and tcp combining will work.
wput is normaly an ftp client but its for the idea ;)
Me No Dev
@me-no-dev
Nov 16 2015 19:10
btw I was looking at FTP and HTTP basic auth
as something that we can probably do
Markus
@Links2004
Nov 16 2015 19:11
HTTP basic auth is only base64, "USER:PASS"
working base64 code is in my websocket lib
Me No Dev
@me-no-dev
Nov 16 2015 19:11
yes :) it's easy to add to the http server
Markus
@Links2004
Nov 16 2015 19:12
yes
Me No Dev
@me-no-dev
Nov 16 2015 19:12
FTP is quite the protocol itself, need to figure out what is used mostly and do just that
and FTP uses more connections for a single client
has one for commands and one for data
Markus
@Links2004
Nov 16 2015 19:13
FTP to the file system where cool, but may tftp is a easyer start
Me No Dev
@me-no-dev
Nov 16 2015 19:14
boot a computer off of theESP :D
Markus
@Links2004
Nov 16 2015 19:15
nice hacking gadget then, by adding a SD card we had enough space xD
Me No Dev
@me-no-dev
Nov 16 2015 19:16
yeah, but we will need time as well :D
Markus
@Links2004
Nov 16 2015 19:16
yup.
Me No Dev
@me-no-dev
Nov 16 2015 19:16
I don't think i've gone over 1.5Mbps
Markus
@Links2004
Nov 16 2015 19:17
SD @80MHz write: 84kB/s read: 231kB/s
its not really fast fat32 slows it down hardly
Me No Dev
@me-no-dev
Nov 16 2015 19:18
yes, but FLASH speed is not uch different
some SDcards can run at higher speeds and I can actually get faster speeds from them than from SPIFFS
Markus
@Links2004
Nov 16 2015 19:19
I test it with a 40MB/s SDcard clocked at 80Mhz
Me No Dev
@me-no-dev
Nov 16 2015 19:20
hm... my tests at normal speeds were the same
maybe it's not the FAT
Markus
@Links2004
Nov 16 2015 19:20
esp8266/Arduino@27f45a2
there all my test values
Me No Dev
@me-no-dev
Nov 16 2015 19:21
yup I remeber that merge
Markus
@Links2004
Nov 16 2015 19:22
i think SPI flash clocked @80Mhz with QIO is faster then the external SD.
Me No Dev
@me-no-dev
Nov 16 2015 19:22
SPI flash at 80MHz with SPIFFS yielded the same speeds if not slower than SD card at normal clock speed
makes no sense to me but it's the reality, so I think that that's just what the esp can do
what is the fastest speed you have acheaved in any test with whatever data?
Markus
@Links2004
Nov 16 2015 19:24
o.O than SPIFFS is less efficient the FAT32. QIO mode get 4 times more date per clock then SPI for SD card.
need to do some test at weeckend.
SD test where read and write in 1024 chunks.
Me No Dev
@me-no-dev
Nov 16 2015 19:27
in a perfect condition where you have freshly formatted SPIFFS and wrote one file just once to it, then SPIFFS should be at it's fastest, but I still got that speed
it will not be much slower than reading the file straight from flash because the file blocks will be one after another
Markus
@Links2004
Nov 16 2015 19:29
may the big flash Sector size kills the performance totally.
Me No Dev
@me-no-dev
Nov 16 2015 19:29
I don't think we can change that though
that is the smallest hardware sector
Markus
@Links2004
Nov 16 2015 19:30
if so then i port my flash write buffer manager from a other project.
That shut reduce the need for erase, significantly.
but it will cost 4k ram in this case.
Me No Dev
@me-no-dev
Nov 16 2015 19:31
it's expensive if you have other things running that need more memory
I dare to keep such amount allocated only for things that run by themselves
Markus
@Links2004
Nov 16 2015 19:32
yes when i make it, the optional to activate for faster write.
Me No Dev
@me-no-dev
Nov 16 2015 19:33
I was thinking that there needs to be a method to defrag/clean the SPIFFS
Markus
@Links2004
Nov 16 2015 19:34
I am not so deep inside of SPIFFS, no idea.
Me No Dev
@me-no-dev
Nov 16 2015 19:34
when you have written/deleted many times, the flash get's full of pages marked as deleted
and when you want to add a new larger file, for each sector you need, SPIFFS will defrag what it can from partially filled sectors to be able to delete some for the new data
that is made so there are the least possible erases
ut it really slows things down when you get to that point
Markus
@Links2004
Nov 16 2015 19:37
so trigger a defrag manually, when the program has nothing to do where nice.
Me No Dev
@me-no-dev
Nov 16 2015 19:37
yup
will make reading the files faster as well
don;t have to go all around the flash to find the chunks
frippe75
@frippe75
Nov 16 2015 21:40

Good evening! (my time)

I'm getting error avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x10
Trying to program an ATMega328p using the Arduino_Wifi_AVRISP.

alt

pastebin - full output

const uint8_t reset_pin = 16; // GPIO 16
ESP8266AVRISP avrprog(port, reset_pin);

The ATmega is a 16Mhz/5V running on a breadboard setup with optiboot. Using FTDI cable programs the normal Blink sketch fine. Between the ESP and the ATmega there is a Bi-Directional Logic Level shifter for 3V/5V pin... Common ground...

The breadboard setup has a resetbutton so I have tried manually to hold the reset-line low during programming since I believe thats related...
Another thing is... The ESP is only powered using FTDI so it might not be able to drive both the ESP and the programming as well... But it's stable... Uptime is ... about an hour.. woho

Maybe some sleep (for my self) would be the way to go...
Maybe another option is to setup some voltageReg 3.3V and 5V and remove the FTDI's. Not sure if they might interfere with programming....

frippe75
@frippe75
Nov 16 2015 21:54
...Posted this on http://www.esp8266.com as well... Figured it was more forum related perhaps.
Ivan Grokhotkov
@igrr
Nov 16 2015 23:51
@frippe75 regarding AVRSP you might want to ping @kzyapkov who is the author of this library