mholgatem / gpioneer

A python GPIO controller
MIT License
33 stars 6 forks source link

how to uninstall? #2

Closed XKRJAGUAR closed 8 years ago

XKRJAGUAR commented 8 years ago

Hi,

really exited to use this program however when I input all the commands and I get to "bash gpioneer/install.sh", when processing that there seems to be a few errors. After that it comes up with the "press Y/N to configure" as normal, I press Y but I am not prompted to input the controls as specified in the README. it comes up with the menu in blue text but upon entering any of the commands it just says no such file or directory. i would really like to re install it as a reconfigured some of the partitions and i believe it didn't install properly, what is the bets way to uninstall? or if I am simply using the program wrong any suggestions are very much appreciated, thanks.

mholgatem commented 8 years ago

Sure! lets troubleshoot this! First off, what OS are you on?

here are the dependencies that it makes sure you have: python, python-dev, python-requests, python-pip, supervisor, gunicorn, sqlite3, pyyaml, flask-sqlalchemy, flask-admin, evdev

depending on your OS: python, python-requests, and sqlite3 were probably already installed, so you can just do:

pip uninstall flask pyyaml flask-sqlalchemy flask-admin evdev sudo apt-get remove python-dev python-requests, python pip

then: sudo nano /etc/rc.local and remove the line that look something like this: python "$SCRIPTPATH"/GPioneer.py &>/dev/null &

that should get you back to square one.

XKRJAGUAR commented 8 years ago

Hi, thanks for the speedy reply, I am running raspian (shows up as linux Linux 3.18.11+ ) after running each line of code, there seemed to be some problems. upon entering the first line it replied "Cannot uninstall requirement flask, not installed Storing complete log in /home/pi/.pip/pip.log"

on the next line I was replied to with "E: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct the problem." i ran the sudo dpkg... line as it told me to and it did something but upon entering the sudo nano /etc/rc.local there is no line even mentioning gpioneer. it still wont let me reinstall it or anything.

also to note when i enter "bash bash gpioneer/install.sh" I am greeted with many many lines saying thins such as "warning: no previously-included files matching '*.pyo' found under directory 'examples'" it says this for lot of different file names etcetera.

I try running these lines a few times to no avail, I am almost certain a re install would fix it as the file system was not expanded when i first installed it

mholgatem commented 8 years ago

it sounds like the files never installed in the first place. It creates the line in rc.local pretty early on, so if that line isn't there, then the script must have prematurely ended. The warnings are ok, they can be ignored. You only need to be concerned if there are any 'error:' messages.

you said that you are doing:

bash bash gpioneer/install.sh

Make sure that you only have one 'bash' in there, but try elevating your privileges like this:

sudo bash gpioneer/install.sh

XKRJAGUAR commented 8 years ago

sorry, I didn't mean to type "bash bash", I tried using sudo bash but still doesn't fix anything, it gets to the blue menu but again when I try to use any of the configure gpioneer commands, it just comes back with no such file or directory, any suggestions?

mholgatem commented 8 years ago

does it list which file is missing?

XKRJAGUAR commented 8 years ago

I decided to reset the SD card completely and install it again, unfortunately the exact same problem! If for example I type in- "sudo python GPioneer.py -c"

I get the message- "python: can't open file 'GPioneer.py': [Errno 2] No such file or directory"

the line that you mentioned is now in the rc.local file now however so that's a change

XKRJAGUAR commented 8 years ago

Upon looking into the files using winSCP, I can see that there is now a GPioneer folder which is full of files, this did not exists before so this is progress but I still get the same error for some reason

mholgatem commented 8 years ago

ah yes, if you are going to run the configuration manually, you first need to change directory into the gpioneer folder. so do this:

cd ~/gpioneer sudo python GPioneer.py -c

XKRJAGUAR commented 8 years ago

well, id prefer if it ran automatically but it doesn't seem to... ill give that a try though!

mholgatem commented 8 years ago

it should have automatically run after installation

XKRJAGUAR commented 8 years ago

gave it a try, it doesn't refuse the command so it is obviously correct but nothing happens

XKRJAGUAR commented 8 years ago

when you say run automatically, what is supposed to happen after I use the bash command?

XKRJAGUAR commented 8 years ago

is it possible you could give me a slightly more in depth run through of what should happen after I enter 'y' to start the configuration?

XKRJAGUAR commented 8 years ago

if I type in my IP into a web browser I am greeted with "sqlalchemy.exc.OperationalError"

"OperationalError: (sqlite3.OperationalError) no such table: gpioneer [SQL: u'SELECT count(?) AS count_1 \nFROM gpioneer'] [parameters: ('*',)]"

not sure if this is of any relevance to help solving the problem?

mholgatem commented 8 years ago

I'll look into and get back to you monday afternoon

XKRJAGUAR commented 8 years ago

thanks

mholgatem commented 8 years ago

So after you press 'y' to start configuration, it should tell you to press up twice, then press down twice, etc. It will watch for the button presses and then generate the database. I would guess that if you are getting just a black screen, then perhaps your overscan settings are cutting off the line. try just pressing the same gpio button several times and you should see it print out a couple lines stating that the control was mapped to the gpio button.

I'm not sure why you are getting the sqlite3 operational error in the database, every time that gpioneer starts, it should verify that the database/table exist and then create them if they don't. I'll look into it.

XKRJAGUAR commented 8 years ago

ok,

so what happens is, I press enter 'y'. then it comes up with the blue table of advanced configurations, and back to console as if nothing had happened

mholgatem commented 8 years ago

quick question, are you using a screen that is attached to the gpio?

XKRJAGUAR commented 8 years ago

No, my screen is a composite display

mholgatem commented 8 years ago

ok, you said that you get just a black screen when you run the commands

cd ~/gpioneer sudo python GPioneer.py -c

what if you do those and then press the same gpio button repeatedly, anything?

XKRJAGUAR commented 8 years ago

I'll give that a try and get back to you tommorow asap, really appreciate all the help, its either this or suffer with adafruits retrogame...

Maybe I can try and supply some video of what happens

mholgatem commented 8 years ago

yeah, if you can do that, it would be very helpful.

XKRJAGUAR commented 8 years ago

OK, file was very large so uploaded it to you tube, i did use putty but i assure you it is the exact same as to what happens on the pi. https://www.youtube.com/watch?v=CqNuY6GFGYI&feature=youtu.be its just really awkward to record the pi screen and the quality would be great.

mholgatem commented 8 years ago

This is very strange behavior. I can't figure out why it is exiting without printing so much as an error message. I think that I am going to write a debug mode into and see if we can at least figure out where it is dropping out.

XKRJAGUAR commented 8 years ago

yeah, i was thinking that the code could be altered as to just force me to enter setup mode

XKRJAGUAR commented 8 years ago

any update on the debug mode?

mholgatem commented 8 years ago

I haven't had a chance to get to it yet, I'm hoping to have some time Friday. If not, then it will be Monday because I'm taking my son camping this weekend.

XKRJAGUAR commented 8 years ago

No problem, enjoy!

mholgatem commented 8 years ago

ok, i set up a basic debug that will print out to your screen as the the program progresses. you just need to do the following commands to update.

cd ~ sudo rm -r gpioneer git clone https://github.com/mholgatem/gpioneer.git

Then run the program with

sudo python GPioneer.py -c --debug

*note the two hyphens in '--debug'

XKRJAGUAR commented 8 years ago

Ok, I ran the code only to be met with

python: can't open file 'GPioneer.py': [Errno 2] No such file or directory

I have been met with this error before, is it possible it is saving into the wrong location or something?

mholgatem commented 8 years ago

sorry, make sure that you cd back into the gpioneer folder

cd ~/gpioneer sudo python GPioneer.py -c --debug

XKRJAGUAR commented 8 years ago

I tried that, I run it and nothing happens, just like when I recorded it

mholgatem commented 8 years ago

ok, can you point me to the image that you used to create your sd card? Let me try downloading that and we can go from there.

XKRJAGUAR commented 8 years ago

here is the exact file i used for my retropie - I am using a pi 1, model b-

https://www.dropbox.com/s/x1zc2xuiwpv3dwb/retropie-v3.8.1-rpi1_zero.img.gz?dl=0

mholgatem commented 8 years ago

ok, I have one of those on hand. I'll check into it.

XKRJAGUAR commented 8 years ago

did you find anything of note?

mholgatem commented 8 years ago

I haven't had a chance to try it out yet, I should have some time today to mess with it.

XKRJAGUAR commented 8 years ago

fantastic, thanks again for all the help

mholgatem commented 8 years ago

sorry, I haven't forgotten about you. Things have just been really hectic lately. I'll let you know as soon as I have a chance to check it out.

XKRJAGUAR commented 8 years ago

No problem at all, no hurry

mholgatem commented 8 years ago

ok, it looks like they already had the python-evdev module installed in this version of retropie (but it's an old module).

so do this:

sudo pip install evdev --upgrade

That fixed it for me

XKRJAGUAR commented 8 years ago

Fantastic!

I can now configure gpioneer! BUT in retropie it doesnt seem to be accepting any inputs, other reboot, is there anything else i should be doing when finished the configuration do i need to set the controller do gpio somehow or what?

mholgatem commented 8 years ago

reboot your system, to make sure that everything has taken effect. In the command line, try pressing some of your buttons and check to see if they are outputting anything. It's been a while since I have used retropie, but I believe that there is an option to configure controllers. It should just register as a normal keyboard when you start pressing buttons.

XKRJAGUAR commented 8 years ago

no input seems to happen whatsoever ): , i can now access the gpioneer by going online as well now by typing in the IP

mholgatem commented 8 years ago

when you access the web interface, does it have listings? (something like "P1_UP KEY_UP 7")

XKRJAGUAR commented 8 years ago

image

mholgatem commented 8 years ago

ok, I'm guessing that gpioneer didn't start correctly then. I'm actually almost done with some big changes, but in the meantime you can do this.

sudo python ~/gpioneer/GPioneer.py &

This will run the app in the background, after running that command, try pressing P1_COIN (while still in the command line) and see if it outputs '1'

mholgatem commented 8 years ago

I just did a big update. You should do the following to update

sudo nano /etc/rc.local Delete the line that reads: python /home/pi/gpioneer/GPioneer.py &>/dev/null & exit and save, then: cd ~/gpioneer sudo bash remove.sh git reset --hard origin/master git pull sudo bash install.sh

That should get you completely up to date. Gpioneer will automatically start with the system and you can easily stop/start gpioneer and the web interface using these commands:

sudo systemctl stop gpioneer -or- sudo systemctl stop gpioneer-web

XKRJAGUAR commented 8 years ago

working! took a while but its working great now! using the online tool works great and i am blown away by the customize ability, will most definitely be using GPioneer in future projects! I cant thank you enough for all the help, if you ever need someone to help you test a new project or anything I am very happy to help. Keep up the good work, Thanks, Calum