Copyright © https://mongoose-os.com

Mongoose OS Forum

frame
ATTENTION! This forum has moved to:

https://community.mongoose-os.com

Do not post any new messages.

mos web IDE is unstable, mos ls doesn't work, mos build is different than mos flash esp32 and doesn'

the first of many problems is the unstable IDE, it doesn't work most of the time, and editing conf0.json wifi station and MQTT settings breaks the IDE/firmware for some reason.
api_mqtt.js is not included in the device file manager -> MJS error: failed to exec file "api_mqtt.js": failed to read file "api_mqtt.js"

for some reason some RPC service in the background does subscribe to the MQTT broker, but the example files fail to subscribe or publish

mos ls <- does not work
mos build just builds a different version of mongoose without MQTT enable block in conf0.json

I would like to edit json files outside the web IDE and compile locally to the machine, is there a way to do that?

Comments

  • I have the same problems.

  • I had the same problems.

    I insert (replace the old way with modules) of the content of one the examples from github to my mos.yml. Then mos ls worked again.

    libs:
      - origin: https://github.com/mongoose-os-libs/mjs
      - origin: https://github.com/mongoose-os-libs/rpc-mqtt
      - origin: https://github.com/mongoose-os-libs/rpc-service-config
      - origin: https://github.com/mongoose-os-libs/rpc-service-fs
      - origin: https://github.com/mongoose-os-libs/rpc-service-gpio
      - origin: https://github.com/mongoose-os-libs/rpc-service-i2c
      - origin: https://github.com/mongoose-os-libs/rpc-uart
      - origin: https://github.com/mongoose-os-libs/updater-rpc
  • thank you for the comment. you said you had the same problems, yet you only provided a solution for one problem? and I couldn't follow these instructions.

    my mos.yml
    version: "1.0"
    arch: esp32
    author: ""
    description: ""
    mongoose_os_version: master
    sources:
    - src
    filesystem:
    - fs
    extra_files: []
    ffi_symbols: []
    config_schema: []
    build_vars:
    APP_CONF_SCHEMA: src/conf_schema.yaml
    cflags: []
    cxxflags: []
    cdefs: {}
    tags: []
    manifest_version: ""
    skeleton_version: 2017-05-16
    deps: []
    libs_handled: []

    you want me to edit
    "libs_handled: []"
    to
    libs_handled:
    - origin: https://github.com/mongoose-os-libs/mjs
    - origin: https://github.com/mongoose-os-libs/rpc-mqtt
    - origin: https://github.com/mongoose-os-libs/rpc-service-config
    - origin: https://github.com/mongoose-os-libs/rpc-service-fs
    - origin: https://github.com/mongoose-os-libs/rpc-service-gpio
    - origin: https://github.com/mongoose-os-libs/rpc-service-i2c
    - origin: https://github.com/mongoose-os-libs/rpc-uart
    - origin: https://github.com/mongoose-os-libs/updater-rpc

    ?

  • cristiand391cristiand391 Buenos Aires, Argentina

    If you use "mos flash esp32" you just flash the default firmware with the included libs.

    "mos build" compile a local project that are in your current folder.

    If your project doesn't include rpc-uart you can't work with RPC either the CLI o Web UI because there's no way to call RPC over UART (nodemcu and other development boards have a USB to UART driver in the board)

  • cristiand391cristiand391 Buenos Aires, Argentina

    Additionally, you are using the skeleton app that mongoose provide through "mos init --arch", the mos.yml file that have is a bit outdated. Download the empty app from https://github.com/mongoose-os-apps/empty and start working :)

    Read the doc: https://mongoose-os.com/docs/core_components/apps.html

  • "mos flash esp32" doesn't include "api_mqtt.js" in the device file manager.
    mos build is vague, and just downloads code from somewhere else. how to use "mos build" to build mongoose with "api_mqtt.js"?

  • cristiand391cristiand391 Buenos Aires, Argentina

    "mos build" just compile a local project that are in your current folder, don't download anything (only if need to update libs).

    If the default firmware doesn't include the mqtt api js, just start a new app and include the library, you just need to add the lib url in the mos.yml

  • can you provide a code snippet or screen-shot of what you are referring to?
    "mos init -arch esp32" makes this folder structure

    ├── fs
    ├── mos.yml
    └── src
    ├── conf_schema.yaml
    └── main.c

    "mos build" without internet

    WARNING: Setting build variable "APP_CONF_SCHEMA" in "mos.yml" is deprecated, use "config_schema" property instead.

    Connecting to http://mongoose.cloud, user test
    Uploading sources (1555 bytes)
    Error: Post http://mongoose.cloud/api/test/firmware/build: dial tcp: lookup mongoose.cloud on 127.0.1.1:53: server misbehaving

    why am I uploading my potential source code to mongoose?

    "mos build" with internet

    WARNING: Setting build variable "APP_CONF_SCHEMA" in "mos.yml" is deprecated, use "config_schema" property instead.

    Connecting to http://mongoose.cloud, user test
    Uploading sources (1555 bytes)
    Success, built src/esp32 version 1.0 (20170611-234601/???).
    Firmware saved to build/fw.zip

    this made the fw.zip file that's slightly different from the firmware downloaded using "mos flash -arch esp32"

    how/where do I edit "conf0.json" and add "api mqtt js"

    if you are not going to provide accurate comments/replies, please refrain from posting.

  • cristiand391cristiand391 Buenos Aires, Argentina

    why am I uploading my potential source code to mongoose?

    mos build command packs source and filesystem files and sends them to the Mongoose OS cloud build backend. There is no need to setup and configure a toolchain on a local machine! However, it is possible to do a local build. In this case, your machine needs to have Docker installed.

    "mos flash esp32" just flash a pre-compiled firmware that is downloaded from mongoose servers, it includes almost all the libs.

    "mos init --arch esp32" only download an empty firmware without mqtt lib and any other. If you want to work with MQTT, you need to include the lib in your project by adding the lib url in the mos.yml file (example: https://github.com/mongoose-os-apps/empty/blob/master/mos.yml).

  • cristiand391cristiand391 Buenos Aires, Argentina

    Libraries: https://github.com/mongoose-os-libs

    Add to your project rpc-uart, rpc-service-fs, rpc-service-config and mqtt, and try the web ui :)

  • arahmyarahmy Cairo
    edited June 2017

    so I replaced the mos.yml with the one in the empty example and added all the libs to get mqtt, here is the mos.yml file,

    arch: esp32
    author: mongoose-os
    description: An empty app that does nothing
    version: 1.0
    
    # Optional. List of tags for online search.
    tags:
      - c
    
    # List of files / directories with C sources. No slashes at the end of dir names.
    sources:
      - src
    
    # List of dirs. Files from these dirs will be copied to the device filesystem
    filesystem:
      - fs
    
    # Custom configuration entries, settable via "device configuration"
    config_schema:
    #  - ["my_app", "o", {title: "My app custom settings"}]
    #  - ["my_app.bool_value", "b", false, {title: "Some boolean value"}]
    #  - ["my_app.string_value", "s", "", {title: "Some string value"}]
    #  - ["my_app.int_value", "i", 123, {title: "Some integer value"}]
    
    # List of libraries used by this app, in order of initialisation
    libs:
      - origin: https://github.com/mongoose-os-libs/empty
      - origin: https://github.com/mongoose-os-libs/mjs
      - origin: https://github.com/mongoose-os-libs/rpc-mqtt
      - origin: https://github.com/mongoose-os-libs/rpc-service-config
      - origin: https://github.com/mongoose-os-libs/rpc-service-fs
      - origin: https://github.com/mongoose-os-libs/rpc-service-gpio
      - origin: https://github.com/mongoose-os-libs/rpc-service-i2c
      - origin: https://github.com/mongoose-os-libs/rpc-uart
      - origin: https://github.com/mongoose-os-libs/updater-rpc
      - origin: https://github.com/mongoose-os-libs/mqtt
      - origin: https://github.com/mongoose-os-libs/arduino-compat
    
    # Used by the mos tool to catch mos binaries incompatible with this file format
    skeleton_version: 2017-05-18
    

    it did add some files, but guess what is missing,

    MJS error: failed to exec file "api_mqtt.js": failed to read file "api_mqtt.js"

  • cristiand391cristiand391 Buenos Aires, Argentina

    Is the "api_mqtt.js" file in the esp32 after you flash it? Paste the log.

Sign In or Register to comment.