Skip to content
/ enocean Public

an enocean implementation for rust

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT
Notifications You must be signed in to change notification settings

Cutii/enocean

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

72 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Enocean implementation for the Rust Programming Language

⚠️ This lib is still under construction, I built it as a Rust lang training ⚠️

Enocean : (official website) is a Radio protocol for Smart Home / Buildings devices.

This lib is a rust implementation of Enocean Serial Protocol, which you can find here: ESP3
You can use this library with any compatible EnOcean Radio Gateway eg. USB300 gateway .

⚠️ This lib is still under construction ⚠️

Example

cargo run --example main
NB: You will have to specify the serialport corresponding to your enocean dongle. If you don't want to bother with that, juste create an UDEV rule ( here for an USB300 ) :
sudo nano /etc/udev/rules.d/99-usb-serial.rules and append :
SUBSYSTEM=="tty", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6001", SYMLINK+="ttyUsb300",MODE ="0666", GROUP="dialout"
Note that you will have to add your user to the dialout group.
Finally, you can trigger the UDev rules with :
sudo udevadm control --reload-rules && sudo udevadm trigger

Feature Overview

This lib use serialport crate to interact with Serial / Radio gateway.
⚠️ For now, link between enocean device ID and its EEP is hardcoded in eep.rs file.

Library files main content: (Non exhaustive, just for quick overview)

  • enocean.rs : Enocean serial protocol implementation (eg . Vector of byte to Ensocean Serial Packet) (...)
  • commincator.rs : Interface with serialport (use std::sync::mpsc to interact with your code for send /receive packets) (...)
  • eep.rs : Specific for ERP1 packet type, allow to get the content of a radio telegram (...)
  • lib.rs : Custom types / errorTypes (...)

Supported Enocean Serial Packets type for now :

  • Radio ERP1 : 0x01
  • Response : 0x02
  • radio_sub_tel : 0x03
  • event : 0x04
  • common_command : 0x05
  • smart_ack_command : 0x06
  • remote_man_command : 0x07
  • radio_message : 0x09
  • radio_advanced : 0x0a

License

This library is primarily distributed under the terms of both the MIT license
and the Apache License (Version 2.0).

See LICENSE-APACHE and LICENSE-MIT for details.

About

an enocean implementation for rust

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages