Skip to content
This repository has been archived by the owner on Feb 7, 2024. It is now read-only.

FileServer.h --> not showing right path to images #1

Open
dirkclemens opened this issue Sep 30, 2022 · 10 comments
Open

FileServer.h --> not showing right path to images #1

dirkclemens opened this issue Sep 30, 2022 · 10 comments

Comments

@dirkclemens
Copy link

dirkclemens commented Sep 30, 2022

Great library! Thanks !

I found one error in file: FileServer.h
line 60: html += F("</td><td><a href=\"/view");
should end with an / after view/
line 60: html += F("</td><td><a href=\"/view/");

and
line 63: html += filename.substring(0);
instead of filename.substring(1)

@Patriboom
Copy link

I don't use the same version as you. Do I ?
Around those lines, my FileServer.h file looks like:

		                    _server.sendContent(F(">"));
		                    _server.sendContent(F("<td>"));
		                    _server.sendContent(String(i++));
		                    _server.sendContent(F("</td><td><a href=\"/view"));
		                    _server.sendContent(filename);
		                    _server.sendContent(F("\" style=\"font-weight: bold;\" target=\"_blank\">"));
		                    _server.sendContent(filename.substring(1));
		                    _server.sendContent(F("</a></td><td>"));
		                    _server.sendContent(formatBytes(file.size()));
		                    _server.sendContent(F("</td><td>"));
		                    _server.sendContent(F("<a href=\"/delete"));
		                    _server.sendContent(filename);
		                    _server.sendContent(F("\" style=\"color: #600; font-weight: bold;\" >X</a>"));
		                    _server.sendContent(F("</td></tr>"));

I can find no « html += " expression.
About the misstyping you quote on line 60, your correction is useless for my code. The code I downloaded is like the one you pretend wrong but works good for me.

@ghmpi
Copy link

ghmpi commented Feb 1, 2023

Something that may be related..
I tried 1.0.13 and things were not happy with the new rotate code.. on Chrome browser the image would not display.

1.0.12 works fine. I did notice the change in the code for the "/view" vs "/view/" portion. Something changed and it's not happy, at least for me.

@Patriboom
Copy link

Patriboom commented Feb 1, 2023

Since he started the repository EloquentEsp32cam , I think the author doesn't work anymore on the actual one.
You may try my fork. If I can help or find the problem, I'll post on my fork (which is, for now, a copy of the original): https://github.com/Patriboom/EloquentSurveillance

@ghmpi
Copy link

ghmpi commented Feb 2, 2023

Is the original author not working on this anymore?

@Patriboom
Copy link

I'm not sure, but when I wrote him a personnal message he invited me to adopt the new library. I wrote him one month ago a message about some modifications I suggested for the FileServer.h file. And until then, my modifications are waiting (see « pull requests » ) .... so is my conclusion (from what He wrote me and from the long delay to accept the pull request).

@ghmpi
Copy link

ghmpi commented Feb 2, 2023

Thank you Patriboom for your comments.
I was looking for motion detection code for the ESP32 camera.. and came across this. Now I see the other libraries from the same author.. but it seems to be similar to this one with additions maybe? I have to look into them when I have time.

This library itself is not so big, so I can usually find and fix bugs myself, but it takes time. I would, obviously, rather everything work correctly.

It would be good to know that the original author has moved on to something else and is not maintaining this code, if this is indeed the case.

Thank you all!

@Patriboom
Copy link

Patriboom commented Feb 2, 2023

Hello Ghmpi,
I'm surprised to read that the code doesn't work. On my ESP32-cam mvt dectector works good. Do you use Windows / Mac / other or Liinux ?
Did you forget to change the camera name and other configurations?

  WRITE_PERI_REG(RTC_CNTL_BROWN_OUT_REG, 0); //disable brownout detector
  camera.aithinker();
  camera.sxga();
  camera.highQuality();
  mvt.setMinChanges(0.1);
  mvt.setMinPixelDiff(10);
  mvt.setMinSizeDiff(0.05);
  mvt.debounce(10000L);

camera.aithinker is essential.

With ESP32-cam, you have to include the libraries

#include "soc/soc.h"             // disable brownout problems
#include "soc/rtc_cntl_reg.h"    // disable brownout problems

even if you're using EloquentSurveillance

mine also includes
#include "driver/rtc_io.h"

So, shortly, my first lines are:

#include <FS.h>
#include <SD_MMC.h>
#include "soc/soc.h"             // disable brownout problems
#include "soc/rtc_cntl_reg.h"    // disable brownout problems
#include "driver/rtc_io.h"

And the first lines of the setup() are:

void setup() {
  Serial.begin(115200);
  delay(3000);

  rtc_gpio_hold_dis(GPIO_NUM_4);    // Libérer la broche 4 de toute emprise
  ledcSetup(7, 5000, 8);            // Utiliser le canal 7 pour contrôler la DEL (flash) connectée au GPIO 4
  ledcAttachPin(4, 7);

  //Définitions utiles à la caractérisation de la caméra et de sa sensibilité aux changements
  WRITE_PERI_REG(RTC_CNTL_BROWN_OUT_REG, 0); //disable brownout detector
  camera.aithinker();
  camera.sxga();
  camera.highQuality();
  mvt.setMinChanges(0.1);
  mvt.setMinPixelDiff(10);
  mvt.setMinSizeDiff(0.05);
  mvt.debounce(10000L);

I have to say that I modified the code, so it's not so sure that the original did work at once. I merged the mvt detector and FTP file server. My code reads also config from microSD and write pictures on the same card.
An other version of my modified code (of mvt dectector) sends email on every detection.

@ghmpi
Copy link

ghmpi commented Feb 3, 2023

I tried your suggestions by including the two brownout include files, and the brownout disable line.. still the same thing. I don't believe the device is browning out.

I tried windows 7, and windows 10, Chrome brower on each, plus an android device. Also tried an old version of Internet Explorer and a new version of edge. The newest 1.0.13 rotate code just does not seem to work.

Also, in the main http page where the device lists the jpegs, I get "apture.jpg" instead of "capture.jpg"... this was also reported by someone else as a bug.

I can't put more time into this right now.. this project was just for fun. I'll do some more research in the future, maybe I'll look at your fork or revisit this again as well.

Thank you for your time.

Regards,
-Moses

@Patriboom
Copy link

Sometime, it is as simple as too long delay for browser. Just refresh your page and the image may show up.

@Patriboom
Copy link

Did you find an answer ?
Finally, on a forth aithinker ESP32cam, I encounter the same problem as you and can not solve it.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants