{"id":37,"date":"2026-02-20T16:45:03","date_gmt":"2026-02-20T16:45:03","guid":{"rendered":"https:\/\/papaya.hopto.org\/?p=37"},"modified":"2026-02-20T16:45:04","modified_gmt":"2026-02-20T16:45:04","slug":"notes-linux-to-pi-io-testing","status":"publish","type":"post","link":"https:\/\/papaya.hopto.org\/?p=37","title":{"rendered":"Notes &#8211; Linux to Pi IO testing"},"content":{"rendered":"\n<ol class=\"wp-block-list\">\n<li>Install Pycharm in Ubunto 20.04 LTS.<\/li>\n<\/ol>\n\n\n<p>\u00a0<strong> \u00a0 sudo snap install pycharm-community &#8211;classic<\/strong><\/p>\n\n\n<p>2. Install vncserver<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&nbsp; &nbsp;sudo apt update\n\n&nbsp; &nbsp;sudo&nbsp; apt install sc xfce4 xfce4-goodies\n\n&nbsp; &nbsp;sudo apt install tightvncserver<\/code><\/pre>\n\n\n\n<p>3. Configure vncserver<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>vncserver -kill :1\nmv ~\/.vnc\/xstartup ~\/.vnc\/xstartup.bak\nnano ~\/.vnc\/xstartup\n\nAdd the following lines to xstartup\n<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>#!\/bin\/bash\nxrdb $HOME\/.Xresources\nstartxfce4 &amp;<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>chmod +x ~\/.vnc\/xstartup<\/code><\/pre>\n\n\n\n<p>Start vncserver<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>vncserver<\/code><\/pre>\n\n\n\n<p>On another computer that is running VNCviewer, enter IP:5901 where IP is the IP address of the Ubuntu computer. If there are display issues ,<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>touch ~\/.Xauthority\nsudo chown $USER:$USER ~\/.Xauthority\n<\/code><\/pre>\n\n\n\n<p>Install pyuic . Python3.12 is already installed in Ubuntu. For some reason when installing the package in PyCharm with a virtual environment it fails to install pyqt5-tools. The one below works.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt install pyqt5-dev-tools<\/code><\/pre>\n\n\n\n<p>To generate a python file for the  ui created in QTDesigned<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img fetchpriority=\"high\" decoding=\"async\" width=\"900\" height=\"576\" src=\"https:\/\/papaya.hopto.org\/wp-content\/uploads\/2025\/05\/image-5.png\" alt=\"\" class=\"wp-image-51\" srcset=\"https:\/\/papaya.hopto.org\/wp-content\/uploads\/2025\/05\/image-5.png 900w, https:\/\/papaya.hopto.org\/wp-content\/uploads\/2025\/05\/image-5-300x192.png 300w, https:\/\/papaya.hopto.org\/wp-content\/uploads\/2025\/05\/image-5-768x492.png 768w\" sizes=\"(max-width: 900px) 100vw, 900px\" \/><\/figure>\n\n\n\n<pre class=\"wp-block-code\"><code>pyuic5  untitled.ui -o test.py <\/code><\/pre>\n\n\n\n<p>Generated test.py. Note that the test.py file should not be modified. Instead the ui file should be changed and then the above command is run again. Part of code for test.py<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># -*- coding: utf-8 -*-\n\n# Form implementation generated from reading ui file 'untitled.ui'\n#\n# Created by: PyQt5 UI code generator 5.14.1\n#\n# WARNING! All changes made in this file will be lost!\n\n\nfrom PyQt5 import QtCore, QtGui, QtWidgets\n\n\nclass Ui_MainWindow(object):\n    def setupUi(self, MainWindow):\n        MainWindow.setObjectName(\"MainWindow\")\n        MainWindow.resize(800, 600)\n        self.centralwidget = QtWidgets.QWidget(MainWindow)\n        self.centralwidget.setObjectName(\"centralwidget\")\n        self.label = QtWidgets.QLabel(self.centralwidget)\n        self.label.setGeometry(QtCore.QRect(100, 90, 121, 16))\n        self.label.setObjectName(\"label\")\n        self.AOut0 = QtWidgets.QLCDNumber(self.centralwidget)\n        self.AOut0.setGeometry(QtCore.QRect(400, 120, 64, 23))\n        self.AOut0.setObjectName(\"AOut0\")\n        self.label_10 = QtWidgets.QLabel(self.centralwidget)\n        self.label_10.setGeometry(QtCore.QRect(240, 90, 121, 16))\n        self.label_10.setObjectName(\"label_10\")\n        self.layoutWidget = QtWidgets.QWidget(self.centralwidget)\n        self.layoutWidget.setGeometry(QtCore.QRect(210, 120, 16, 181))\n        self.layoutWidget.setObjectName(\"layoutWidget\")\n        self.verticalLayout_3 = QtWidgets.QVBoxLayout(self.layoutWidget)\n        self.verticalLayout_3.setContentsMargins(0, 0, 0, 0)\n        self.verticalLayout_3.setObjectName(\"verticalLayout_3\")\n        self.label_11 = QtWidgets.QLabel(self.layoutWidget)\n        self.label_11.setObjectName(\"label_11\")\n        self.verticalLayout_3.addWidget(self.label_11)\n        self.label_12 = QtWidgets.QLabel(self.layoutWidget)\n        self.label_12.setObjectName(\"label_12\")\n        self.verticalLayout_3.addWidget(self.label_12)\n        self.label_13 = QtWidgets.QLabel(self.layoutWidget)\n        self.label_13.setObjectName(\"label_13\")\n        self.verticalLayout_3.addWidget(self.label_13)\n        self.label_14 = QtWidgets.QLabel(self.layoutWidget)\n<\/code><\/pre>\n\n\n\n<p class=\"has-text-align-left\">To use the form  in your python file import the class<\/p>\n\n\n\n<p>from test import UI_MainWindow<\/p>\n\n\n\n<p>Sample code  <strong>display.py<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>import sys<br>from test import Ui_MainWindow<br>from PyQt5.QtWidgets import QMainWindow,QApplication, QWidget,QPushButton,QLCDNumber<br><br><br>class Setup(QMainWindow,Ui_MainWindow): # inherit from the base class and the Ui_MainWindow so that ui elements are available<br><br> def __init__(self,parent=None): #parent=None means a top level window<br>        super().__init__(parent) # calls the constructor of the parent classes<br>                                 # for proper initialization<br>        self.setupUi(self)<br><br><br>if __name__ == '__main__':<br>    app = QApplication(sys.argv)<br>    window = Setup()<br>    window.show()<br>    sys.exit(app.exec())<br>~<br><br><br><\/code><\/pre>\n\n\n\n<p class=\"has-text-align-left\">Note:  In PyCharm, if  pyqt5-tools is enabled,  just open a terminal ( bottom left) and type pyuic5 file.ui -o  test.py to generate the python file. <\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u00a0 \u00a0 sudo snap install pycharm-community &#8211;classic 2. Install vncserver 3. Configure vncserver Start vncserver On another computer that is running VNCviewer, enter IP:5901 where IP is the IP address of the Ubuntu computer. If there are display issues , Install pyuic . Python3.12 is already installed in Ubuntu. For some reason when installing the &#8230; <a title=\"Notes &#8211; Linux to Pi IO testing\" class=\"read-more\" href=\"https:\/\/papaya.hopto.org\/?p=37\" aria-label=\"Read more about Notes &#8211; Linux to Pi IO testing\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_regular_price":[],"currency_symbol":[],"footnotes":""},"categories":[1],"tags":[],"class_list":["post-37","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"post_slider_layout_featured_media_urls":{"thumbnail":"","post_slider_layout_landscape_large":"","post_slider_layout_portrait_large":"","post_slider_layout_square_large":"","post_slider_layout_landscape":"","post_slider_layout_portrait":"","post_slider_layout_square":"","full":""},"_links":{"self":[{"href":"https:\/\/papaya.hopto.org\/index.php?rest_route=\/wp\/v2\/posts\/37","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/papaya.hopto.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/papaya.hopto.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/papaya.hopto.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/papaya.hopto.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=37"}],"version-history":[{"count":16,"href":"https:\/\/papaya.hopto.org\/index.php?rest_route=\/wp\/v2\/posts\/37\/revisions"}],"predecessor-version":[{"id":97,"href":"https:\/\/papaya.hopto.org\/index.php?rest_route=\/wp\/v2\/posts\/37\/revisions\/97"}],"wp:attachment":[{"href":"https:\/\/papaya.hopto.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=37"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/papaya.hopto.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=37"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/papaya.hopto.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=37"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}