Forum Replies Created

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • in reply to: Unable to build Firmware 2.1.9(9) on OSBo #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 🙂

    in reply to: Unified Firmware and BBB IO #73186

    noski
    Participant

    I got a hint from another user @sakos on how this could be achieved in this post – https://opensprinkler.com/forums/topic/pre-configured-sd-card-image/#post-41383

    Quote:
    – Control of relay on legacy Opensprinkler Pi boards.
    To assign the relay to a station just configure the station as “RF” and set “0” as RF code.

    I downloaded their SD card image to try to figure out what changes they made.
    They made changes to the function switch_rfstation in OpenSprinkler.cpp

    The function has slightly changed in the latest Firmware 2.1.9(9) from what sakos had. So I took what sakos did and tried to make it work.
    What I came up with is this:

    void OpenSprinkler::switch_rfstation(RFStationData *data, bool turnon) {
    ulong on, off;
    uint16_t length = parse_rfstation_code(data, &on, &off);
    #if defined(ARDUINO)
    #if defined(ESP8266)
    rfswitch.enableTransmit(PIN_RFTX);
    rfswitch.setProtocol(1);
    rfswitch.setPulseLength(length);
    rfswitch.send(turnon ? on : off, 24);
    #else
    send_rfsignal(turnon ? on : off, length);
    #endif
    #else
    if (((char*)data)[0]==’0′ && ((char*)data)[1]< ‘0’) {
    //Single zero character of RF code
    digitalWrite(PIN_RFTX, turnon ? HIGH : LOW);
    } else {
    // pre-open gpio file to minimize overhead
    rf_gpio_fd = gpio_fd_open(PIN_RFTX);
    send_rfsignal(turnon ? on : off, length);
    gpio_fd_close(rf_gpio_fd);
    rf_gpio_fd = -1;
    }
    #endif

    }

    … and it works in controlling the mini-relay!

    I understand the PIN used by the mini-relay has been repurposed in the code for the RF functionality.
    It would be great if @Ray could implement a way to choose if you are using the RF functionality or the mini-relay.
    Perhaps it could be handled with the argument to the build.sh script? something like:
    sudo ./build.sh osbo_relay (for the relay)
    sudo ./build.sh osbo_rf (for RF)

    But for now I guess I’ll have to live with my hack.

    in reply to: Unified Firmware and BBB IO #73179

    noski
    Participant

    Sorry to dig up old thread.
    I also have an OSBo and would like to make use of the mini-relay.
    I have recently upgraded to Firmware 2.1.9(9).

    @nystrom
    – were you able to get the mini-relay working? If so, what changes did you have to make?

    @Ray
    – I know you said the mini-relay has been discontinued, but it would be great if it was still useable for those that have it. Can you provide pointers on what changes we can make ourselves to use the mini-relay?

    in reply to: Unable to build Firmware 2.1.9(9) on OSBo #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 🙁

    in reply to: NOOB needs help with RTC service #39355

    noski
    Participant

    I have tried the instruction in the wiki and all the commands worked, but when I disconnected from the internet and rebooted, the time doesn’t get set properly.

    ubuntu@arm:~$ date
    Fri Jul 17 21:58:17 EST 2015
    ubuntu@arm:~$ sudo hwclock --rtc /dev/rtc1 -r
    [sudo] password for ubuntu:
    Sat 18 Jul 2015 08:05:48 PM EST  -0.714392 seconds

    Where do I see the output from the echo commands in /etc/rc.local to confirm what it is doing?

    in reply to: Store availability? #27430

    noski
    Participant

    Thanks Ray. Just for clarification, for the relay, by slightly bigger you mean v1.0 is rated 120VAC/2A and v1.1 is rated 250VAC/3A?

    in reply to: Store availability? #27428

    noski
    Participant

    Hi ray, is there any difference between v1.0 and v1.1 other than change in layout?
    Openlab in Australia is still selling v1.0. Just want to know if I would be missing out on something new/important if I bought it?

    in reply to: 12-Volt DC Solenoid Valve Supoprt #24783

    noski
    Participant

    Hi danico, I joined the forum so I could enquire about your setup as it sounds like something I want to do. Can you provide more details? Did you get it up and running?
    Is your ‘storage battery’ 12v? Are you connecting it directly to your opensprinkler or are you converting it? What types of lights are you running?
    noski.

Viewing 8 posts - 1 through 8 (of 8 total)