Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Pim van Pelt
    @pimvanpelt
    currently all it does is expose gpio and a few sensors
    and it's not complete (and as well I have not run it in production, only in a few test instances where it seems to work well with MQTT auto discovery)
    YueBing Tao
    @kof98765
    @pimvanpelt ...
    YueBing Tao
    @kof98765

    @pimvanpelt

    void mbuf_resize(struct mbuf a, size_t new_size) {
    if(new_size==0)//if new_size ==0 will free(a->buf)?????
    return;
    if (new_size > a->size || (new_size < a->size && new_size >= a->len)) {
    char
    buf = (char *) MBUF_REALLOC(a->buf, new_size);

    Francesco
    @fcolasante_gitlab
    Anyone use GCP on ESP32?
    I have some problem... My device continously disconnett to MQTT broker
    [Jun 24 21:21:10.776] SW ECDSA verify curve 3 hash_len 32 sig_len 71
    [Jun 24 21:21:11.200] SW ECDH curve 3
    [Jun 24 21:21:11.726] mgos_mqtt_conn.c:227    MQTT0 TCP connect ok (0)
    [Jun 24 21:21:12.085] mgos_mqtt_conn.c:271    MQTT0 CONNACK 0
    [Jun 24 21:21:12.085] mgos_mqtt_conn.c:208    MQTT0 sub /devices/esp32_7C21F0/commands/# @ 1
    [Jun 24 21:21:12.091] mgos_mqtt_conn.c:208    MQTT0 sub /devices/esp32_7C21F0/config @ 1
    [Jun 24 21:21:12.189] mgos_mqtt_conn.c:253    MQTT0 Disconnect
    [Jun 24 21:21:12.189] mgos_mqtt_conn.c:544    MQTT0 connecting after 1883 ms
    [Jun 24 21:21:14.080] mgos_mqtt_conn.c:468    MQTT0 connecting to mqtt.2030.ltsapis.goog:8883
    [Jun 24 21:21:14.278] mg_ssl_if_mbedtls.c:31  0x3ffc8ee8 ciphersuite: TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256
    [Jun 24 21:21:14.297] SW ECDSA verify curve 3 hash_len 32 sig_len 72
    [Jun 24 21:21:14.727] SW ECDSA verify curve 3 hash_len 32 sig_len 72
    [Jun 24 21:21:15.154] SW ECDSA verify curve 3 hash_len 32 sig_len 71
    Liviu
    @nliviu
    Try the mongoose-os channel https://gitter.im/cesanta/mongoose-os
    Mark
    @markterrill
    @fcolasante_gitlab turn up debugging and look to see if it's saying certificate error and then rebooting the device. If so, do the gcp provision script again.
    MiddlePaw
    @MiddlePaw
    Dose anyone know how to deal with credential issue(username&apikey) when connect to Adafruit with mqtt?
    Sergey Lyubka
    @cpq
    @MiddlePaw please elaborate - can you share a code snippet that fails?
    Matthew Hughson
    @mhughson
    I am trying to run mongoose.exe and windows blocks it saying a virus is detected.
    I've tried both Chrome and Internet Explorer
    novlean
    @novlean
    Matthew please refer to https://mongoose.ws/desktop-app/faq/ where your situation is explained.
    Matthew Hughson
    @mhughson
    im not actually sure how to add an exclusion for a file that can't even be downloaded.
    MaximF39
    @MaximF39
    Как скачать монгус?
    novlean
    @novlean
    Mongoose Desktop executable download -> https://mongoose.ws/desktop-app/ .
    Mongoose Library download -> https://github.com/cesanta/mongoose/releases .
    zhangzj03
    @zhangzj03
    hi,i can't find mg_start_thread function
    Sergey Lyubka
    @cpq
    @zhangzj03 you're using a very outdated version. Please get the latest from github
    d4rkmen
    @d4rkmen
    guys, i have small Q, because the mqtt client example missing wildcard subscription logic
    hi first
    v6 library has ‘mg_mqtt_match_topic_expression’ to match received topic with subscription expr
    how to handle it in v7?
    Sergey Lyubka
    @cpq
    @d4rkmen just to clarify. This question is about MQTT server implementation, is that correct ?
    d4rkmen
    @d4rkmen
    helper functions for mqtt client
    Sergey Lyubka
    @cpq
    That function in 6.x branch was meant for the server. Could you elaborate your anticipated usage by the client please?
    d4rkmen
    @d4rkmen
    sure, look:
    lets say we have multiple topics to subscribe
    cool/foo/bar
    foo/+/bar
    all received messages we have in one place and need to pick a handler for just received mqtt message depending of a topic
    message received topic foo/123/bar
    Sergey Lyubka
    @cpq
    Ah. Understood.
    Just use * instead of +.
    d4rkmen
    @d4rkmen
    this is very cool helper but not in this particular case. another call is now to get the wildcard token 123 from the topic string. helper funcs for these cases would be very nice
    a man can write own helpers offcourse :heavy_check_mark: but to have it included is a pleasure :smile:
    Sergey Lyubka
    @cpq
    Did 6.x helper function extract sub-topics? Can't remember, but I don't think so
    It looks like you're asking for something like this:
      if (mg_globmatch(...)) {
        int id = 0;
        sscanf(mm->topic.ptr, "foo/%d/", &id);
        ...
      } else if (mg_globmatch()) {
        ...
    d4rkmen
    @d4rkmen
    well, i got an answer for my Q, thanks
    getter to add:
    struct mg_str mg_mqtt_topic_component(struct mg_str *topic, int index)
    and return a path component by index, then mg_strcmp
    Sergey Lyubka
    @cpq
    @d4rkmen thanks. But aren't you using Mongoose OS with includes 6.x ?
    d4rkmen
    @d4rkmen
    no, this is my first v7 project :+1:
    d4rkmen
    @d4rkmen
    @cpq
    // * Port from v6
    static struct mg_str mg_mqtt_next_topic_component(struct mg_str* topic) {
        struct mg_str res = *topic;
        const char* c = mg_strstr(*topic, mg_str("/"));
        if (c != NULL) {
            res.len = (c - topic->ptr);
            topic->len -= (res.len + 1);
            topic->ptr += (res.len + 1);
        } else {
            topic->len = 0;
        }
        return res;
    }
    
    // * Port from v6
    int mg_mqtt_match_topic_expression(struct mg_str exp, struct mg_str topic) {
        struct mg_str ec, tc;
        if (exp.len == 0)
            return 0;
        while (1) {
            ec = mg_mqtt_next_topic_component(&exp);
            tc = mg_mqtt_next_topic_component(&topic);
            if (ec.len == 0) {
                if (tc.len != 0)
                    return 0;
                if (exp.len == 0)
                    break;
                continue;
            }
            if (mg_vcmp(&ec, "+") == 0) {
                if (tc.len == 0 && topic.len == 0)
                    return 0;
                continue;
            }
            if (mg_vcmp(&ec, "#") == 0) {
                return (exp.len == 0);
            }
            if (mg_strcmp(ec, tc) != 0) {
                return 0;
            }
        }
        return (tc.len == 0 && topic.len == 0);
    }
    
    // * Exctract MQTT topic level by index
    struct mg_str mg_mqtt_topic_level(struct mg_str topic, int level) {
        struct mg_str tc;
        int i = 0;
        while (1) {
            tc = mg_mqtt_next_topic_component(&topic);
            if (tc.len == 0)
                return mg_str("");
            if (i == level)
                return tc;
            i++;
        }
    }
    my suggestion for this case, thanks.
    d4rkmen
    @d4rkmen
    hi, gyys!
    facing vierd issue with mqtt client: missing messages
    i can reed them on other client witch opened to monitor the flow
    but mongoose missing it. when i resend it again manually - it works ok (QOS 0)
    d4rkmen
    @d4rkmen
    solved, problem was: mongoose subscribed with QOS 1, other client QOS 0
    Sergey Lyubka
    @cpq
    @d4rkmen thanks for clarifying!
    d4rkmen
    @d4rkmen
    actually, thank YOU for this amazing library and the way You maintain it @cpq
    MERN Micro Framework
    @mernjs

    Hello Everyone,

    MERN Micro Framework provides starter kits for building web, desktop and mobile apps in pure JavaScript.

    https://www.npmjs.com/package/create-mernjs-app

    If you have any query or suggestions. Please let me know.