Coder Social home page Coder Social logo

maehw / serialhex2flipperzeroinfrared Goto Github PK

View Code? Open in Web Editor NEW
92.0 1.0 4.0 38 KB

Convert infrared serial interface commands for Flipper Zero ๐Ÿฌ ๐Ÿงฑ๐Ÿค–

License: GNU General Public License v3.0

Python 100.00%
flipper-zero flipperzero infrared infrared-encoder lego lego-mindstorms mindstorms mindstorms-rcx rcx serial-communication

serialhex2flipperzeroinfrared's Introduction

README

The Python script convert.py can be used to convert infrared serial interface commands (in hexadecimal representation) into a Flipper Zero[1] compatible infrared[2] .ir file.

The script supports sending multiple multibyte messages at once and adds wait times for message replies by default.

Use case: It can be used to convert LEGO MINDSTORMS RCX[3] (the "yellow programmable brick") infrared commands[4] (see LEGO_RCX.json input file).

โš ๏ธ If LEGO MINDSTORMS RCX is a use case for you: the example does not take care of the toggle bit. So sending the IR commands may not always work. You'll need to dive deeper into the internals of the RCX communication protocol. Pull requests are very welcome!

References

[1] Flipper Zero โ€” Portable Multi-tool Device for Geeks

[2] Flipper Zero Blog โ€” Taking over TVs with Flipper Zero Infrared Port

[3] Disclaimer: LEGO and MINDSTORMS are trademarks and copyrights of the LEGO Group of companies which does not sponsor, authorize or endorse this site.

[4] RCX 2.0 Firmware Command Overview / LASM bytecode specification

Dependencies

A Python 3 environment is required.

The script only imports sys and json and therefore shouldn't require any additional packages.

Converter usage

Run converter and print output on stdout:

$ python convert.py LEGO_RCX.json

Run converter and pipe output to IR output file:

$ python convert.py LEGO_RCX.json > LEGO_RCX.ir

Run converter and pipe output to both an IR output file and stdout:

$ python convert.py LEGO_RCX.json | tee LEGO_RCX.ir

For the format of the .json file, inspect LEGO_RCX.json example.

Plot usage

The IR signal plot script additionally requires the Python module matplotlib.

Usage: python3 plot_signal.py <IR_file_name> <IR_signal_name>

Example:

python plot_signal.py LEGO_RCX.ir ABC_STOP
Trying to open file 'LEGO_RCX.ir' and then to plot signal 'ABC_STOP'
Found signal:
  Raw signal name: ABC_STOP
  Raw signal data: 833 417 417 417 417 ...

IR signal plot

serialhex2flipperzeroinfrared's People

Contributors

maehw avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.