Esempio n. 1
0
    def __init__(self,
                 name,
                 pin0=18,
                 pin1=23,
                 pin2=24,
                 pin3=25,
                 simulation=True):

        #GPIO: 18 23 24 25
        #pin : 12 16 18 22

        self.logger = logging.getLogger('myQ.quadcptr')
        self.name = name
        self.simulation = simulation

        self.version = 1

        self.motor = [motor('M' + str(i), 0) for i in xrange(4)]
        self.motor[0] = motor('M0',
                              pin0,
                              kv=1000,
                              WMin=0,
                              WMax=100,
                              simulation=self.simulation)
        self.motor[1] = motor('M1',
                              pin1,
                              kv=1000,
                              WMin=0,
                              WMax=100,
                              simulation=self.simulation)
        self.motor[2] = motor('M2',
                              pin2,
                              kv=1000,
                              WMin=0,
                              WMax=100,
                              simulation=self.simulation)
        self.motor[3] = motor('M3',
                              pin3,
                              kv=1000,
                              WMin=0,
                              WMax=100,
                              simulation=self.simulation)

        self.sensor = sensor(simulation=self.simulation)

        self.pidR = pid()
        self.pidP = pid()
        self.pidY = pid()
        self.pidR_rate = pid()
        self.pidP_rate = pid()
        self.pidY_rate = pid()

        self.ip = '192.168.1.1'

        self.netscan = netscan(self.ip)

        self.webserver = webserver(self)

        self.display = display(self)

        self.rc = rc(self.display.screen)

        self.imulog = False
        self.savelog = False
        self.calibIMU = False
        self.debuglev = 0
        self.netscanning = False

        #for quadricopter phisics calculations- not used yet
        self.prop = prop(9, 4.7, 1)
        self.voltage = 12  # [V]
        self.mass = 2  # [Kg]
        self.barLenght = 0.23  # [mm]
        self.barMass = 0.15  # [kg]

        self.datalog = ''
        self.initLog()
Esempio n. 2
0
#    You should have received a copy of the GNU General Public License
#    along with this program.  If not, see <http://www.gnu.org/licenses/>.

#    Contact me at:
#    [email protected]
#    solenerotech.wordpress.com
##############################################################################

from netscan import netscan
from loggingQ import setupLogger
from time import time, sleep

logger = setupLogger('myQ', True, 'netscan_log.txt')

myNetscan = netscan(ip='192.168.0.70', timeout=0.5)  # wifi >WP
#myNetscan = netscan(ip='192.168.137.10', timeout=1)  # phoneAP > rpi
#myNetscan.scanAll('192.168.137.')

myNetscan.start()
initTime = time()


try:
    #do something...
    sleep(20)


finally:
    # shut down cleanly
    myNetscan.stop()
Esempio n. 3
0
 (options, args) = parser.parse_args()
 try:
     Moption = options.MenuOption
 except Exception, e:
     print "\n[!] Error: " + str(e)
     exit(0)
 if (Moption == "1"):
     try:
         parameters = str(options.range).split(",")
     except Exception, e:
         print "\n[!] Error: " + str(e)
         exit(0)
     if parameters[0] != "None":
         try:
             #banners.randomBanner()
             netscan.netscan(int(parameters[0]), int(parameters[1]))
         except Exception, e:
             print "\n[!] Error: " + str(e)
         exit(0)
     else:
         try:
             banners.randomBanner()
             netscan.netscan(2, 254)
         except Exception, e:
             print "\n[!] Error: " + str(e)
         exit(0)
 elif (Moption == "2"):
     try:
         host = str(options.host)
         ports = str(options.port)
         flag = str(options.flag)
Esempio n. 4
0
#    You should have received a copy of the GNU General Public License
#    along with this program.  If not, see <http://www.gnu.org/licenses/>.

#    Contact me at:
#    [email protected]
#    solenerotech.wordpress.com
##############################################################################

from netscan import netscan
from loggingQ import setupLogger
from time import time, sleep

logger = setupLogger('myQ', True, 'netscan_log.txt')

myNetscan = netscan(ip='192.168.0.70', timeout=0.5)  # wifi >WP
#myNetscan = netscan(ip='192.168.137.10', timeout=1)  # phoneAP > rpi
#myNetscan.scanAll('192.168.137.')

myNetscan.start()
initTime = time()

try:
    #do something...
    sleep(20)

finally:
    # shut down cleanly
    myNetscan.stop()

    logger.debug("time: " + str(time() - initTime) + " conn: " +