Browse Source

Doku update

subDesTagesMitExtraKaese 4 years ago
parent
commit
75740fc0f3
9 changed files with 364 additions and 328 deletions
  1. 2 1
      .gitignore
  2. 26 32
      README.md
  3. 29 0
      hardware/bom.md
  4. BIN
      hardware/gpio_pinout.png
  5. 0 265
      software/BananaPiM2+/doku.md
  6. 192 30
      software/install.md
  7. 37 0
      software/tests/btRecv.py
  8. 41 0
      software/tests/btSend.py
  9. 37 0
      software/ui/README.md

+ 2 - 1
.gitignore

@@ -1,2 +1,3 @@
 *.code-workspace
-__pycache__/
+__pycache__/
+.vscode

+ 26 - 32
README.md

@@ -2,37 +2,31 @@
 
 ![Hardware Chart](hardware/windkanal.png)
 
-# Komponentenliste [BOM](hardware/pcb/bom.xlsx)
-
-| Designator                                        | Name                         | Footprint    | Stück |
-|---------------------------------------------------|------------------------------|--------------|-------|
-| C1,C6,C2,C5                                       | SMD Kondensator              | 0805'        | 4     |
-| R2,R3,R4,R5,R5,R7,R8                              | SMD Widerstand               | 0805'        | 7     |
-| R1                                                | SMD Widerstand               | 0805'        | 1     |
-| LED1                                              | Led Grün                     | 5mm          | 1     |
-| LED2                                              | LED Rot                      | 5mm          | 1     |
-| LED3                                              | LED Gelb                     | 5mm          | 1     |
-| Q1,Q4                                             | SMD NPN Transistor           | SOT\-23      | 2     |
-| Q2                                                | SMD PNP Transistor           | SOT\-23      | 1     |
-| U2,U5                                             | 8\-Kanal SPI ADC             | SOIC\-16     | 2     |
-| U4                                                | Bidirektionaler Pegelwandler | SSOP\-20     | 1     |
-| JP1\-JP7                                          | Zweifach\-Schraubklemme      | 3,5mm pitch  | 15    |
-| P1                                                | 2x20\-pin stackable Header   | 2,54mm pitch | 1     |
-| H1                                                | 1x3\-pin stackable Header    | 2,54mm pitch | 1     |
-| [PCB](https://easyeda.com/User201/windkanal) | 65mm x 65mm                  | \-           | 1     |
-| Banana Pi BPI\-M2\+                               | Single\-Board\-Computer      | \-           | 1     |
-| M2\.5 Abstandshalter für PI und PCB               | M2\.5, 10mm                  | \-           | 4     |
-| Netzteil                                          | 5V 3A                        | \-           | 1     |
-| HDMI Verlängerungskabel zum Einbau                | 1m                           | \-           | 1     |
-| USB Verlängerungskabel zum Einbau                 | 0,5m                         | \-           | 2     |
-| HDMI Kabel                                        | \-                           | \-           | 1     |
-| HDMI Monitor                                      | \-                           | \-           | 1     |
-| USB Hub                                           | \-                           | \-           | 1     |
-| USB Tastatur                                      | \-                           | \-           | 1     |
-| USB Maus                                          | \-                           | \-           | 1     |
-
-
-# [PCB](https://easyeda.com/User201/windkanal)
+
+# Hardware
+[PCB](https://easyeda.com/User201/windkanal)
+
 [Gerber Dateien](hardware/pcb)
 
-# [Installation](software/install.md)
+[Komponentenliste](hardware/bom.md)
+
+## GPIO Pinout
+
+![GPIO Pinout](hardware/gpio_pinout.png)
+
+# Installation
+[software/install.md](software/install.md)
+
+# Starten
+
+```bash
+cd software/
+python3 main.py
+```
+
+
+# Entwicklung
+[software/ui/README.md](software/ui/README.md)
+
+## Guides
+PyQt5 Tutorial https://likegeeks.com/pyqt5-tutorial/

+ 29 - 0
hardware/bom.md

@@ -0,0 +1,29 @@
+
+# Komponentenliste [BOM](hardware/pcb/bom.xlsx)
+
+| Designator                                        | Name                         | Footprint    | Stück |
+|---------------------------------------------------|------------------------------|--------------|-------|
+| C1,C6,C2,C5                                       | SMD Kondensator              | 0805'        | 4     |
+| R2,R3,R4,R5,R5,R7,R8                              | SMD Widerstand               | 0805'        | 7     |
+| R1                                                | SMD Widerstand               | 0805'        | 1     |
+| LED1                                              | Led Grün                     | 5mm          | 1     |
+| LED2                                              | LED Rot                      | 5mm          | 1     |
+| LED3                                              | LED Gelb                     | 5mm          | 1     |
+| Q1,Q4                                             | SMD NPN Transistor           | SOT\-23      | 2     |
+| Q2                                                | SMD PNP Transistor           | SOT\-23      | 1     |
+| U2,U5                                             | 8\-Kanal SPI ADC             | SOIC\-16     | 2     |
+| U4                                                | Bidirektionaler Pegelwandler | SSOP\-20     | 1     |
+| JP1\-JP7                                          | Zweifach\-Schraubklemme      | 3,5mm pitch  | 15    |
+| P1                                                | 2x20\-pin stackable Header   | 2,54mm pitch | 1     |
+| H1                                                | 1x3\-pin stackable Header    | 2,54mm pitch | 1     |
+| [PCB](https://easyeda.com/User201/windkanal) | 65mm x 65mm                  | \-           | 1     |
+| Banana Pi BPI\-M2\+                               | Single\-Board\-Computer      | \-           | 1     |
+| M2\.5 Abstandshalter für PI und PCB               | M2\.5, 10mm                  | \-           | 4     |
+| Netzteil                                          | 5V 3A                        | \-           | 1     |
+| HDMI Verlängerungskabel zum Einbau                | 1m                           | \-           | 1     |
+| USB Verlängerungskabel zum Einbau                 | 0,5m                         | \-           | 2     |
+| HDMI Kabel                                        | \-                           | \-           | 1     |
+| HDMI Monitor                                      | \-                           | \-           | 1     |
+| USB Hub                                           | \-                           | \-           | 1     |
+| USB Tastatur                                      | \-                           | \-           | 1     |
+| USB Maus                                          | \-                           | \-           | 1     |

BIN
hardware/gpio_pinout.png


+ 0 - 265
software/BananaPiM2+/doku.md

@@ -1,265 +0,0 @@
-Debian 9 with kernel 4.4.55_3
-
-http://wiki.banana-pi.org/Banana_Pi_BPI-M2%2B#Raspbian
-
-``` bash
-
-# Install System
-
-sudo fdisk -l
-
-unzip 2018-11-09-debian-9-stretch-mate-desktop-preview-bpi-m2p-4.4-sd-emmc.img.zip
-
-sudo dd if=2018-11-09-debian-9-stretch-mate-desktop-preview-bpi-m2p-sd-emmc.img of=/dev/mmcblk1 bs=10MB
-
-# Bluetooth Setup
-
-sudo apt install libdbus-1-dev libglib2.0-dev libudev-dev libical-dev libreadline-dev
-
-wget http://www.kernel.org/pub/linux/bluetooth/bluez-5.49.tar.xz
-
-tar -xf bluez-5.49.tar.xz
-
-cd bluez-5.49/
-
-./configure --prefix=/usr --mandir=/usr/share/man --sysconfdir=/etc --localstatedir=/var --enable-experimental
-
-make -j4
-
-sudo make install
-
-sudo adduser pi bluetooth
-
-sudo cp /etc/dbus-1/system.d/bluetooth.conf /etc/dbus-1/system.d/bluetooth.conf.bak
-
-sudo nano /etc/dbus-1/system.d/bluetooth.conf
-
-#add the #comment lines to the bluetooth.conf without the # 
-
-<policy user="root">
-    <allow own="org.bluez"/>
-    <allow send_destination="org.bluez"/>
-    <allow send_interface="org.bluez.Agent1"/>
-    <allow send_interface="org.bluez.MediaEndpoint1"/>
-    <allow send_interface="org.bluez.MediaPlayer1"/>
-    <allow send_interface="org.bluez.Profile1"/>
-    #<allow send_interface="org.bluez.AlertAgent1"/>
-    #<allow send_interface="org.bluez.ThermometerWatcher1"/>
-    #<allow send_interface="org.bluez.HeartRateWatcher1"/>
-    #<allow send_interface="org.bluez.CyclingSpeedWatcher1"/>
-    <allow send_interface="org.bluez.GattCharacteristic1"/>
-    <allow send_interface="org.bluez.GattDescriptor1"/>
-    <allow send_interface="org.bluez.LEAdvertisement1"/>
-    <allow send_interface="org.freedesktop.DBus.ObjectManager"/>
-    <allow send_interface="org.freedesktop.DBus.Properties"/>
-  </policy>
-
-  #<!-- allow users of bluetooth group to communicate -->
-  #<policy group="bluetooth">
-  #  <allow send_destination="org.bluez"/>
-  #</policy>
-
-  <policy at_console="true">
-    <allow send_destination="org.bluez"/>
-  </policy>
-
-sudo reboot
-
-rfkill list
-
-0: sunxi-bt: Bluetooth
-	Soft blocked: no
-	Hard blocked: no
-1: phy0: Wireless LAN
-	Soft blocked: yes
-	Hard blocked: no
-2: brcmfmac-wifi: Wireless LAN
-	Soft blocked: yes
-	Hard blocked: no
-4: hci0: Bluetooth
-	Soft blocked: yes
-	Hard blocked: no
-
-rfkill unblock bluetooth
-
-0: sunxi-bt: Bluetooth
-	Soft blocked: no
-	Hard blocked: no
-1: phy0: Wireless LAN
-	Soft blocked: yes
-	Hard blocked: no
-2: brcmfmac-wifi: Wireless LAN
-	Soft blocked: yes
-	Hard blocked: no
-4: hci0: Bluetooth
-	Soft blocked: no
-	Hard blocked: no
-
-bluetoothctl
-
-power on
-
-agent on
-
-scan on
-
-# wait few seconds
-
-scan off
-
-pair 00:0B:CE:04:F6:66
-
-#Attempting to pair with 00:0B:CE:04:F6:66
-#Request PIN code
-#[blue1m[agent] Enter PIN code: 0000
-
-#[CHG] Device 00:0B:CE:04:F6:66 Connected: yes
-#[CHG] Device 00:0B:CE:04:F6:66 UUIDs: 00001101-0000-1000-8000-00805f9b34fb
-#[CHG] Device 00:0B:CE:04:F6:66 ServicesResolved: yes
-#[CHG] Device 00:0B:CE:04:F6:66 Paired: yes
-#Pairing successful
-
-info 00:0B:CE:04:F6:66
-
-#Device 00:0B:CE:04:F6:66 (public)
-#	Name: BAmobile
-#	Alias: BAmobile
-#	Class: 0x00001f00
-#	Paired: yes
-#	Trusted: no
-#	Blocked: no
-#	Connected: no
-#	LegacyPairing: yes
-#	UUID: Serial Port               (00001101-0000-1000-8000-00805f9b34fb)
-
-sudo rfcomm bind 0 00:0B:CE:04:F6:66
-
-sudo rfcomm show /dev/rfcomm0 0
-#rfcomm0: 00:0B:CE:04:F6:66 channel 1 clean
-
-#test send
-sudo python3 -c 'print("\26\01\62\65\72\6c\69\6e")' > /dev/rfcomm
-
-#test empfang
-cat /dev/rfcomm0
-
-sudo apt-get install python3-dev
-
-sudo apt install python3-pip
-
-python3 -m pip install setuptools
-
-python3 -m pip install wheel
-
-python3 -m pip install pybluez
-
-sudo apt autoremove
-
-# Python serial bluetooth transmitter / receiver
-
-sudo nano /etc/systemd/system/dbus-org.bluez.service
-
-changing
-
-ExecStart=/usr/lib/bluetooth/bluetoothd
-
-into
-
-ExecStart=/usr/lib/bluetooth/bluetoothd -C
-
-sudo sdptool add SP
-
-nano send_serial_bluetooth.py
-
-# Python Code Start
-
-#!/usr/bin/env python3
-
-import sys
-import bluetooth
-
-addr = None
-
-if len(sys.argv) < 2:
-    print("No device specified. Searching all nearby bluetooth devices for "
-          "the SampleServer service...")
-else:
-    addr = sys.argv[1]
-    print("Searching for SampleServer on {}...".format(addr))
-
-# search for the SampleServer service
-uuid = "00001101-0000-1000-8000-00805f9b34fb"
-service_matches = bluetooth.find_service(uuid=uuid, address=addr)
-
-if len(service_matches) == 0:
-    print("Couldn't find the SampleServer service.")
-    sys.exit(0)
-
-first_match = service_matches[0]
-port = first_match["port"]
-name = first_match["name"]
-host = first_match["host"]
-
-print("Connecting to \"{}\" on {}".format(name, host))
-
-# Create the client socket
-sock = bluetooth.BluetoothSocket(bluetooth.RFCOMM)
-sock.connect((host, port))
-
-print("Connected. Type something...")
-while True:
-    data = input()
-    if not data:
-        break
-    sock.send(data)
-
-sock.close()
-
-# Python Code End
-
-sudo hciconfig hci0 piscan
-
-nano receive_serial_bluetooth.py
-
-# Python Code Start
-
-#!/usr/bin/env python3
-
-import bluetooth
-
-server_sock = bluetooth.BluetoothSocket(bluetooth.RFCOMM)
-server_sock.bind(("", bluetooth.PORT_ANY))
-server_sock.listen(1)
-
-port = server_sock.getsockname()[1]
-
-uuid = "00001101-0000-1000-8000-00805f9b34fb"
-
-bluetooth.advertise_service(server_sock, "SampleServer", service_id=uuid,
-                            service_classes=[uuid, bluetooth.SERIAL_PORT_CLASS],
-                            profiles=[bluetooth.SERIAL_PORT_PROFILE],
-                            # protocols=[bluetooth.OBEX_UUID]
-                            )
-
-print("Waiting for connection on RFCOMM channel", port)
-
-client_sock, client_info = server_sock.accept()
-print("Accepted connection from", client_info)
-
-try:
-    while True:
-        data = client_sock.recv(1024)
-        if not data:
-            break
-        print("Received", data)
-except OSError:
-    pass
-
-print("Disconnected.")
-
-client_sock.close()
-server_sock.close()
-print("All done.")
-
-# Python Code End
-```

+ 192 - 30
software/install.md

@@ -1,67 +1,229 @@
 # Installation
 
-## Python 3
+# 1. Install System
 
-on Ubuntu / Debian
+Download image `Debian 9 with kernel 4.4.55_3` from http://wiki.banana-pi.org/Banana_Pi_BPI-M2%2B#Raspbian
+
+Write image to SD card
+``` bash
+sudo fdisk -l
+# SD card is /dev/mmcblk1
+
+unzip 2018-11-09-debian-9-stretch-mate-desktop-preview-bpi-m2p-4.4-sd-emmc.img.zip
+
+sudo dd if=2018-11-09-debian-9-stretch-mate-desktop-preview-bpi-m2p-sd-emmc.img of=/dev/mmcblk1 bs=10MB
+```
+Boot Banana Pi from SD card
+
+# 2. Bluetooth Setup
 
 ``` bash
 sudo apt update
 sudo apt upgrade -y
-sudo apt install python3-dev python3-pip
-python3 -m pip -U pip setuptools
+sudo apt install libdbus-1-dev libglib2.0-dev libudev-dev libical-dev libreadline-dev
+
+wget http://www.kernel.org/pub/linux/bluetooth/bluez-5.49.tar.xz
+
+tar -xf bluez-5.49.tar.xz && rm bluez-5.49.tar.xz
+
+cd bluez-5.49/
+
+./configure --prefix=/usr --mandir=/usr/share/man --sysconfdir=/etc --localstatedir=/var --enable-experimental
+
+make -j4
+
+sudo make install
+
+sudo adduser pi bluetooth
 ```
 
-## PyQt5 [Tutorial](https://likegeeks.com/pyqt5-tutorial/)
+# 3. Edit bluetooth.conf
+Add the marked lines to `bluetooth.conf`
 
-``` bash
-python3 -m pip install PyQt5 PyQt5-tools
+```bash 
+sudo cp /etc/dbus-1/system.d/bluetooth.conf /etc/dbus-1/system.d/bluetooth.conf.bak
+sudo nano /etc/dbus-1/system.d/bluetooth.conf
+```
+
+```xml
+<policy user="root">
+    <allow own="org.bluez"/>
+    <allow send_destination="org.bluez"/>
+    <allow send_interface="org.bluez.Agent1"/>
+    <allow send_interface="org.bluez.MediaEndpoint1"/>
+    <allow send_interface="org.bluez.MediaPlayer1"/>
+    <allow send_interface="org.bluez.Profile1"/>
+    <!-- add start -->
+        <allow send_interface="org.bluez.AlertAgent1"/>
+        <allow send_interface="org.bluez.ThermometerWatcher1"/>
+        <allow send_interface="org.bluez.HeartRateWatcher1"/>
+        <allow send_interface="org.bluez.CyclingSpeedWatcher1"/>
+    <!-- add end -->
+    <allow send_interface="org.bluez.GattCharacteristic1"/>
+    <allow send_interface="org.bluez.GattDescriptor1"/>
+    <allow send_interface="org.bluez.LEAdvertisement1"/>
+    <allow send_interface="org.freedesktop.DBus.ObjectManager"/>
+    <allow send_interface="org.freedesktop.DBus.Properties"/>
+  </policy>
+
+  <!-- add start -->
+    <!-- allow users of bluetooth group to communicate -->
+    <policy group="bluetooth">
+        <allow send_destination="org.bluez"/>
+    </policy>
+  <!-- add end -->
+
+  <policy at_console="true">
+    <allow send_destination="org.bluez"/>
+  </policy>
+```
+# 4. Reboot
+```bash
+sudo reboot
 ```
+# 5. Test Bluetooth
 
-## Bluetooth for Python
+```bash
+$ rfkill list
+
+    0: sunxi-bt: Bluetooth
+        Soft blocked: no
+        Hard blocked: no
+    1: phy0: Wireless LAN
+        Soft blocked: yes
+        Hard blocked: no
+    2: brcmfmac-wifi: Wireless LAN
+        Soft blocked: yes
+        Hard blocked: no
+    4: hci0: Bluetooth
+        Soft blocked: yes <--
+        Hard blocked: no
+
+$ rfkill unblock bluetooth
+
+    0: sunxi-bt: Bluetooth
+        Soft blocked: no
+        Hard blocked: no
+    1: phy0: Wireless LAN
+        Soft blocked: yes
+        Hard blocked: no
+    2: brcmfmac-wifi: Wireless LAN
+        Soft blocked: yes
+        Hard blocked: no
+    4: hci0: Bluetooth
+        Soft blocked: no <--
+        Hard blocked: no
+```
+Try pairing a device
+```bash
+$ bluetoothctl
 
-on Ubuntu / Debian
+> power on
 
-``` bash
-sudo apt-get install bluez bluez-tools python3-bluez
+> agent on
+
+> scan on
+
+# wait a few seconds
+
+> scan off
+
+> pair 00:0B:CE:04:F6:66
+
+    Attempting to pair with 00:0B:CE:04:F6:66
+    Request PIN code
+    [blue1m[agent] Enter PIN code: 0000
+
+    [CHG] Device 00:0B:CE:04:F6:66 Connected: yes
+    [CHG] Device 00:0B:CE:04:F6:66 UUIDs: 00001101-0000-1000-8000-00805f9b34fb
+    [CHG] Device 00:0B:CE:04:F6:66 ServicesResolved: yes
+    [CHG] Device 00:0B:CE:04:F6:66 Paired: yes
+    Pairing successful
+
+> info 00:0B:CE:04:F6:66
+
+    Device 00:0B:CE:04:F6:66 (public)
+    	Name: BAmobile
+    	Alias: BAmobile
+    	Class: 0x00001f00
+    	Paired: yes
+    	Trusted: no
+    	Blocked: no
+    	Connected: no
+    	LegacyPairing: yes
+    	UUID: Serial Port               (00001101-0000-1000-8000-00805f9b34fb)
 ```
+Try to send a packet
+```bash
+sudo rfcomm bind 0 00:0B:CE:04:F6:66
 
-## SPI for Python
+sudo rfcomm show /dev/rfcomm0 0
+#rfcomm0: 00:0B:CE:04:F6:66 channel 1 clean
 
-Install https://github.com/doceme/py-spidev
+#test send
+sudo python3 -c 'print("\26\01\62\65\72\6c\69\6e")' > /dev/rfcomm
+
+#test receive
+cat /dev/rfcomm0
+```
+# 6. Install python
+```bash
+sudo apt update
+sudo apt upgrade -y
+sudo apt autoremove
+
+sudo apt install python3-dev python3-pip
 
-## Modifying UI with PyQt5 designer
+python3 -m pip -U pip setuptools
+```
 
-on Ubuntu / Debian
+## 6.1 Install pybluez
+```bash
+sudo apt-get install bluez bluez-tools python3-bluez
+
+python3 -m pip install wheel pybluez
+```
 
+## 6.2 Install PyQt5
 ``` bash
-sudo apt install qt4-designer
-designer-qt4
+python3 -m pip install PyQt5 PyQt5-tools
 ```
 
-Location of PyQt5 designer.exe on Windows
-> C:\Program Files\Python36\Lib\site-packages\pyqt5-tools\
+## 6.3 Install spidev
+Install https://github.com/doceme/py-spidev
 
-or
+Warning: Doesn't work on `Debian 9 with kernel 4.4.55_3`
 
-> C:\Users\\\<User>\AppData\Local\Programs\Python\\\<version>\Lib\site-packages\pyqt5-tools\
+Workaround: use gpio bitbang instead of spi device
 
-## Regenerate UI
+# 7. Fix `bluetoothd` service
+Edit `dbus-org.bluez.service`
+```bash
+sudo nano /etc/systemd/system/dbus-org.bluez.service
+```
+change
+> ExecStart=/usr/lib/bluetooth/bluetoothd
 
-on Linux
+into
+> ExecStart=/usr/lib/bluetooth/bluetoothd -C
 
 ```bash
-python3 -m PyQt5.uic.pyuic youruifile -o yourpyfile -x
+sudo systemctl daemon-reload
+sudo sdptool add SP
 ```
 
-on Windows
+# 8. Run Python serial examples
+
+```bash
+python3 tests/btSend.py
+
+sudo hciconfig hci0 piscan
 
-```cmd
-pyuic5 youruifile -o yourpyfile -x
+python3 tests/btRecv.py
 ```
 
-## Running
+# 9. Build and run Frontend
 
 ```bash
-cd software/
-python3 main.py
+./run.sh
 ```

+ 37 - 0
software/tests/btRecv.py

@@ -0,0 +1,37 @@
+#!/usr/bin/env python3
+
+import bluetooth
+
+server_sock = bluetooth.BluetoothSocket(bluetooth.RFCOMM)
+server_sock.bind(("", bluetooth.PORT_ANY))
+server_sock.listen(1)
+
+port = server_sock.getsockname()[1]
+
+uuid = "00001101-0000-1000-8000-00805f9b34fb"
+
+bluetooth.advertise_service(server_sock, "SampleServer", service_id=uuid,
+                            service_classes=[uuid, bluetooth.SERIAL_PORT_CLASS],
+                            profiles=[bluetooth.SERIAL_PORT_PROFILE],
+                            # protocols=[bluetooth.OBEX_UUID]
+                            )
+
+print("Waiting for connection on RFCOMM channel", port)
+
+client_sock, client_info = server_sock.accept()
+print("Accepted connection from", client_info)
+
+try:
+    while True:
+        data = client_sock.recv(1024)
+        if not data:
+            break
+        print("Received", data)
+except OSError:
+    pass
+
+print("Disconnected.")
+
+client_sock.close()
+server_sock.close()
+print("All done.")

+ 41 - 0
software/tests/btSend.py

@@ -0,0 +1,41 @@
+#!/usr/bin/env python3
+
+import sys
+import bluetooth
+
+addr = None
+
+if len(sys.argv) < 2:
+    print("No device specified. Searching all nearby bluetooth devices for "
+          "the SampleServer service...")
+else:
+    addr = sys.argv[1]
+    print("Searching for SampleServer on {}...".format(addr))
+
+# search for the SampleServer service
+uuid = "00001101-0000-1000-8000-00805f9b34fb"
+service_matches = bluetooth.find_service(uuid=uuid, address=addr)
+
+if len(service_matches) == 0:
+    print("Couldn't find the SampleServer service.")
+    sys.exit(0)
+
+first_match = service_matches[0]
+port = first_match["port"]
+name = first_match["name"]
+host = first_match["host"]
+
+print("Connecting to \"{}\" on {}".format(name, host))
+
+# Create the client socket
+sock = bluetooth.BluetoothSocket(bluetooth.RFCOMM)
+sock.connect((host, port))
+
+print("Connected. Type something...")
+while True:
+    data = input()
+    if not data:
+        break
+    sock.send(data)
+
+sock.close()

+ 37 - 0
software/ui/README.md

@@ -0,0 +1,37 @@
+
+## Modifying UI with PyQt5 designer
+
+on Ubuntu / Debian
+
+``` bash
+sudo apt install qt4-designer
+designer-qt4
+```
+
+Location of PyQt5 designer.exe on Windows
+> C:\Program Files\Python36\Lib\site-packages\pyqt5-tools\
+
+or
+
+> C:\Users\\\<User>\AppData\Local\Programs\Python\\\<version>\Lib\site-packages\pyqt5-tools\
+
+## Regenerate UI
+
+on Linux
+
+```bash
+python3 -m PyQt5.uic.pyuic youruifile -o yourpyfile -x
+```
+
+on Windows
+
+```cmd
+pyuic5 youruifile -o yourpyfile -x
+```
+
+## Running
+
+```bash
+cd software/
+python3 main.py
+```