element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Industrial Automation
  • Technologies
  • More
Industrial Automation
Blog AVNET SmartEdge IIOT Gateway: Use RS-485
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Industrial Automation to participate - click to join for free!
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: Jan Cumps
  • Date Created: 24 May 2021 5:51 PM Date Created
  • Views 1064 views
  • Likes 4 likes
  • Comments 0 comments
  • raspberry
  • arduino_mkr_485
  • smartedge
  • rs-485
  • screen
  • arduino
  • linux
Related
Recommended

AVNET SmartEdge IIOT Gateway: Use RS-485

Jan Cumps
Jan Cumps
24 May 2021

The SmartEdge IIOT GatewaySmartEdge IIOT Gateway is a Raspberry Pi 3 Compute based industrial Linux box.

It runs Raspbian with some additions.

There's a set of industrial hardware extensions. In this blog I review the isolated RS-485 bus.

image

 

Hardware

 

The gateway has a physical RS-323 / 485 driver. That's a piece of hardware that's not available on the standard Raspberry Pi family.

I'm going to test it with an Arduino MKR 485 shield.

 

SmartEdge

 

By default, the serial output is configured as RS-485 half-duplex, terminated. This is how I'm going to test it.

image

image source: SmartEdge Industrial IoT Gateway User Guide

 

The pins to use are GND, A- and B+.

 

image

image source: SmartEdge Industrial IoT Gateway User Guide - click for a sharp image

 

Arduino MRK 485 Shield

 

This one is by default full duplex. Move the middle switch left to switch to half duplex.

image

image source: https://store.arduino.cc/arduino-mkr-485-shield

 

The pins to use are GND, Y and Z (on the MKR 485, these are the data pins in half duplex mode)

image

image

images source: https://datasheets.maximintegrated.com/en/ds/MAX3157.pdf

 

While the SmartEdge's bus is isolated, the one on the Arduino isn't. It does not matter for this application.

 

Connection

 

  • GND to GND,
  • SmartEdge A to Arduino Z,
  • SmartEdge B to Arduino Y.

 

Twist the two data lines.

I've used an Arduino MKR WIFI 1010

 

Software

 

I'm using 9600 baud, because that's what the Arduino example is set to.

 

SmartEdge

 

The character device to interface with the RS-485 bus is /dev/ttySC0.

Set its speed to 9600.

 

stty 9600 < /dev/ttySC0

 

If you want to restore the original setting later, query it first:

 

stty -F /dev/ttySC0 -a

 

image

 

Then use a terminal program to connect to it. I installed screen.

 

sudo apt install screen
screen /dev/ttySC0

 

To terminate the screen session type ctrl+a, then k.

 

Arduino

 

I loaded the RS485Passthrough example. The opened the Serial Monitor at 9600 baud.

In the image below you see the results, after typing 12345 in the Arduino monitor and 98765 in the SmartEdge terminal.

image

 

Related Blog
Industrial I/O
Use the Industrial I/O
Control Industrial I/O directly from GPIO Pins
C Program for the Industrial I/O
Control Industrial I/O directly from Node-RED
Display Industrial I/O on Node-RED Dashboard
CAN Bus
Use the Isolated CAN
CAN programming in C on Linux: Filter and Mask
RS-485 Bus
Use RS-485
2020 Linux Image
The 2020 Linux Image and IoTConnect Scripts
Understand the Custom Scripts and Services (Pt. 1: intro and reset button service)
Understand the Custom Scripts and Services (Pt. 2: led service)
Understand the Custom Scripts and Services (Pt. 3: IoT Connect service)
  • Sign in to reply
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube