Hi,
could you help me to understood why my raspberry give me CRC error?
If you solved your issue I hope i could solve it 

here my code and my error:


#!/usr/bin/env python
import minimalmodbus


instrument = minimalmodbus.Instrument('/dev/ttyUSB0', 1) # port name, slave 
address (in decimal)
instrument.serial.parity = minimalmodbus.serial.PARITY_EVEN
instrument.serial.baudrate = 9600
instrument.serial.timeout  = 1

print "Serial Settings: %s" % (instrument)

instrument.debug = True
print instrument.read_register(70, 2)



ValueError: Checksum error in rtu mode: '\x01e' instead of '+\xe4' . The 
response is: '\x01\x03\x00F\x00\x01e' (plain response: 
'\x01\x03\x00F\x00\x01e')


Il giorno sabato 11 luglio 2015 18:49:04 UTC+2, A W ha scritto:
>
> Ok....I guess I can answer my own question, just as a reference for future 
> users getting the same problem. The RS485 switching with GPIO pin as a RTS 
> flow control is too slow for modbus applications. It was able to send 
> message to registers, but it was unable to capture the response from 
> device. Hence, I have switch to using the FTDI USB to RS485 cable and it 
> worked perfectly through /dev/ttyUSB0. 
>
> hope this helps people in the future with similar problem. 
>
> On Sunday, July 5, 2015 at 4:41:56 PM UTC-4, A W wrote:
>>
>> Here is the actual error report back from terminal:
>>
>> ValueError: Checksum error in rtu mode: '\x01x' instead of '|\xa3' . The 
>> response is: '\x00\x01\x06\x00\xff\x00\x01x' (plain response: 
>> '\x00\x01\x06\x00\xff\x00\x01x')
>>
>>
>> On Sunday, July 5, 2015 at 4:20:48 PM UTC-4, A W wrote:
>>>
>>> Ok...I seems to got it working after configuring the GPIO pin for RTS. 
>>> However, when I tried to communicate with modbus device, it gives me an 
>>> "Checksum error in rtu mode". I am using minimal modbus library, and my 
>>> code works fine when communicating between windows and my device.
>>>
>>> I have tested my connection with the scope and it seems to get getting 
>>> the correct output
>>>  
>>>
>>>
>>> <https://lh3.googleusercontent.com/-F3TXY-EePnE/VZmQRb1SiZI/AAAAAAAAAFA/3WE1rRaXQis/s1600/tek00001.bmp>
>>>
>>>
>>> When testing it with the minimal modbus library, the slave ID, function 
>>> code and payload data is correct. It just seems to have problem getting 
>>> pass the error check.
>>>
>>>
>>>
>>> <https://lh3.googleusercontent.com/-e-xK1jzwGAM/VZmQk-l6ZrI/AAAAAAAAAFI/jGzceziRmiI/s1600/test3.py_write_reg255.bmp>
>>>
>>>
>>> I have configured my baud rate and parity check correctly, but I can't 
>>> seems to figure out why it's giving me this checksum error. Anyone have any 
>>> ideas where the problem is?
>>>
>>>
>>> On Saturday, July 4, 2015 at 6:29:11 PM UTC-4, A W wrote:
>>>>
>>>> Hello,
>>>>
>>>> I came across this tutorial on configuration for RS-485 serial 
>>>> communication, but I am new to this and I need some clarifications on the 
>>>> procedure. 
>>>>
>>>> My beaglebone black is currently running on the latest Debian image
>>>>
>>>>>
>>>>> Linux beaglebone 3.8.13-bone70 #1 SMP Fri Jan 23 02:15:42 UTC 2015 
>>>>> armv7l GNU/Linux
>>>>
>>>>  
>>>>
>>>>
>>>> On the website 
>>>> http://inspire.logicsupply.com/2014/09/beaglebone-rs-485-communication.html
>>>>
>>>> Let's dive into the Kernel a bit to to see how RS-485 works in Linux; 
>>>>> the standard steps to put a UART into RS-485 mode are: 
>>>>>
>>>>>    1. Open the special tty file
>>>>>    2. Create a serial_rs485 struct and set the desired configuration 
>>>>>    values
>>>>>    3. Pass the configured struct to Kernel driver by using ioctl 
>>>>>    <http://man7.org/linux/man-pages/man2/ioctl.2.html> on the open 
>>>>>    serial port file descriptor
>>>>>
>>>>> I don't understand do these steps, where do I find the special tty 
>>>> file and as well as creating the serial_rs485 struct. Can someone guide me 
>>>> through this part?
>>>>
>>>> Thank you.
>>>>
>>>>  
>>>>
>>>

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to