Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Jan
    @janko.valiska:matrix.org
    [m]
    Hi, is it posible to receive in GET_ACCEPTED shadow event only desired shadow states? Currently i'm receiving desired but also reported states. I'm using Azure IoT Hub.
    gadget-man
    @gadget-man
    Not sure about Azure but in AWS you get the whole shadow - Desired & Reported. Can’t you just filter it on arrival and only do somethign if it’s desired?
    Jan
    @janko.valiska:matrix.org
    [m]
    Problem is that whole message has bigger size then input receive mqtt buffer. And in that case MQTT connection is dropped.
    Jan
    @janko.valiska:matrix.org
    [m]
    I don't know how to handle long messages from Shadow.
    DrBomb
    @DrBomb
    To answer your question, no, you cannot do a GET_ACCEPTED with just the desired section. I would raise that request to AWS directly. Or raise the mqtt receive buffer
    Or not do a get desired and disable getting it altogether. After all, on a connect you send the state, and you will receive the delta if you send things that do not match the desired
    make sure to send an update that is completely wrong, and you will get the correct desired state on your delta
    DrBomb
    @DrBomb
    ah, you were using azure altogether, but I guess the response still stands
    gadget-man
    @gadget-man
    I know I’ve done this before, but I’m trying to work out how to make RPC calls over a local network using http-server e.g. https://myhostname/rpc. Where in MOS do I set myhostname?
    @gadget-man
    gadget-man
    @gadget-man
    OK thanks. No idea how I’d got it working before, as I’ve never used the dns-sd library!
    DrBomb
    @DrBomb
    Hmm, could be shipped with some default libs
    I believe that's the lib that makes the hostname.local resolution possible
    gadget-man
    @gadget-man
    Ah ok. so mDNS? Previously I’m pretty sure I was able to ping iParcelBox-XXXXXX based on device-id
    DrBomb
    @DrBomb
    yeah, as far as i know
    But can't be certain something else could have been resolving the id for you
    gadget-man
    @gadget-man
    I was thinking it was something to do with http-server, but can’t now find anything
    gadget-man
    @gadget-man
    I think I might have found it - wifi.sta.dhcp_hostname
    DrBomb
    @DrBomb
    Right! That makes sense
    gadget-man
    @gadget-man
    Unfortunately it doesn’t seem to work. The host name appears on the router dhcp table using the above, but trying to ping the host name fails.
    gadget-man
    @gadget-man

    Unfortunately it doesn’t seem to work. The host name appears on the router dhcp table using the above, but trying to ping the host name fails.

    I solved the problem - it was working fine, but my machine was using DNS 8.8.8.8 rather than the router gateway so it was unable to resolve. Changing it back to default and I was immediately able to ping whatever I set in wifi.sta.dhcp_hostname

    Sekilsgs2
    @Sekilsgs2
    No answers about callback with double values?
    Sekilsgs2
    @Sekilsgs2

    And new question - i'm have problem with this function -

    // Simple mjs solution to split string into an array
    function splitString(inTxt, sepChr) {
        let pos = inTxt.indexOf(sepChr);
        let out = [];
        let part = '';
        while (pos !== -1) {
            part = inTxt.slice(0, pos);
            print("part == ", part);
            if (part.length > 0)
                out.push(part);
            inTxt = inTxt.slice(pos + 1, inTxt.length);
            print("inTxt == ", inTxt);
            pos = inTxt.indexOf(sepChr);
            print("pos == ", pos);
        }
        if (inTxt !== "")
            out.push(inTxt);
        return out;
    }

    Some time this not working as is should -
    i'm need split this string with delim ";" -

    1;2;1;0;38;2865.0

    But from logs i'm see this -

    [Mar 26 13:37:55.106] part ==  1  - //cutted first finded
    [Mar 26 13:37:55.106] inTxt ==  2;1;0;38;2865.0  // new string without first
    [Mar 26 13:37:55.106] pos ==  1  - ///pos of next 
    [Mar 26 13:37:55.106] part ==  2 - /next finded
    [Mar 26 13:37:55.106] inTxt ==  1;0;38;2865.0 - // new string
    [Mar 26 13:37:55.106] pos ==  -1   - ///WHYYYYY????

    Why we have -1 after running this -

    pos = inTxt.indexOf(";");
    where inTxt === "1;0;38;2865.0"

    ??

    Sekilsgs2
    @Sekilsgs2
    I'm compare with ffi c function strcspn and this working good without any problems
    Jan
    @janko.valiska:matrix.org
    [m]
    Hi, is it possible to compile esp8266 fw without mounting FS on boot?
    Deomid Ryabkov
    @rojer
    no, minimal FS is required
    Deomid Ryabkov
    @rojer
    @mamuesp would you like to move your https://github.com/mamuesp/timezones library to mongoose-os-libs?
    Jan
    @janko.valiska:matrix.org
    [m]
    Thank you Rojer. I have one more question regarding how daylight saving works in mongoose. Is device rebooted after time is changed?
    Sergio R. Caprile
    @scaprile
    AFAIK there is a "time changed" event callback you can register. I guess this applies; however, I live in a country where DST is not used and haven't checked. Take it with a grain of salt. This event is fired on SNTP adjustments, for example.
    DrBomb
    @DrBomb
    I believe, and I'm not completely sure this is the case. That the DST jump will not trigger or reboot the system
    DST is only applied when you need local time, or for example, on cron jobs
    And on those cases, I think if the invocation time lines after the DST, the time libs will make sure to get that sorted out
    But when you call mg_time you're getting the UTC, unix time, as you should have
    hence why it isn't affected by DST
    I've used the cron lib for a couple years now on the US/Central timezone and DST has been adjusted automatically
    Liviu
    @nliviu
    cron jobs are based on UTC time.
    mgos_cron.c:231         Next invocation: 1617036555 [2021/03/29 16:49:15 UTC]
    And yes, DST is applied when you need local time AND sys.tz_spec is set.
    DrBomb
    @DrBomb
    cron job messages show a timestamp in UTC, but they will follow the timezone set on the tz_spec
    @nliviu
    Sergio R. Caprile
    @scaprile
    So hence DST "jumps" will not trigger time change events... now I know, thanks. It makes sense to just change the conversion factor to localtime...
    Jan
    @janko.valiska:matrix.org
    [m]
    Thanks for clarifications.
    Jan
    @janko.valiska:matrix.org
    [m]
    If I set oneshot timer, for example mgos_set_timer(1000, 0, &timer_cb, NULL) should i store timer_id and call mgos_clear_timer(id) to release internally allocated memory of this timer?
    Jan
    @janko.valiska:matrix.org
    [m]
    What is meaning of bool return value of mgos_mqtt_global_connect?
    Sergio R. Caprile
    @scaprile
    I've found that if you hold a timer handler and later you cancel the timer as you suggest, you have to also invalidate your handler (timer_id = MGOS_INVALID_TIMER_ID). If you setup and cancel several timers you may get repeated ids because they are reused (iirc).
    If you don't need to cancel the timer, it will clear itself when it fires (unless it repeats, of course...)
    Clearing an already cleared (automatically or cancelled) timer is safe, but since ids are reused and you started another timer in between... you end up cancelling the new timer and not the old one (iirc, again)
    Jim Archer
    @jimarcher

    Hi Everyone, I have been fighting an issue with Little FS and the Winbond W25Nxxx device driver / VFS driver for some time now. Using an ESP32-WROOM-32U with a W25N 2 Gbit device (I have not tried the 2 Gbit) I am able to start Mongoose and create the file system. But if I open a file using fopen() and start appending data, after just a few hundred bytes LFS reports the device is fill. Also, if I create a number of small files, after about 18 or so, it reports that the superblock is full.

    Does this ring any bells?

    55 replies
    Oops.. I'm using the 1 Gbit device, have not tried the 2 Gbit
    Deomid Ryabkov
    @rojer
    hm, that definitely shouldn't happen.
    Anshu694
    @Anshu694
    can someon help me out with cron task in mongoose ?
    Any examples??