Diferència entre revisions de la pàgina «ModBUS RTU a l'IoT-Vertebrae»
		
		
		
		
		
		
		Salta a la navegació
		Salta a la cerca
		
				
		
		
		
		
		
		
		
		
	
| Línia 39: | Línia 39: | ||
| = ModBUS RTU emprant un convertidor USB a RS485 = | = ModBUS RTU emprant un convertidor USB a RS485 = | ||
| [[Image:usbModbusRtu00.jpg|center|thumb|Convertidor USB a ModBUS RTU]] | [[Image:usbModbusRtu00.jpg|center|thumb|Convertidor USB a ModBUS RTU]] | ||
| + | |||
| + |  pi@raspberrypi:~/codis/modbus $ '''python mb_IoT_01.py /dev/ttyUSB0 4800''' | ||
| + |  s: Relay SET, r: Relay RESET, i: Read inputs, t: temperature, h: relative humidity, p: pressure, a: altitude,  | ||
| + |  v: VOC and q: quit | ||
| + |  Baudrate: 4800 at /dev/serial0 | ||
| + |  { | ||
| + |  Sending: Reading temperature | ||
| + |  070300000001846C | ||
| + |  He rebut 7 bytes | ||
| + |  0703020AF83766 | ||
| + |  '''T: 28.08 ºC''' | ||
| + |  } ---- | ||
| + |  { | ||
| + |  Sending: Reading relative humidity | ||
| + |  070300010001D5AC | ||
| + |  He rebut 7 bytes | ||
| + |  0703021211FCE8 | ||
| + |  '''RH: 46.25 %''' | ||
| + |  } ---- | ||
Revisió del 11:03, 26 ago 2024
El ModBUS RTU a l'IoT-Vertebrae és integrat al cap v2.1. A versions prèvies de cap cal fer servir un convertidor USB a ModBUS RTU
ModBUS RTU integrat al cap
pi@raspberrypi:~/codis/modbus $ python mb_IoT_01.py /dev/serial0 4800
s: Relay SET, r: Relay RESET, i: Read inputs, t: temperature, h: relative humidity, p: pressure, a: 
altitude, v: VOC and q: quit
Baudrate: 4800 at /dev/serial0
{
Sending: Relay SET
07050004FF00CD9D
He rebut 8 bytes
07050004FF00CDFF
Received: Relay SET
} ----
{
Sending: Relay RESET
0705000400008C6D
He rebut 8 bytes
0705000400008CFF
Received: Relay RESET
} ----
{
Sending: Reading temperature
070300000001846C
He rebut 7 bytes
0703020AB37751
T: 27.39 ºC
} ----
{
Sending: Reading relative humidity
070300010001D5AC
He rebut 7 bytes
07030214F03F00 
RH: 53.60 %
} ----
ModBUS RTU emprant un convertidor USB a RS485
pi@raspberrypi:~/codis/modbus $ python mb_IoT_01.py /dev/ttyUSB0 4800
s: Relay SET, r: Relay RESET, i: Read inputs, t: temperature, h: relative humidity, p: pressure, a: altitude, 
v: VOC and q: quit
Baudrate: 4800 at /dev/serial0
{
Sending: Reading temperature
070300000001846C
He rebut 7 bytes
0703020AF83766
T: 28.08 ºC
} ----
{
Sending: Reading relative humidity
070300010001D5AC
He rebut 7 bytes
0703021211FCE8
RH: 46.25 %
} ----



