projects
/
stratum0-wiki.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
cf70ea7
)
/* Demonstrator-Anwendung */ Tür-öffner skript
author
Tsuro
<Tsuro@stratum0.org/mediawiki/>
Wed, 21 Nov 2012 21:50:44 +0000
(21:50 +0000)
committer
Tsuro
<Tsuro@stratum0.org/mediawiki/>
Wed, 21 Nov 2012 21:50:44 +0000
(21:50 +0000)
Doorbell_Extender.mw
patch
|
blob
|
history
diff --git
a/Doorbell_Extender.mw
b/Doorbell_Extender.mw
index
b6c8411
..
1a8d534
100644
(file)
--- a/
Doorbell_Extender.mw
+++ b/
Doorbell_Extender.mw
@@
-72,3
+72,21
@@
Java-Klasse, mit der UDP-Events gesendet und empfangen werden können.
* Events: siehe weiter oben
Verfügbar im [http://svn.tinyhost.de/stratum0/doorbell/trunk/UDP_SEND_workspace_%28Java%29/UDP-Send/src/doorbell/ SVN]
* Events: siehe weiter oben
Verfügbar im [http://svn.tinyhost.de/stratum0/doorbell/trunk/UDP_SEND_workspace_%28Java%29/UDP-Send/src/doorbell/ SVN]
+
+=== kleines Python-Skript um die Tür unten zu öffnen ===
+<pre>
+import socket as sock
+import time
+
+stop_command = b"EVENTDISTRv1;DoorUnten=RISING"
+start_command = b"EVENTDISTRv1;DoorUnten=FALLING"
+ip = "192.168.178.255"
+port = 31337
+
+s = sock.socket(sock.AF_INET, sock.SOCK_DGRAM)
+s.setsockopt(sock.SOL_SOCKET,sock.SO_BROADCAST,1)
+s.sendto(start_command,(ip,port))
+time.sleep(3)
+s.sendto(stop_command,(ip,port))
+s.close()
+</pre>
This page took
0.024405 seconds
and
4
git commands to generate.