sshivasagaran
Posts: 1
Joined: Fri Oct 19, 2018 8:41 am

Unable to establish communication Temperature meter to my Rasbperry pi

Fri Oct 19, 2018 9:01 am

this the code i am using

*********************************************************************

Code: Select all

import pymodbus
import serial
import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BOARD)
GPIO.setup(15, GPIO.OUT)
from pymodbus.client.sync import ModbusSerialClient as ModbusClient
client = ModbusClient(method='rtu', port='/dev/ttyAMA0', timeout=1, stopbits = 1, bytesize = 8,
parity='N', baudrate= 38400)
client.connect()
while True:
temp = client.read_holding_registers(address=1, count=1, unit=1);
print temp.registers[0] / 100;
******************************************************************************
Which gives this error Error No 25 Inappropriate ioctl for device.

Andyroo
Posts: 441
Joined: Sat Jun 16, 2018 12:49 am
Location: Side of the hill in Lincolnshire

Re: Unable to establish communication Temperature meter to my Rasbperry pi

Fri Oct 19, 2018 12:56 pm

What type of temperature meter are you using?

How is it connected to the Pi? (I.e. what interface card for MODBUS to Pi is being used).
Need Pi spray - these things are breeding in my house...

boyoh
Posts: 1175
Joined: Fri Nov 23, 2012 3:30 pm
Location: Selby. North Yorkshire .UK

Re: Unable to establish communication Temperature meter to my Rasbperry pi

Fri Oct 19, 2018 7:08 pm

Be more explicit, is it a temperature sensor ,if so give type and make

Or more details on meter you are using
BoyOh ( Selby, North Yorkshire.UK)
Some Times Right Some Times Wrong

Return to “Beginners”