Sunday, 17 April 2016

How to transfer and received file beagle bone to FTP server in fedora

 How to transfer and received file beagle bone to FTP server in        fedora

Server Side:
 
Step 1:In vsftpd.conf file (/etc/vsftpd/vsftpd.conf) editthis lines.

 anon_other_write_enable=YES
dirmessage_enable=YES
dirlist_enable=YES
no_anon_password=YES
file_open_mode=0777
guest_enable=YES
anon_upload_enable=YES


Step 2 : start service vsftpd (service vsftpd start)
Step 3: stop firewall (systemctl stop firewalld.service)
step 4: mount --bind /default directory/ /var/ftp

Client side: 

Step 1: stop firewall service

from ftplib import FTP

import os



flag = True



while(flag):

        os.system("ifconfig eth0 192.168.5.2")

        ftps = FTP('172.16.1.176')

        ftps.login('apcoer','12345678')



        print "Select an option for transfering files:\n1.Machine to BBB\n2. BBB to machine"

        print "3.FTP to BBB\n4.BBB to FTP\n5.Exit"

        choice = int(input())

        if choice == 1:

                mcip = raw_input("Enter the ip of machine from where the file is to be received: ")



                user = raw_input("Enter the user from  whom the file is to be received: ")

                filename = raw_input("Enter path of the file to be received: ")

                destpath = raw_input("Enter the path where the file is to be stored: ")

                os.system("scp "+user+"@"+mcip+":"+filename+" "+destpath)

                print "File received successfully"





        elif choice == 2:

                mcip = raw_input("Enter the ip of machine to send files to: ")

                user = raw_input("Enter the user to whom the file is to be sent: ")

                destpath = raw_input("Enter where the file should be stored on receiving machine: ")

                filename = raw_input("Enter the path to the file to be sent: ")

                os.system("scp "+filename+" "+user+"@"+mcip+":"+destpath)

                print "File successfully sent"



        elif choice == 3:

             ftps.retrlines('LIST')

                filename = raw_input("Enter the filename to be downloaded: ")

                ftps.retrlines('RETR '+filename, open(filename,"wb").write)

                print "File successfully downloaded"



        elif choice == 4:

                filename = raw_input("Enter the filename which is to be sent: ")
        print filename
                #ftps.storlines("STOR " + os.path.basename(filename), open(filename))
        ftps.storlines('STOR '+os.path.basename(filename), open(os.path.basename(filename),w"/var/ftp"))

                print "File successfully uploaded"



        else:

                flag = False

Monday, 8 February 2016

How to connect beaglebone

1)
[apcoer@localhost-localdomain ~]$ ssh root@192.168.7.2
The authenticity of host '192.168.7.2 (192.168.7.2)' can't be established.
ECDSA key fingerprint is c0:81:1a:f4:58:b9:51:15:00:df:ee:71:c4:d9:fd:54.
Are you sure you want to continue connecting (yes/no)? y
Please type 'yes' or 'no': y
Please type 'yes' or 'no': yes
Warning: Permanently added '192.168.7.2' (ECDSA) to the list of known hosts.
Debian GNU/Linux 7

BeagleBoard.org BeagleBone Debian Image 2014-04-23

Support/FAQ: http://elinux.org/Beagleboard:BeagleBoneBlack_Debian
Last login: Wed Apr 23 20:27:40 2014 from 192.168.7.1
root@beaglebone:~# vnc
-bash: vnc: command not found
root@beaglebone:~# vncserver

New 'X' desktop is beaglebone:1

Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/beaglebone:1.log

root@beaglebone:~#

2) open remote desktop