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:
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.
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???
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.