Wiringpi2 Error

Moderators: odroid, mdrjr

Wiringpi2 Error

Unread postby Gerri3d » Wed May 16, 2018 10:33 pm

I tried a small test program which workes some weeks ago:

Code: Select all
#!/usr/bin/python
import wiringpi2 as wpi
import time
 
wpi.wiringPiSetup()
wpi.pinMode(27,1)
 
while True:
    wpi.digitalWrite(27, 1)
    time.sleep(4)
    wpi.digitalWrite(27, 0)
    time.sleep(4)



and it worked. But today I get this error(s):

odroid@odroid:~/WiringPi2-Python$ python led_exam.py
Traceback (most recent call last):
File "led_exam.py", line 2, in <module>
import wiringpi2 as wpi
File "/home/odroid/WiringPi2-Python/wiringpi2.py", line 28, in <module>
_wiringpi2 = swig_import_helper()
File "/home/odroid/WiringPi2-Python/wiringpi2.py", line 20, in swig_import_helper
import _wiringpi2
ImportError: No module named _wiringpi2
odroid@odroid:~/WiringPi2-Python$ python led_exam.py
Traceback (most recent call last):
File "led_exam.py", line 2, in <module>
import wiringpi2 as wpi
File "/home/odroid/WiringPi2-Python/wiringpi2.py", line 28, in <module>
_wiringpi2 = swig_import_helper()
File "/home/odroid/WiringPi2-Python/wiringpi2.py", line 20, in swig_import_helper
import _wiringpi2
ImportError: No module named _wiringpi2
odroid@odroid:~/WiringPi2-Python$


I am new in python (it is 3.5) and I need some help to find the problem.
Gerri3d
 
Posts: 10
Joined: Thu Apr 12, 2018 7:46 pm
languages_spoken: german
ODROIDs: XU4

Re: Wiringpi2 Error

Unread postby odroid » Wed May 16, 2018 11:39 pm

No module named _wiringpi2 means there is no wiringpi lib for python.
Did you follow this instruction to install the WiringPi?
https://wiki.odroid.com/odroid-xu4/appl ... o/wiringpi
User avatar
odroid
Site Admin
 
Posts: 27754
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID

Re: Wiringpi2 Error

Unread postby Gerri3d » Wed May 16, 2018 11:47 pm

yes I did. And it workes some days ago. How can I check that it is still there?
Gerri3d
 
Posts: 10
Joined: Thu Apr 12, 2018 7:46 pm
languages_spoken: german
ODROIDs: XU4

Re: Wiringpi2 Error

Unread postby odroid » Thu May 17, 2018 12:17 am

I have no idea what's wrong in your system.
Just follow the steps again since there will be no negative side effect.
User avatar
odroid
Site Admin
 
Posts: 27754
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID

Re: Wiringpi2 Error

Unread postby Gerri3d » Thu May 17, 2018 12:25 am

how can I uninstall everything now?

WHich folders should I use?
Gerri3d
 
Posts: 10
Joined: Thu Apr 12, 2018 7:46 pm
languages_spoken: german
ODROIDs: XU4

Re: Wiringpi2 Error

Unread postby odroid » Thu May 17, 2018 12:58 am

Do you remember where you downloaded wiringpi and wiringpi2-python source code?
If you can't remember, just start the instruction again.
User avatar
odroid
Site Admin
 
Posts: 27754
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID

Re: Wiringpi2 Error

Unread postby Gerri3d » Thu May 17, 2018 5:04 pm

I installed the wiringPi folder (C) at the root. Where sholud I install the Python wrapper now?
https://github.com/hardkernel/WiringPi2-Python
Gerri3d
 
Posts: 10
Joined: Thu Apr 12, 2018 7:46 pm
languages_spoken: german
ODROIDs: XU4

Re: Wiringpi2 Error

Unread postby odroid » Thu May 17, 2018 10:58 pm

You can run the git command in current directory "wiringPi".
User avatar
odroid
Site Admin
 
Posts: 27754
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID


Return to Hardware and peripherals

Who is online

Users browsing this forum: No registered users and 2 guests