# Insegna di Pasquale

* Risoluzione: 384x96
* Risoluzione Keynote: 1152x288
* 36 Moduli P6 outdoor 192x192mm 32x32pixel organizzati su 3 file
* Raspberry Pi P4 + [Acme Systems HAT A3](http://www.acmesystems.it/HAT-A3)

Connessioni:

* http://billy.local:1880
* ssh pi@billy.local (user:pi password:raspberry)

## Node-red:

Accedere alla configurazione del nodo Telegram-receiver ed inserire il 
token Telegram assegnato al bot del cliente

Per creare un bot usare il bot Telegram BotFather __@BotFather__ accessibile anche tramite questa url:

* <https://telegram.me/BotFather>

## Comandi telegram

* /off o /halt sudo hal
* /temp Temperatura CPU
* /shell comando Invio comandi alla Shell
* /menu stampa il menu

## Come è stato installato il software

### Flow Node-red

* [flows.json](./flows.json)

### Installazione Node-red

Type at command line prompt:

	bash <(curl -sL https://raw.githubusercontent.com/node-red/linux-installers/master/deb/update-nodejs-and-nodered)

Enable the systemd service by typing:

	sudo systemctl enable nodered.service

Then start it:

	sudo systemctl start nodered.service

### Installazione del software di hzeller

	sudo apt update
	sudo apt -y install git libgraphicsmagick++-dev libwebp-dev libavcodec-dev libavformat-dev libswscale-dev initramfs-tools
	git clone https://github.com/hzeller/rpi-rgb-led-matrix.git
	cd ~/rpi-rgb-led-matrix/utils
	make led-image-viewer
	make video-viewer
	cd ~/rpi-rgb-led-matrix/examples-api-use
	make 

Applicare la seguente patch:

	diff --git a/lib/options-initialize.cc b/lib/options-initialize.cc
	index 6bb8f97..64129df 100644
	--- a/lib/options-initialize.cc
	+++ b/lib/options-initialize.cc
	@@ -295,7 +295,7 @@ RGBMatrix *CreateMatrixFromOptions(const RGBMatrix::Options &options,
	   }
	 
	   // For the Pi4, we might need 2, maybe up to 4. Let's open up to 5.
	-  if (runtime_options.gpio_slowdown < 0 || runtime_options.gpio_slowdown > 5) {
	+  if (runtime_options.gpio_slowdown < 0 || runtime_options.gpio_slowdown > 10) {
	     fprintf(stderr, "--led-slowdown-gpio=%d is outside usable range\n",
	             runtime_options.gpio_slowdown);
	     return NULL;
	-- 
	2.20.1

To remove this module type the following commands:

	cat <<EOF | sudo tee /etc/modprobe.d/blacklist-rgb-matrix.conf
	blacklist snd_bcm2835
	EOF
	sudo update-initramfs -u
	sudo reboot

### Comandi utili

Colori pieni

	sudo examples-api-use/demo -D 4 --led-chain=12 --led-parallel=3 --led-multiplexing=2 --led-slowdown-gpio=5 --led-rgb-sequence=BGR

Visualizzazioni immagini:

	sudo utils/led-image-viewer  --led-chain=12 --led-parallel=3 --led-multiplexing=2 --led-slowdown-gpio=5 --led-rgb-sequence=BGR -W 10 /home/pi/img1.jpg /home/pi/img2.jpg /home/pi/img2.jpg

Riproduzione video (solo Raspberry 4)

	sudo utils/video-viewer  --led-chain=12 --led-parallel=3 --led-multiplexing=2 --led-slowdown-gpio=5 --led-rgb-sequence=BGR -f  /home/pi/billed.m4v
