Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE REQUEST]ESP32 support #5

Open
luc-github opened this issue Jan 12, 2021 · 17 comments
Open

[FEATURE REQUEST]ESP32 support #5

luc-github opened this issue Jan 12, 2021 · 17 comments
Labels
enhancement New feature or request

Comments

@luc-github
Copy link

I know it may need some esp32 core update but any chance for ESP32 support ?

@d-a-v
Copy link
Owner

d-a-v commented Jan 12, 2021

There are little updates done in esp8266 arduino core to enable web hooks.
Unfortunately the PR is mixed with other internal changes.
Functionality main changes are:

I guess the hook call in ESP 32 arduino would have to happen there.

Do you think you could make a PR of it ?

@d-a-v d-a-v added the question Further information is requested label Jan 12, 2021
@luc-github
Copy link
Author

So if I implement each steps - in theory it should be ok ?
I give a try and report to you ^_^ thank you

@d-a-v
Copy link
Owner

d-a-v commented Jan 12, 2021

So if I implement each steps - in theory it should be ok ?

It will be OK, no reason against it.

I forgot to mention the return type in

bool WebServer::_parseRequest(WiFiClient& client)

that must be changed to ClientFuture.

@luc-github
Copy link
Author

ok noted - thank you 👍

@luc-github
Copy link
Author

luc-github commented Jan 15, 2021

@d-a-v I did first part luc-github/arduino-esp32@b523379
seems working - I have followed your instructions even I have no idea of what I am doing ^_^

Testing with HelloServer.ino

/ and I got hello from esp32! in browser=>ok
/dump and no answer in browser =>ok
/yes and got proper answer

File Not Found

URI: /yes
Method: GET
Arguments: 0

On serial

Connected to WIFI_OFFICE_A2G
IP address: 192.168.1.61
MDNS responder started
HTTP server started
A useless web hook has passed
A useless web hook has passed
The dumper web hook is on the run
(<32> chars)Host: 192.168.1.61
Connection: (<32> chars)keep-alive
Upgrade-Insecure-Req(<32> chars)uests: 1
User-Agent: Mozilla/5.(<32> chars)0 (Windows NT 10.0; Win64; x64) (<32> chars)AppleWebKit/537.36 (KHTML, like (<32> chars)Gecko) Chrome/87.0.4280.88 Safar(<32> chars)i/537.36
Accept: text/html,appl(<32> chars)ication/xhtml+xml,application/xm(<32> chars)l;q=0.9,image/avif,image/webp,im(<32> chars)age/apng,*/*;q=0.8,application/s(<32> chars)igned-exchange;v=b3;q=0.9
Accep(<32> chars)t-Encoding: gzip, deflate
Accep(<32> chars)t-Language: fr-FR,fr;q=0.9,en-US(<19> chars);q=0.8,en;q=0.7


Telling server to forget this connection

Now checking WebDav code but I have realized that FS of ESP32 is different from ESP8266 so cannot be drop as it is , as well as all call related to ESP8266WebServer - I will check that part first before pushing PR to ESP32 core

@d-a-v
Copy link
Owner

d-a-v commented Jan 15, 2021

The "hooked" way of using espwebdav imposes that the files on the filesystem are stored in /theHookedDirectory/.
I understand that it is currently a limitation.
Until this is improved, can you try to store files in the FS's directory /yes/ and check if you can see them in a webdav browser ?

@luc-github
Copy link
Author

luc-github commented Jan 15, 2021

Sorry you misunderstood my test
/ is to check root
/dump is the hook
/yes was to go to not found handler so it is working as expect

So it is ok with Helloserver.ino, I have clarified my report

@luc-github
Copy link
Author

hi here the POC luc-github@d949d6f

I have some refresh problem - but not sure how to address it

@luc-github
Copy link
Author

luc-github commented Jan 17, 2021

OK I have followed your advice and indeed debug was part of issue
the other part was the File system difference SPIFFS esp32 is different to SPIFFS

  • the file/dir detection - I use exists instead of open
  • the mkdir feature - it does not work

Helloserver.ino => Ok
Simple_esp32.ino =>Ok
Hooked_esp32.ino => WebDav Not working - under investigation

@d-a-v
Copy link
Owner

d-a-v commented Jan 17, 2021

the mkdir feature - it does not work

spiffs has no support for directories, but sdfs has. What FS did you try with ?
Does esp32/arduino have littlefs (it has support for directories too).

@luc-github
Copy link
Author

luc-github commented Jan 17, 2021

yes I know, I am trying with SPIFFS - ESP32 has SPIFFS/FAT /SD not yet LITTLEFS , it is planned in 2.0 but currently it can be used as external FS - I will try it later

I also suspect the pb with the hooked is also related with directory pb, a nice to have would be to separate the url from the real directory name
for example use http://192.168.1.61/dav but map the / of the FS or /www/dav of FS not /dav

@d-a-v d-a-v added enhancement New feature or request and removed question Further information is requested labels Jan 17, 2021
@d-a-v
Copy link
Owner

d-a-v commented Jan 17, 2021

The "hooked" way of using espwebdav imposes that the files on the filesystem are stored in /theHookedDirectory/.

for example use http://192.168.1.61/dav but map the / of the FS or /www/dav of FS not /dav

That is a fair request

@luc-github
Copy link
Author

luc-github commented Jan 18, 2021

still working on difference of FS
here as example the output between the 2 littleFS

ESP8266 Little FS

>>>>>>>> dir /
1.PNG                                      0MiB     76KiB 77569
1.md                                       0MiB      0KiB 6
[Z]
[dav]
    0.txt                                      0MiB      0KiB 0
    1.txt                                      0MiB      0KiB 0
    2.txt                                      0MiB      0KiB 0
    Capture.PNG                                0MiB     76KiB 77569
    espconf.ini                                0MiB      2KiB 2239
    readme.md                                  0MiB      0KiB 6
<<<<<<<< dir
interactive: F/ormat D/ir C/reateFile
Heap stats: free heap: 46536 - max block: 46296 - fragmentation: 1%
interactive: F/ormat D/ir C/reateFile
Heap stats: free heap: 46536 - max block: 46296 - fragmentation: 1%

ESP32 LittleFS

>>>>>>>> dir /
/readme.md                                 0MiB      0KiB 6
/test.file                                 0MiB      0KiB 0
[/dav]
    ///dav/New Text Document.txt               0MiB      0KiB 0
    ///dav/www.txt                             0MiB      0KiB 0
<<<<<<<< dir
interactive: F/ormat D/ir C/reateFile
Heap stats: free heap: 356360
interactive: F/ormat D/ir C/reateFile
Heap stats: free heap: 356360

ESP32 SPIFFS

>>>>>>>> dir /
/readme.md                                 0MiB      0KiB 6
<<<<<<<< dir
interactive: F/ormat D/ir C/reateFile
Heap stats: free heap: 356620
interactive: F/ormat D/ir C/reateFile
Heap stats: free heap: 356620

@luc-github
Copy link
Author

The simple_esp32.ino is ok
The hooked_esp32.ino is still failing
esp8266.log
esp32.log
Esp32 do not have HTTP_HEAD neither keepAlive connection - so I think I have added them but I may still miss one part to make the connection to succeed
here the esp32 webserver modified https://github.com/luc-github/arduino-esp32/commits/webserver-hook/libraries/WebServer

I do not know what is missing 😭

@agoy507
Copy link

agoy507 commented Mar 27, 2021

How wiring sdcard to esp32 ?
how configuration pin on sourcecode?
can you describe ?

@d-a-v
Copy link
Owner

d-a-v commented Mar 27, 2021

SD cards have mmc emulation. It's on the SPI bus.
You need one of the SPI buses (MISO, MOSI, CLK) and another unused GPIO for CS.

@agoy507
Copy link

agoy507 commented Mar 29, 2021

thanks :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants