A MicroPython Interpreter For Flipper Zero

Screenshot of the REPL running on the Flipper, importing the flipper API library and calling infrared receive function out of it with help of autocomplete

Got a Flipper Zero? Ever wanted to use a high-level but powerful scripting language on it? Thanks to [Oliver] we now have a MicroPython application for the Flipper, complete with a library for hardware and software feature support. Load it up, start it up, connect over USB, and you’ve got the ever-so-convenient REPL at your disposal. Or, upload a Python script to your Flipper and run them directly from Flipper’s UI at your convenience!

In the API docs, we’re seeing support for every single primitive you could want – GPIO (including the headers at the top, of course), a healthy library for LCD and LCD backlight control, button handling, SD card support, speaker library for producing tones, ADC and PWM, vibromotor, logging, and even infrared transmit/receive support. Hopefully, we get support for Flipper’s wireless capabilities at some point, too!

Check out the code examples, get the latest release from the Flipper app portal or GitHub, load it up, and play! Mp-flipper has existed for the better half of a year now, so it’s a pretty mature application, and it adds quite a bit to Flipper’s use cases in our world of hardware hacking. Want to develop an app for the Flipper in Python or otherwise? Check out this small-screen UI design toolkit or this editor we’ve featured recently!

13 thoughts on “A MicroPython Interpreter For Flipper Zero

  1. I dunno. Perhaps I’m a parochial idiot, but I have a difficult time with trust and respect in regards to a company that requires the chrome browser for some of its stuff.

    1. you don’t need to use the chrome browser.
      the company offers a method to update firmware that uses webusb.. you can update the firmware using many other methods..

    2. It’s got nothing to do with the Flipper and everything to do with Firefox stubbornly refusing to support any of the hardware access methods needed. Instead they claim “security” and force you to run native binaries instead… Which is literally less safe, it just gets them to dodge responsibility.

      Aside from that, you don’t need to use the browser tools to work with the device. There’s a native updater, as well as an android app. You don’t lose any functionality, just some convenience.

      1. “Responsibility” is the wrong word to use here. “Work” is what they are avoiding. Not to mention Firefox faces an uphill battle for system access if they do implement it. This sucks, but aim your misplaced anger somewhere else.

        1. an uphill battle for system access

          Uh, and yet chrome/chromium did it without issue.

          And it’s most definitely not a case of avoiding the work required. Mozilla are on record about the WebSerial/WebUSB/WebBluetooth standards and their unwillingness to support them, and their rationale. It’s a crap one, but it’s explicit.

    3. For some quasi- ideological reason (that´s not what a webbrowser is supposed to do) Firefox chose NOT to implement WebUSB (but on the other hand like some other browser they support Webserial) .
      Chrome implemented webusb first, and became the de-facto recommendation for a growing segment: things that you can flash through USB. I know at least one other example: Pybricks.

  2. Actually, people can program in Python for MCUs. I’m on my way to implementing this idea. I was initially thinking about using an interpreter, but unfortunately, it’s heavy on coding, and I can’t do it alone. So, my new approach is to use Python bytecode. Instead of making a parser to handle bytecode from C, I plan to export the bytecode as a normal text file, then write Python code to parse the bytecode directly to ASM. Bytecode resembles opcodes and ASM, so if I define the bytecode functionality, I can parse it to ASM logically. It’s still valid, and since modern computers have sufficient memory, it could work.

    The idea for linking bytecode to ASM came from an old project where the author linked a string to opcodes and loaded it onto old computers. This means, no matter what compiler is used, it still links to binary in the end. If I use Python string conventions for bytecode, it could be the answer. Who knows?

  3. “what is the size of a micropython interpreter?

    AI Overview.

    A MicroPython interpreter typically occupies around 256 kilobytes of code space,
    making it suitable for running on small microcontrollers with limited memory,
    while also requiring only a modest amount of RAM (usually around 16 kilobytes).”

    Bright fig Forth fits into the 8KB internal memory of an 8051.

    Fifg Forth is both an interactive interpreter and compiler as well as a single task OS.

    More reinventions?

  4. “what is the size of a micropython interpreter?

    AI Overview.

    A MicroPython interpreter typically occupies around 256 kilobytes of code space,
    making it suitable for running on small microcontrollers with limited memory,
    while also requiring only a modest amount of RAM (usually around 16 kilobytes).”

    Bright fig Forth fits into the 8KB internal memory of an 8051.

    Fifg Forth is both an interactive interpreter and compiler as well as a single task OS.

    More reinventions?

  5. “how often should a micropython interpreter be updated?

    AI Overview.

    A MicroPython interpreter should be updated whenever a new version is available
    that includes critical bug fixes, security patches, or new features relevant to
    your project, which could mean updating fairly regularly depending on the project’s needs and the release cadence of MicroPython updates; however, be cautious about updating too frequently on embedded devices due to potential compatibility issues
    with your hardware and codebase.

    fig Forth does not require updates. :)

    Updates to try to repair buggy, malware vulnerable, unmaintainable can bankrupt software companies?

  6. You guys thinking data center in a shoebox hardware/software technologies?

    We were thinking binary numbers greater than then number of atoms in the universe in 1970s.

    Art of Computer Programming obsolete?

    Except explanation of the Generalize Shift Register Pseudorandom Generator in vol 3, of course. :)

    AI Overview.

    An orderly enumeration of nonsingular binary matrices can be achieved by systematically generating all possible matrices and then filtering out those that are singular (non-invertible).

    Orderly enumeration of nonsingular binary matrices applied to text encryption Communications of the ACM.

    AI not a scam as coauthor Lewis reported in an email?

    AI uses too much power? :(

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.