So I have been quite busy getting the updating function to work. When I previously thought I was 50% complete, that was more like 10%.
I'm hoping Mikael can help me with this one:
Code: Select all
gcc -Wall -c -fopenmp -fPIC -D__NEON__ -mcpu=cortex-a7 -mfpu=neon -O3 test.c
gcc -Wall -c -fopenmp -fPIC -D__NEON__ -mcpu=cortex-a7 -mfpu=neon -O3 images.c
gcc -o test test.o images.o thnets.so -L./OpenBLAS-stripped -lopenblas -lm -lpng -ljpeg
g++ -O3 -Wall -c -fopenmp -fPIC -I../thnets -I/usr/include/freetype2 teradeep_opencv.cpp
teradeep_opencv.cpp: In function âint main(int, char**)â:
teradeep_opencv.cpp:230:9: warning: variable âfpsâ set but not used [-Wunused-but-set-variable]
float fps = 1;
^
teradeep_opencv.cpp:145:14: warning: unused variable âwinnameâ [-Wunused-variable]
const char *winname = "thnets opencv demo";
^
teradeep_opencv.cpp: At global scope:
teradeep_opencv.cpp:29:39: warning: âwin_widthâ defined but not used [-Wunused-variable]
static int frame_width, frame_height, win_width, win_height;
^
teradeep_opencv.cpp:29:50: warning: âwin_heightâ defined but not used [-Wunused-variable]
static int frame_width, frame_height, win_width, win_height;
^
teradeep_opencv.cpp:105:12: warning: âint text(cv::Mat*, int, int, const char*, int, int)â defined but not used [-Wunused-function]
static int text(Mat *frame, int x, int y, const char *text, int size, int color)
^
g++ -o teradeep_opencv teradeep_opencv.o -L/usr/local/lib -lopenblas -lm -lpthread -lfreetype -lopencv_highgui -lopencv_core -lopencv_imgproc -lGL -L/usr/local/lib -lthnets
/usr/bin/ld: cannot find -lGL
collect2: error: ld returned 1 exit status
Makefile:23: recipe for target 'teradeep_opencv' failed
make: *** [teradeep_opencv] Error 1
What I've done is have the updating function do the following:
created an update number variable in the config file.
do a git pull
compare the current update number to the new number located in the freshly synced aftersight.cfg in /home/pi/After-Sight-Model-1
If the update has a newer number (and this is key. If you make an update, you must update aftersight.cfg and increment the update number) then it executes the following scripts:
installdeps.sh - install dependencies that it can, and then hold them so they don't get replaced with newer libraries. If something works, then we keep it. If we need to change it, the last step of updating is running a script that runs only once for that update. We can do it there. This is working well.
a-update_core.sh - update the core files (mostly python scripts, but also a few other files, all of which are in /home/pi), this includes the main menu system, facial detection, rangefinder code. This is working well.
a-update_voice.sh - update raspivoice (I had trouble with this on the rpi 3 because old dependencies have been updated. I had to do a lot of by hand installing/uninstalling/reinstalling libraries to get to the point where I can compile raspivoice reliably) older versions of the hardware should be fine because they should already have all the needed libraries installed. This works well now.
a-update_teradeep.sh - update teradeep - This is where the trouble got over my head. At the current time, I am highly tempted to comment this out from the updates until I have more time to delve into the problems. I embedded the error message above. I will admit it: cpp scares the living daylights out of me.
a-update_facedetect.sh - update facial detection directory. This is for if I advance from the 15 year old cascade method to something more modern.
one-time scripts function - not implemented yet. I am planning on making a folder for each update version that requires it. This will execute shell scripts once, and then never again. This would be for things like adding new features where you need to do something like create a folder structure and store new files. Or, possibly something like forcing the download of a new model file for teradeep. I am going to try my damnedest to get this working ASAP. As this is a nice way of making the device adaptable in the future.
So my proximal goals are to have everything but the teradeep update working. I can later fix the teradeep update problem with a custom one time executed script. This will give me something that we can test on the older devices, to try to keep them in sync as well.
As far as I know there is no reason why the rpi2 and rpi3 are not going to work well together from the software update perspective. Of course we will have to add some conditional code to determine if the device is one version or the other for some functions, but for the most part it should be fine.
Eventually, I hope everyone with an older device will get a newer one and we can leave the rpi2 in the past. Everything has an end of life.
I am expecting to have the above goals completed before midnight tomorrow. (A guy can hope anyways).