Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WiringPi double initialization #3

Open
rpp0 opened this issue Nov 30, 2016 · 3 comments
Open

WiringPi double initialization #3

rpp0 opened this issue Nov 30, 2016 · 3 comments

Comments

@rpp0
Copy link

rpp0 commented Nov 30, 2016

Hi, it seems something changed in the WiringPi library that causes the following runtime error:

$ ./thethingsnetwork-send-v1 
wiringPiSetup*: You must only call this once per program run. This is a fatal error. Please fix your code.

I fixed it by commenting out

wiringPiSetup();

Additionally, in the example there is another call to wiringPiSetup() which needs to be commented out.

@sbisca
Copy link

sbisca commented Dec 2, 2016

Hi, i'm having the same issue. I also commented the line #130 but still seems doesn't work..

void setup() {
  // LMIC init
  wiringPiSetup();

@rpp0
Copy link
Author

rpp0 commented Dec 2, 2016

Do you get the same error after commenting the line? Perhaps you forgot to rebuild the library (remove the .o files and compile again) or there's another wiringPiSetup() somewhere in the code.

@sbisca
Copy link

sbisca commented Dec 2, 2016

As you can see here, i commented that line, removed the file and runned make again, than executed. But still same error..

pi@raspberrypi:~/lmic_pi-master/examples/thethingsnetwork-send-v1 $ rm thethingsnetwork-send-v1
rm: remove write-protected regular file ‘thethingsnetwork-send-v1’? y
pi@raspberrypi:~/lmic_pi-master/examples/thethingsnetwork-send-v1 $ ls
Makefile  thethingsnetwork-send-v1.cpp  thethingsnetwork-send-v1.ino
pi@raspberrypi:~/lmic_pi-master/examples/thethingsnetwork-send-v1 $ sudo make
cd ../../lmic && make
make[1]: Entering directory '/home/pi/lmic_pi-master/lmic'
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory '/home/pi/lmic_pi-master/lmic'
cc -I../../lmic -o thethingsnetwork-send-v1 thethingsnetwork-send-v1.cpp ../../lmic/*.o -lwiringPi
pi@raspberrypi:~/lmic_pi-master/examples/thethingsnetwork-send-v1 $ sudo ./thethingsnetwork-send-v1
wiringPiSetup*: You must only call this once per program run. This is a fatal error. Please fix your code.
pi@raspberrypi:~/lmic_pi-master/examples/thethingsnetwork-send-v1 $ ls
Makefile  thethingsnetwork-send-v1  thethingsnetwork-send-v1.cpp  thethingsnetwork-send-v1.ino
pi@raspberrypi:~/lmic_pi-master/examples/thethingsnetwork-send-v1 $ 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants