nrf24l01+ RPi2 direct connection problem



  • Hello,

    I followed the nrf24l01+ direct RPi2 connection guide here:
    http://forum.mysensors.org/topic/1151/tutorial-raspberry-pi-nrf24l01-direct-connection

    I have had librf24-bcm.so.1.0 installed from tmrh20.
    Unfortunately, I was not able to compile it from librf24-bcm folder:

    g++ -Wall -fPIC -Ofast -mfpu=vfp -mfloat-abi=hard -mtune=arm1176jzf-s -march=armv7-a -D BCM2835_PERI_BASE=0x -c RF24.cpp
    gcc -Wall -fPIC -Ofast -mfpu=vfp -mfloat-abi=hard -mtune=arm1176jzf-s -march=armv7-a -D BCM2835_PERI_BASE=0x -c bcm2835.c
    bcm2835.c: In function ‘bcm2835_init’:
    bcm2835.c:1207:28: error: invalid suffix "x" on integer constant
    bcm2835.c:1208:28: error: invalid suffix "x" on integer constant
    bcm2835.c:1209:28: error: invalid suffix "x" on integer constant
    bcm2835.c:1210:28: error: invalid suffix "x" on integer constant
    bcm2835.c:1211:28: error: invalid suffix "x" on integer constant
    bcm2835.c:1212:28: error: invalid suffix "x" on integer constant
    bcm2835.c:1213:28: error: invalid suffix "x" on integer constant
    bcm2835.c:1214:28: error: invalid suffix "x" on integer constant
    bcm2835.c:1228:83: error: invalid suffix "x" on integer constant
    bcm2835.c:1232:81: error: invalid suffix "x" on integer constant
    bcm2835.c:1236:81: error: invalid suffix "x" on integer constant
    bcm2835.c:1239:83: error: invalid suffix "x" on integer constant
    bcm2835.c:1242:83: error: invalid suffix "x" on integer constant
    bcm2835.c:1246:83: error: invalid suffix "x" on integer constant
    bcm2835.c:1249:83: error: invalid suffix "x" on integer constant
    bcm2835.c:1253:79: error: invalid suffix "x" on integer constant
    Makefile:52: recipe for target 'bcm2835.o' failed
    make: *** [bcm2835.o] Error 1
    

    When I run PiGatewaySerial, I see the following:

    pi@raspberrypi2 ~/Raspberry $ sudo ./PiGatewaySerial
    Starting PiGatewaySerial...
    Protocol version - 1.4
    Created PTY '/dev/pts/1'
    Gateway tty: /dev/ttyMySensorsGateway
    ================ SPI Configuration ================
    CSN Pin  	 = CE0 (PI Hardware Driven)
    CE Pin  	 = Custom GPIO22
    Clock Speed	 = 8 Mhz
    ================ NRF Configuration ================
    STATUS		 = 0x0e RX_DR=0 TX_DS=0 MAX_RT=0 RX_P_NO=7 TX_FULL=0
    RX_ADDR_P0-1	 = 0xa8a8e1fc00 0xa8a8e1fc00
    RX_ADDR_P2-5	 = 0xff 0xc4 0xc5 0xc6
    TX_ADDR		 = 0xa8a8e1fc01
    RX_PW_P0-6	 = 0x20 0x20 0x20 0x00 0x00 0x00
    EN_AA		 = 0x3b
    EN_RXADDR	 = 0x06
    RF_CH		 = 0x4c
    RF_SETUP	 = 0x23
    CONFIG		 = 0x0e
    DYNPD/FEATURE	 = 0x3f 0x06
    Data Rate	 = 250KBPS
    Model		 = nRF24L01+
    CRC Length	 = 16 bits
    PA Power	 = PA_LOW
    read: 1-1-0 s=255,c=0,t=17,pt=0,l=3:1.5
    send: 1-194-1-0 s=255,c=0,t=17,pt=0,l=3,st=ok:1.5
    read: 1-1-0 s=255,c=3,t=6,pt=1,l=1:0
    send: 1-194-1-0 s=255,c=3,t=6,pt=1,l=1,st=ok:0
    read: 1-1-0 s=255,c=3,t=11,pt=0,l=17:Sensebender Micro
    send: 1-194-1-0 s=255,c=3,t=11,pt=0,l=17,st=ok:Sensebender Micro
    read: 1-1-0 s=255,c=3,t=12,pt=0,l=3:1.2
    send: 1-194-1-0 s=255,c=3,t=12,pt=0,l=3,st=ok:1.2
    read: 1-1-0 s=1,c=0,t=6,pt=0,l=0:
    send: 1-194-1-0 s=1,c=0,t=6,pt=0,l=0,st=ok:
    read: 1-1-0 s=2,c=0,t=7,pt=0,l=0:
    send: 1-194-1-0 s=2,c=0,t=7,pt=0,l=0,st=fail:
    read: 1-1-0 s=199,c=0,t=13,pt=0,l=0:
    send: 1-194-1-0 s=199,c=0,t=13,pt=0,l=0,st=fail:
    read: 1-1-0 s=1,c=1,t=0,pt=7,l=5:23.2
    send: 1-194-1-0 s=1,c=1,t=0,pt=7,l=5,st=fail:23.2
    read: 1-1-0 s=2,c=1,t=1,pt=2,l=2:57
    send: 1-194-1-0 s=2,c=1,t=1,pt=2,l=2,st=fail:57
    read: 1-1-0 s=199,c=1,t=38,pt=4,l=4:3143
    send: 1-194-1-0 s=199,c=1,t=38,pt=4,l=4,st=fail:3143
    read: 1-1-0 s=255,c=3,t=0,pt=1,l=1:88
    send: 1-194-1-0 s=255,c=3,t=0,pt=1,l=1,st=fail:88
    read: 1-1-255 s=255,c=3,t=7,pt=0,l=0:
    

    Nothing can be seen in Domoticz.
    Unfortunately, I cannot reinstall my RPi to re-compile librf24-bcm.so.1.0 as it is production system.

    Any ideas please?



  • @Mediacj - I have just noticed you had a similar issue. Care to share how you resolved it please?
    @hek - Do you know if the problem is only in librf24-bcm.so.1.0?



  • I didn't get it to work unfortunately.



  • @Mediacj said:

    I didn't get it to work unfortunately.

    Damn! All google links are only to this website and it looks like there is no solution to this issue for now. Thanks for your reply though



  • Hello.
    I think that the problem related to the messsage:
    error: invalid suffix "x" on integer constant
    come from a problem in the Makefile of the librf24-bcm.
    There you can find the following line:

    IOBASE := $(shell cat /proc/iomem | grep bcm2708_vcio | cut -f 1 -d "-")

    This try to find the memory base address of the peripherals in the Raspberry that is variable between the different models.

    In my Raspberry the /proc/iomem file does not contain any information about bcm2708_vcio and the string returned is empty (in my case should be 0x20000000)

    You could try to hard code the correct value in the Makefile.

    Hope this help



  • @salvato Thanks very much!
    The makefile has to be changed to

    This is for the standard PI
    amend the following:
    #define BCM2835_PERI_BASE 0x3F000000

    I can confirm - now it works and everything compiles fine!



  • @alexsh1
    Happy to have solved your problem.



  • Hi guys, i have the same problem with compiling librf24-bcm library on RPI2. I have changed line "#define BCM2835_PERI_BASE 0x20000000" to "#define BCM2835_PERI_BASE 0x3F000000" in bcm2835.h file but it didnt help. I still get compiling error "bcm2835.c:1253:79: error: invalid suffix "x" on integer constant
    Makefile:52: recipe for target 'bcm2835.o' failed". What else need to be changed ? thanks



  • @lubo
    oh i had to update CCFLAGS += -D BCM2835_PERI_BASE=0x${IOBASE} to CCFLAGS += -D BCM2835_PERI_BASE=0x3F000000 in makefile and it works now thanks 🙂



  • @lubo Ok, you have figured it out. Excellent! It is the makefile which has to be changed



  • well... I made a different modification:
    I changed the row
    IOBASE := $(shell cat /proc/iomem | grep bcm2708_vcio | cut -f 1 -d "-")
    in
    IOBASE := 20000000

    (3F000000 in your case)



  • Wow nice and easy to follow. I had the error but the error thread helped me.
    Just wondering why does it say its running "MySensors Gateway USB
    Version: 1.4"



  • Because it is running MS v1.4 (current is v1.5 and development is v1.6) 🙂
    If you wonder why it says USB, it emulates USB.

    @Eawo said:

    Just wondering why does it say its running "MySensors Gateway USB
    Version: 1.4"


Log in to reply
 

Suggested Topics

  • 5
  • 2
  • 1
  • 3
  • 5
  • 5

0
Online

11.4k
Users

11.1k
Topics

112.7k
Posts