Python3 modules for GPIO and Serial Port.



  • Hi,
    I'm not able to find packages for python3 for using GPIO or SerialPort... are they only available for python2? If so, will in near future this packages available for python3? what about a one-wire package?
    Thanks!



  • @Pablo-Fonovich
    if you use SSH and do opkg you will see the available commands.
    then do opkg list (it displays all available, quite long list)
    or simpler: opkg list | grep pyth (to limit and show only the part of the list that has 'pyth' in the text.
    You will then see python and also python3 stuff.

    I think that you have to use opkg install python3-light or python3 (i you want all)
    then you need
    then opkg install pyOnionGpio
    I think it should be ok then.

    Personnally i used also pyserial BUT:
    I wanted only python3-light to limit the space used.
    Then i used opkg install python-pyserial
    BUT it installs python-base then python-light (based on python 2.7) then python-pyserial
    but when my python script does import 'serial', it fails.
    So finally i removed python3 and let python 2.7
    I don't know how to use python3 and make it point to serial although pyserial is said to work with python3.



  • Hi,
    Yes, i already knew how to list python specific packages.. the thing is that (at least when i tested) pyOnionGpio is only available for python2. When a try to import in python 3 it fails.. same with pyserial.


  • administrators

    @Pablo-Fonovich You can use pip to install pyserial:

    opkg install python3-light python3-pip
    pip3 install pyserial
    

Log in to reply
 

Looks like your connection to Community was lost, please wait while we try to reconnect.