# Test CM-Panel POE

## Programmi di test

Programma principale

* [test_cmpanel-poe.py](./test_cmpanel-poe.py)

Programmi secondari di prova

* [rs232.py](./rs232.py)
* [rs485.py](./rs485.py)
* [rs422.py](./rs422.py)
* [relay.py](./relay.py)
* [stereotest.wav](./stereotest.wav)

Test backlight:

	sudo gpiod 
	./pwm 0
	./pwm 50
	./pwm 100
	
* [pwm.py](./pwm.py)
	

## Preparazione microSD

Rotate the LCD of 180 degrees:


	$ sudo nano /boot/config.txt

	dtoverlay=vc4-kms-dpi-generic
	max_framebuffers=2
	display_lcd_rotate=2


Disable login on TFT display (getty@tty1.service)

	systemctl list-units --type=service | grep getty

	...

	$ sudo nano /etc/systemd/system/getty@tty1.service.d/override.conf

	[Service]
	ExecStart=
	ExecStart=-/sbin/agetty --autologin pi --noclear %I $TERM

	$ sudo systemctl daemon-reload
	$ sudo systemctl restart getty@tty1.service
	
Disable login on debug port display (serial-getty@ttyS0.service)

	$ systemctl list-units --type=service | grep getty

	...

	$ sudo nano /lib/systemd/system/serial-getty@.service

	Change the line:
	
	ExecStart=-/sbin/agetty -o '-p -- \\u' --keep-baud 115200,57600,38400,9600 - $TERM

	in
	
	ExecStart=-/sbin/agetty --autologin pi --keep-baud 115200,57600,38400,9600 - $TERM	

	$ sudo systemctl daemon-reload
	$ sudo systemctl restart serial-getty@ttyS0.service

Se a static IP:

	$ sudo nano /etc/network/interfaces.d/eth0

	allow-hotplug eth0
	iface eth0 inet static
	address 192.168.10.65
	network 192.168.10.0
	netmask 255.255.255.0
	gateway 192.168.10.1


Aggiungere al file;

	$ nano ~/.bashrc
	
le righe:

	if [ "$(tty)" = "/dev/tty1" ]; then
	    echo "Startup test"
	    aplay stereotest.wav
	    ./test_cmpanel-poe.py
	fi

Tests:

	$ sudo apt update
	$ sudo apt -y install evtest python3-evdev python3-serial


* @article='cmpanel_touch'
* @article='cmpanel-poe_relay'
* @article='cmpanel-poe_serial'
* @article='cmpanel-poe_audio'

## Parametric test points

* [cmpanel-poe_testpoints.pdf](./cmpanel-poe_testpoints.pdf)

## Links

* <https://raw.githubusercontent.com/Evilpaul/RPi-config/master/config.txt>