mikey11
Posts: 351
Joined: Tue Jun 25, 2013 6:18 am
Location: canada
Contact: Website

Re: Sight for the Blind for <100$

Fri Apr 01, 2016 2:08 am

I have discovered an error in the update mechanism.

there is a script in /home/pi that you will need to edit or replace. unfortunately, I can't fix this any other way (ie. you can't run the updater to fix it).

it is the script a-update.sh

It currently reads:

Code: Select all

#!/bin/sh
cd /home/pi/After-Sight-Model-1
git pull
chmod +x *.sh
echo "Now run: a-update_core.sh, a-update_voice.sh or a-update_teradeep.sh from the /home/pi/After-Sight-Model-1 directory"
The git pull command is the problem. When making certain kinds of changes, the git pull command will cause an exit without downloading new info. This is rather unfortunate, because the latest update number is 12 and includes the contrast change. If you are only hearing about version 11 it's because of this bug.

I'm researching the solution to the problem, but I can't test this as easily as you can, because I did a hack that fixed the bug temporarily. It would come back for me too. I'm going to get a solution in the next few minutes.

I will post a redo of /home/pi/a-update.sh

It will very likely change the git pull command to a few individual commands that will force the git servers version to force past the error and be installed correctly.

stay tuned.

This should be the last hurdle on the updaters issues (I hope).

mikey11
Posts: 351
Joined: Tue Jun 25, 2013 6:18 am
Location: canada
Contact: Website

Re: Sight for the Blind for <100$

Fri Apr 01, 2016 2:12 am

And here is the solution.

replace the contents of /home/pi/a-update.sh with the following:

Code: Select all

#!/bin/sh
cd /home/pi/After-Sight-Model-1
git fetch --all
git reset --hard origin/master
chmod +x *.sh
echo "Now run: a-update_core.sh, a-update_voice.sh or a-update_teradeep.sh from the /home/pi/After-Sight-Model-1 directory"
The two new commands fix the problem that cropped up using git pull. basically, some cases of files differing on the device stopped a download of new files.

the new commands force a download regardless of the files on the device.

Sorry to put people through this, but...

So I will fix both my image files for the rpi v2 and the rpi v3 and repost links here ASAP.

probably will have the new image up tomorrow.

however, it would still be very nice of you to confirm this for me Pranav.

mikey11
Posts: 351
Joined: Tue Jun 25, 2013 6:18 am
Location: canada
Contact: Website

Re: Sight for the Blind for <100$

Fri Apr 01, 2016 2:13 am

be sure to make sure that a-update.sh is executable!

a quick

sudo chmod +x a-update.sh

will do the trick.

PranavLal
Posts: 118
Joined: Fri Jun 28, 2013 4:49 pm

Re: Sight for the Blind for <100$

Fri Apr 01, 2016 3:08 am

Hi Mike,

I modified the a-update.sh script as you suggested and reran the update. I am on update 12. The update has worked successfully at least for raspiVoice because I am able to run it without problems.

Pranav

mikey11
Posts: 351
Joined: Tue Jun 25, 2013 6:18 am
Location: canada
Contact: Website

Re: Sight for the Blind for <100$

Fri Apr 01, 2016 3:24 am

Thanks for testing. I am syncing a new image, with all good luck, the last.

User avatar
seeingwithsound
Posts: 164
Joined: Sun Aug 28, 2011 6:07 am
Contact: Website

Re: Sight for the Blind for <100$

Fri Apr 01, 2016 6:10 am

mikey11 wrote:I have integrated the contrast code, and it is much nicer. I have noticed though that when contrast is set to 0 that I get nothing. I had added the zero setting to the cycling in the menu so that it was 0,1,2,3

at the next opportunity, dropping the 0 seems like a plan.
Thanks, glad that it worked out! By "nothing" I suppose you mean that you get no contrast enhancement with contrast set to 0, not that you get no sound? It does the same as contrast 1 and brightness 0 in the old code, and is meant as a setting for turning off contrast enhancement altogether. Indeed I do not expect people to use it often, but if someday an input device other than a regular camera is used (or when loading an image file) then it is quite possible that the view is already high contrast. I personally consider it a matter of user interface consistency to be able to turn off any image enhancements, but that is just my opinion. There is indeed a trade-off with the number of values that users need to cycle through.

Peter


Seeing with Sound - The vOICe
http://www.seeingwithsound.com

User avatar
seeingwithsound
Posts: 164
Joined: Sun Aug 28, 2011 6:07 am
Contact: Website

Re: Sight for the Blind for <100$

Fri Apr 01, 2016 6:07 pm

mikey11 wrote:And here is the solution.

replace the contents of /home/pi/a-update.sh with the following:

Code: Select all

#!/bin/sh
cd /home/pi/After-Sight-Model-1
git fetch --all
git reset --hard origin/master
chmod +x *.sh
echo "Now run: a-update_core.sh, a-update_voice.sh or a-update_teradeep.sh from the /home/pi/After-Sight-Model-1 directory"
Hi Mike,

I manually updated a-update.sh according to the code provided by you, made sure that it was executable, and applied "Update software". The device spoke that it applied update 12 (and when repeated later stated that no changes were required for update 12). So it looks like update 12 was applied, yet raspivoice/RaspiVoice.cpp still contained the old contrast code, so I suppose you meant here only the command line change for contrast that you talked of and not yet my proposed changes?

Peter

mr_indoj
Posts: 42
Joined: Wed Jul 01, 2015 9:28 am

Re: Sight for the Blind for <100$

Fri Apr 01, 2016 6:47 pm

Hi
It looks like the updated raspivoice.cpp didn't make its way into the git repo.
/Mikael

User avatar
seeingwithsound
Posts: 164
Joined: Sun Aug 28, 2011 6:07 am
Contact: Website

Re: Sight for the Blind for <100$

Fri Apr 01, 2016 7:18 pm

Hi Mikael,
mr_indoj wrote:It looks like the updated raspivoice.cpp didn't make its way into the git repo.
Indeed, I found no changes on github either. I now created a pull request at https://github.com/aftersight/After-Sight-Model-1 for the contrast changes as proposed on this forum yesterday. I have not worked with github before, so I hope this pans out as intended. I found it confusing that there is a raspivoice_standalone and a raspivoice folder in the After-Sight-Model-1 repository, because it looks like a lot of code duplication that makes it harder to maintain. And then there is also the separate github raspivoice repository by Ar-es.

Peter

mikey11
Posts: 351
Joined: Tue Jun 25, 2013 6:18 am
Location: canada
Contact: Website

Re: Sight for the Blind for <100$

Fri Apr 01, 2016 8:02 pm

That's frustrating.

I was sure I submitted it. Erg. Will redo again tonight, and make it update 13

mr_indoj
Posts: 42
Joined: Wed Jul 01, 2015 9:28 am

Re: Sight for the Blind for <100$

Fri Apr 01, 2016 8:06 pm

Thanks, yes that's a bit confusing, i created the standalone copy to preserve the old camera code, so its not used currently, just the raspivoice one is used.

/Mikael

User avatar
seeingwithsound
Posts: 164
Joined: Sun Aug 28, 2011 6:07 am
Contact: Website

Re: Sight for the Blind for <100$

Fri Apr 01, 2016 8:22 pm

mr_indoj wrote:Thanks, yes that's a bit confusing, i created the standalone copy to preserve the old camera code, so its not used currently, just the raspivoice one is used.
OK thanks, my today's pull request included both folders just in case, but I'll then only address the raspivoice folder in the future. Anyway, looking forward to seeing the contrast update incorporated one way or the other.

Peter

mikey11
Posts: 351
Joined: Tue Jun 25, 2013 6:18 am
Location: canada
Contact: Website

Re: Sight for the Blind for <100$

Fri Apr 01, 2016 8:24 pm

My apologies gentlemen,

It's been a string of rookie mistakes on my part. So, when making an update. Change what you are going to change.

create /updatecontrol/updateXX/update.sh

The folder with the next number up must exist (in the most recent case, 13), AND a script named update.sh must exist in that folder. The script doesnt need to do anything, other than not hang the system. ie. what I do right now is make the script create a folder and then exit.

then modify aftersight.cfg and increment the configupdatenumber value to the next number up.

I have done this successfully now, the contrast change had better work for the rest of you, or I will smash one of my fingers with a hammer and take a week off :x

User avatar
seeingwithsound
Posts: 164
Joined: Sun Aug 28, 2011 6:07 am
Contact: Website

Re: Sight for the Blind for <100$

Fri Apr 01, 2016 8:53 pm

Thanks Mike, that worked like a charm, and I can see the updated contrast code in RaspiVoice.cpp. It only looks like you forgot to update Options.cpp with "opt.contrast = 2.0;" and "--contrast=[2.0]\t\t\tContrast enhancement factor >= 1.0" (given your choice of not supporting complete disabling of contrast enhancement, or else it is better to look at my today's pull request for the changes in KeyboardInput.cpp and Options.cpp at https://github.com/aftersight/After-Sight-Model-1/pulls).

Peter

PranavLal
Posts: 118
Joined: Fri Jun 28, 2013 4:49 pm

Re: Sight for the Blind for <100$

Fri Apr 01, 2016 11:57 pm

Hi all,

I have updated to update 13 without errors. I have set the advanced contrast to 3. Things are indeed much clearer.

I am going to be taking the unit to a national monument today afternoon and hope to be able to see its architecture assuming the security people allow me in with all my equipment.
Pranav

mikey11
Posts: 351
Joined: Tue Jun 25, 2013 6:18 am
Location: canada
Contact: Website

Re: Sight for the Blind for <100$

Sat Apr 02, 2016 12:25 am

It only looks like you forgot to update Options.cpp with "opt.contrast = 2.0;" and "--contrast=[2.0]\t\t\tContrast enhancement factor >= 1.0" (given your choice of not supporting complete disabling of contrast enhancement, or else it is better to look at my today's pull request for the changes in KeyboardInput.cpp and Options.cpp at https://github.com/aftersight/After-Sight-Model-1/pulls).
Peter,

I believe there is some confusion about how we are operating raspivoice currently.

Sometime near December, the decision was made to make a background frame grabber for the camera, and then let this process distribute frames to different processes such as teradeep, raspivoice, and recently to the facial detection routine. In line with this, it was also decided that the rotary encoder input in raspivoice would be disabled, and all options that people wanted would be migrated to the main menuing system.

ie. rather than launching raspivoice, and then having the startup menu system be quiet to let raspivoice have it's own speech driven menu, we opted to turn off raspivoices speech driven menu. this allowed the main menu to continue to operate to launch the other processes at the same time.

as a result we use an intermediate launcher for raspivoice which is located in raspivoice.py. All the options for raspivoice that we currently have in the main menu->settings->raspivoice settings menu are executed as command line options. This renders the default settings in options.cpp less important. the option settings are stored in aftersight.cfg and are persistent boot to boot which is a nice behaviour.

I do agree that the updates for options.cpp and keyboardinput.cpp ought to be implemented as well, but this would be primarily for the raspivoice standalone, or for Ares repository (which I saw you already submitted to him).

in our implementation, when you change a raspivoice setting, it actually kills raspivoice, and then restarts it with the changed command line flag. This introduces a short but noticeable lag on the rpi v 2 hardware, however on the rpi v 3, that short lag is almost non-existent.

I hope this clarifies to a certain extent.

User avatar
seeingwithsound
Posts: 164
Joined: Sun Aug 28, 2011 6:07 am
Contact: Website

Re: Sight for the Blind for <100$

Sat Apr 02, 2016 7:12 am

mikey11 wrote:I believe there is some confusion about how we are operating raspivoice currently.
Hi Mike, thank you for your explanation, which indeed takes away some confusion. The conventional way of working is that a program has built-in defaults that apply unless they are overridden through external inputs such as command line options. One simply leaves a command line option out if one is fine with its corresponding default value. Apparently the intermediate launcher now always overrides the raspivoice defaults even when the new settings are identical to the built-in defaults (which in this particular case they were not, because the built-in defaults have not yet been adapted to the new algorithm, thus breaking internal consistency of the source code in the raspivoice folder). In any case, I'm happy to hear that the intended "default" contrast value of 2 is now effective one way or the other (namely via "configraspivoicecontrast = --contrast=2" in aftersight.cfg).

In the longer run I would strongly plead for leaving active default values where they belong: in the source code (folder) for the corresponding algorithm. An algorithm and its default parameters belong together and should be kept together in the same code group (here the raspivoice folder). The configraspivoicecontrast in aftersight.cfg could then for instance remain empty, "configraspivoicecontrast = ", meaning that the program's (algorithm's) default contrast value is not overridden.

Thanks,

Peter

User avatar
seeingwithsound
Posts: 164
Joined: Sun Aug 28, 2011 6:07 am
Contact: Website

Re: Sight for the Blind for <100$

Sat Apr 02, 2016 7:23 am

PranavLal wrote:Things are indeed much clearer.
Thanks Pranav. I am eager to let the blind Russian users of The vOICe for Raspberry Pi upgrade as soon as possible to a new image with the new contrast algorithm and contrast setting (default 2, which is a general compromise between easier perception of visual parts and the view getting too cartoonish with effective loss of visual information contained in shading etc).

Peter

mikey11
Posts: 351
Joined: Tue Jun 25, 2013 6:18 am
Location: canada
Contact: Website

Re: Sight for the Blind for <100$

Sat Apr 02, 2016 5:51 pm

I am syncing another image as we speak, and it shall be ready later today.

This would be the go-to image from now on for the rpi v 2.

I shall also post this link on the after-sight.com website. This will already have the contrast update installed, and also be ready to receive new updates in the future.

mikey11
Posts: 351
Joined: Tue Jun 25, 2013 6:18 am
Location: canada
Contact: Website

Re: Sight for the Blind for <100$

Sun Apr 03, 2016 12:20 am

https://drive.google.com/file/d/0B30mp6 ... sp=sharing

https://drive.google.com/file/d/0B30mp6 ... sp=sharing

The above link should be for the raspberry pi v2 image with contrast update installed, and updater changes made to fix the git pull bug.

User avatar
seeingwithsound
Posts: 164
Joined: Sun Aug 28, 2011 6:07 am
Contact: Website

Re: Sight for the Blind for <100$

Sun Apr 03, 2016 9:23 am

mikey11 wrote:The above link should be for the raspberry pi v2 image with contrast update installed, and updater changes made to fix the git pull bug.
Hi Mike, with the new April 2 image I find that raspivoice has horribly poor contrast out-of-the-box, essentially rendering it useless for all contrast settings. Apparently this is due to the unlucky combination of the new default contrast 2 setting and the old RaspiVoice.cpp algorithm and code. While updating via the menu Settings | Update software, I indeed found that the image was still at update 12, and installing update 13 fixed the contrast problem by installing the new RaspiVoice.cpp, but I believe one should not expose (new) users to this hurdle. People who carefully track the discussion on this forum will know what to do, but most others won't. Will you be updating the image to at least get half-decent behavior out-of-the-box, even though the updating mechanism works well now? I just cannot "advertise" the current image like I had planned for today.

Thanks!

Peter


P.S. Maybe you can at the same time process my April 1 pull request for Options.cpp and KeyboardInput.cpp, such that the currently inconsistent settings can no longer trip up people who look through the raspivoice source code.

mikey11
Posts: 351
Joined: Tue Jun 25, 2013 6:18 am
Location: canada
Contact: Website

Re: Sight for the Blind for <100$

Sun Apr 03, 2016 12:18 pm

Sorry Peter, I will rework this. I'm sorry to have had it happen.

mikey11
Posts: 351
Joined: Tue Jun 25, 2013 6:18 am
Location: canada
Contact: Website

Re: Sight for the Blind for <100$

Sun Apr 03, 2016 3:03 pm

https://drive.google.com/file/d/0B30mp6 ... sp=sharing
https://drive.google.com/file/d/0B30mp6 ... sp=sharing

This is the pi v 2 WITH update 13 applied this time.

I will look to getting the pull request items done this afternoon.

Again, Apologies.

User avatar
seeingwithsound
Posts: 164
Joined: Sun Aug 28, 2011 6:07 am
Contact: Website

Re: Sight for the Blind for <100$

Sun Apr 03, 2016 3:13 pm

mikey11 wrote:https://drive.google.com/file/d/0B30mp6 ... sp=sharing
https://drive.google.com/file/d/0B30mp6 ... sp=sharing

This is the pi v 2 WITH update 13 applied this time.

I will look to getting the pull request items done this afternoon.
That's great, Mike, I'll check it out. (I was creating my own image with fixes, basically just to see if I could, but my upload to Google Drive is still in progress after some 3 hours, so apparently you have a much faster upload connection.)

Thanks!

Peter


P.S. No problem, Mike. You've done a tremendous amount of work, and the only way to prevent occasional slip-ups is not to do anything. :)

mikey11
Posts: 351
Joined: Tue Jun 25, 2013 6:18 am
Location: canada
Contact: Website

Re: Sight for the Blind for <100$

Sun Apr 03, 2016 4:43 pm

one week of my life I have have 5 megabit/s U/D connection, the alternating week it varies between 0.05 and 1 megabit Down/ 0.05 Up.

In a way it's lucky that I'm making the mistakes when I'm around the higher speed connection.

The slow one is brutal. Some parts of Canada really do have third world internet speeds

Return to “Assistive technology and accessibility”

Who is online

Users browsing this forum: No registered users and 1 guest