tk-nodescan_v7.3.py 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587
  1. #! /usr/bin/python
  2. # -*- coding: utf-8 -*-
  3. """
  4. This file is part of librelight.
  5. librelight is free software: you can redistribute it and/or modify
  6. it under the terms of the GNU General Public License as published by
  7. the Free Software Foundation, either version 2 of the License, or
  8. (at your option) any later version.
  9. librelight is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with librelight. If not, see <http://www.gnu.org/licenses/>.
  15. (c) 2012 micha.rathfelder@gmail.com
  16. """
  17. import time
  18. import struct
  19. import sys
  20. import tkinter as Tkinter
  21. import _thread as thread
  22. import nodescan_v6_2 as nodscaner
  23. title = "TK-ArtNet-Nodscaner"
  24. sys.stdout.write("\x1b]2;"+title+"\x07")
  25. node_list = []
  26. def load(event):
  27. sel = int( li_nodes.curselection()[0] )
  28. print("li_nodes.get")
  29. try:
  30. sel = int(li_nodes.get(sel).split()[0])
  31. print(sel)
  32. except:
  33. return 0
  34. sel -= 1
  35. node_list[sel]
  36. clear_entry_ip()
  37. e_ip.configure(state='normal')
  38. e_ip.insert("end",node_list[sel]["IP"].replace("[","").replace("]",""))
  39. #e_ip.configure(state='readonly')
  40. e_ip_new.insert("end",node_list[sel]["IP"].replace("[","").replace("]",""))
  41. e_mac.delete("0","end")
  42. e_mac.insert("end",node_list[sel]["MAC"].replace("[","").replace("]",""))
  43. e_mac2.delete("0","end")
  44. e_mac2.insert("end",node_list[sel]["MAC"].split(":")[-1])
  45. #print(dir(event))
  46. #print(node_list)
  47. #for i in node_list:
  48. # print(i)
  49. def clear_entry_ip():
  50. e_ip.configure(state='normal')
  51. e_ip.delete("0","end")
  52. e_ip.configure(state='readonly')
  53. e_ip_new.delete("0","end")
  54. def clear_node():
  55. global node_list
  56. li_nodes.delete("0","end")
  57. node_list = []
  58. li_nodes.delete("0","end")
  59. def poll(delay=1):
  60. global old_tick
  61. clear_entry_ip()
  62. clear_node()
  63. time.sleep(delay)
  64. nodscaner.poll()
  65. time.sleep(0.5)
  66. old_tick = 0
  67. def clear(event= None):
  68. global rx
  69. rx.clear()
  70. clear_node()
  71. #poll()
  72. def poll_loop(sleep):
  73. if sleep < 1:
  74. sleep = 1
  75. time.sleep(sleep)
  76. while 1:
  77. poll()
  78. time.sleep(sleep)
  79. old_tick = 0
  80. rx = nodscaner.ArtNetNodes()
  81. def _scan():
  82. global rx,node_list,old_tick,Scrollbar
  83. rx.loop()
  84. print("get node from cache " )
  85. li_nodes.insert("end",str("----"))
  86. while 1:
  87. nodes = rx.get()
  88. new_tick = rx.tick()
  89. if new_tick == old_tick:
  90. continue
  91. old_tick = new_tick
  92. #print("node",nodes)
  93. if nodes:
  94. li_node_scroll = li_nodes.yview()
  95. #clear_node()
  96. #li_nodes.delete(0,"end")
  97. #print("yea",len(nodes))
  98. node_nr = 1
  99. nodesB = {}
  100. for node in nodes:
  101. k = node["MAC"]
  102. nodesB[k] = node
  103. print("k",nodesB.keys())
  104. #for node in nodes:
  105. #for k,node in nodesB.items():
  106. k_sort = list(nodesB.keys())
  107. k_sort.sort()
  108. print("k sort",k_sort)
  109. for k in k_sort:
  110. node = nodesB[k]
  111. li_nodes.insert("end",str(node_nr).rjust(3," ") +" "+ node["lname"])
  112. bg = "lightgrey"
  113. color = li_nodes.itemconfig("end", bg=bg)
  114. ip = str(node_nr).rjust(3," ") +" "+ node["IP"]
  115. bg = ""
  116. if node["PortTypes"][0] == "@":
  117. ip += " DMX-in"
  118. bg ="yellow"
  119. else:
  120. ip += " DMX-out"
  121. bg ="lightgreen"
  122. if bg:
  123. color = li_nodes.itemconfig("end", bg=bg)
  124. li_nodes.insert("end",str(node_nr).rjust(3," ") +" short Name:"+ node["sname"])
  125. li_nodes.insert("end",ip)
  126. if bg:
  127. color = li_nodes.itemconfig("end", bg=bg)
  128. inout = " UNIVERS OUT="+ str(ord(node["SwOut"][0]))+" IN="+ str(ord(node["SwIn"][0]))
  129. li_nodes.insert("end",str(node_nr).rjust(3," ") + inout)
  130. li_nodes.insert("end",str(node_nr).rjust(3," ") +" "+ node["MAC"])
  131. timeline = ""
  132. timeline += " LASTCHANGE:%0.1f"% (time.time()-float(node["UPDATESTAMP"]) )
  133. REFRESHSTAMP = time.time()-float(node["REFRESHSTAMP"])
  134. timeline +=" LASTPING:%0.1f"% REFRESHSTAMP
  135. li_nodes.insert("end",str(node_nr).rjust(3," ") +timeline )
  136. if node["BOOT"]:
  137. BOOT = time.time()-float(node["BOOT"])
  138. else:
  139. BOOT = 0
  140. timeline =" BOOT:%0.1f"% BOOT
  141. li_nodes.insert("end",str(node_nr).rjust(3," ") +timeline +" sec" )
  142. bg = ""
  143. #if REFRESHSTAMP > 5 :
  144. # bg="red"
  145. #else:
  146. # bg="lightgreen"
  147. if bg:
  148. li_nodes.itemconfig("end", bg=bg)
  149. #li_nodes.insert("end",str(node_nr).rjust(3," ")
  150. #li_nodes.insert("end","")
  151. li_nodes.insert("end","*"*60)
  152. #li_nodes.itemconfig("end", bg="brown")
  153. node_nr += 1
  154. node_list += [node]
  155. #Scrollbar.set('0', '0.1')
  156. print(li_node_scroll)
  157. #print(dir(li_nodes))
  158. #li_node_scroll = int(li_node_scroll[0])
  159. #li_nodes.yview_moveto(li_node_scroll)
  160. time.sleep(0.2)
  161. def get_new_ip(event=None):
  162. b = e_ip_new.get().replace("[","").replace("]","")
  163. return b
  164. def get_new_ip_str(event=None):
  165. x = get_new_ip()
  166. #x = x[1:-1]
  167. x = x.strip()
  168. #x = x.replace(",",".")
  169. x = x.replace(" ","")
  170. x = x.split(",")
  171. print( "get_new_ip_str",x)
  172. return x
  173. def send_none(event=None):
  174. pass
  175. def send_mac(event=None):
  176. #new_mac = "CMD MAC6 " + hex(e_mac2.get()) #)
  177. #new_mac = "CMD MAC6 " + struct.pack("<B",(int(e_mac2.get(),16))).decode()
  178. new_mac = b"CMD MAC6 " + struct.pack("<B",(int(e_mac2.get(),16)))
  179. a = e_ip.get().replace("[","").replace("]","")
  180. cur_ip = []
  181. for i in a.split(","):
  182. cur_ip +=[int(i)]
  183. print("SEND MAC:",cur_ip,new_mac)
  184. nodscaner.send_node_cmd(cur_ip,cmd=new_mac)
  185. #poll(1.5)
  186. def send_dmx_store(event=None):
  187. cmd = "CMD DMX STORE "
  188. a = e_ip.get().replace("[","").replace("]","")
  189. cur_ip = []
  190. for i in a.split(","):
  191. cur_ip +=[int(i)]
  192. print("SEND:",cur_ip,cmd)
  193. nodscaner.send_node_cmd(cur_ip,cmd)
  194. poll(1.5)
  195. def send_cmd(event=None):
  196. cmd = e_cmd.get() #"CMD DMX STORE "
  197. _send_cmd(cmd=cmd)
  198. def send_cmd2(event=None):
  199. cmd = e_cmd2.get() #"CMD DMX STORE "
  200. _send_cmd(cmd=cmd)
  201. def send_cmd3(event=None):
  202. cmd = e_cmd3.get() #"CMD DMX STORE "
  203. _send_cmd(cmd=cmd)
  204. def send_cmd4(event=None):
  205. cmd = e_cmd4.get() #"CMD DMX STORE "
  206. _send_cmd(cmd=cmd)
  207. def send_cmd5(event=None):
  208. cmd = e_cmd5.get() #"CMD DMX STORE "
  209. _send_cmd(cmd=cmd)
  210. def _send_cmd(event=None,cmd=""):
  211. #cmd = e_cmd.get() #"CMD DMX STORE "
  212. cmd = cmd.split(" ")
  213. value = cmd[-1]
  214. try:
  215. value = struct.pack("<B",int(value))
  216. except:pass
  217. cmd = cmd[:-1] #.append(value)
  218. cmd.append(value)
  219. print("_send_cmd:",cmd)
  220. cmd=" ".join(map(str,cmd) )
  221. a = e_ip.get().replace("[","").replace("]","")
  222. cur_ip = []
  223. sep = "xx"
  224. if "," in a:
  225. sep = ","
  226. if "." in a:
  227. sep = "."
  228. for i in a.split(sep):
  229. cur_ip +=[int(i)]
  230. print("SEND:",cur_ip,cmd)
  231. nodscaner.send_node_cmd(cur_ip,cmd)
  232. #poll(1.5)
  233. def set_ip(event=None):
  234. print("SET NEW IP")
  235. cur_ip=(2,0,0,94)
  236. new_ip=(2,0,0,201)
  237. new_netmask=(255,0,0,0)
  238. a = e_ip.get().replace("[","").replace("]","")
  239. b = e_ip_new.get().replace("[","").replace("]","")
  240. c = variable.get() #e_mask_new.get()
  241. new_netmask = [] #c.split(".") #list(c)
  242. for i in c.split("."):
  243. new_netmask +=[int(i)]
  244. cur_ip = []
  245. for i in a.split(","):
  246. cur_ip +=[int(i)]
  247. new_ip = []
  248. for i in b.split(","):
  249. new_ip +=[int(i)]
  250. if new_ip == cur_ip:
  251. print("neu und als IP sind gleich" )
  252. return 0
  253. #cur_ip=(2,0,0,94)
  254. #new_ip=(2,0,0,201)
  255. print("new",[cur_ip, new_ip, new_netmask])
  256. print()
  257. nodscaner.set_ip4(cur_ip,new_ip, new_netmask)
  258. poll(1.5)
  259. def set_node_pin(evnet=None):
  260. cmd = "CMD DMX=PIN"
  261. ip = get_new_ip_str()
  262. print("ip",[ip])
  263. nodscaner.send_node_cmd(ip,cmd=cmd)
  264. poll(1.5)
  265. def set_node_in(evnet=None):
  266. cmd="CMD DMX=IN"
  267. ip = get_new_ip_str()
  268. nodscaner.send_node_cmd(ip,cmd=cmd)
  269. poll(1.5)
  270. def set_node_out(evnet=None):
  271. cmd="CMD DMX=OUT"
  272. ip = get_new_ip_str()
  273. nodscaner.send_node_cmd(ip,cmd=cmd)
  274. poll(1.5)
  275. root = Tkinter.Tk()
  276. #root.geometry("900x700+100+100")
  277. root.geometry("900x400+100+100")
  278. root.title( title)
  279. fframe = Tkinter.Frame(root)
  280. fframe.pack(side="top",expand=0,fill="x")
  281. cframe = Tkinter.Frame(root)
  282. cframe.pack(side="top",expand=1,fill="both")
  283. font1 = ("Helvetica", 8)
  284. font2 = ("Helvetica", 10)
  285. font3 = ("Helvetica", 16)
  286. font20 = font=("Helvetica", 20)
  287. b_scan = Tkinter.Button(fframe,text="ArtNetPoll",width=10,command=poll,font=font2)
  288. b_scan.pack(side="left",expand=0,fill="y")
  289. b_scan = Tkinter.Button(fframe,text="clear",width=10,command=clear,font=font2)
  290. b_scan.pack(side="left",expand=0,fill="y")
  291. scrollbar = Tkinter.Scrollbar(cframe)
  292. scrollbar.pack(side=Tkinter.RIGHT, fill="y")
  293. #pool = Tkinter.Listbox(root,selectmode="extended",exportselection=0)
  294. li_nodes = Tkinter.Listbox(cframe,exportselection=0,width=35,font=font1)
  295. li_nodes.pack(side="left",expand=0,fill="y")
  296. li_nodes.bind("<ButtonRelease-1>",load )
  297. li_nodes.config(yscrollcommand=scrollbar.set)
  298. scrollbar.config(command=li_nodes.yview)
  299. eframe = Tkinter.Frame(cframe)
  300. eframe.pack(side="left",expand=0,fill="y")
  301. eframe1 = Tkinter.Frame(cframe)
  302. eframe1.pack(side="left",expand=0,fill="y")
  303. # ----------------------------------------------
  304. line_frame = Tkinter.Frame(eframe)
  305. line_frame.pack(side="top",expand=0,fill="x")
  306. Tkinter.Label(line_frame,text="OLD IP:",font=font3,width=6).pack(side="left",expand=0,fill="y")
  307. e_ip = Tkinter.Entry(line_frame,font=font20,width=13)
  308. e_ip["bg"] = "lightgrey"
  309. e_ip.pack(side="left")
  310. #b_scan = Tkinter.Button(line_frame,width=14,font=font3)
  311. #b_scan.pack(side="left",expand=1)
  312. # ----------------------------------------------
  313. line_frame = Tkinter.Frame(eframe)
  314. line_frame.pack(side="top",expand=0,fill="x")
  315. e_ip_label = Tkinter.Label(line_frame,text=" IP:",font=font3,width=6)
  316. e_ip_label.pack(side="left",expand=0,fill="y")
  317. e_ip_new = Tkinter.Entry(line_frame,font=font20,width=13)
  318. e_ip_new.bind("<Return>", set_ip )
  319. e_ip_new.bind("<KP_Enter>", set_ip)
  320. #e_ip_new.bind("<Tab>", update_name)
  321. e_ip_new.bind("<ISO_Left_Tab>", set_ip)
  322. e_ip_new.pack(side="left")
  323. #-------------------------------------------- line
  324. line_frame = Tkinter.Frame(eframe)
  325. line_frame.pack(side="top",expand=0,fill="x")
  326. variable = Tkinter.StringVar(root)
  327. variable.set("255.0.0.0") # default value
  328. Tkinter.Label(line_frame,text="MASK",font=font3,width=6).pack(side="left",expand=0,fill="y")
  329. e_mask_new = Tkinter.OptionMenu(line_frame, variable,"255.255.255.0","255.0.0.0") #,width=10)
  330. e_mask_new.configure(font=("Helvetica", 22))
  331. e_mask_new.configure(width=10)
  332. e_mask_new["bg"] = "#fff"
  333. #heigh=1,font=("Helvetica", 20)
  334. e_mask_new.pack(side="left")
  335. #e_mask_new.insert("end","255.0.0.0")
  336. #e_mask_new.insert("end","255.255.255.0")
  337. b_scan = Tkinter.Button(line_frame,text="SEND TO NODE",command=set_ip,width=14,font=font1)
  338. b_scan.pack(side="left",expand=0)
  339. #-------------------------------------------- line
  340. line_frame = Tkinter.Frame(eframe)
  341. line_frame.pack(side="top",expand=0,fill="x")
  342. Tkinter.Label(line_frame,text="MAC:",font=font3,width=6).pack(side="left",expand=0,fill="y")
  343. e_mac = Tkinter.Entry(line_frame,width=13,font=font20)
  344. e_mac.pack(side="left")
  345. e_mac["bg"] = "lightgrey"
  346. e_mac2 = Tkinter.Entry(line_frame,width=3,font=font20)
  347. e_mac2.pack(side="left")
  348. e_mac2.bind("<Return>", send_mac )
  349. e_mac2.bind("<KP_Enter>", send_mac)
  350. Tkinter.Button(line_frame,text="SEND TO NODE",command=send_mac,width=14,font=font1).pack(side="left",expand=0)
  351. #-------------------------------------------- line
  352. #b_scan = Tkinter.Button(eframe1,width=14,font=font3)
  353. #b_scan.pack(side="top",expand=0)
  354. line_frame = Tkinter.Frame(eframe)
  355. line_frame.pack(side="top",expand=0,fill="x")
  356. Tkinter.Label(line_frame,text="DMX:",font=font3,width=6).pack(side="left",expand=0,fill="y")
  357. b_set_node_pin = Tkinter.Button(line_frame,text="HW-PIN",command=set_node_pin,width=6,font=font3)
  358. b_set_node_pin.pack(side="left",expand=0)
  359. b_set_node_in = Tkinter.Button(line_frame,text="IN",command=set_node_in,width=6,font=font3)
  360. b_set_node_in.pack(side="left",expand=0)
  361. b_set_node_out = Tkinter.Button(line_frame,text="OUT",command=set_node_out,width=6,font=font3)
  362. b_set_node_out.pack(side="left",expand=0)
  363. #-------------------------------------------- line
  364. line_frame = Tkinter.Frame(eframe)
  365. line_frame.pack(side="top",expand=0,fill="x")
  366. Tkinter.Label(line_frame,text="CMD",font=font3,width=6).pack(side="left",expand=0,fill="y")
  367. e_cmd = Tkinter.Entry(line_frame,font=font3,width=16)
  368. e_cmd.bind("<Return>", send_cmd )
  369. e_cmd.pack(side="left")
  370. #-------------------------------------------- line
  371. line_frame = Tkinter.Frame(eframe)
  372. line_frame.pack(side="top",expand=0,fill="x")
  373. Tkinter.Label(line_frame,text="L-Name",font=font3,width=6).pack(side="left",expand=0,fill="y")
  374. e_lname = Tkinter.Entry(line_frame,font=font3,width=10)
  375. e_lname.pack(side="left")
  376. #-------------------------------------------- line
  377. line_frame = Tkinter.Frame(eframe)
  378. line_frame.pack(side="top",expand=0,fill="x")
  379. Tkinter.Label(line_frame,text="S-Name",font=font3,width=6).pack(side="left",expand=0,fill="y")
  380. e_sname = Tkinter.Entry(line_frame,font=font3,width=10)
  381. e_sname.pack(side="left")
  382. #-------------------------------------------- line
  383. line_frame = Tkinter.Frame(eframe)
  384. line_frame.pack(side="top",expand=0,fill="x")
  385. Tkinter.Label(line_frame,text="ArtNet",font=font3,width=6).pack(side="left",expand=0,fill="y")
  386. Tkinter.Label(line_frame,text="SUB:",font=font3,width=4).pack(side="left",expand=0,fill="y")
  387. e_artnet_uni1 = Tkinter.Entry(line_frame,font=font3,width=4)
  388. e_artnet_uni1.pack(side="left")
  389. Tkinter.Label(line_frame,text="NET:",font=font3,width=4).pack(side="left",expand=0,fill="y")
  390. e_artnet_uni1 = Tkinter.Entry(line_frame,font=font3,width=4)
  391. e_artnet_uni1.pack(side="left")
  392. Tkinter.Label(line_frame,text="UNI:",font=font3,width=4).pack(side="left",expand=0,fill="y")
  393. e_artnet_uni1 = Tkinter.Entry(line_frame,font=font3,width=4)
  394. e_artnet_uni1.pack(side="left")
  395. Tkinter.Button(line_frame,text="SEND TO NODE",command=send_none,width=14,font=font1).pack(side="left",expand=0)
  396. #-------------------------------------------- line
  397. b_scan = Tkinter.Text(eframe,width=20,font=font2)
  398. b_scan.pack(side="top",expand=1,fill="x")
  399. #-------------------------------------------- line
  400. line_frame = Tkinter.Frame(eframe1)
  401. line_frame.pack(side="top",expand=0,fill="x")
  402. Tkinter.Label(line_frame,text="CMD",font=font3,width=6).pack(side="left",expand=0,fill="y")
  403. e_cmd2 = Tkinter.Entry(line_frame,font=font3,width=16)
  404. e_cmd2.insert("end","DMX ERASE ")
  405. e_cmd2.bind("<Return>", send_cmd2 )
  406. e_cmd2.pack(side="left")
  407. #-------------------------------------------- line
  408. line_frame = Tkinter.Frame(eframe1)
  409. line_frame.pack(side="top",expand=0,fill="x")
  410. Tkinter.Label(line_frame,text="CMD",font=font3,width=6).pack(side="left",expand=0,fill="y")
  411. e_cmd3 = Tkinter.Entry(line_frame,font=font3,width=16)
  412. e_cmd3.insert("end","DMX OUT STORE ")
  413. e_cmd3.bind("<Return>", send_cmd3 )
  414. e_cmd3.pack(side="left")
  415. #-------------------------------------------- line
  416. line_frame = Tkinter.Frame(eframe1)
  417. line_frame.pack(side="top",expand=0,fill="x")
  418. Tkinter.Label(line_frame,text="CMD",font=font3,width=6).pack(side="left",expand=0,fill="y")
  419. e_cmd4 = Tkinter.Entry(line_frame,font=font3,width=16)
  420. e_cmd4.insert("end","DMX OUT SET 2")
  421. e_cmd4.bind("<Return>", send_cmd4 )
  422. e_cmd4.pack(side="left")
  423. #-------------------------------------------- line
  424. line_frame = Tkinter.Frame(eframe1)
  425. line_frame.pack(side="top",expand=0,fill="x")
  426. Tkinter.Label(line_frame,text="CMD",font=font3,width=6).pack(side="left",expand=0,fill="y")
  427. e_cmd5 = Tkinter.Entry(line_frame,font=font3,width=16)
  428. e_cmd5.insert("end","REBOOT ")
  429. e_cmd5.bind("<Return>", send_cmd5 )
  430. e_cmd5.pack(side="left")
  431. thread.start_new_thread(_scan, () )
  432. nodscaner.bind_cmd_node()
  433. def read_cmd_buf():
  434. b_scan.insert("end", "buf read\n" )
  435. while 1:
  436. if nodscaner.node_cmd_buf_list:
  437. msg = str(nodscaner.node_cmd_buf_list)
  438. print("read_cmd_buf msg",msg)
  439. nodscaner.node_cmd_buf_list = []
  440. stamp = str(time.time())+"\n"
  441. stamp = time.strftime("%Y-%m-%d %X\n")
  442. b_scan.insert("end",stamp)
  443. b_scan.insert("end", msg +"\n")
  444. b_scan.see("end")
  445. time.sleep(0.1)
  446. #thread.start_new_thread(nodscaner.node_cmd_recive, () )
  447. #thread.start_new_thread(read_cmd_buf, () )
  448. def _update():
  449. while 1:
  450. time.sleep(10)
  451. root.update_idletasks()
  452. def X():
  453. thread.start_new_thread(nodscaner.node_cmd_recive, () )
  454. thread.start_new_thread(read_cmd_buf, () )
  455. thread.start_new_thread(_update, () )
  456. #thread.start_new_thread(node_cmd_recive, () )
  457. #send_node_cmd(ip=(2,0,0,91),cmd="DMX OUT STORE")
  458. nodscaner.send_node_cmd(ip=(2,255,255,255),cmd="CMD GT ")
  459. #nodscaner.send_node_cmd(ip,cmd=cmd)
  460. rx = nodscaner.ArtNetNodes()
  461. #rx.loop()
  462. z = 0
  463. poll()
  464. while 1:
  465. nodes = rx.get()
  466. #print(len(nodes))
  467. if z % 10 == 0:
  468. pass
  469. #print("----")
  470. #pass#print("node count",len(nodes),rx.tick())
  471. #for node in nodes:
  472. # print(node["MAC"],node["lname"])
  473. z += 1
  474. time.sleep(0.2)
  475. print()
  476. print("time out")
  477. raw_input("ENDE")
  478. thread.start_new_thread(X,()) #node_cmd_recive, () )
  479. root.mainloop()