Open rpp0 opened 7 years ago
Hi, i'm having the same issue. I also commented the line #130 but still seems doesn't work..
void setup() {
// LMIC init
wiringPiSetup();
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.
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 $
Hi, it seems something changed in the WiringPi library that causes the following runtime error:
I fixed it by commenting out https://github.com/ernstdevreede/lmic_pi/blob/c4a7c2080faf3fb76277f78b6d035c284a5eec9c/lmic/hal.c#L18
Additionally, in the example there is another call to wiringPiSetup() which needs to be commented out.