Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    DrBomb
    @DrBomb
    Something could be shorting out, or the cable might be bad. Try changing the cable
    David Cruchon
    @Enophi
    @DrBomb Yes. Sometimes i see the "read err EOF". I already test another USB cable but I don't have another one on hand. I'll get some more to test. Thanks a lot for your answers
    maks-davletchin
    @maks-davletchin
    Hello everybody. I try to flash module ESP-WROOM-32, but have a problem. From ESP Download Tool I see that SPI speed of this module is 40 MHz. Mos flashs my chip with 80MHz. Is there any solutions to flash it with frequency 80MHz in mos?
    maks-davletchin
    @maks-davletchin
    excuse me, made a typo: Is there any solutions to flash it with SPI frequency 40MHz in mos?
    Liviu
    @nliviu
    AFAIK, you can set the flash parameters:
          --esp-flash-params string             Flash chip params. Either a comma-separated string of mode,size,freq or a number. Mode must be one of: qio, qout, dio, dout. Valid values for size are: 2m, 4m, 8m, 16m, 32m, 16m-c1, 32m-c1, 32m-c2. If left empty, an attempt will be made to auto-detect. freq is SPI frequency and can be one of 20m, 26m, 40m, 80m
    mos help --full
    to see all the options
    alishabbir53
    @alishabbir53
    Error: /src/cli/dev/dev_conf.go:81: no config value at path "wifi.ap.enable"
    What is that error mean
    I flashed the doorsensor firmware found from mongoose os github
    when I tried to connect the module with internet so i received this error
    maks-davletchin
    @maks-davletchin

    AFAIK, you can set the flash parameters:

          --esp-flash-params string             Flash chip params. Either a comma-separated string of mode,size,freq or a number. Mode must be one of: qio, qout, dio, dout. Valid values for size are: 2m, 4m, 8m, 16m, 32m, 16m-c1, 32m-c1, 32m-c2. If left empty, an attempt will be made to auto-detect. freq is SPI frequency and can be one of 20m, 26m, 40m, 80m

    Thanks so much!!)

    Sekilsgs2
    @Sekilsgs2

    Hi. can i'm using double in this variant -

      // Set handler for the virtual pin reads / writes.
      // 
      // Example:
      // ```javascript
      // Blynk.setHandler(function(conn, cmd, pin, val, id) {
      //   print(cmd, pin, val);
      // }, null);
      // 
      setHandler: ffi('void blynk_set_handler(void (*)(void *, char *, int, double, int, userdata), userdata)'),

    and later in this -

    Blynk.setHandler(function(conn, cmd, pin, val, id) {
    Sekilsgs2
    @Sekilsgs2
    I'm try but getting error -
    [Mar 21 08:49:09.231] MJS error: failed to exec file "api_blynk.js": bad ffi signature: "void blynk_set_handler(void (*)(void *, char *, int, double, int, userdata), userdata)": bad ffi signature: "void (*)(void *, char *, int, double, int, userdata)": the callback signature is valid, but there's no existing callback implementation for it
    from mgos_blynk.h -
    /* Blynk event handler signature. */
    typedef void (*blynk_handler_t)(struct mg_connection *, const char *cmd,
                                    int pin, double val, int id, void *user_data);
    
    /* Set Blynk event handler. */
    void blynk_set_handler(blynk_handler_t func, void *user_data);
    Sekilsgs2
    @Sekilsgs2
    from ffi_exports.c -
    /* Auto-generated, do not edit. */
    
    /*
     * Symbols filtered by the following globs:
     */
    
    #include <stdbool.h>
    
    #include "mgos_dlsym.h"
    
    /* NOTE: signatures are fake */
    void  blynk_send(void *, int, int, void *, int);
    void  blynk_set_handler(void (*)(void *, char *, int, double, int, void *), void *);
    sean
    @tonetechnician

    Hi there! Very happy to have found this chat. I'm hoping someone might be able to provide some guidance, or opinion if what I want to do is even possible.

    I have a mongoose http server setup in a C++ application. Everything is working well, I can receive requests and send back responses all from my single static callback. I can interact with my application context using the user_data argument.

    Now, in my application's mongoose event handler, I'm triggering a C++ event which activates a whole event flow within my application. I'd like to have it that I can keep the mongoose connection open, append data to the connection's buffer and only once the event flow is completed, send the response and manually close the connection. Currently mongoose closes the connection immediately after the connections event handler has been executed so I'm unable to do this.

    Is it possible to prevent mongoose from closing the connection at the end of the event handler and rather manually closing it myself?

    I saw some old docs (http://ces.ap-folio.com/developers.html#_http_websocket) which had some user settable flags such as "MG_F_BUFFER_BUT_DONT_SEND " and "MG_F_FINISHED_SENDING_DATA " which seem like ones I should use. But I'm unable to find a similar flag in a more recent version of mongoose.

    Any help or guidance would be very much appreciated! Thank you!

    DrBomb
    @DrBomb
    Welcome! This is the chat for mongoose-os the IoT framework for developing applications. But it is mostly based off mongoose proper so I guess it is fine for you to post here as it might be more active
    From my experience using sockets on mongoose, the connection shouldn't be closing by itself unless you set the close connection flag
    Sergey Lyubka
    @cpq
    @tonetechnician see https://github.com/cesanta/mongoose/tree/master/examples/multi-threaded . It is an example on how you can response only when certain event happens
    sean
    @tonetechnician

    Thanks @DrBomb !

    @tonetechnician see https://github.com/cesanta/mongoose/tree/master/examples/multi-threaded . It is an example on how you can response only when certain event happens

    Amazing! This looks like it will suit my application very well.

    I attempted a workaround it by pausing polling and passing a reference to the connection along with my event flow, then appending data and start polling again. It seems to be working, but not sure how robust a solution it is. This multi threaded example is very clear

    Thanks so much @cpq !!!!
    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?