Running Configuration Software

From pCT
Revision as of 09:20, 8 June 2021 by Vei046 (talk | contribs) (Created page with "My system: Windows 10 WSL2: Distributor ID: Ubuntu Description: Ubuntu 20.04.2 LTS Release: 20.04 Codename: focal Python 3.8.5 (default, Jan 27 2021, 15:41:1...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

My system:

Windows 10 WSL2: Distributor ID: Ubuntu Description: Ubuntu 20.04.2 LTS Release: 20.04 Codename: focal

Python 3.8.5 (default, Jan 27 2021, 15:41:15)

Non-standard dependencies are: uhal (from IPbus) PyQt5 pymongo

requires Ipbus and MongoDB

below are my steps to set it up for WSL2, and not tested for anything else. The general steps should be the same regardless. Terminal lines are marked with $.

Installing dependencies:

IPbus:

following https://wiki.uib.no/pct/index.php/Using_IPbus: Guide found under "Smart Dummy Hardware" More step by step (Instructions partly copied from link above, order slightly changed):

$ sudo apt update $ sudo apt install git g++ make erlang python3 python-is-python3 libboost1.71-all-dev libpugixml-dev

using the IPbus fork of Alf Herland $ git clone https://github.com/alf000/ipbus-software.git $ git checkout smartdummy

In the directory where the repository have been downloaded: $ make $ sudo make install prefix=/home/user/ipbus-install

Adding paths to envirorment: $ export LD_LIBRARY_PATH=/home/user/ipbus-install/lib:$LD_LIBRARY_PATH $ export PYTHONPATH=/home/user/ipbus-install/lib/python3.8/site-packages:$PYTHONPATH

Originally the second path was user/software-dev/ipbus-install, but i did not have the software-dev part, causing the path to be broken, and the uhal module for python was not found.

Qt5 designer:

Following https://askubuntu.com/a/1294861

$ sudo apt-get install qttools5-dev-tools (Not sure if needed) $ sudo apt-get install qttools5-dev

Then 'designer' command worked for me.

PyQt5:

Install PyQt5 library with pip: $ pip3 install PyQt5


MongoDB: Using a fix for WSl from this https://stackoverflow.com/a/62496101 Could work for regular Ubuntu and perhaps others, but the important thing is to have the mongodb service open somehow. Did not need anything like this when running other pymongo code in Windows 10.

$ mongodb-org $ sudo nano /etc/init.d/mongod Enter this text in the above file: https://raw.githubusercontent.com/mongodb/mongo/master/debian/init.d

$ sudo chmod +x /etc/init.d/mongod $ sudo service mongod start

The last two reset after some time, consistent with new updates.

Pymongo: Simple. pip install pymongo



To run the code:

access the ipbus:

go to ipbus-install. for me its /home/user/ipbus-install. To start it: Go to bin and $ ./controlhub_start go to /uhal/tests/ $ ./DummyHardwareUdp.exe -p 50001 -v 2 -V

Run program: When IPbus is running, open a new terminal window, go to /production_tests/Config_gui/ $ python config_v1.py