No announcement yet.

Python binding for ViSi-Genie-RaspPi-Library

  • Filter
  • Time
  • Show
Clear All
new posts

  • Python binding for ViSi-Genie-RaspPi-Library


    I wrote a little binding for using the ViSi-Genie-RaspPi-Library in Python:

    I made a pull request, so if you guys at 4Dsystems are interested, you could merge it back onto the main repo.


  • #2

    thanks alot for the binding ,this is excatly what i was looking for.

    i have a problem thou with genieReplyAvail() and genieGetReply().

    i'm trying to read the report msg sent from a winbutton to the pi,its working in c but not in python .any ideas why?


    • #3

      Hi! first thanks for the python version, second chou_aieb, did you solve this issue?

      I 'm trying to use the colorpicker controller, this way it work for one minute then goes down returning -1 at read.

      import geniePi as D
      import wiringpi2 as W

      D.genieSetup("/dev/ttyAMA0", 115200)

      while 1:
      a = D.genieReadObj(32,0)
      R1 = a / 2048
      G1 = (a - R1 * 2048) / 32
      B1 = a - R1 * 2048 - G1 * 32
      print ("a:%s R:%s G:%s B:%s " % (a,R,G,B))

      I'm looking at genieGetReply to solve this issue(to avoid the use of ReadObj):

      But looking at swig files seems like genieReplyAvail is always considered as 0, am I right?

      SWIGINTERN PyObject *_wrap_genieReplyAvail(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
      PyObject *resultobj = 0;
      int result;

      So genieGetReply() isn't called.
      It appear that to use genieGetReply() I must create a class of the struct genieReplyStruct.

      x =D.genieReplyStruct()
      (if geniReplyAvail never get other value than 0 so this stay forever in the delay(1) statement)

      I cannot understand how this should be implemented and called, so I kindly ask you a little advice.


      • #4

        This forum is really useful!


        • #5

          Unfortunately there aren't many Python people here.

          dmichel76 has not visited since he made that post, perhaps you can email and/or PM him here, or find him via github?


          • #6
            I have not been able to contact dmichel76 but with this product being used on Raspberry Pi and Beaglebone Black products, Python would help us none C guys a lot. I love to use the ViSi Genie but I would either like to have python control the device after I created the gui or myself using serial. Right now there is no good documentation for me to run simple serial commands to set a form led readout.



            • #7
              Hi Folks, has anyone made any progress with this?