xkonni / raspberry-remote

Control remote plugs with the Raspberry Pi, features a webinterface. Uses RCSwitch and wiringPi.
GNU General Public License v2.0
109 stars 47 forks source link

64Bit Support #37

Closed Marco-Total closed 3 years ago

Marco-Total commented 3 years ago

Hi,

i have a raspi 4 with 8 GByte RAM, so i need to use the 64Bit version of raspberry pi os.

Can I use your tool under a raspi4 with 64Bit? When i Try to compile the files, I got following error:

root@mapi24:/home/pi/raspberry-remote# make send
g++ -Wall -lwiringPi   -c -o RCSwitch.o RCSwitch.cpp
RCSwitch.cpp:31:42: warning: converting to non-pointer type ‘long unsigned int’ from NULL [-Wconversion-null]
 unsigned long RCSwitch::nReceivedValue = NULL;
                                          ^~~~
RCSwitch.cpp: In constructor ‘RCSwitch::RCSwitch()’:
RCSwitch.cpp:41:30: warning: converting to non-pointer type ‘long unsigned int’ from NULL [-Wconversion-null]
   RCSwitch::nReceivedValue = NULL;
                              ^~~~
RCSwitch.cpp: In member function ‘void RCSwitch::enableReceive()’:
RCSwitch.cpp:575:32: warning: converting to non-pointer type ‘long unsigned int’ from NULL [-Wconversion-null]
     RCSwitch::nReceivedValue = NULL;
                                ^~~~
RCSwitch.cpp:576:36: warning: converting to non-pointer type ‘unsigned int’ from NULL [-Wconversion-null]
     RCSwitch::nReceivedBitlength = NULL;
                                    ^~~~
RCSwitch.cpp: In member function ‘bool RCSwitch::available()’:
RCSwitch.cpp:588:38: warning: NULL used in arithmetic [-Wpointer-arith]
   return RCSwitch::nReceivedValue != NULL;
                                      ^~~~
RCSwitch.cpp: In member function ‘void RCSwitch::resetAvailable()’:
RCSwitch.cpp:592:30: warning: converting to non-pointer type ‘long unsigned int’ from NULL [-Wconversion-null]
   RCSwitch::nReceivedValue = NULL;
                              ^~~~
g++ -Wall -lwiringPi   -c -o send.o send.cpp
send.cpp: In function ‘int main(int, char**)’:
send.cpp:184:65: warning: ISO C++ forbids converting a string constant to ‘char*’ [-Wwrite-strings]
                         mySwitch.send("010101010001000101010001");
                                                                 ^
send.cpp:188:61: warning: ISO C++ forbids converting a string constant to ‘char*’ [-Wwrite-strings]
                         mySwitch.sendTriState("FFFF0F0FFF0F");
                                                             ^
g++ RCSwitch.o send.o -o send -Wall -lwiringPi
/usr/bin/ld: inkompatibles /usr/lib/gcc/aarch64-linux-gnu/8/../../../../lib/libwiringPi.so wird bei der Suche nach -lwiringPi übersprungen
/usr/bin/ld: inkompatibles /usr/lib/../lib/libwiringPi.so wird bei der Suche nach -lwiringPi übersprungen
/usr/bin/ld: inkompatibles /usr/lib/gcc/aarch64-linux-gnu/8/../../../libwiringPi.so wird bei der Suche nach -lwiringPi übersprungen
/usr/bin/ld: inkompatibles //usr/lib/libwiringPi.so wird bei der Suche nach -lwiringPi übersprungen
/usr/bin/ld: -lwiringPi kann nicht gefunden werden
collect2: error: ld returned 1 exit status
make: *** [Makefile:14: send] Fehler 1
xkonni commented 3 years ago

The top are just warnings, could be fixed. Actual issue is that you did not install wiringpi, do that and it should be fine.

Marco-Total commented 3 years ago

The top are just warnings, could be fixed. Actual issue is that you did not install wiringpi, do that and it should be fine.

wiringpi is installed:

root@mapi24:/home/pi# gpio -v
gpio version: 2.50
Copyright (c) 2012-2018 Gordon Henderson
This is free software with ABSOLUTELY NO WARRANTY.
For details type: gpio -warranty

Raspberry Pi Details:
  Type: Unknown17, Revision: 04, Memory: 0MB, Maker: Sony
  * Device tree is enabled.
  *--> Raspberry Pi 4 Model B Rev 1.4
  * This Raspberry Pi supports user-level GPIO access.
xkonni commented 3 years ago

maybe. still the error says it can't be found.

here's my output:

$ apt show wiringpi
Package: wiringpi
Version: 2.50
Priority: optional
Section: libraries
Maintainer: Gordon Henderson <projects@drogon.net>
Installed-Size: unknown
Depends: libc6
Download-Size: 52.9 kB
APT-Manual-Installed: yes
APT-Sources: http://archive.raspberrypi.org/debian buster/main armhf Packages
Description: The wiringPi libraries, headers and gpio command
  Libraries to allow GPIO access on a Raspberry Pi from C and C++
  and BASIC programs as well as from the command-line
$ gpio -v
gpio version: 2.50
Copyright (c) 2012-2018 Gordon Henderson
This is free software with ABSOLUTELY NO WARRANTY.
For details type: gpio -warranty

Raspberry Pi Details:
  Type: Pi 3, Revision: 02, Memory: 1024MB, Maker: Sony 
  * Device tree is enabled.
  *--> Raspberry Pi 3 Model B Rev 1.2
  * This Raspberry Pi supports user-level GPIO access.
$ make send
g++ -Wall -lwiringPi   -c -o RCSwitch.o RCSwitch.cpp
[warnings...]
g++ -Wall -lwiringPi   -c -o send.o send.cpp
[warnings...]
g++ RCSwitch.o send.o -o send -Wall -lwiringPi 
$ ldd ./send
    linux-vdso.so.1 (0x7efa5000)
    /usr/lib/arm-linux-gnueabihf/libarmmem-${PLATFORM}.so => /usr/lib/arm-linux-gnueabihf/libarmmem-v7l.so (0x76f62000)
    libwiringPi.so => /usr/lib/libwiringPi.so (0x76f44000)
    libstdc++.so.6 => /usr/lib/arm-linux-gnueabihf/libstdc++.so.6 (0x76dfd000)
    libm.so.6 => /lib/arm-linux-gnueabihf/libm.so.6 (0x76d7b000)
    libgcc_s.so.1 => /lib/arm-linux-gnueabihf/libgcc_s.so.1 (0x76d4e000)
    libc.so.6 => /lib/arm-linux-gnueabihf/libc.so.6 (0x76c00000)
    libpthread.so.0 => /lib/arm-linux-gnueabihf/libpthread.so.0 (0x76bd6000)
    librt.so.1 => /lib/arm-linux-gnueabihf/librt.so.1 (0x76bbf000)
    libcrypt.so.1 => /lib/arm-linux-gnueabihf/libcrypt.so.1 (0x76b7f000)
    /lib/ld-linux-armhf.so.3 (0x76f77000)

check if you have /usr/lib/libwiringPi.so on your device.

Marco-Total commented 3 years ago

The File is there: root@mapi24:/usr/lib# ls -alh /usr/lib/libwiringPi.so lrwxrwxrwx 1 root root 19 Aug 20 13:50 /usr/lib/libwiringPi.so -> libwiringPi.so.2.50

xkonni commented 3 years ago

okay, but it is not found by gcc. this is not specific to this project.

check with their official examples: http://wiringpi.com/examples/ - can you compile those?

Marco-Total commented 3 years ago

Hi and thanks,

I try the example project "blinc" and got the thame error.

I remove the last version 2.5.2 and install a fork from github:

https://github.com/WiringPi/WiringPi

root@mapi24: apt remove wiringPi
root@mapi24: git clone https://github.com/WiringPi/WiringPi
root@mapi24: cd WiringPi/
.root@mapi24: /build
root@mapi24: echo /usr/local/lib >> /etc/ld.so.conf
root@mapi24: gpio -v
gpio version: **2.60**
Copyright (c) 2012-2018 Gordon Henderson
This is free software with ABSOLUTELY NO WARRANTY.
For details type: gpio -warranty

Raspberry Pi Details:
  Type: Pi 4B, Revision: 04, Memory: 8192MB, Maker: Sony
  * Device tree is enabled.
  *--> Raspberry Pi 4 Model B Rev 1.4
  * This Raspberry Pi supports user-level GPIO access.

Now, i can run make without any problems! Thank you for the help!

xkonni commented 3 years ago

ok, glad it's solved ;)