Skip to content

SoftwareSerial based RS485 tools for sending and receiving data packets, networking and more!

License

Notifications You must be signed in to change notification settings

Rafdal/lib-rs485-soft

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

lib-rs485-soft

SoftwareSerial based RS485 tools for sending and receiving data packets, networking and more!

With 3 abstraction layers:

1: Basic TX/RX Layer (RS485Soft.h)

  • Sending and receiving packets (half-duplex)
  • Data integrity hash check (Pearson Hashing)

2: Network Layer (RSNetDevice.h)

  • All the basic features
  • Networking features (addresses for sender and receiver) up to 254 devices in a single network
  • Callbacks for incoming packets
  • Set intervals for periodic actions or packet broadcasting

3: Master-Slave Layer (RSMaster.h & RSSlave.h)

  • All the networking and basic features
  • Packet topics
  • Master and Slave logic roles
  • Advanced callbacks for topic data requests and responses handling
  • Slave connectivity check functions

What is RS485?

RS485 is a TIA/EIA hardware standard for wired communications over long distances and noisy industrial enviroments

Target boards:

  • Arduino: UNO, Pro Mini, Nano
  • Espressif: ESP8266 (not tested yet)

Wiring

Is recommended to use PWM digital pins

  • RO -> pinRO
  • DI -> pinDI
  • DE -> pinControl
  • RE -> pinControl

Object Declaration and Constructors

// Layer 1 (basic)
RS485Soft rs485(RXpin, TXpin, controlPin);

// Layer 2 (network)
RSNetDevice device(RXpin, TXpin, controlPin);

// Layer 3 (master-slave)
RSMaster master(RXpin, TXpin, controlPin);
RSSlave slave(RXpin, TXpin, controlPin);

RS485 datasheet

For more info about wiring and RS485 module usage, you can read this doc

See the examples folder for a detalied explaination and use cases

Contact and Feedback

Gmail: rdalzotto@itba.edu.ar

About

SoftwareSerial based RS485 tools for sending and receiving data packets, networking and more!

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published