-
Notifications
You must be signed in to change notification settings - Fork 75
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
Final link can not find sysconf #2
Comments
Thanks. |
@joachimBurket I'm using ESP-IDF which is the official version of v4.2. The precompiled OpenCV library included in the project was used. This is the log of the error. [1/5] Performing build step for 'bootloader' |
I have the same problem...trying to perform idf.py build on a windows 10 system...followed the instructions for installing the toolchain but the build fails with exactly the same error related to 'sysconf'. |
I've tried a few things since my last post: 1.) tried building the ttgo_demo project on Ubuntu 20.04 - WORKED! Went back and looked at the README.rst notes and see that they're written as if being performed on a linux-type system. So, I'm now thinking that in order to get this to work on a Windows 10 system, it has to be built from bottom up, can't use the copy of opencv directory that's pre-built and that's why the original issue creator and myself are finding we can't get the ttgo_demo to build. So, I'm going to go back to the README.rst and see if I can make sense of the full-build details and go from there; otherwise at this point I would say it's a no-go on Windows 10 and there needs to be a caveat included to that effect - of course, the caveat should be included anyway because the project won't build with the pre-compiled opencv lib. |
So, after much fiddling around getting the build to even start, I encountered the following error building on windows: |
Hi there, This project was made during my studies, and I am unfortunately no longer working in this field. I would be happy that this project lives, but as I don't use it anymore, I won't spend much time on it. Feel free to fork it if you want to make it evolve! :) That said, I can at least try to help you make it compile ;)
As you're saying, you'll probably need to build it to make it work on Windows. @rqbh @aseitasi15 were you also trying to build it on Windows? To build the library, you need to make the operations done in the build script. Globally, it makes this:
About the error you have, try to remove the whole
As a workaround if you don't succeed to compile on Windows, you can try to use Windows WSL (if you can change a bit you're development environment). It works pretty well with vscode. |
Could be that you're not launching the script from the good directory. If I recall correctly, I think you must launch it from the root of the repo, so:
|
joachimBurket thanks for the reply. This has been a frustrating effort, especially on my Windows 10 machine. I have make some progress, but had to do a number of things to get where I am, which I think is SUCCESS - but I'll wait until I actually use the library I've created in a test app. But, here's what I discovered and what I did to fix: I'm afraid I can't translate my changes over to the MAC environment for the previous poster with the sysconf issue (which is what I had early on). Perhaps the -DESP32=ON option isn't being set? That error happened in the parallel.cpp module, so maybe the quick and dirty fix is to do what I did and add the #define ESP32 1 at the top of the file and be done with it! |
Seems like I didn't succeed afterall. Although I was able to get through the build, the link portion still failed with undefined reference to sysconf. I went back and tried again in vscode, but ran into errors compiling the imgwarp.cpp module. I'm giving up on trying to build this on windows; it's broken and I can't fix it and it just isn't worth the time and energy to fix. I've struggled with this for several days. I've built on WSL2 in win10 and seems to work, but still getting sysconf linker issue. I'm now moving over to using ubuntu inside a VBOX on win10 and will see what happens, but I'm not too optimistic. If this doesn't work, I give up. I've even tried building the examples, just as they exist in your distro and they won't build either, so something's broken and I can't fix it. I have built the hello_opencv example, though, successfully so there's something about the TTGO-DEMO that creates problems building on win10. Nice effort, though. |
I quit! Anyone who has the time, energy and knowledge to make this repository build on Windows, hats off to you! I do believe that esp-idf has changed over the last 4 years and obviously this repository hasn't. It can be built on Ubuntu and it also can be built on Windows 10/WSL 2, but since USB devices are not visible to WSL, you can't flash from WSL, you've got to take the generated partition, bootloader and app bin files over to native WIN10 in order to use esptool.py to flash to the board. Even after having done so, I see a lot of messages on the serial monitor about i2c and sda and scl assigned to the same pins...don't know what those are about or if they're just "noise" which can be ignored. I never did get the ttgo_demo app to produce the output shown on the esp32-opencv repository, I just get a white screen. So, I'll go over to my rPi, install opencv-python and get back to work on my original project. |
@johncblacker sorry to hear that. It is indeed possible that esp-idf has changes that requires new modifications on OpenCV files. As said, the project is at least working on Linux using esp-idf v4.2-dev released last year (should also be working on v4.2.1). Regarding MAC, were you able to start the compilation @aseitasi15 ? |
@joachimBurket Sorry for late reply. As you said, I was able to rebuild the OpenCV library in my environment and tried to build ttgo_demo with these, but the same problem occurred. The hello_opencv example works seamlessly. The ttgo_demo has a problem. There is no problem with the source code, and the OpenCV library has been rebuilt on my Mac, so all library dependencies should have been resolved as well. It was tested in version 4.3 of ESP-IDF and the version 4.1 is the same. Is there anything else I can do about it? |
I have encountered a similar error issue the first time I used the Canny function (you can see it here. I had in mind making a docker container to do the build, which could help avoiding these errors (could also help with @johncblacker building issues on Windows). I'll update you if I succeed on doing it |
// esp32 doesn't support sysconf call. FIXME: add support Following your direction, I handled the sysconf part from the parallel.cpp and then build it up again. |
Hard to say like this, could you send the whole compilation output? |
|
@aseitasi15 could you also send the ttgo-demo project compilation logs ? |
|
@aseitasi15 @johncblacker I've tested to build OpenCV and the ttgo_demo project using Espressif idf docker image, and it is working out of the box! What I've done:
|
Tried the the docker approach...ran into a problem with the docker run... to build esp32-opencv. I was building in a powershell command shell on windows 10 and it gave me a "Variable reference is not valid : was not followed by a valid variable name character. Perhaps I'm missing some setup work required prior to issuing the docker run? Any ideas? I'll research on my own for now. |
Looks like PWD needs to have curly brackets around it: ${PWD}: |
So, there is no "ade" sub-directory in ./3rdparty perhaps I needed to download the repository again? |
Sorry about the formatting of my previous comment. |
I am ecstatic to say: IT WORKED! A few hitches along the way which were my problems as I'm not a docker guru and I also made a mistake by opening the build_opencv_for_esp32 in windows notepad, which screwed up line endings and then when I went to run it bash didn't like it. Also, since I had uninstalled the esp-idf toolchain so I had to flash using esptool; but it did work. So, now I have another platform on which to experiment with opencv - currently working on my rPi 3b+ also and have a "speed camera" setup pointing at the street outside my home...too many automobiles going over the speed limit! |
@johncblacker Yeah! Nice to hear! Very glad this project can be used :) |
@aseitasi15 not sure I understand, but if you build into the container, the python version used should be the good one (the one espressif configured in the container's image). |
I looked at my output from the build and I don't see that it built the python bindings (I think this means it doesn't build the equivalent of "opencv-python"), but I could be wrong about that. In fact searching the output of the make for opencv there is no string "python" in the output at all. It's simply building opencv for use with c/c++ - I think. Python 3.6.9 is the default python in the docker container (python -V = Python 3.6.9). Python 2.7 would have to be in the espresif-idf repository. If you look in /opt/esp/python_env you'll see idf4.4_py3.6_env, no mention of python 2.7. So, my conclusion is: don't worry about python 2.7 you should be running python version 3 and should be good to go with that. But, again, this build doesn't include python, so you'd have to modify the build in order to write your scripts in python - I think. |
As I thought back on the whole idea of using docker it now makes sense why the build works - it's building inside a Ubuntu 18.04.5 system and that has worked for me before; it was the windows "native" build that didn't/doesn't work. But, hey, I'm good with it. In fact there really was no mention of being able to use ESP32-OPENCV in Python...I am curious, though, it the build would work with python build enabled in the cmake config. |
I followed the instructions to build opencv as noted above which is to use the shell script for that. I did use idf.py build to build the ttgo_demo app. But, remember, that app is not a python app, it is c++/c code. If you're looking to write python code on the ESP32, using perhaps micropython, then the esp32-opencv repository would have to be built with python support; and you'd have to get it over to micropython (something like a pip install or perhaps a setup...). I did try, once, to do a pip install opencv-python a couple of months ago and it fails because there just isn't enough memory to install it. The other approach, if you're building a web app is to use the opencv javascript bindings and you wouldn't have to load the opencv.js onto the esp32, but it'd be on the client/web browser machine either locally or you could link to it in the html code. |
Hello, I'm getting this error:
when clicking yes here. Anyone knows how could I solve it? |
There is a fix in idf about the sysconf. espressif/esp-idf#6119. add_prebuilt_library(opencv_imgcodecs "opencv/libopencv_imgcodecs.a" PRIV_REQUIRES newlib) |
Good work, but at final link stage, here is an error, can not find sysconf,
platorm win10, idf 3.3/4.3, ttgo example
The text was updated successfully, but these errors were encountered: