Browse Source

fix: gid 20, add: wlan-AP

micha 3 years ago
parent
commit
b47542ad46
4 changed files with 56 additions and 4 deletions
  1. 3 2
      ArtNetProcessor.py
  2. 14 0
      hostapd.conf
  3. 37 0
      setup_AP.sh
  4. 2 2
      start_ASP.sh

+ 3 - 2
ArtNetProcessor.py

@@ -347,7 +347,8 @@ class Window():
                             if v == 0:
                                 v = "+"
                             x += str(v).rjust(4," ")
-                            if (i+1) % 21 == 0:# and i:
+                            #if (i+1) % 21 == 0:# and i:
+                            if (i+1) % 20 == 0:# and i:
                                 lines.append(x)
                                 x=""
                         if x:
@@ -576,7 +577,7 @@ class HostBuffer():
         self.__universes = OrderedDict() # {} # 192.168.0.1 = [0]*512
         #self.update(host="localhost",univ=0,dmxframe=[6]*512)
         dmxframe = [0]*512
-        dmxframe[15] = 6
+        dmxframe[15] = -6
         #self.update(host="333.333.333.333",univ=8,dmxframe=dmxframe)
 
     def get_mtx(self,host="", univ=""):

+ 14 - 0
hostapd.conf

@@ -0,0 +1,14 @@
+interface=wlan0
+#bridge=br0
+hw_mode=g
+channel=7
+wmm_enabled=0
+macaddr_acl=0
+auth_algs=1
+ignore_broadcast_ssid=0
+wpa=2
+wpa_key_mgmt=WPA-PSK
+wpa_pairwise=TKIP
+#rsn_pairwise=CCMP
+ssid=rpi-desk
+wpa_passphrase=123zt56A

+ 37 - 0
setup_AP.sh

@@ -0,0 +1,37 @@
+#ip l add link br0 type bridge
+
+#ip netns add ap2 66
+#iw phy wlan0 set netns ap2
+#iw phy wlan0 set netns 66
+#ip l set wlan0 netns 66
+sleep 1
+date
+
+killall hostapd
+killall wpa_supplicant
+killall dnsmasq
+sleep 1
+ip l set wlan0 up
+
+sleep 2
+rfkill unblock all
+ip l set wlan0 up
+sleep 2
+ip a add 192.168.4.11/24 dev wlan0
+
+#for internet routing
+#iptables -t nat -A POSTROUTING -m iprange --src-range 192.168.4.0-192.168.4.255 -o eth0 -j MASQUERADE
+
+
+#-B in background
+#/usr/sbin/hostapd -B -P /run/hostapd.pid /etc/hostapd/hostapd.conf
+/usr/sbin/hostapd -B -P /run/hostapd.pid hostapd.conf
+sleep 2
+
+# -q debugg -d no-deamon
+/usr/sbin/dnsmasq  --dhcp-range=192.168.4.100,192.168.4.110 -q -a 192.168.4.11
+date
+echo "ende ----------------"
+#read -p hi
+#sleep 9999
+

+ 2 - 2
start_ASP.sh

@@ -5,7 +5,7 @@ netns=$(ip netns identify $$)
 
 python3 /home/pi/ASP/ArtNetProcessor.py --recive 10. --sendto 2.255.255.255 netns=$netns
 if [ $? != 0 ]; then
-     #python3 /home/user/ASP/ArtNetProcessor.py --recive 10. --sendto 2.255.255.255 netns=$netns
-     python3 /home/micha/ASP/ArtNetProcessor.py --recive 10. --sendto 2.255.255.255 netns=$netns
+     python3 /home/user/ASP/ArtNetProcessor.py --recive 10. --sendto 2.255.255.255 netns=$netns
+     #python3 /home/micha/ASP/ArtNetProcessor.py --recive 10. --sendto 2.255.255.255 netns=$netns
   
 fi