OpenSprinkler Forums Hardware Questions OpenSprinkler Beagle (OSBo) Unable to build Firmware 2.1.9(9) on OSBo

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #73132

    noski
    Participant

    When attempting to build the latest version on OSBo, I receive the following:

    ubuntu@arm:~$ cd /home/ubuntu/OpenSprinkler-Firmware/
    ubuntu@arm:~/OpenSprinkler-Firmware$ git pull
    Already up-to-date.
    ubuntu@arm:~/OpenSprinkler-Firmware$ sudo ./build.sh osbo
    [sudo] password for ubuntu:
    Building OpenSprinkler…
    Installing required libraries…
    Reading package lists… Done
    Building dependency tree
    Reading state information… Done
    E: Unable to locate package libmosquitto-dev
    Compiling firmware…
    main.cpp: In function ‘void push_message(int, uint32_t, float, const char*)’:
    main.cpp:1439:106: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 3 has type ‘uint32_t {aka unsigned int}’ [-Wformat=]
    sprintf_P(payload, PSTR(“{\”count\”:%lu,\”volume\”:%d.%02d}”), lval, (int)volume/100, (int)volume%100);
    ^
    main.cpp:1442:120: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 3 has type ‘uint32_t {aka unsigned int}’ [-Wformat=]
    sprintf_P(postval+strlen(postval), PSTR(“Flow count: %lu, volume: %d.%02d”), lval, (int)volume/100, (int)volume%100);
    ^
    mqtt.cpp:37:24: fatal error: mosquitto.h: No such file or directory
    #include <mosquitto.h>
    ^
    compilation terminated.
    Done!

    I tried raising a Support Ticket but unfortunately the response was – “OSBo has been discontinued many years ago, we no longer maintain the firmware for BeagleBone.”

    This is disappointing given the promise of the Unified Firmware – “The purpose is to make a fully consistent firmware for OS, OSPi and OSBo” (taken from blog post https://opensprinkler.com/opensprinkler-recent-news-and-updates-feb-2015/)

    I am reaching out for help from anyone who may be able to assist. Thank you.

    #73133

    noski
    Participant

    I tried to see if I could figure out a solution myself.

    This first issue appeared to be:
    E: Unable to locate package libmosquitto-dev

    It appears that package isn’t available for the BeagleBone.
    When I search, there are packages available with a slightly different name:

    ubuntu@arm:~/OpenSprinkler-Firmware$ apt-cache search mosquitto
    libmosquitto0 – MQTT version 3.1 client library
    libmosquitto0-dev – MQTT version 3.1 client library, development files
    libmosquittopp0 – MQTT version 3.1 client C++ library
    libmosquittopp0-dev – MQTT version 3.1 client C++ library, development files
    mosquitto – MQTT version 3.1 compatible message broker
    mosquitto-clients – Mosquitto command line MQTT clients
    python-mosquitto – MQTT version 3.1 client library, python bindings

    So I tried installing libmosquitto0-dev:
    sudo apt-get install libmosquitto0-dev

    I thought I was on a winner, but unfortunately now I get a whole new set of errors:

    ubuntu@arm:~/OpenSprinkler-Firmware$ sudo ./build.sh osbo
    Building OpenSprinkler…
    Installing required libraries…
    Reading package lists… Done
    Building dependency tree
    Reading state information… Done
    E: Unable to locate package libmosquitto-dev
    Compiling firmware…
    main.cpp: In function ‘void push_message(int, uint32_t, float, const char*)’:
    main.cpp:1439:106: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 3 has type ‘uint32_t {aka unsigned int}’ [-Wformat=]
    sprintf_P(payload, PSTR(“{\”count\”:%lu,\”volume\”:%d.%02d}”), lval, (int)volume/100, (int)volume%100);
    ^
    main.cpp:1442:120: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 3 has type ‘uint32_t {aka unsigned int}’ [-Wformat=]
    sprintf_P(postval+strlen(postval), PSTR(“Flow count: %lu, volume: %d.%02d”), lval, (int)volume/100, (int)volume%100);
    ^
    mqtt.cpp: In function ‘void _mqtt_connection_cb(mosquitto*, void*, int)’:
    mqtt.cpp:314:131: error: invalid conversion from ‘const char*’ to ‘const uint8_t* {aka const unsigned char*}’ [-fpermissive]
    int rc = mosquitto_publish(mqtt_client, NULL, MQTT_AVAILABILITY_TOPIC, strlen(MQTT_ONLINE_PAYLOAD), MQTT_ONLINE_PAYLOAD, 0, true);
    ^
    In file included from mqtt.cpp:37:0:
    /usr/include/mosquitto.h:395:20: error: initializing argument 5 of ‘int mosquitto_publish(mosquitto*, uint16_t*, const char*, uint32_t, const uint8_t*, int, bool)’ [-fpermissive]
    libmosq_EXPORT int mosquitto_publish(struct mosquitto *mosq, uint16_t *mid, const char *topic, uint32_t payloadlen, const uint8_t *payload, int qos, bool retain);
    ^
    mqtt.cpp: In static member function ‘static int OSMqtt::_init()’:
    mqtt.cpp:341:46: error: cannot convert ‘bool’ to ‘void*’ for argument ‘2’ to ‘mosquitto* mosquitto_new(const char*, void*)’
    mqtt_client = mosquitto_new(“OS”, true, NULL);
    ^
    mqtt.cpp:347:65: error: invalid conversion from ‘void (*)(mosquitto*, void*, int)’ to ‘void (*)(void*, int)’ [-fpermissive]
    mosquitto_connect_callback_set(mqtt_client, _mqtt_connection_cb);
    ^
    In file included from mqtt.cpp:37:0:
    /usr/include/mosquitto.h:618:21: error: initializing argument 2 of ‘void mosquitto_connect_callback_set(mosquitto*, void (*)(void*, int))’ [-fpermissive]
    libmosq_EXPORT void mosquitto_connect_callback_set(struct mosquitto *mosq, void (*on_connect)(void *, int));
    ^
    mqtt.cpp:348:71: error: invalid conversion from ‘void (*)(mosquitto*, void*, int)’ to ‘void (*)(void*)’ [-fpermissive]
    mosquitto_disconnect_callback_set(mqtt_client, _mqtt_disconnection_cb);
    ^
    In file included from mqtt.cpp:37:0:
    /usr/include/mosquitto.h:634:21: error: initializing argument 2 of ‘void mosquitto_disconnect_callback_set(mosquitto*, void (*)(void*))’ [-fpermissive]
    libmosq_EXPORT void mosquitto_disconnect_callback_set(struct mosquitto *mosq, void (*on_disconnect)(void *));
    ^
    mqtt.cpp:349:54: error: ‘mosquitto_log_callback_set’ was not declared in this scope
    mosquitto_log_callback_set(mqtt_client, _mqtt_log_cb);
    ^
    mqtt.cpp:350:118: error: invalid conversion from ‘size_t {aka unsigned int}’ to ‘const char*’ [-fpermissive]
    mosquitto_will_set(mqtt_client, MQTT_AVAILABILITY_TOPIC, strlen(MQTT_OFFLINE_PAYLOAD), MQTT_OFFLINE_PAYLOAD, 0, true);
    ^
    mqtt.cpp:350:118: error: invalid conversion from ‘const char*’ to ‘uint32_t {aka unsigned int}’ [-fpermissive]
    mqtt.cpp:350:118: error: too few arguments to function ‘int mosquitto_will_set(mosquitto*, bool, const char*, uint32_t, const uint8_t*, int, bool)’
    In file included from mqtt.cpp:37:0:
    /usr/include/mosquitto.h:268:20: note: declared here
    libmosq_EXPORT int mosquitto_will_set(struct mosquitto *mosq, bool will, const char *topic, uint32_t payloadlen, const uint8_t *payload, int qos, bool retain);
    ^
    mqtt.cpp: In static member function ‘static int OSMqtt::_connect()’:
    mqtt.cpp:364:66: error: too few arguments to function ‘int mosquitto_connect(mosquitto*, const char*, int, int, bool)’
    rc = mosquitto_connect(mqtt_client, _host, _port, MQTT_KEEPALIVE);
    ^
    In file included from mqtt.cpp:37:0:
    /usr/include/mosquitto.h:322:20: note: declared here
    libmosq_EXPORT int mosquitto_connect(struct mosquitto *mosq, const char *host, int port, int keepalive, bool clean_session);
    ^
    mqtt.cpp: In static member function ‘static int OSMqtt::_publish(const char*, const char*)’:
    mqtt.cpp:385:89: error: invalid conversion from ‘const char*’ to ‘const uint8_t* {aka const unsigned char*}’ [-fpermissive]
    int rc = mosquitto_publish(mqtt_client, NULL, topic, strlen(payload), payload, 0, false);
    ^
    In file included from mqtt.cpp:37:0:
    /usr/include/mosquitto.h:395:20: error: initializing argument 5 of ‘int mosquitto_publish(mosquitto*, uint16_t*, const char*, uint32_t, const uint8_t*, int, bool)’ [-fpermissive]
    libmosq_EXPORT int mosquitto_publish(struct mosquitto *mosq, uint16_t *mid, const char *topic, uint32_t payloadlen, const uint8_t *payload, int qos, bool retain);
    ^
    mqtt.cpp: In static member function ‘static int OSMqtt::_loop()’:
    mqtt.cpp:394:42: error: too many arguments to function ‘int mosquitto_loop(mosquitto*, int)’
    return mosquitto_loop(mqtt_client, 0 , 1);
    ^
    In file included from mqtt.cpp:37:0:
    /usr/include/mosquitto.h:503:20: note: declared here
    libmosq_EXPORT int mosquitto_loop(struct mosquitto *mosq, int timeout);
    ^
    mqtt.cpp: In static member function ‘static const char* OSMqtt::_state_string(int)’:
    mqtt.cpp:398:33: error: ‘mosquitto_strerror’ was not declared in this scope
    return mosquitto_strerror(error);
    ^
    Done!

    And so I am stuck again 🙁

    #73167

    noski
    Participant

    OK I have resolved my issue by starting from scratch and re-installing everything.
    My issue appears to be caused by the old OS I was running – Angstrom – which is what the BeagleBone originally came with back in 2014.
    I flashed the latest Debian image to the eMMC with image “bone-eMMC-flasher-debian-10.3-iot-armhf-2020-04-06-4gb.img.xz” – downloaded from https://beagleboard.org/latest-images
    I found instructions here useful for performing subsequent updates and disabling unneeded services – https://www.selectiveintellect.net/blog/2021/8/15/setting-up-a-beaglebone-black-with-debian-buster-for-iot
    I then installed the Unified Firmware with these instructions – https://openthings.freshdesk.com/support/solutions/articles/5000631599-installing-and-updating-the-unified-firmware

    Works now 🙂

    #75621

    GeerGuy
    Participant

    I have an OSB0 V1.1 board and a BBB. The web interface is working, but my valves are not being turned on, might be a hardware issue.

    Which services did you disable on the BBB?

    #75670

    GeerGuy
    Participant

    No issues with the compile, 5V good, 24VAC good and the web interface is working, but the valves not being opened.

    Maybe an issue with the IO?

    Any ideas?

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.

OpenSprinkler Forums Hardware Questions OpenSprinkler Beagle (OSBo) Unable to build Firmware 2.1.9(9) on OSBo