Welcome new user! You can search existing questions and answers without registering, but please register to post new questions and receive answers.
Welcome to JeVois Tech Zone, where you can ask questions and receive answers from other members of the community.

Unable to cross-compile for Jevois hardware or install new modules to micro SD

0 votes
Hi,

I am just trying to run the Hello Jevois demo in Ubuntu 16.04. Everything works fine on the host. However when I tried to compile in the platform, nothing works really.

I typed this:

cd ~/hellojevois/pbuild
make && make install

And I got the following error:

lease set environment variable JEVOIS_SRC_ROOT to the directory in which jevois and jevoisbase sources are. Skipping module doc creation because of missing JEVOIS_SRC_ROOT
[ 33%] Built target modinfo_HelloJeVois
[100%] Built target HelloJeVois
Install the project...
-- Install configuration: ""
modules
share
-- Up-to-date: /media/xiaotian/JEVOIS/modules/Tutorial/HelloJeVois
CMake Error at cmake_install.cmake:48 (file):
  file INSTALL cannot set permissions on
  "/media/xiaotian/JEVOIS/modules/Tutorial/HelloJeVois"

Makefile:104: recipe for target 'install' failed
make: *** [install] Error 1

Then I have tried all three ways of installing the modified module to micro SD but they all failed. I followed the procedure showing http://jevois.org/tutorials/ProgrammerHello.html. For example with the .jvpkg package way, there was no 28.5fps frame rate available, I had only 30/1, 15/1,15/2. Choosing 30/1 in guvcview will play the jevois-tutorial video first but with no colored text message will be added. I have also checked the bullet points mentioned below, all of them were as expected. Similar things happened for the other two methods. Do you have any idea where the possible problem is? Many thanks!

XT
asked Mar 21 in Programmer Questions by yoann747 (250 points)

1 Answer

0 votes
 
Best answer
The error you are getting is related to permission, maybe try "sudo make install" instead of "make install"? Are you the owner of the desktop (i.e., did you login and start X under the same username as you are running make install? Usually the owner of the desktop should have full permission to mounted SD cards but somehow this does not seem to be the case here).

Then check that all the files were indeed written: "ls -l /media/xiaotian/JEVOIS/modules/Tutorial/HelloJeVois/" and check the dates and times.

Finally, reboot JeVois and then check whether the new mapping was added to JEVOIS:/config/videomappings.cfg -- if not, maybe add it by hand for now and check whether after another reboot it now becomes available in guvcview.
answered Mar 21 by JeVois (32,640 points)
selected Mar 26 by yoann747
Hi again,

Thanks for the reply. The installation problem has been fixed by using "sudo make install".

However I still cannot figure out the cross-compling issue. Using the "microSD" method as an example, after typing the command "./rebuild-platform.sh --microsd", all the files (so file, postinstall file and two png files) were written into "/media/xiaotian/JEVOIS/modules/Tutorial". And the time and date are also correct. After that I reboot the Jevois but there was still no new mapping added. So I manually add the mapping to JEVOIS:/config/videomappings.cfg and restart Jevois. But again there is no new mapping available in Guvcview. Then I check the files in "/media/xiaotian/JEVOIS1/modules/Tutorial/HelloJevois", finding that the postinstall file is gone, which should be correct?

Apart from that I also had these findings:

(1) When checking the files in the "/media/xiaotian/JEVOIS/modules/Tutorial", I can actually see 4 folders: Boot, JeVois, Jevois1 and Linux. The files are copied into the Jevois folder. All the other 3 folders except Jevois have a pattern indicating they are USB drive. For me it makes sense. Just to test I also copy all the files to Jevois1 folder and reboot again, but still no new mappings available

(2) Since the new mapping is not added automatically to videomappings.cfg after reboot. I add it to the by hand. Just to test I delete many mappings here because somewhere in the document saying too many mappings could be the reason of not displaying new mapping. Then I start Jevois again, the mappings deleted cannot be seen in the Guvcview but the added module is still not available. I even change the frame rate of the new mapping but it still does not work.

To sum up, everything seems to work fine (the jvpkg method also seems to be working) but I just cannot see the new mapping in the Guvcview. Do you have any idea? Thanks again, XT
hum, maybe there is a syntax error in your mapping wirtten in your postinstall file? It is normal for postinstall to disappear: on reboot, we check for any postinstall files, then execute them, then delete them (so we will not add those mappings again on the next reboot).

Can you post your postinstall file?

Also note that if there are duplicate output formats, we resolve them by changing the frame rate. So, if you have two mappings with YUYV 320x240@60 output, you will end up with one at 60fps and another modified to 59fps.

maybe your issue is that you already have another mapping with the exact same output resolution and fps?

maybe this can be useful to check: http://jevois.org/doc/VideoMapping.html

and in particular:

To avoid having your JeVois smart camera just hang because of parsing errors, for example in case of malformed or duplicate video mappings in the videomappings.cfg file, the following policy has been adopted:

if a mapping is malformed (missing fields, wrong fields, etc), it will be skipped.

if there is no mapping with USB output in the file, one will be added, YUYV 640x480 @ 30fps PassThrough.

if there is no default mapping (marked with a * at the end), the first mapping with USB output will be selected as default.

if two mappings have identical USB output pixel format, resoltion, and frame rate, the second one will be slowed down by 1 fps (and so on if more than two conflicts).
Hi ,

Now I am able to see the 28.5fps frame rate in the guvcview. Thanks for reminding me to check the postinstall file. The problem is somehow the text in postinstall file does not match the text in the videomappings file. After I manually changed them, the problem is solved.

However another another problem pops up. When I choose 28.5 fps in the Guvcview, the following error is shown:

caught std:exception FTL DynamicloaderImpl::DynamicLoader: Error open shared library jevois/module/Tutorial/HelloJevois2.so libjevois.so.1.7.2 cannot open shared object file: No such file or directory

I have googled a lot and tried many methods. For example
http://jevois.org/qa/index.php?qa=99&qa_1=rebuild-platform-fails-with-error-loading-shared-lib-libisl
https://stackoverflow.com/questions/480764/linux-error-while-loading-shared-libraries-cannot-open-shared-object-file-no-s
https://lonesysadmin.net/2013/02/22/error-while-loading-shared-libraries-cannot-open-shared-object-file/


But none of them work in my case. There is simply no /usr/local/lib root. I have tried this to include the folders that have "HelloJevois2.so" and "libjevois.so.1.7.2" under "/etc/ld.so.conf", which I did but the error is still existing.

cat /etc/ld.so.conf
sudo sh -c "echo '/jevois/modules/Tutorial/HelloJeVois2' >> /etc/ld.so.conf"
sudo sh -c "echo '/home/xiaotian/jevois/pbuild' >> /etc/ld.so.conf"
echo "/usr/local/lib" >> /etc/ld.so.conf
sudo ldconfig


 Could you give me a hint on it? Thanks and nice weekand :)
Hum, this looks a bit confusing to me. Can you please clarify:

- where do you see the exception message, is it in a serial terminal connected to jevois? or maybe in the video that guvcview displays?

- where did you do the ldconfig, is it on your host computer?

Maybe check out this one: http://jevois.org/doc/Concepts.html in the section "Host and platform modes"

In particular, all the code in pbuild/ is cross-compiled for ARM and is meant to be copied to microSD and to run on the CPU inside JeVois, so adding that directory to your host ldconfig will just confuse your host because the .so files inside are for ARM and not for Intel (assuming you have an Intel host).

I think maybe the problem is that you compiled your module for 1.7.2, but you have an older version of the JeVois core installed on your microSD card. So you should get 1.7.2 for everything. You can do that by rebuilding jevois, then rebuilding jevoisbase, then flashing a new microSD card.

For that, try to follow the steps under "Compiling JeVois, JeVoisBase, samplemodule" at http://jevois.org/tutorials/ProgrammerSetup.html

Or, you can try to download and flash 1.7.2 to microSD first from http://jevois.org/start and then install your module on that microSD.
Hi!

I think you are correct, I downloaded and flashed the microSD quite a long time ago and I downloaded the Ubuntu packages recently. I guess this is the reason why such error occurred. The error message was shown in the guvcview. I did everything again from the start and now it works!  Thanks!
...