Error compiling mysensors in beaglebone black



  • Hi,

    I'm trying to install mysensors in beaglebone black as a gateway to connect to home assistant through ethernet, but it gives me this error:

    debian@beaglebone:~/MySensors$ make
    gcc -MT build/hal/architecture/Linux/drivers/core/log.o -MMD -MP -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=hard -DMY_RADIO_RF24 -DMY_GATEWDLINUX_SPI_SPIDEV -DMY_LINUX_SERIAL_PORT=\"COM2\" -DMY_CONTROLLER_IP_ADDRESS=192,168,1,75:8123  -Ofast -g -Wall -Wextra  -I. -I./core -I./hal/architecte -c hal/architecture/Linux/drivers/core/log.c -o build/hal/architecture/Linux/drivers/core/log.o
    gcc -MT build/hal/architecture/Linux/drivers/core/config.o -MMD -MP -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=hard -DMY_RADIO_RF24 -DMY_GAG -DLINUX_SPI_SPIDEV -DMY_LINUX_SERIAL_PORT=\"COM2\" -DMY_CONTROLLER_IP_ADDRESS=192,168,1,75:8123  -Ofast -g -Wall -Wextra  -I. -I./core -I./hal/architcore -c hal/architecture/Linux/drivers/core/config.c -o build/hal/architecture/Linux/drivers/core/config.o
    g++ -MT build/hal/architecture/Linux/drivers/core/StdInOutStream.o -MMD -MP -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=hard -DMY_RADIO_RF24DMY_DEBUG -DLINUX_SPI_SPIDEV -DMY_LINUX_SERIAL_PORT=\"COM2\" -DMY_CONTROLLER_IP_ADDRESS=192,168,1,75:8123  -Ofast -g -Wall -Wextra -std=c++11 -I. -I./cure/Linux/drivers/core -c hal/architecture/Linux/drivers/core/StdInOutStream.cpp -o build/hal/architecture/Linux/drivers/core/StdInOutStream.o
    g++ -MT build/hal/architecture/Linux/drivers/core/noniso.o -MMD -MP -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=hard -DMY_RADIO_RF24 -DMY_GAG -DLINUX_SPI_SPIDEV -DMY_LINUX_SERIAL_PORT=\"COM2\" -DMY_CONTROLLER_IP_ADDRESS=192,168,1,75:8123  -Ofast -g -Wall -Wextra -std=c++11 -I. -I./core -I./x/drivers/core -c hal/architecture/Linux/drivers/core/noniso.cpp -o build/hal/architecture/Linux/drivers/core/noniso.o
    g++ -MT build/hal/architecture/Linux/drivers/core/GPIO.o -MMD -MP -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=hard -DMY_RADIO_RF24 -DMY_GATE-DLINUX_SPI_SPIDEV -DMY_LINUX_SERIAL_PORT=\"COM2\" -DMY_CONTROLLER_IP_ADDRESS=192,168,1,75:8123  -Ofast -g -Wall -Wextra -std=c++11 -I. -I./core -I./hadrivers/core -c hal/architecture/Linux/drivers/core/GPIO.cpp -o build/hal/architecture/Linux/drivers/core/GPIO.o
    hal/architecture/Linux/drivers/core/GPIO.cpp: In constructor ‘GPIOClass::GPIOClass()’:
    hal/architecture/Linux/drivers/core/GPIO.cpp:53:33: warning: ‘%s’ directive output may be truncated writing up to 255 bytes into a region of size 48 [-
        snprintf(file, sizeof(file), "/sys/class/gpio/%s/base", de->d_name);
                                     ^~~~~~~~~~~~~~~~~~~~~~~~~
    hal/architecture/Linux/drivers/core/GPIO.cpp:53:12: note: ‘snprintf’ output between 22 and 277 bytes into a destination of size 64
        snprintf(file, sizeof(file), "/sys/class/gpio/%s/base", de->d_name);
        ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    hal/architecture/Linux/drivers/core/GPIO.cpp:62:33: warning: ‘%s’ directive output may be truncated writing up to 255 bytes into a region of size 48 [-
        snprintf(file, sizeof(file), "/sys/class/gpio/%s/ngpio", de->d_name);
                                     ^~~~~~~~~~~~~~~~~~~~~~~~~~
    hal/architecture/Linux/drivers/core/GPIO.cpp:62:12: note: ‘snprintf’ output between 23 and 278 bytes into a destination of size 64
        snprintf(file, sizeof(file), "/sys/class/gpio/%s/ngpio", de->d_name);
        ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    g++ -MT build/hal/architecture/Linux/drivers/core/SPIDEV.o -MMD -MP -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=hard -DMY_RADIO_RF24 -DMY_GAG -DLINUX_SPI_SPIDEV -DMY_LINUX_SERIAL_PORT=\"COM2\" -DMY_CONTROLLER_IP_ADDRESS=192,168,1,75:8123  -Ofast -g -Wall -Wextra -std=c++11 -I. -I./core -I./x/drivers/core -c hal/architecture/Linux/drivers/core/SPIDEV.cpp -o build/hal/architecture/Linux/drivers/core/SPIDEV.o
    g++ -MT build/hal/architecture/Linux/drivers/core/Print.o -MMD -MP -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=hard -DMY_RADIO_RF24 -DMY_GAT -DLINUX_SPI_SPIDEV -DMY_LINUX_SERIAL_PORT=\"COM2\" -DMY_CONTROLLER_IP_ADDRESS=192,168,1,75:8123  -Ofast -g -Wall -Wextra -std=c++11 -I. -I./core -I./h/drivers/core -c hal/architecture/Linux/drivers/core/Print.cpp -o build/hal/architecture/Linux/drivers/core/Print.o
    g++ -MT build/hal/architecture/Linux/drivers/core/EthernetClient.o -MMD -MP -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=hard -DMY_RADIO_RF24DMY_DEBUG -DLINUX_SPI_SPIDEV -DMY_LINUX_SERIAL_PORT=\"COM2\" -DMY_CONTROLLER_IP_ADDRESS=192,168,1,75:8123  -Ofast -g -Wall -Wextra -std=c++11 -I. -I./cure/Linux/drivers/core -c hal/architecture/Linux/drivers/core/EthernetClient.cpp -o build/hal/architecture/Linux/drivers/core/EthernetClient.o
    g++ -MT build/hal/architecture/Linux/drivers/core/SerialPort.o -MMD -MP -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=hard -DMY_RADIO_RF24 -DMY_GATEWAY_LINUX -DMY_DEBUG -DLINUX_SPI_SPIDEV -DMY_LINUX_SERIAL_PORT=\"COM2\" -DMY_CONTROLLER_IP_ADDRESS=192,168,1,75:8123  -Ofast -g -Wall -Wextra -std=c++11 -I. -I./core -I./hal/architecture/Linux/drivers/core -c hal/architecture/Linux/drivers/core/SerialPort.cpp -o build/hal/architecture/Linux/drivers/core/SerialPort.o
    g++ -MT build/hal/architecture/Linux/drivers/core/Stream.o -MMD -MP -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=hard -DMY_RADIO_RF24 -DMY_GATEWAY_LINUX -DMY_DEBUG -DLINUX_SPI_SPIDEV -DMY_LINUX_SERIAL_PORT=\"COM2\" -DMY_CONTROLLER_IP_ADDRESS=192,168,1,75:8123  -Ofast -g -Wall -Wextra -std=c++11 -I. -I./core -I./hal/architecture/Linux/drivers/core -c hal/architecture/Linux/drivers/core/Stream.cpp -o build/hal/architecture/Linux/drivers/core/Stream.o
    g++ -MT build/hal/architecture/Linux/drivers/core/IPAddress.o -MMD -MP -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=hard -DMY_RADIO_RF24 -DMY_GATEWAY_LINUX -DMY_DEBUG -DLINUX_SPI_SPIDEV -DMY_LINUX_SERIAL_PORT=\"COM2\" -DMY_CONTROLLER_IP_ADDRESS=192,168,1,75:8123  -Ofast -g -Wall -Wextra -std=c++11 -I. -I./core -I./hal/architecture/Linux/drivers/core -c hal/architecture/Linux/drivers/core/IPAddress.cpp -o build/hal/architecture/Linux/drivers/core/IPAddress.o
    g++ -MT build/hal/architecture/Linux/drivers/core/compatibility.o -MMD -MP -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=hard -DMY_RADIO_RF24 -DMY_GATEWAY_LINUX -DMY_DEBUG -DLINUX_SPI_SPIDEV -DMY_LINUX_SERIAL_PORT=\"COM2\" -DMY_CONTROLLER_IP_ADDRESS=192,168,1,75:8123  -Ofast -g -Wall -Wextra -std=c++11 -I. -I./core -I./hal/architecture/Linux/drivers/core -c hal/architecture/Linux/drivers/core/compatibility.cpp -o build/hal/architecture/Linux/drivers/core/compatibility.o
    g++ -MT build/hal/architecture/Linux/drivers/core/interrupt.o -MMD -MP -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=hard -DMY_RADIO_RF24 -DMY_GATEWAY_LINUX -DMY_DEBUG -DLINUX_SPI_SPIDEV -DMY_LINUX_SERIAL_PORT=\"COM2\" -DMY_CONTROLLER_IP_ADDRESS=192,168,1,75:8123  -Ofast -g -Wall -Wextra -std=c++11 -I. -I./core -I./hal/architecture/Linux/drivers/core -c hal/architecture/Linux/drivers/core/interrupt.cpp -o build/hal/architecture/Linux/drivers/core/interrupt.o
    g++ -MT build/hal/architecture/Linux/drivers/core/SoftEeprom.o -MMD -MP -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=hard -DMY_RADIO_RF24 -DMY_GATEWAY_LINUX -DMY_DEBUG -DLINUX_SPI_SPIDEV -DMY_LINUX_SERIAL_PORT=\"COM2\" -DMY_CONTROLLER_IP_ADDRESS=192,168,1,75:8123  -Ofast -g -Wall -Wextra -std=c++11 -I. -I./core -I./hal/architecture/Linux/drivers/core -c hal/architecture/Linux/drivers/core/SoftEeprom.cpp -o build/hal/architecture/Linux/drivers/core/SoftEeprom.o
    g++ -MT build/hal/architecture/Linux/drivers/core/EthernetServer.o -MMD -MP -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=hard -DMY_RADIO_RF24 -DMY_GATEWAY_LINUX -DMY_DEBUG -DLINUX_SPI_SPIDEV -DMY_LINUX_SERIAL_PORT=\"COM2\" -DMY_CONTROLLER_IP_ADDRESS=192,168,1,75:8123  -Ofast -g -Wall -Wextra -std=c++11 -I. -I./core -I./hal/architecture/Linux/drivers/core -c hal/architecture/Linux/drivers/core/EthernetServer.cpp -o build/hal/architecture/Linux/drivers/core/EthernetServer.o
    g++ -MT build/examples_linux/mysgw.o -MMD -MP -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=hard -DMY_RADIO_RF24 -DMY_GATEWAY_LINUX -DMY_DEBUG -DLINUX_SPI_SPIDEV -DMY_LINUX_SERIAL_PORT=\"COM2\" -DMY_CONTROLLER_IP_ADDRESS=192,168,1,75:8123  -Ofast -g -Wall -Wextra -std=c++11 -I. -I./core -I./hal/architecture/Linux/drivers/core -c examples_linux/mysgw.cpp -o build/examples_linux/mysgw.o
    In file included from ./MySensors.h:244,
                     from examples_linux/mysgw.cpp:82:
    ./core/MyGatewayTransportEthernet.cpp: In function ‘bool gatewayTransportInit()’:
    ./core/MyGatewayTransportEthernet.cpp:57:40: error: expected primary-expression before ‘(’ token
     #define _ethernetControllerIP IPAddress(MY_CONTROLLER_IP_ADDRESS)
                                            ^
    ./core/MyGatewayTransportEthernet.cpp:223:21: note: in expansion of macro ‘_ethernetControllerIP’
      if (client.connect(_ethernetControllerIP, MY_PORT)) {
                         ^~~~~~~~~~~~~~~~~~~~~
    <command-line>: error: expected ‘)’ before ‘:’ token
    ./core/MyGatewayTransportEthernet.cpp:57:41: note: in expansion of macro ‘MY_CONTROLLER_IP_ADDRESS’
     #define _ethernetControllerIP IPAddress(MY_CONTROLLER_IP_ADDRESS)
                                             ^~~~~~~~~~~~~~~~~~~~~~~~
    ./core/MyGatewayTransportEthernet.cpp:223:21: note: in expansion of macro ‘_ethernetControllerIP’
      if (client.connect(_ethernetControllerIP, MY_PORT)) {
                         ^~~~~~~~~~~~~~~~~~~~~
    In file included from ./MySensors.h:244,
                     from examples_linux/mysgw.cpp:82:
    ./core/MyGatewayTransportEthernet.cpp:57:40: note: to match this ‘(’
     #define _ethernetControllerIP IPAddress(MY_CONTROLLER_IP_ADDRESS)
                                            ^
    ./core/MyGatewayTransportEthernet.cpp:223:21: note: in expansion of macro ‘_ethernetControllerIP’
      if (client.connect(_ethernetControllerIP, MY_PORT)) {
                         ^~~~~~~~~~~~~~~~~~~~~
    ./core/MyGatewayTransportEthernet.cpp: In function ‘bool gatewayTransportSend(MyMessage&)’:
    ./core/MyGatewayTransportEthernet.cpp:57:40: error: expected primary-expression before ‘(’ token
     #define _ethernetControllerIP IPAddress(MY_CONTROLLER_IP_ADDRESS)
                                            ^
    ./core/MyGatewayTransportEthernet.cpp:272:22: note: in expansion of macro ‘_ethernetControllerIP’
       if (client.connect(_ethernetControllerIP, MY_PORT)) {
                          ^~~~~~~~~~~~~~~~~~~~~
    <command-line>: error: expected ‘)’ before ‘:’ token
    ./core/MyGatewayTransportEthernet.cpp:57:41: note: in expansion of macro ‘MY_CONTROLLER_IP_ADDRESS’
     #define _ethernetControllerIP IPAddress(MY_CONTROLLER_IP_ADDRESS)
                                             ^~~~~~~~~~~~~~~~~~~~~~~~
    ./core/MyGatewayTransportEthernet.cpp:272:22: note: in expansion of macro ‘_ethernetControllerIP’
       if (client.connect(_ethernetControllerIP, MY_PORT)) {
                          ^~~~~~~~~~~~~~~~~~~~~
    In file included from ./MySensors.h:244,
                     from examples_linux/mysgw.cpp:82:
    ./core/MyGatewayTransportEthernet.cpp:57:40: note: to match this ‘(’
     #define _ethernetControllerIP IPAddress(MY_CONTROLLER_IP_ADDRESS)
                                            ^
    ./core/MyGatewayTransportEthernet.cpp:272:22: note: in expansion of macro ‘_ethernetControllerIP’
       if (client.connect(_ethernetControllerIP, MY_PORT)) {
                          ^~~~~~~~~~~~~~~~~~~~~
    ./core/MyGatewayTransportEthernet.cpp: In function ‘bool gatewayTransportAvailable()’:
    ./core/MyGatewayTransportEthernet.cpp:57:40: error: expected primary-expression before ‘(’ token
     #define _ethernetControllerIP IPAddress(MY_CONTROLLER_IP_ADDRESS)
                                            ^
    ./core/MyGatewayTransportEthernet.cpp:398:22: note: in expansion of macro ‘_ethernetControllerIP’
       if (client.connect(_ethernetControllerIP, MY_PORT)) {
                          ^~~~~~~~~~~~~~~~~~~~~
    <command-line>: error: expected ‘)’ before ‘:’ token
    ./core/MyGatewayTransportEthernet.cpp:57:41: note: in expansion of macro ‘MY_CONTROLLER_IP_ADDRESS’
     #define _ethernetControllerIP IPAddress(MY_CONTROLLER_IP_ADDRESS)
                                             ^~~~~~~~~~~~~~~~~~~~~~~~
    ./core/MyGatewayTransportEthernet.cpp:398:22: note: in expansion of macro ‘_ethernetControllerIP’
       if (client.connect(_ethernetControllerIP, MY_PORT)) {
                          ^~~~~~~~~~~~~~~~~~~~~
    In file included from ./MySensors.h:244,
                     from examples_linux/mysgw.cpp:82:
    ./core/MyGatewayTransportEthernet.cpp:57:40: note: to match this ‘(’
     #define _ethernetControllerIP IPAddress(MY_CONTROLLER_IP_ADDRESS)
                                            ^
    ./core/MyGatewayTransportEthernet.cpp:398:22: note: in expansion of macro ‘_ethernetControllerIP’
       if (client.connect(_ethernetControllerIP, MY_PORT)) {
                          ^~~~~~~~~~~~~~~~~~~~~
    make: *** [Makefile:99: build/examples_linux/mysgw.o] Error 1
    

    Configure command was:

    ./configure --my-debug=enable --my-gateway=ethernet --my-controller-ip-address=192.168.1.75:8123  --my-serial-port=COM2
    

  • Mod

    @ruben_gr since all the errors mention an ip address, my guess is that --my-controller-ip-address=<IP> needs to be given an ip address. Try removing :8123 and see if the compilation works. If it does, the error is with the configuration and not with the code or the beaglebone.



  • @mfalkvidd You are right! Sorry for my mistake, and thank you.

    Ruben Rodrigues



  • I'm getting this error now, and i don't have nothing in parameters with GPIO9:

    debian@beaglebone:~/MySensors$ sudo ./bin/mysgw
    Jun 17 08:17:50 INFO  Starting gateway...
    Jun 17 08:17:50 INFO  Protocol version - 2.3.2
    Jun 17 08:17:50 DEBUG MCO:BGN:INIT GW,CP=RNNGL---,FQ=NA,REL=255,VER=2.3.2
    Jun 17 08:17:50 DEBUG TSF:LRT:OK
    Jun 17 08:17:50 DEBUG TSM:INIT
    Jun 17 08:17:50 DEBUG TSF:WUR:MS=0
    Jun 17 08:17:50 DEBUG !TSM:INIT:TSP FAIL
    Jun 17 08:17:50 DEBUG TSM:FAIL:CNT=1
    Jun 17 08:17:50 DEBUG TSM:FAIL:DIS
    Jun 17 08:17:50 DEBUG TSF:TDI:TSL
    
    
    Jun 17 08:18:00 DEBUG TSM:FAIL:RE-INIT
    Jun 17 08:18:00 DEBUG TSM:INIT
    Jun 17 08:18:11 ERROR Could not open /sys/class/gpio/gpio9/direction
    

  • Mod

    Maybe the info in https://forum.mysensors.org/topic/5668/mysensors-gateway-on-orangepi-zero-opi can help. I have no idea how the spidev stuff works, but I imagine it can be different on beagle compared to raspberry.



  • @mfalkvidd Why you think that this error is related to SPI? i'm not using RF modules neither GPIO, just ethernet.


  • Mod

    @ruben_gr because the gateway fails to init the nrf24 radio.

    Add --my-transport=none to the configure command and go back to the make step if you don't want to use the default setting of nrf24.



  • @mfalkvidd thank you.

    I want to connect MySensors gateway to my homeassistant. I check the ipaddress and are correct. Why do i get this error? Or how can i debug it?

    Jun 20 10:21:22 DEBUG GWT:TPS:ETH OK
    Jun 20 10:21:22 ERROR connect: Connection refused
    Jun 20 10:21:22 ERROR failed to connect
    Jun 20 10:21:22 DEBUG GWT:TPS:ETH OK
    Jun 20 10:21:22 ERROR connect: Connection refused
    Jun 20 10:21:22 ERROR failed to connect
    

    homeassistant.PNG


  • Mod

    @ruben_gr are you still using —my-controller-ip-address in the configure command? In that case remove it, your controller will connect to the gateway.



  • It works, thank you for your patience!!

    But just to understand it, why i don't need —my-controller-ip-address?

    Btw, i want to build my own serial modules to connect to this gateway. Can you share with me the RS485 protocol of MySensors? Can i use RS485 just as a serial port without addresses?

    Thank you again.


  • Mod

    @ruben_gr the technical reason is that the default mode is that the gateway listens for incoming connections from a controller. Since you've configured your controller to connect to the gateway, the default mode is what you need.

    Some controllers accept (expect?) the gateway to connect to the controller instead. That's when my-controller-ip-address is used.

    About rs485: I don't know. I have never used rs485. But MySensors expects to talk to other Mysensors nodes, you can't add stuff that doesn't speak the mysensors protocol. Mysensors uses node ID for addressing. https://www.mysensors.org/about/overview might be useful.



  • @mfalkvidd Understood.

    Right, but if i use the same protocol i think that it's possible to connect both. I want to connect BeagleBone to PIC microcontroller, that is not supported by MySensors, but i will try to migrate from arduino to PIC. Thank you.


  • Mod

    @ruben_gr thanks for explaining. Your strategy makes sense, at least to me 🙂 If you find migration of the entire MySensors library too cumbersome, you could probably make do with just migrating the transport protocol parts.



  • @mfalkvidd Yes. Thank you!



  • http://learntohackit.com/intro/# it can be useful information ???


Log in to reply
 

Suggested Topics

16
Online

11.4k
Users

11.1k
Topics

112.7k
Posts