Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Mark
    @markterrill
    oh my bad. yes, doesn't work
    https://t2fi.com/
    @mbresciani
    Yes, I read that someplace. Thanks for the link I should have checked there.
    Mark
    @markterrill
    sorry, got thoroughly confused with RPC via gatt
    ie server
    you're talking about gattc client
    https://t2fi.com/
    @mbresciani
    Yes
    Jan
    @janko.valiska:matrix.org
    [m]
    Hi, the mg_connect_opts.ssl_cert is the path to the client certificate file, or is the actual content of this client certificate file?
    Jan
    @janko.valiska:matrix.org
    [m]
    Guys, what could be problem, if we cannot connect to https server? It gives us this error:
    [Feb 11 11:50:20.902] mongoose.c:4912 0x3fff378c received handshake message [Feb 11 11:50:20.955] mongoose.c:4912 0x3fff378c mbedtls_ssl_flush_output() returned -78 (-0x004e) [Feb 11 11:50:20.955] mongoose.c:4912 0x3fff378c mbedtls_ssl_write_record() returned -78 (-0x004e) [Feb 11 11:50:20.955] mongoose.c:4912 0x3fff378c mbedtls_ssl_send_alert_message() returned -78 (-0x004e)
    Liviu
    @nliviu
    #define MBEDTLS_ERR_NET_SEND_FAILED                       -0x004E  /**< Sending information through the socket failed. */
    Jan
    @janko.valiska:matrix.org
    [m]
    @nliviu: it's too much general error code... maybe i should enable some embedtls debugging to see more logs... is there option to debug SSL things?
    Liviu
    @nliviu
    Try to increase debug.mbedtls_level
    compwiz21
    @compwiz21
    Can someone please please help me get started with Mongoose-OS? I'm trying to install it, but i'm getting a bunch of errors
    image.png
    compwiz21
    @compwiz21
    any ideas?
    Sekilsgs2
    @Sekilsgs2
    cc3220 i2c wont start automatically - need manual run mgos_i2c_create - why this not running automatically? maybe i2c cfg enabled after init all mgos deps?
    Sergio R. Caprile
    @scaprile
    @compwiz21 Have you been to the support forum ? Have you read the tutorials ? You are not installing, you are cloning a repo and you seem to have a wrong URL for it. Try asking here
    Francesco
    @fcolasante_gitlab
    Anyone have some error like this:
    /media/frank/Dati/development/kairos/kairos-firmware/kairos_pro/deps/http-server/src/mgos_http_server.c:169:3: error: implicit declaration of function 'mg_file_upload_handler'; did you mean 'upload_handler'? [-Werror=implicit-function-declaration]
       mg_file_upload_handler(c, ev, p, upload_fname, user_data);
       ^~~~~~~~~~~~~~~~~~~~~~
       upload_handler
    /media/frank/Dati/development/kairos/kairos-firmware/kairos_pro/deps/http-server/src/mgos_http_server.c: In function 'mgos_http_ev':
    /media/frank/Dati/development/kairos/kairos-firmware/kairos_pro/deps/http-server/src/mgos_http_server.c:199:10: error: 'MG_EV_HTTP_MULTIPART_REQUEST' undeclared (first use in this function); did you mean 'MG_EV_HTTP_REQUEST'?
         case MG_EV_HTTP_MULTIPART_REQUEST: {
              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
              MG_EV_HTTP_REQUEST
    /media/frank/Dati/development/kairos/kairos-firmware/kairos_pro/deps/http-server/src/mgos_http_server.c:199:10: note: each undeclared identifier is reported only once for each function it appears in
    cc1: all warnings being treated as errors
    /mongoose-os/platforms/esp32/src/esp32_src.mk:102: recipe for target 'mgos_http_server.c.o' failed
    make[1]: *** [mgos_http_server.c.o] Error 1
    make[1]: *** Waiting for unfinished jobs....
    make[1]: Leaving directory '/media/frank/Dati/development/kairos/kairos-firmware/kairos_pro/build/objs/mosapp'
    /opt/Espressif/esp-idf/make/project.mk:635: recipe for target 'component-mosapp-build' failed
    make: *** [component-mosapp-build] Error 2
    Greg Oleksiak
    @goleksiak
    Tried mos 2.19.1 but looks like it still has same bugs as before:
    In file included from /Users/gregoleksiak/eatabit/repos/eatabit-firmware-v6/deps/freertos/include/mgos_freertos.h:26,
                     from /Users/gregoleksiak/eatabit/repos/eatabit-firmware-v6/deps/freertos/src/mgos_freertos.c:18:
    /Users/gregoleksiak/eatabit/repos/eatabit-firmware-v6/deps/mongoose/include/mongoose.h:1919:31: error: 'struct tm' declared inside parameter list will not be visible outside of this definition or declaration [-Werror]
     double cs_timegm(const struct tm *tm);
                                   ^~
    In file included from /Users/gregoleksiak/eatabit/repos/eatabit-firmware-v6/deps/freertos/include/mgos_freertos.h:26,
                     from /Users/gregoleksiak/eatabit/repos/eatabit-firmware-v6/deps/freertos/src/mgos_freertos_core_dump.c:18:
    /Users/gregoleksiak/eatabit/repos/eatabit-firmware-v6/deps/mongoose/include/mongoose.h:1919:31: error: 'struct tm' declared inside parameter list will not be visible outside of this definition or declaration [-Werror]
     double cs_timegm(const struct tm *tm);
                                   ^~
    cc1: all warnings being treated as errors
    Sekilsgs2
    @Sekilsgs2

    @compwiz21 Have you been to the support forum ? Have you read the tutorials ? You are not installing, you are cloning a repo and you seem to have a wrong URL for it. Try asking here

    You are shure? I'm current test 2.19.1 mos tool for bionic ubuntu and have this error too! I'm not compile mos - i'm install with apt. And with old mos 2.19 compilled from sources - not have this error!

    root@DESKTOP-5I223JS:~/mo19.1# mos clone https://github.com/mongoose-os-apps/demo-js app19
    Error: app19: Local copy in "demo-js" does not exist and fetching is not allowed
    /build/mos-HUa0jy/mos-2.19.1+9bf406d~bionic0/cli/build/swmodule.go:262:
    /build/mos-HUa0jy/mos-2.19.1+9bf406d~bionic0/cli/main.go:198: clone failed
    and 2.19
    root@DESKTOP-5I223JS:~/mos# ./mos clone https://github.com/mongoose-os-apps/demo-js app19
    app19: Does not exist, cloning from "https://github.com/mongoose-os-apps/demo-js"...
    app19: Checking out master...
    app19: Done, hash e4ecb176b4e95f53e5938724b6cb6723b4b95fad
    Sekilsgs2
    @Sekilsgs2

    the problem is this strange commit -

    https://github.com/mongoose-os/mos/commit/37a6dad3960dfe9d8527252da5fb486b2f633ed1
    } else if os.IsNotExist(err) {
            if pullInterval == 0 {
                return fmt.Errorf("%s: Local copy in %q does not exist and fetching is not allowed", name, targetDir)
            }

    Strange because - if os.IsNotExist(err) - we have always this error because mos need clone to this dir. Or increase pullinterval - just to know what it is :-D

    Sergio R. Caprile
    @scaprile
    Interesting.
    So 2.19.1 seems to have a problem cloning repos...
    Sekilsgs2
    @Sekilsgs2

    And i'm find what cause crashes with _umm_free on cc3220 with 2.19+ FW
    This commit -

    https://github.com/cesanta/mongoose-os/commit/aae44c3113f3fbaffde1d06210fe72f4e1e215b0

    In 2.18 we have generated mgos_config struct -

    const struct mgos_config mgos_config_defaults = {
      .i2c.enable = 1,
      .i2c.freq = 100000,
      .i2c.debug = 0,
      .i2c.sda_pin = 2,
      .i2c.scl_pin = 1,
      .sys.atca.enable = 0,
      .sys.atca.i2c_bus = 0,
    ........

    and in
    file - mongoose-os/src/mgos_sys_config.c
    in function - mgos_sys_config_load_level_internal

    this struct copying to global mgos_sys_config

    ....
      // Start with compiled-in defaults.
      memcpy(cfg, &mgos_config_defaults, sizeof(*cfg));
    ....

    and later this global struct using to operate with configs.
    But in 2.19+ struct mgos_config_defaults not generating - and global mgos_sys_config edited with function

    void mgos_config_set_defaults(struct mgos_config *cfg)

    First crash occure in function -
    enum mgos_init_result mgos_sys_config_init(void)
    in -

      if (mgos_sys_config_get_device_id() != NULL) {
        char *device_id = strdup(mgos_sys_config_get_device_id());  ---- i'm think strdup make something wrong...
        mgos_expand_mac_address_placeholders(device_id);
        mgos_sys_config_set_device_id(device_id);
        free(device_id); - ----------------------------------------- this line make crash board
      }

    If i'm comment ..free... - fw crashing on next free..

    If i'm revert and again generate struct mgos_config_defaults and use memcpy to copy this to global mgos_sys_config - now fw never crashing..
    Anybody know why new code cause crashing on cc3220? Maybe TI compiller bug, but i'm try newer - not help. Or this commit have bugs and need rewrite some stuff?

    DrBomb
    @DrBomb
    First things first. Do a clean compile. If it doesn't fix it, start stripping down your code down until you are completely sure the crash still happens. When you have the reproduction steps. Open an issue on the mongoose-os repo and post your reproduction app. That way anyone can jump in and reproduce the crash reliably
    Otherwise you're just posting a crash that could be your fault because we don't see the whole thing
    Also, the CC platforms are not getting any new updates unfortunately. You should contact cesanta personally if you are their client or if you are willing to pay to get the issue resolved faster
    Actually, I don't know if the CC platforms are completely abandoned, but I remember that they didn't have the attention to continue developing
    Sekilsgs2
    @Sekilsgs2
    I'm think no body help.. because need have cc board for this and.. my work not commercial. Now i'm using latest fw with my fix (using const struct) and writing ota backend - now all working but with simple changes...
    DrBomb
    @DrBomb
    Again, this could be better seen if you made a repro app and filed an issue
    Mark
    @markterrill
    mmm. stupid question time. how do you output a mg_str with frozen (ie a mg_rpc_send_responsef )
    presuming its: return json_printf(out, "{mac: %.Q, manu_hex: %.Q, sr_hex: %.*Q, model: %d}", p->mac.len, p->mac.p, p->manu_hex.len, p->manu_hex.p, p->sr_hex.len, p->sr_hex.p, (int)p->model);
    Mark
    @markterrill
    think i've realised my issue, I'm not outputting a struct, i'm outputting an array of structs.
    Mark
    @markterrill
    that's got me stumped. appreciate any advice on how I could output an array of struct ie mystruct[1] = {'mark', 'terrill',99}; mystruct[2]={'john','citizen',30}; becomes json of people:[{name:"Mark",surname:"Terrill",age:99}, {name:"John", surname:"Citizen",age:30}]
    Mark
    @markterrill
    think I've figured out how json_printf effectively concats output, along with using len = json ... it seems to be working. Just struggling with passing some variable values around.
    Liviu
    @nliviu
    json_printf_array() might help.
    Mark
    @markterrill
    i basically used that as a base
    it seems to be looping and working
    just having issues between the various BLE advertisement fields and outputting to RPC!
    ie, i trigger a scan via rpc. it outputs the current 'nearby' array of structs and then starts a ble scan. the scan stores the results of the scan (mac, manu, service data, and interpreted hardware device model enum).
    so basically you call the same thing 6 seconds apart and you've got the nearby devices. i may separate that into 'scan' and 'retrieve' but it suits my purposes at the mo.
    Mark
    @markterrill
    i had been trying to store the ble_data->adv_data and & scan_rsp as a mg_str, but that doesn't seem to have worked out well
    gadget-man
    @gadget-man
    I’m trying to make a basic api call to https://api.ipify.org, but I get the following error appearing:
    mg_ssl_if_mbedtls.c:30  0x3ffefa14 ciphersuite: TLS-ECDHE-RSA-WITH-AES-128-GCM-SHA256
    mg_ssl_if_mbedtls.c:30  0x3ffefa14 x509_verify_cert returned -9984
    mg_ssl_if_mbedtls.c:30  0x3ffefa14   The certificate is not correctly signed by the trusted CA
    The certificate is signed with an unacceptable hash.
    mg_ssl_if_mbedtls.c:206 0x3ffefa14 mbedTLS error: -0x2700
    I’ve tried just browsing to the site from a browser and the certificate seems, fine, expires 19 Feb 2022, issued by Sectigo RAS Domain Validation Secure Server CA. Is there something I should be doing in my firmware to recognise this CA?
    Liviu
    @nliviu
    Did you include the ca-bundle library?
    Liviu
    @nliviu
    [Feb 17 21:26:40.258] mongoose.c:4912         0x3ffc7ad8 ciphersuite: TLS-ECDHE-RSA-WITH-AES-128-GCM-SHA256
    [Feb 17 21:26:40.264] mgos_mongoose.c:66      New heap free LWM: 211996
    [Feb 17 21:26:41.042] mgos_mongoose.c:66      New heap free LWM: 207700
    [Feb 17 21:26:41.046] mgos_sntp.c:98          SNTP query to time.google.com
    [Feb 17 21:26:41.109] mgos_sntp.c:61          SNTP reply from 216.239.35.12: time 1613590001.858544, local 4.775971, delta 1613589997.082573
    [Feb 17 21:26:41.205] main.c:40               ipify_handler:40 - MG_EV_CONNECT - ev_data=0
    [Feb 17 21:26:41.365] main.c:44               ipify_handler:44 - MG_EV_HTTP_REPLY - body: [my_ip]
    gadget-man
    @gadget-man
    No as it’s such a large file - so I include my own ca.pem!!! Thanks I’ll have a look at the latest ca-bundle and try and work out which one i’m missing
    gadget-man
    @gadget-man
    Wierd - I updated my ca.pem to include everything from ca-bundle’s version (plus one additional one for COMODO RSA Certification Authority) but it still fails with the same error