CM3-Home

RS-485 interface

The RS485 is commonly used to connect DMX512, Modbus or generic RS485 serial devices.

What is a RS485 ? What is a DMX512 ? What is a Modbus ?

Two RS485 lines are available on CM3-Home model Full and one on the model Basic. The lines are opto-isolated from the CPU and available on screw terminals as shown below.

How to use the RS485 ports

The ports are visible by Linux on /dev/ttyUSB0 (left port) and /dev/ttyUSB2 (right port) and can be managed by software like any other serial line. The DE signals required to get the bus are managed by the hardware on FTDI FT4232 chip.

Python example

Send and receive chars on the right RS485 port. To do the same on the left port change /dev/ttyUSB2 with /dev/ttyUSB0.

#!/usr/bin/python
import serial
import time

ser = serial.Serial(
    port='/dev/ttyUSB2',
    baudrate=115200,
    timeout=1,
    parity=serial.PARITY_NONE,
    stopbits=serial.STOPBITS_ONE,
    bytesize=serial.EIGHTBITS
)
ser.flushOutput()
ser.flushInput()

rx_counter=0
tx_counter=0
while True:
    tx_counter=tx_counter+1
    ser.write("Tx counter = %d | Rx counter = %d\n\r" % (tx_counter,rx_counter))
    print("Tx counter = %d | Rx counter = %d" % (tx_counter,rx_counter))

    a=ser.read(1)

    if a:
        rx_counter=rx_counter+1
        ser.write("Tx counter = %d | Rx counter = %d | Received: %s %02x\n\r" % (tx_counter,rx_counter,a,ord(a)))
        print("Tx counter = %d | Rx counter = %d | Received: %s %02x" % (tx_counter,rx_counter,a,ord(a)))

eShop

EUR 130.00


CM3-HOME-B - Home automation carrier board for Raspberry CM3L module

Motherboard designed to provide a reliable Home Automation solution based on Raspberry Pi CM3L industrial module

  • Optional parts non included to order separately:
    • Raspberry Compute Module 3L (Product # CM3L)
    • Wifi module (Product # WIFI-2) and antenna (Product # AN-WIFI-01)
    • MicroSD (Product # MICROSD8G-E)
    • Case (Product # CM3-HOME-CASE)
| Product description || CM3-Home catalog |

Sergio Tanzilli
System designer and Acme co-founder
Personal email: tanzilli@acmesystems.it
Webpages: https://www.acmesystems.it - http://www.tanzolab.it - http://www.tanzilli.com
Github repositories: https://github.com/tanzilli and https://github.com/acmesystems