Releases: derdoktor667/FlyskyIBUS
0.8.1
FlyskyIBUS Library for ESP32
The FlyskyIBUS library is a powerful and user-friendly Arduino library for the ESP32, specifically designed for receiving and decoding Flysky iBUS RC signals. It enables seamless integration of your Flysky remote control into your ESP32-based projects, ideal for drones, robots, and other remote-controlled applications.
✨ Features at a Glance
- Full iBUS Protocol Support: Receives and processes up to 14 channels from your Flysky iBUS remote control.
- Fire and Forget Operation: No need to call any explicit
update()orloop()function. Simply retrieve channel values usinggetChannel()orgetChannels(), and the library will automatically process all available incoming iBUS data, ensuring your main loop remains clean and responsive. - Precise Timing: Leverages hardware UART for reliable and accurate iBUS signal decoding. Data acquisition is seamlessly integrated into channel retrieval, ensuring up-to-date values without explicit polling.
- Robust Failsafe Detection: Integrated dual-logic failsafe detection provides additional safety in critical situations.
- Flexible Configuration: Easy adaptation of the UART interface and GPIO pins to your specific hardware.
- Arduino IDE Compatibility: Seamless integration into your existing Arduino projects and workflows.
🤝 Compatibility
This library is specifically developed for ESP32 microcontrollers and uses the Arduino ESP32 Framework.
🚀 Installation
Installation is quick and easy via the Arduino Library Manager:
- Open the Arduino IDE.
- Navigate to
Sketch->Include Library->Manage Libraries.... - Search for "FlyskyIBUS" in the Library Manager.
- Select the library from the list and click "Install".
Alternatively, you can manually install the library by cloning or downloading the repository and moving its contents into your Arduino libraries folder (e.g., ~/Arduino/libraries/FlyskyIBUS/ on Linux/macOS or Documents\Arduino\libraries\ on Windows).
💡 Usage Example
Here's a simple example demonstrating how to read channel values with the library:
#include <FlyskyIBUS.h>
// Create an IBUS object for Serial2
// Default pins for Serial2 are GPIO16 (RX) and GPIO17 (TX) on many ESP32 boards.
// Adjust the pins to your board if necessary. The TX pin is optional
// if you only want to receive.
FlyskyIBUS IBUS;
void setup() {
Serial.begin(115200);
Serial.println("Starting FlyskyIBUS Receiver...");
// Initialize IBUS on HardwareSerial Serial2, specifying RX and TX pins.
// The TX pin (GPIO17 in this example) is optional and only required if you intend to transmit data.
IBUS.begin(Serial2, 16, 17); // Example: Serial2, RX: GPIO16, TX: GPIO17
}
void loop() {
// Retrieve channel values. The library automatically processes any incoming iBUS data
// when getChannel() or getChannels() is called, so no explicit update function is needed.
Serial.print("Channel 1 (Roll): ");
Serial.println(IBUS.getChannel(0));
Serial.print("Channel 2 (Pitch): ");
Serial.println(IBUS.getChannel(1));
Serial.print("Channel 3 (Throttle): ");
Serial.println(IBUS.getChannel(2));
Serial.print("Channel 4 (Yaw): ");
Serial.println(IBUS.getChannel(3));
// Optional: Read more channels
// ...
// Check the failsafe status
if (IBUS.isFailsafe()) {
Serial.println("!!! FAILSAFE ACTIVE !!! Signal loss or error detected.");
}
delay(50); // A small delay to avoid flooding the serial output
}You can find more detailed examples in the examples folder of the library.
💖 Contributing
Contributions, whether in the form of bug reports, feature suggestions, or code improvements, are highly welcome! Please open an Issue or create a Pull Request on GitHub.
📄 License
This project is licensed under the MIT License. Details can be found in the LICENSE file.
👩💻 For Developers
Here are the arduino-cli commands for compiling and uploading example sketches. These are useful for development and automation.
Compiling an example sketch:
arduino-cli compile --fqbn esp32:esp32:esp32 ~/Arduino/libraries/FlyskyIBUS/examples/read_Channels/read_Channels.inoUploading to ESP32 (assuming /dev/ttyUSB0 is the upload port):
arduino-cli upload -p /dev/ttyUSB0 --fqbn esp32:esp32:esp32 ~/Arduino/libraries/FlyskyIBUS/examples/read_Channels/read_Channels.ino0.8.0
FlyskyIBUS Library for ESP32
The FlyskyIBUS library is a powerful and user-friendly Arduino library for the ESP32, specifically designed for receiving and decoding Flysky iBUS RC signals. It enables seamless integration of your Flysky remote control into your ESP32-based projects, ideal for drones, robots, and other remote-controlled applications.
✨ Features at a Glance
- Full iBUS Protocol Support: Receives and processes up to 14 channels from your Flysky iBUS remote control.
- Non-Blocking Design: Signal processing happens in the background via efficient hardware UART interrupts, ensuring your main loop remains responsive.
- Precise Timing: Utilizes hardware UART interrupts for reliable and accurate iBUS signal decoding.
- Robust Failsafe Detection: Integrated dual-logic failsafe detection provides additional safety in critical situations.
- Flexible Configuration: Easy adaptation of the UART interface and GPIO pins to your specific hardware.
- Arduino IDE Compatibility: Seamless integration into your existing Arduino projects and workflows.
🤝 Compatibility
This library is specifically developed for ESP32 microcontrollers and uses the Arduino ESP32 Framework.
🚀 Installation
Installation is quick and easy via the Arduino Library Manager:
- Open the Arduino IDE.
- Navigate to
Sketch->Include Library->Manage Libraries.... - Search for "FlyskyIBUS" in the Library Manager.
- Select the library from the list and click "Install".
Alternatively, you can manually install the library by cloning or downloading the repository and moving its contents into your Arduino libraries folder (e.g., ~/Arduino/libraries/FlyskyIBUS/ on Linux/macOS or Documents\Arduino\libraries\ on Windows).
💡 Usage Example
Here's a simple example demonstrating how to read channel values with the library:
#include <FlyskyIBUS.h>
// Create an IBUS object for Serial2
// Default pins for Serial2 are GPIO16 (RX) and GPIO17 (TX) on many ESP32 boards.
// Adjust the pins to your board if necessary. The TX pin is optional
// if you only want to receive.
FlyskyIBUS IBUS;
void setup() {
Serial.begin(115200);
Serial.println("Starting FlyskyIBUS Receiver...");
// Initialize IBUS on HardwareSerial Serial2
// IBUS.begin(HardwareSerial& serialPort, uint8_t rxPin, uint8_t txPin = -1);
IBUS.begin(Serial2, 16, 17); // Example: Serial2, RX: GPIO16, TX: GPIO17
}
void loop() {
// Process received iBUS data. This function is non-blocking.
IBUS.loop();
// Check if new data has been received from the receiver
if (IBUS.isDataReady()) {
// Read channel values (Channel 0 is the first channel, Channel 1 the second, etc.)
Serial.print("Channel 1 (Roll): ");
Serial.println(IBUS.readChannel(0));
Serial.print("Channel 2 (Pitch): ");
Serial.println(IBUS.readChannel(1));
Serial.print("Channel 3 (Throttle): ");
Serial.println(IBUS.readChannel(2));
Serial.print("Channel 4 (Yaw): ");
Serial.println(IBUS.readChannel(3));
// Optional: Read more channels
// ...
}
// Check the failsafe status
if (IBUS.isFailsafe()) {
Serial.println("!!! FAILSAFE ACTIVE !!! Signal loss or error detected.");
}
delay(50); // A small delay to avoid flooding the serial output
}You can find more detailed examples in the examples folder of the library.
💖 Contributing
Contributions, whether in the form of bug reports, feature suggestions, or code improvements, are highly welcome! Please open an Issue or create a Pull Request on GitHub.
📄 License
This project is licensed under the MIT License. Details can be found in the LICENSE file.
👩💻 For Developers
Here are the arduino-cli commands for compiling and uploading example sketches. These are useful for development and automation.
Compiling an example sketch:
arduino-cli compile --fqbn esp32:esp32:esp32 ~/Arduino/libraries/FlyskyIBUS/examples/read_Channels/read_Channels.inoUploading to ESP32 (assuming /dev/ttyUSB0 is the upload port):
arduino-cli upload -p /dev/ttyUSB0 --fqbn esp32:esp32:esp32 ~/Arduino/libraries/FlyskyIBUS/examples/read_Channels/read_Channels.ino0.7.0
FlyskyIBUS Library for ESP32
Arduino IDE compatible Flysky IBUS receiver library for ESP32
Receive and decode Flysky IBUS RC signals directly on the ESP32. Interrupt-driven, non-blocking, and easy to use.
Features
- 📡 Full IBUS Support – Receive and decode all 14 channels (1000-2000µs)
- ⚡ Hardware UART Interrupts – Precise timing via direct ESP32 UART interrupts
- 🚫 Non-blocking Design – No timers, no delays, runs completely in the background
- 🛡️ Robust Failsafe – Dual failsafe detection for maximum safety
- 🛠️ Plug & Play – One function call is enough, the library handles the rest
- 🔧 Configurable – Choose any UART interface and GPIO pin
- ✅ Arduino IDE Ready – Fully compatible with Arduino IDE and ESP32 Core
Failsafe
The library implements a dual-logic failsafe for maximum reliability:
- Signal Loss (Timeout): If no valid IBUS data is received for more than 100ms, the failsafe is triggered.
- Receiver Failsafe Signal: The library detects when the receiver itself enters failsafe mode and sends channel values outside the standard range (1000-2000µs).
When failsafe is active, getChannel() will return the neutral value (1500), and hasFailsafe() will return true.
Installation
Copy the library to your Arduino libraries folder and restart the Arduino IDE.
Usage
#include <FlyskyIBUS.h>
// Default: Serial2, GPIO16
FlyskyIBUS ibus;
void setup() {
Serial.begin(115200);
ibus.begin();
}
void loop() {
uint16_t ch1 = ibus.getChannel(1);
uint16_t ch2 = ibus.getChannel(2);
Serial.print(" CH1: "); Serial.println(ch1);
Serial.print(" CH2: "); Serial.println(ch2);
delay(100);
}IBUS Frame Structure
Byte: 0 1 2 3 4 5 ... 28 29 30 31
Data: 0x20 0x40 [CH1_L][CH1_H][CH2_L][CH2_H] ... [CH14L][CH14H][CHKL][CHKH]
| | |<--- Channel Data (28 Bytes, 14 Channels) --->| |<--CRC-->|
| |
Header (0x20 0x40)
115200 Baud, 8N1 • Channel values: Little-Endian • CRC: 0xFFFF - sum of all bytes
Hardware Connection
Flysky Receiver ESP32
[IBUS] ---------> [GPIO16]
[GND] ---------> [GND]
[VCC] ---------> [3.3V/5V]
API
FlyskyIBUS ibus(Serial2, GPIO_NUM_16); // Constructor
bool begin(); // Initialization
uint16_t getChannel(uint8_t channel); // Read channel (1-14), returns 1500 on failsafe
uint16_t getRawChannel(uint8_t ch); // Read channel (1-14), returns raw value
uint8_t getChannelCount(); // Number of active channels
bool hasFailsafe(); // Returns true if failsafe is active📄 License
MIT License – see LICENSE
👤 Author
Wastl Kraus
GitHub: @derdoktor667
Website: wir-sind-die-matrix.de
0.6.1 Hotfix
Merge pull request #4 from derdoktor667/dev library.properties
0.6.0
FlyskyIBUS Library for ESP32
Arduino IDE compatible Flysky IBUS receiver library for ESP32
Receive and decode Flysky IBUS RC signals directly on the ESP32. Interrupt-driven, non-blocking, and easy to use.
Features
- 📡 Full IBUS Support – Receive and decode all 14 channels (1000-2000µs)
- ⚡ Hardware UART Interrupts – Precise timing via direct ESP32 UART interrupts
- 🚫 Non-blocking Design – No timers, no delays, runs completely in the background
- 🛡️ Robust Failsafe – Dual failsafe detection for maximum safety
- 🛠️ Plug & Play – One function call is enough, the library handles the rest
- 🔧 Configurable – Choose any UART interface and GPIO pin
- ✅ Arduino IDE Ready – Fully compatible with Arduino IDE and ESP32 Core
Failsafe
The library implements a dual-logic failsafe for maximum reliability:
- Signal Loss (Timeout): If no valid IBUS data is received for more than 100ms, the failsafe is triggered.
- Receiver Failsafe Signal: The library detects when the receiver itself enters failsafe mode and sends channel values outside the standard range (1000-2000µs).
When failsafe is active, getChannel() will return the neutral value (1500), and hasFailsafe() will return true.
Installation
Copy the library to your Arduino libraries folder and restart the Arduino IDE.
Usage
#include <FlyskyIBUS.h>
// Default: Serial2, GPIO16
FlyskyIBUS ibus;
void setup() {
Serial.begin(115200);
ibus.begin();
}
void loop() {
uint16_t ch1 = ibus.getChannel(1);
uint16_t ch2 = ibus.getChannel(2);
Serial.print(" CH1: "); Serial.println(ch1);
Serial.print(" CH2: "); Serial.println(ch2);
delay(100);
}IBUS Frame Structure
Byte: 0 1 2 3 4 5 ... 28 29 30 31
Data: 0x20 0x40 [CH1_L][CH1_H][CH2_L][CH2_H] ... [CH14L][CH14H][CHKL][CHKH]
| | |<--- Channel Data (28 Bytes, 14 Channels) --->| |<--CRC-->|
| |
Header (0x20 0x40)
115200 Baud, 8N1 • Channel values: Little-Endian • CRC: 0xFFFF - sum of all bytes
Hardware Connection
Flysky Receiver ESP32
[IBUS] ---------> [GPIO16]
[GND] ---------> [GND]
[VCC] ---------> [3.3V/5V]
API
FlyskyIBUS ibus(Serial2, GPIO_NUM_16); // Constructor
bool begin(); // Initialization
uint16_t getChannel(uint8_t channel); // Read channel (1-14), returns 1500 on failsafe
uint16_t getRawChannel(uint8_t ch); // Read channel (1-14), returns raw value
uint8_t getChannelCount(); // Number of active channels
bool hasFailsafe(); // Returns true if failsafe is active📄 License
MIT License – see LICENSE
👤 Author
Wastl Kraus
GitHub: @derdoktor667
Website: wir-sind-die-matrix.de
0.5.0
FlyskyIBUS Library for ESP32
Arduino IDE compatible Flysky IBUS receiver library for ESP32
Receive and decode Flysky IBUS RC signals directly on the ESP32. Interrupt-driven, non-blocking, and easy to use.
Features
- 📡 Full IBUS Support – Receive and decode all 14 channels (1000-2000µs)
- ⚡ Hardware UART Interrupts – Precise timing via direct ESP32 UART interrupts
- 🚫 Non-blocking Design – No timers, no delays, runs completely in the background
- 🛠️ Plug & Play – One function call is enough, the library handles the rest
- 🔧 Configurable – Choose any UART interface and GPIO pin
- ✅ Arduino IDE Ready – Fully compatible with Arduino IDE and ESP32 Core
Installation
Copy the library to your Arduino libraries folder and restart the Arduino IDE.
Usage
#include <FlyskyIBUS.h>
// Default: Serial2, GPIO16
FlyskyIBUS ibus;
void setup() {
Serial.begin(115200);
ibus.begin();
}
void loop() {
uint16_t ch1 = ibus.getChannel(1);
uint16_t ch2 = ibus.getChannel(2);
Serial.print(" CH1: "); Serial.println(ch1);
Serial.print(" CH2: "); Serial.println(ch2);
delay(100);
}IBUS Frame Structure
Byte: 0 1 2 3 4 5 ... 28 29 30 31
Data: 0x20 0x40 [CH1_L][CH1_H][CH2_L][CH2_H] ... [CH14L][CH14H][CHKL][CHKH]
| | |<--- Channel Data (28 Bytes, 14 Channels) --->| |<--CRC-->|
| |
Header (0x20 0x40)
115200 Baud, 8N1 • Channel values: Little-Endian • CRC: 0xFFFF - sum of all bytes
Hardware Connection
Flysky Receiver ESP32
[IBUS] ---------> [GPIO16]
[GND] ---------> [GND]
[VCC] ---------> [3.3V/5V]
API
FlyskyIBUS ibus(Serial2, GPIO_NUM_16); // Constructor
bool begin(); // Initialization
uint16_t getChannel(uint8_t channel); // Read channel (1-14)
uint8_t getChannelCount(); // Number of active channels📄 License
MIT License – see LICENSE
👤 Author
Wastl Kraus
GitHub: @derdoktor667
Website: wir-sind-die-matrix.de