def __init__(self, port, timeQueue): # make public queue self.commandQueue = Queue() self.timeQueue = timeQueue self.port = port # init module self.andRaspTCP = tcpServer.TCPServer(self.commandQueue, "", port, self.timeQueue) # set module to executer self.commandExecuter = executer.Executer(self.andRaspTCP, self.timeQueue)
import tcpServer tcp_server = tcpServer.TCPServer("172.20.10.2", 9031) tcp_server.start()
import tcpServer import executer from asyncio import Queue import time # make public queue commandQueue = Queue() # init module andRaspTCP = tcpServer.TCPServer(commandQueue, "", 35357) print("TCP set") andRaspTCP.start() # set module to executer commandExecuter = executer.Executer(andRaspTCP) while True: try: command = commandQueue.get() commandExecuter.startCommand(command) except: pass # while True: # time.sleep(3) # andRaspTCP.sendAll("321\n")
import tcpServer HOST = 'localhost' PORT = 60728 andRaspTCP = tcpServer.TCPServer(HOST, PORT) andRaspTCP.run()
import tcpServer import executer import queue import datetime print("tcp server :: start") # make public queue commandQueue = queue.Queue() server_ip = "0.0.0.0" server_port = 8888 # init module # 아이피를 0.0.0.0 으로 바꿈 andRaspTCP = tcpServer.TCPServer(commandQueue, server_ip, server_port) andRaspTCP.start() # set module to executer ''' commandExecuter = executer.Executer(andRaspTCP) while True: try: command = commandQueue.get() commandExecuter.startCommand(command) except: pass ''' # 모든 클라이언트에게 데이터 전송 # while True:
import tcpServer import executer import Queue import time IP = "192.168.10.105" PORT = 8090 commandQueue = Queue.Queue() andRaspTCP = tcpServer.TCPServer(commandQueue, IP, PORT) andRaspTCP.start() commandExecuter = executer.Executer(andRaspTCP) while True: try: command = commandQueue.get() commandExecuter.startCommand(command) except Exception: print "main.py Error" pass
import tcpServer import executer import queue import time # make public queue commandQueue = queue.Queue() # init module andRaspTCP = tcpServer.TCPServer(commandQueue, '192.168.0.5', 37771) andRaspTCP.start() # set module to executer commandExecuter = executer.Executer(andRaspTCP) while True: try: command = commandQueue.get() commandExecuter.startCommand(command) except Exception as e: print(e) # while True: # time.sleep(3) # andRaspTCP.sendAll("321\n")]
int(s) return True except ValueError: return False if len(sys.argv) == 1: print 'usage: python server_v_1.py port_number' exit(1) elif not isNumber(sys.argv[1]): print 'Invalid port_number, ', sys.argv[1] exit(2) port = int(sys.argv[1]) commandQueue = Queue.Queue() print 'Server open with port of ', port andRaspTCP = tcpServer.TCPServer(commandQueue, "", port) andRaspTCP.start() commandExecuter = executer.Executer(andRaspTCP) while True: try: command = commandQueue.get() commandExecuter.startCommand(command) except: pass
import tcpServer server = tcpServer.TCPServer("192.168.219.115", 9999) server.start()
import tcpServer andRaspTCP = tcpServer.TCPServer("127.0.0.1", 4000) andRaspTCP.start()
import tcpServer andRaspTCP = tcpServer.TCPServer("10.0.0.10", 50000) andRaspTCP.start()
import tcpServer from multiprocessing import Queue import time #import serial import dbModule from datetime import date, datetime # make public queue commandQueue = Queue() # init Arduino #ser = serial.Serial(port = 'COM7', baudrate = 9600) # init module andRaspTCP = tcpServer.TCPServer(commandQueue, "172.30.1.44", 8888) andRaspTCP.start() print("서버 연결 중") # set module to executer #commandArduino = serialtest.Arduino_master(andRaspTCP) coffee_out = [0 for i in range(7)] coffee_out_count = 0 # Coffee output chart test coffee_out[0] = 2 coffee_out[1] = 5 coffee_out[2] = 1 #coffee_out[3] = 0 coffee_out[4] = 2 coffee_out[5] = 6
import tcpServer import executer from multiprocessing import Queue #실행해야 하는 파일 commandQueue = Queue() # 아이피 변경하기* andRaspTCP = tcpServer.TCPServer(commandQueue, "172.30.1.51", 7777) andRaspTCP.start() commandExecuter = executer.Executer(andRaspTCP) while True: try: command = commandQueue.get() commandExecuter.startCommand(command) except: pass
import tcpServer import executer import fcm_test from multiprocessing import Queue # make public queue commandQueue = Queue() # init module andRaspTCP = tcpServer.TCPServer(commandQueue, "", 12345) andRaspTCP.start() # set module to executer commandExecuter = executer.Executer(andRaspTCP) while True: try: command = commandQueue.get() commandExecuter.startCommand(command) except: pass
# Trained model code. # Created by Imagic 2018 # Copyright © 2018 Imaigc All rights reserved. import tcpServer import executer import datetime import time import Training_model as train from multiprocessing import Queue # make public queue commandQueue = Queue() # init module andRaspTCP = tcpServer.TCPServer(commandQueue, "192.168.0.12", 34343) # "" -> Host, 34343-> port number andRaspTCP.start() # set module to executer commandExecuter = executer.Executer(andRaspTCP) print("Imagic Server started. Server version : 1.0.0") while True: try: now = datetime.datetime.now() #print('current time : ', now.hour,':',now.minute,':',now.second) timeInfo = str(now.hour) + str(now.minute) + str(now.second) if timeInfo == '20510': #when training time set, start training. time.sleep(1) train.search_csvfile()
#plt.imshow(image) #plt.show() while True : if os.path.isfile(s) : txtfile = open(s,'r') break else : continue if txtfile is not None : # make public queue commandQueue = Queue() # init module andRaspTCP = tcpServer.TCPServer(commandQueue, "", 7784) andRaspTCP.start() # set module to executer commandExecuter = executer.Executer(andRaspTCP) f = txtfile while True: aa = f.readline() if not aa: break line = aa print(line) f.close() while True: try: command = commandQueue.get() commandExecuter.startCommand(command, line)
p = subprocess.Popen(arg, shell=True, stdout=subprocess.PIPE) data = p.communicate() split_data = data[0].split() ipaddr = split_data[split_data.index('src') + 1] # Unique number of raspberry pi dat = {'did': 'raspberry002', 'ip': ipaddr} # Server ID serverURL = "http://rails-beanstalk.gb6ktuimmz.ap-northeast-2.elasticbeanstalk.com/regist" # make public queue commandQueue = Queue.Queue() # init module andRaspTCP = tcpServer.TCPServer(commandQueue, ipaddr, 1234) andRaspTCP.start() arduinoSerial = arduino.Arduino(commandQueue) arduinoSerial.start() # set module to executer commandExecuter = executer.Executer(andRaspTCP, arduinoSerial) # post raspby device id, ip res = requests.post(serverURL, data=dat) print(res.text) while True: try: command = commandQueue.get() commandExecuter.startCommand(command) except: