Copyright © https://mongoose-os.com

Mongoose OS Forum

frame

what librarys to use mjs project with rpc?

mtraxmtrax Canberra
edited April 7 in Mongoose OS

I'm a bit confused what libraries I should use in my mos.yml file?

I originally had:

  - 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-uart
  - origin: https://github.com/mongoose-os-libs/rpc-mqtt
  - origin: https://github.com/mongoose-os-libs/mjs

which fails for some reason I have replaced it with:
- origin: https://github.com/mongoose-os-libs/js-demo-bundle

but I have no idea what this library does is that a recommended list of libraries for specific functions?

eg rpc, mqm and gpio etc..
do I need a wifi library?

Comments

  • SergeySergey Dublin, Ireland

    The list of libraries you should use depends on what you'd like to achieve

  • mtraxmtrax Canberra

    I added all above libraries and compile failed, what is the problem?

  • nliviunliviu Romania

    Compilation can fail for a lot reasons.
    If you don't give more information, nobody can help.
    How to ask questions

  • mtraxmtrax Canberra
    edited April 10

    Build log too big to paste
    here is the last bit of the log

    [Apr 10 18:28:58.788] /fwbuild-volumes/2.0/apps/garage-doors/esp8266/build_contexts
    /build_ctx_906297415/build/objs/ffi_exports.c.o:(.rodata.ffi_exports+0x334): undefined reference to

    mgos_spi_get_global'
    [Apr 10 18:28:58.788] /fwbuild-volumes/2.0/apps/garage-doors/esp8266/build_contexts/build_ctx_906297415/build/objs/ffi_exports.c.o:(.rodata.ffi_exports+0x33c): undefined reference to
    mgos_spi_run_txn'
    [Apr 10 18:28:58.788] /fwbuild-volumes/2.0/apps/garage-doors/esp8266/build_contexts/build_ctx_906297415/build/objs/ffi_exports.c.o:(.rodata.ffi_exports+0x344): undefined reference to
    mgos_spi_set_fd_txn'
    [Apr 10 18:28:58.788] /fwbuild-volumes/2.0/apps/g
    arage-doors/esp8266/build_contexts/build_ctx_906297415/build/objs/ffi_exports.c.o:(.rodata.ffi_exports+0x34c): undefined reference to
    mgos_spi_set_hd_txn'
    [Apr 10 18:28:58.788] collect2: error: ld returned 1 exit status
    [Apr 10 18:28:58.788] make: *** [/fwbuild-volumes/2.0/apps/garage-doors/esp8266/build_contexts/build_ctx_906297415/build/objs/garage-doors.elf] Error 1
    [Apr 10 18:28:58.788] /mongoose-os/fw/platforms/esp8266/Makefile.build:444: recipe for target '/fwbuild-volumes/2.0/apps/garage-doors/esp8266/build_contexts/build_ctx_906297415/build/objs/garage-doors.elf'
    failed
    [Apr 10 18:28:58.788] make: Leaving directory '/app'
    [Apr 10 18:28:58.788] Error: exit status 2
    Build failed:build failed

    attaching file

  • nliviunliviu Romania

    It looks like you have in the project's fs directory the following files and the corresponding libraries are not listed in the libs section of mos.yml:
    api_adc.js, api_aws.js, api_i2.js, api_pwm.js, api_shadow.js, api_spi.js

    These files should not be added in the fs directory. If the corresponding library exists in the libs section, the build process will add it automatically.
    Delete them from fs and add only the libraries you use. load the files you are using in init.js.

    Example: if you need i2c

     - origin: https://github.com/mongoose-os-libs/i2c
    

    and in config.schema

     - ["i2c.enable", true]
    

    Read the mos.yml (and mos_esp8266.yml, if exists) of the library you want to use. It will give you more hints about the way to use the library.

    Thanked by 1Sergey
  • mtraxmtrax Canberra

    ok I know a bit more cheers.
    I couldn't see those files in my "fs" folder so I don't know what is wrong, but I cloned the "empty" project and pasted my code into that and that compiles ok now.

    thanks again.

Sign In or Register to comment.