This project demonstrates of testing a ascii character three times when transmitted over a serial connection. The character will be sent from one serial device, CP210x UART Bridge, to another device and a Oscilloscope will read the data and display the character and a camera looking at the Oscilloscope will also read the character.
The three test points are:
- (T1) Scope reading over TCP/IP
- (T2) Web cam OCR looking at the scope
- (T3) The receiving serial device
Char -> Serial Device->|<- Silicon Labs CP210x UART Bridge
|
T1 <--- Scope Data <---|
| |
T2 <---- USB Cam OCR |
|
T3 <- Serial Device----|<- Silicon Labs CP210x UART Bridge
- Rigol 1054z Oscilloscope
- 2 x Silicon Labs CP210x UART Bridge
- Logitech USB C Web Cam
- opencv-python
- pyserial
- pytesseract
- pytest
- PyVISA
- PyVISA-py
The tests/conftest.py
file looks for $HOME/triplechartest.txt"
file. And in that file is a comma separated list of values.
For example:
# Serial Device,Serial Device,Vide0 Device,Rigol Scope IP Address
/dev/ttyUSB0,/dev/ttyUSB0,4,127.0.0.1
$ git clone https://github.com/tgu-ltd/triplechartest
$ cd triplechartest
$ poetry install
$ poetry shell
$ pytest
Three files are written during the tests:
main.png
is a image of the webcamtest.png
is a captured region of the webcam imagescreen.png
is a screen shot loaded from the rigol scope
One file is read during the tests:
rigol_setup.bin
is used to setup the rigol 1054z. This file can be generated using theRigol(ip=x.x.x.x)._read_setup()
after manually setting up the scope.