No announcement yet.

Python interface to Raspberry Pi VisiGenie C library , using ctypes module

  • Filter
  • Time
  • Show
Clear All
new posts

  • Python interface to Raspberry Pi VisiGenie C library , using ctypes module

    Hello everyone,

    I'm doing a project using Python 3.8 on the Raspberry Pi, interfacing various hadrware components controlled by a Gen4-35DT .

    When I saw that there's no native Python library to control the display, I downloaded and compiled the C ViSi-Genie-RaspPi-Library ( and using the ctypes module, I built the interfaces to call the compiled C library functions inside my Python code.

    After loading the native C library (.so file on the system) inside python, I managed to run the basic demo app on App Note 23 using Python code.

    And right now I can call genieReadObject and genieWriteObject on my project and they're working well (my project mostly uses buttons).

    But, by no means I'm a Python expert , and I'm sure there are errors in my translation of the structs and unions , and the way I call the functions that will bite me in the future. I suspect that will happen when I have to call visi genie magic functions, which I currently don't have a clue how to use and probably coded them wrong on my translation.

    Question is, is there anyone good with Python, and specially with interfacing external libraries using ctypes, interested in reviewing what I did and correct/confirm that it will work reliably for other library calls? Maybe it can be the start of a general Python interface using visiGenie, but right now I don't believe it's good enough to be considered like that.


  • #2
    Hi Luis,

    I'm very interested in looking at what you've done, I have similar needs!


    • #3
      Hi Phil, since the post I made we decided to switch back to an Arduino Mega, but I still have the Python code with me. Let me gather it and I'll post here when ready, ok?