Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
p1337
@p1337
is there a tutorial / how you can post file to the esp8266 ?
this is a part of the arduino Code:
void handleFileUpload(){
if(server.uri() != "/edit") return;
HTTPUpload& upload = server.upload();
if(upload.status == UPLOAD_FILE_START){
if(SD.exists((char )upload.filename.c_str())) SD.remove((char )upload.filename.c_str());
uploadFile = SD.open(upload.filename.c_str(), FILE_WRITE);
DBG_OUTPUT_PORT.print("Upload: START, filename: "); DBG_OUTPUT_PORT.println(upload.filename);
} else if(upload.status == UPLOAD_FILE_WRITE){
if(uploadFile) uploadFile.write(upload.buf, upload.currentSize);p
DBG_OUTPUT_PORT.print("Upload: WRITE, Bytes: "); DBG_OUTPUT_PORT.println(upload.currentSize);
} else if(upload.status == UPLOAD_FILE_END){
if(uploadFile) uploadFile.close();
DBG_OUTPUT_PORT.print("Upload: END, Size: "); DBG_OUTPUT_PORT.println(upload.totalSize);
}
}
Me No Dev
@me-no-dev
you post files to http://ip-of-esp/edit
there are some files in the SD Server sketch folder that usually go on the SD Card
they will give you interface to the file system andlet you edit/upload/download
p1337
@p1337
thanks for your answer, i´ve tried to post files - to /edit
<form enctype="multipart/form-data" action="/edit" method="POST">
<!-- MAX_FILE_SIZE muss vor dem Dateiupload Input Feld stehen -->
<input type="hidden" name="MAX_FILE_SIZE" value="30000" />
<!-- Der Name des Input Felds bestimmt den Namen im $_FILES Array -->
Diese Datei hochladen: <input name="upload" type="file" />
<input type="submit" value="Send File" />
</form>
but no files was created
Me No Dev
@me-no-dev
does anything come up inthe serial?
p1337
@p1337
i´ll check

seems to be okay : Upload: WRITE, Bytes: 2048
Upload: WRITE, Bytes: 2048
Upload: WRITE, Bytes: 1814
Upload: END, Size: 1144598

<meta http-equiv='refresh' content='0; URL=http://192.168.4.1/'>

this is the beginning : '>LmacRxBlk:1
LmacRxBlk:1
Upload: START, filename: image.jpeg
Upload: WRITE, Bytes: 2048
Upload: WRITE, Bytes: 2048
Me No Dev
@me-no-dev
yes it seems ok
p1337
@p1337
have i create the edit folder perhaps ?
Steve Nelson
@zenmanenergy
Is it necessary to have: while (WiFi.status() != WL_CONNECTED) {
delay(500); } after you do a WiFi.begin()?
it blocks other code from running while it is attempting to connect. I’ve tried writing a script without it, but never seems to connect without the delay(). i’ll see if I can consolodate the code so i can paste it.
Steve Nelson
@zenmanenergy
ooh! must have a been a bug in my code. when i rewrote it, it works. ha classic.
Lstt2005
@Lstt2005
Dear friends! Who may implement this libraries (Telegram bot)? - http://www.esp8266.com/viewtopic.php?f=29&t=5789 :smile: - the author this labrary is answer me - http://www.esp8266.com/viewtopic.php?f=24&t=4396&p=30488&hilit=telegram#p30488
But in this library author use SSL connection trouth PROXYSSL...
Steve Nelson
@zenmanenergy
here’s an example of wifi connect without using the delay() function. https://github.com/zenmanenergy/ESP8266-Arduino-Examples/tree/master/helloworld_wifiConnect_nonblocking
(answering my own question from this morning :-)
Victor Aprea
@vicatcu
hi, anybody home?
Steve Nelson
@zenmanenergy
I’m around, but probably not much help.
Victor Aprea
@vicatcu
@zenmanenergy hehe nice to meet you :)
i'll be back, switching back to ubuntu
Victor Aprea
@vicatcu
i'll leave gitter open, if anyone has insights into #855 would be much appreciated
Steve Nelson
@zenmanenergy
Do you have more than one esp you can test with? Does it do that with every device? I’m testing it on a nodemcu 1.0 right now… one sec.
Victor Aprea
@vicatcu
@zenmanenergy yea I'm going to go ahead right now with another one, but I don't know how the borked one got into that state
Steve Nelson
@zenmanenergy
I just uploaded it 5 times to my development board and it worked fine every time. one thing that’s different about esp boards versus arduinos is that to see the Serial output in the setup() function I always seem to have to reset the board after you upload it with the serial monitor open.
Victor Aprea
@vicatcu
and i'm hoping there's a way to recover it, i'm more worried about bricking more without knowing if it can come back
Steve Nelson
@zenmanenergy
another super minor thing… add a println to this:
Serial.print(F("Flash Chip Size By Id: "));
the text is showing up at the end of the garbage for me after i reset
Victor Aprea
@vicatcu
i was able to load software on it multiple times before i wasn't
the garbage you're seeing is almost certainly decode-able at 77600 baud
if you use PuTTY instead of Arduino Serial Monitor you can set arbitrary baud rates
crazy ass baud rate, but it is what it is
Martin Ayotte
@martinayotte
I see that you are using F macro, but the Serial.print() is not PROGMEM aware ...
Steve Nelson
@zenmanenergy
which board are you working with? I have struggled with a bunch of them, the power requirements usually cause the issues.
Martin are you suggesting he just get rid of the F() function in the print?
Victor Aprea
@vicatcu
@martinayotte if you're talking to me, it doesn't matter what I try and load anymore, it just goes reset crazy in flash load boot mode
Martin Ayotte
@martinayotte
Yes ! F macro can only be used with method like client.write_P() or server.send_P(), Serial doesn't have such method.
Steve Nelson
@zenmanenergy
sweet. that’s good to know.
Victor Aprea
@vicatcu
btw I just loaded code onto a different board and it's fine
Steve Nelson
@zenmanenergy
the board must have just gone bad.
Victor Aprea
@vicatcu
i don't think so honestly
i just don't understand well enough what's going on at the boot level to know what boot mode (3, 6) means
Victor Aprea
@vicatcu
is the ROM bootloader documented anywhere, like how to decode boot mode and reset cause?
Steve Nelson
@zenmanenergy
I’m not certain about that. martin may know. are you sure you have the right flash size?