Banana Pi Programming


Since the Banana Pi is a full blown computer, you can run your development tools on the Banana Pi itself, unlike the Arduino where you have to build a program on a separate computer and then upload it to the Arduino.


Development IDE

Eclipse or not? I would if I could. However, Eclipse keeps crashing because of a Java out of heap memory error.

Next: Geany. Lightwight and some git integration.

Geany

installing geany:

sudo apt-get install geany

Installation works and geany starts very quickly.

https://github.com/geany


Project management with geany

Menu Project -> New


The project file has to have the extension .geany so that the file browser will find it when you open an existing project.
Which files will be part of this project? The files that happen to be open when you close the project. That's it.



Plugins

http://plugins.geany.org/install.html


Version Control System

we use git in combination with github.

sudo apt-get install git



Preparation

set push.default

try

git push

read error message and fix accordingly


Basic usage of git via command line


On github.com, create repository with readme.md so that it wil be ready for cloning.

clone remote:

git clone https://github.com/atmelino/bananapi.git

cd bananapi

git command line daily workflow


change into directory of local repository

When you start working on your computer, update local repository from remote repository:

git pull

When you are done programming, send changes to remote repositoy:

git add (your filename)

git commit
(enter your comments)

git push


Git Cola installation and setup

The git integration with geany is complicated, so we will use an external program to synchronize our code with github.

git-cola runs both on Ubuntu and on the Banana Pi

sudo apt-get install git-cola
sudo apt-get install python-pyinotify


Before we start git-cola, you should create a credentials file, otherwise you will have to enter the credentials for every operation (downside: password is in plain text)

create a file named .netrc in you home directory

put the following into your file:

machine github.com
login technoweenie
password SECRET

machine api.github.com
login technoweenie
password SECRET 

Bugs specific to Banana Pi

If you try to push and get an error
failed to retrieve property `GtkRange::activate-slider' of type `gboolean' from rc file value
edit the file
/usr/share/themes/Lubuntu-default/gtk-2.0/gtkrc
change
GtkScrollbar::activate-slider=FALSE
to
GtkScrollbar::activate-slider=0

http://stackoverflow.com/questions/20140267/gtk-scrollbar-error

git-cola window settings

It is difficult to arrange the git-cola windows with the mouse. Alternatively, you can edit the config file

nano ~/.config/git-cola/settings

make sure save GUI settings is checked

File -> Preferences




Here is a "sane" setting:

{
    "gui_state": {
        "mainview": {
            "lock_layout": false, 
            "height": 433, 
            "windowstate": "AAAA/wAAAAL9AAAAAgAAAAAAAAFjAAABsfwCAAAAAvsAAAAMAEMAbwBtAG0AaQB0AQAAAAAAAADmAAAAPgD////7AAAADgBDAG8AbgBzAG8AbABlAQAAAOkAAADIAAAAFgD///8AAAABAAABXwAAAbH8AgAAAAP7AAAACABEAGkAZgBmAQAAAAAAAABEAAAAHgD////7AAAADABTAHQAYQB0AHUAcwEAAABHAAAA+QAAAGAA////+wAAAA4AQQBjAHQAaQBvAG4AcwEAAAFDAAAAbgAAADMA////AAAAAAAAAbEAAAAEAAAABAAAAAgAAAAI/AAAAAA=", 
            "width": 709, 
            "maximized": false, 
            "y": 21, 
            "x": 45
        }, 
        "pull": {
            "rebase": false, 
            "height": 420, 
            "width": 666, 
            "maximized": false, 
            "y": 14, 
            "x": 301
        }, 
        "dagview": {
            "count": 1000, 
            "lock_layout": false, 
            "height": 744, 
            "windowstate": "AAAA/wAAAAH9AAAAAwAAAAAAAAKSAAAA1PwCAAAAAfsAAAAGAEwAbwBnAQAAAAAAAADUAAAAawD///8AAAABAAACkgAAANT8AgAAAAH7AAAACgBHAHIAYQBwAGgBAAAAAAAAANQAAABgAP///wAAAAMAAAUnAAACEfwBAAAAAfsAAAAIAEQAaQBmAGYBAAAAAAAABScAAAGHAP///wAAAAAAAADUAAAABAAAAAQAAAAIAAAACPwAAAAA", 
            "width": 1319, 
            "maximized": true, 
            "y": 24, 
            "x": 47
        }, 
        "push": {
            "y": 20, 
            "x": 260, 
            "maximized": false, 
            "width": 666, 
            "height": 420
        }
    }, 
    "bookmarks": [], 
    "recent": [
        "/media/data/public_html/bananapi"
    ]
}


create and clone repository with git-cola

On github.com, create repository with readme.md so that it will be ready for cloning.

Start git-cola. Click on clone. Get URL from github



and paste into git-cola dialog.



click ok and navigate to local path (here: /media/data/public_html)

The remote will now be cloned to your computer.


Daily workflow with git-cola

start your computer. Open repository.



pull all changes from remote to your computer.

Do you get the error "fatal: unable to access 'https://github.com/atmelino/bananapi.git/': server certificate verification failed. CAfile: /etc/ssl/certs/ca-certificates.crt CRLfile: none"
is your date set correctly?



Edit your files.


When finished:

in git cola:

refresh.

select your files and stage. commit. push.

Helpful Links:

http://cerebrux.net/2013/02/07/github-git-cola-gui-step-by-step-management-of-your-code/


git-cola without .netrc

If you are not using an external credentials method, you have to start git cola from command line

git-cola

Then click on clone in the GUI



then go back to the command line and enter the credentials.



When all the files have been pulled, the main GUI will finally come up.

Make sure to set View-> Console to that you can see the messages:



Next time you start git-cola, you will just have to click on the name:



Now, if you make any changes, you will have to enter the credentials again in the terminal.

Note: You have to start git-cola from command line so that you can enter the credentials.


Python

the Adafruit DCTest.py program has an infinite loop that will keep the motors running even after you leave the web browser. How to stop it?

1. find process ID

ps -ef | grep python

output:
UID        PID  PPID  C STIME TTY          TIME CMD

UID or USER    Username of the process's owner
PID                    Process ID number
PPID                  ID number of the process's parent process
C or CP              CPU usage and scheduling information


2. kill the according process

sudo kill 1234

http://superuser.com/questions/446808/how-to-manually-stop-a-python-script-that-runs-continuously-on-linux












10 comments:

  1. Tevida complete set of accessories for men, which include exercises and gripping devices.Therefore, you can be sure that herbal supplements for men are really safe. But, before you go out and buy a male
    https://www.supplementsforfitness.com/tevida/

    ReplyDelete
  2. weeks compel more early react, and several can accept an event with fitting a match days notice. It depends on our schedules, flow bookings and flexibleness and of way, the performer himself (or herself). Our schedules are really fantastic, and totally non-traditional - we can screw gigs at all hours of the day, nighttime, and yet into the rattling primeval mornings. Satisfy Observe: If you phone a entertainer a day or two, or threesome, or symmetric quaternary before your event, they leave most promising protection a respond. It takes instant to neaten your circumstance unscheduled, whether by creating impost routines as I do, mounting up a penalization set tilt, or effort required licenses or permits for more hazardous book similar flak consumption and sideshow stunts. What Are You Hunting For Hiring amusement for your event can really heighten your guests' change. Whether it's a unrecorded banding, DJ, caricaturist, or prestidigitator, unrecorded performances make a genuinely unique experience that your guests will portion with their friends and families when they lead. You necessity to
    movieshook.com

    ReplyDelete

  3. Suplementarios >>> La autenticidad de nuestro sitio web es claramente visible a través de los blogs de moda de salud con el nombre mencionado en él. Tenemos una tendencia a ofrecer nuestro mejor apoyo a los huéspedes que buscan detalles de los suplementos y las comparaciones entre ellos. Para más información amable >>> http://suplementarios.es/

    http://suplementarios.es/caralean/

    https://www.facebook.com/Suplementarios-2251727545101681/

    ReplyDelete

  4. Shark Tank Diets : It is a natural product.That does not cause any side effects! Helps the body to stay healthy !You will love to use it again and again because it really works and most people are using it a lot.

    For more kind Information : http://www.sharktankdiets.com/

    http://www.sharktankdiets.com/his-and-hers-keto/

    ReplyDelete
  5. Does one rise up each and every day believing this? I may want to focus more on Muscle Building. Flexuline Muscle One in every of the foremost common questions I receive is, "How long until I begin to work out results?" I reckon that quells some of the issues I've been reading almost about Muscle Building. I'm an ace. Perhaps we ought to take this off the record. Should you have issue getting your mind around that, do not worry. These are some typical techniques. News flash, not everything with regard to Muscle Building is unmistakable. I might continue going but I suppose you understand the thought.

    https://www.nutrifitweb.com/flexuline-muscle/

    https://www.nutrifitweb.com/

    ReplyDelete
  6. We should at least ban them from any oversight over Total Testosterone Booster. What if the Testosterone you're using is more than good enough to get the task done? Clearly, that's their opinion however, there isn't a need to go beyond that. This should be a long term remedy so that male enhancement product is going to be the next point that you will have to add to your Male Enhancement pills collection. I'm overwhelmed so before there was an Internet, there were only a few strategies competent people could get Male Health. Male Enhancement should be providing solutions for your problems. Endurmax Reviews

    ReplyDelete
  7. Refer to the various resurge reviews online to know about the science behind resurge supplement. Cholesterol accumulation is a big problem nowadays. People keep on doing exercises, going to the gym, running on a diet, etc. just to transcend the extra belly fat but to the contrary, the entire secret to their slim and fit body is hidden under their skin.

    ReplyDelete

  8. In the event that gentlepersons hopped off a mountain, okay? It's not the standard, worn out skin health management you're use to. I'm attempting to discover skin health management new parts. Challenges! My cerebrum is shot. With the appearance of skin health management, there is no necessity to endeavor that. That relies upon who you inquire. It is never to be failed to remember. There is an entire reiteration of things that influence skin health management.


    https://twitter.com/nutrahealthpro

    https://www.instagram.com/nutrahealthpro/


    https://in.pinterest.com/nutrahealthpro1

    https://www.nutrahealthpro.com

    https://www.facebook.com/nutrahealthpro

    ReplyDelete