Esp32_cam_demo does not seem to work

idf:
git clone --recursive https://github.com/husarnet/esp-idf ~/apps/husarnet-esp-idf
Tools:
xtensa-esp32-elf-linux64-1.22.0-73-ge28a011-5.2.0.tar.gz
demo:
git clone https://github.com/husarnet/esp32-cam-demo

I tried to compile the source code, but it does not seem to work, can you help, thank you

Hi,

could you try to run camera demo using Arduino core for ESP32 instead of esp-idf?

I haven’t used ESP32 camera by myself, but it looks like that demo from this repo should work fine https://github.com/BugerDread/esp32-mjpeg-ipcam .

The procedure to port probably most of ESP32 arduino project would be as follows (assuming no Arduino IDE installed and no additional libraries added):

1. Install Arduino IDE

2. Install Husarnet package for ESP32:

  • open File -> Preferences
  • in a field Additional Board Manager URLs add this link: https://files.husarion.com/arduino/beta/package_esp32_husarnet_index.json
  • open Tools -> Board: ... -> Boards Manager ...
  • Search for esp32-husarnet
  • Click Install button

3. Select ESP32 dev board:

  • open Tools -> Board
  • select AI Thinker ESP32-CAM under “ESP32 Arduino (Husarnet)” section

4. Port demo to Husarnet

  • add #include <Husarnet.h>
  • replace WiFiClient with HusarnetClient
  • replace WiFiServer with HusarnetServer
  • under the line, where you have WiFi connection in the code, add those lines:
/* Start Husarnet */
const char* hostName = "esp32cam";
const char* husarnetJoinCode = "fc94:b01d:1803:8dd8:b293:5c7d:7639:932a/xxxxxxxxxxxxxxxxxxxxx";
Husarnet.join(husarnetJoinCode, hostName);
Husarnet.start();

You will find your join code on app.husarnet.com after selecting network, clicking “add element” button and selecting “join code” tab.

Please let me know about results.

Dominik,

Thanks for all the work and what appears to be a potentially useful system.

I have been trying to setup the ESP32-cam for arduino IDE as you noted. It appears the Husarnet.h library is embedded somewhere in the board files. That was a bit confusing since I had no clear way to differentiate expressif and Husarnet board packages in the board manager (no Husarnet shown next to boards in version 1.8.12 IDE). I uninstalled the standard Esp32 boards to make sure of which I was choosing, but it is unclear to me the use case in the future where I may need to go back to expressif version.

When I compile WifiCam.ino from your esp32cam.h library, (https://github.com/DominikN/esp32cam) I get several errors. First a warning that I am not sure if critical : “#warning Use WiFi.h from WiFiWebServer”

Then a “Multiple libraries were found for “WiFi.h”” and error compiling for board (either wrover or ai thinker)

Then other possible errors depending on “WiFiWebServer.h” versions installed (directly from library manager). Most common is something is multiple lines resulting in something like “WifiCam:52:40: error: conversion from ‘WiFiClient’ to non-scalar type ‘HusarnetClient’ requested
HusarnetClient client = server.client();”

I updated and tried the compile again with 1.8.13 arduino IDE with same results.

Note I am also running from windows 10 64b.

If there is a more appropriate place to post these issues, please advise. I did not see an arduino IDE specific forum thread.

Thanks,
Jason

Well, I fumbled around long enough to find several of the culprits that were broken. After that, I did get it to run, but it is only reaching 1.8 frames per second or so for the video. It is kind of like watching a slow traffic cam. Some of the serial terminal notes also had very high latency times. It also stops running a lot (need to make sure I do not have a bad wire exaggerating that). I tried it from different ISP with decent service speeds at different locations with the same results here in St. Louis, MO.

These are the items I had to tweak to get it to compile and run…

  • My mistake installing WiFiWebServer straight from arduino library manager. Needed to follow the instructions in the git to use Dominik’s version for husarnet.
  • Within the husarnet esp32 boards…
  • found the “platform.txt” file and added “(husarnet)” next to title so it is clear in arduino which board series is correct
  • There was a compile error that esptool.exe was missing. This needs proper path or a move to esptool folder as is inherited from from post 1.0.2 esspressif board manager versions on windows installs (not sure if also an issue for linux or mac). I simply copied it into the correct folder.
  • In the example program, the port at “HusarnetServer server(80);” needed to be corrected to 8000 to correctly be able to log into the webpage.

Some additional notes of use…

  • There is still a warning about wifi.h having multiple installs and using the one within husarnet. Not sure if this is anything of importance.
  • The version number of the boards within the boards manager notes the current beta version of 1.1.0 as being installed as 1.0.5.

My goal is to control some basic robots as remote rovers. Lots of example programs have been made using the esp32-cam on local networks. Some use “esp_http_server.h” and others “soc/soc.h.” Can those be used through husarnet? If so, any documentation that might help me set it up?

Of course, I will not be able to get there from here with the low frame rate. What can I do to speed up the frame rate???

Thanks

Hi PrimalEng,

recently ESP32 camera example has been added to Husarnet documentation - https://docs.husarnet.com/docs/begin-esp32-platformio#simple-webcam . That example works together with Arduino framework and platformio.

Please take a look at this example and let me know whether your issues still exist there.

Cheers,
Dominik

Dominik,

Thanks for getting back to me.

I have moved on to using a different solution on my project. My robots are now much more capable with a raspberry pi tied into an online robot control through www.vigibot.com

I may still utilize Husarnet for some score keeping and robot battle arena task management. If I do, I will dig back in and let you know if my issues are now resolved.

Thanks again,
Jason