tecnologia:luzparaeleko:inversor
This is an old revision of the document!
Manual Inversor: manual_inversor.pdf
Manual Monitorización: manual_monitorizacion.pdf
Monitorizar con raspberry
Conectamos el cable que viene con el inversor. Al inversor el exttremo RJ45 y por el otro lado es serial. Compramos un cable serial a USB y lo conectamos a este cable (por el serial) y a la raspberry
Ahora miramos los puertos USB de la raspberry
pi@raspberrypi:~ $ lsusb Bus 001 Device 004: ID 067b:2303 Prolific Technology, Inc. PL2303 Serial Port Bus 001 Device 005: ID 0665:5161 Cypress Semiconductor USB to Serial Bus 001 Device 006: ID 0424:7800 Standard Microsystems Corp. Bus 001 Device 003: ID 0424:2514 Standard Microsystems Corp. USB 2.0 Hub Bus 001 Device 002: ID 0424:2514 Standard Microsystems Corp. USB 2.0 Hub Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Nos quedamos con la línea que pone USB to Serial:
Bus 001 Device 005: ID 0665:5161 Cypress Semiconductor USB to Serial
La que pone “Prolific Technology, Inc. PL2303 Serial Port” es del puerto RJ45 que veremos mas tarde.
Como root buscamos el puerto:
root@raspberrypi:~# ls -l /dev/hidraw* crw------- 1 root root 244, 0 Jun 22 15:41 /dev/hidraw0
Es el puerto hidraw0
Ahora ejecutamos python y lanzamos estos comandos:
Python 2.7.16 (default, Oct 10 2019, 22:02:15) [GCC 8.3.0] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>>
import os,sys
fd = open('/dev/hidraw0', 'r+')
fd.write('QPIGS\xB7\xA9\r')
res = fd.read(110).encode('string-escape')
res = res.split("\\")
res = res[0][1:].split(" ")
print 'res=', res
Nos tiene que devolver algo como esto:
res= ['000.0', '00.0', '230.0', '50.0', '0252', '0246', '005', '370', '53.30', '001', '100', '0044', '0006', '127.6', '53.18', '00000', '00010110', '00', '00', '00319', '010']
tecnologia/luzparaeleko/inversor.1655910539.txt.gz · Last modified: by admin

