Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Deomid Ryabkov
    @rojer
    but good to have to make things explicit
    Deomid Ryabkov
    @rojer

    @chrisbucher it works for me, with this exact content in rpc_acl.json and rpc.acl_file=rpc_acl.json (did you remember to set that?), i get 403 when trying to go via HTTP:

    $ curl http://192.168.11.161/rpc/Sys.GetInfo
    {"code":403,"message":"unauthorized"}

    with debug.level=3 on the device, i see this in the logs:

    [Jul  6 16:20:33.371] mongoose.c:15306        0x3ffdd63c conn 0x3ffe4b9c from 192.168.11.104:60248
    [Jul  6 16:20:33.377] mongoose.c:2752         0x3ffdd63c 0x3ffe4e98 1073629196 0
    [Jul  6 16:20:33.385] mongoose.c:2759         0x3ffe4e98 tcp://192.168.11.104:60248
    [Jul  6 16:20:33.391] mgos_http_server.c:180  0x3ffe4e98 HTTP connection from 192.168.11.104:60248
    [Jul  6 16:20:33.399] mg_rpc.c:563            0x3ffe4e38 '' HTTP
    [Jul  6 16:20:33.403] mg_rpc.c:493            0x3ffe4e38 CHAN OPEN (HTTP 192.168.11.104:60248)
    [Jul  6 16:20:33.412] mg_rpc.c:520            0x3ffe4e38 GOT PARSED FRAME: '' -> '' 799428820 args ''
    [Jul  6 16:20:33.419] mgos_vfs.c:283          rpc_acl.json -> /rpc_acl.json pl 1 -> 1 0x3ffbaac4 (refs 1)
    [Jul  6 16:20:33.428] mgos_vfs.c:377          open rpc_acl.json 0x0 0x1b6 => 0x3ffbaac4 rpc_acl.json 1 => 257 (refs 1)
    [Jul  6 16:20:33.438] mgos_vfs.c:536          fstat 257 => 0x3ffbaac4:1 => 0 (size 120)
    [Jul  6 16:20:33.444] mgos_vfs.c:536          fstat 257 => 0x3ffbaac4:1 => 0 (size 120)
    [Jul  6 16:20:33.451] mgos_vfs.c:564          lseek 257 0 1 => 0x3ffbaac4:1 => 0
    [Jul  6 16:20:33.457] mgos_vfs.c:564          lseek 257 0 0 => 0x3ffbaac4:1 => 0
    [Jul  6 16:20:33.464] mgos_vfs.c:410          close 257 => 0x3ffbaac4:1 => 0 (refs 0)
    [Jul  6 16:20:33.472] mgos_rpc.c:425          Called 'Sys.GetInfo' via 'HTTP', ACL: '-*'
    [Jul  6 16:20:33.480] mg_rpc.c:636            0x3ffe4e38 SEND FRAME (85): {"id":799428820,"src":"shelly25-test3","error":{"code":403,"message":"unauthorized"}} -> 1
    since UART is not allowed, this doesn't work too:
    $ mos call Sys.GetInfo
    Using port /dev/ttyUSB0
    Error: /build/mos-latest-Da4ye0/mos-latest-202106171938+f08e2c6~focal0/cli/dev/dev_conn_impl.go:171: remote error 403: unauthorized
    so, everything appears to be working.
    abhibhatia98
    @abhibhatia98
    Hi, I am sending some data over mqtt. Previously I defined mqtt server by running below command. mos config-set mqtt.enable=true mqtt.server=192.168.43.164:1883 from mos tool. Do any one share how can I defined it through program internally ??
    Deomid Ryabkov
    @rojer
    @abhibhatia98
    mgos_sys_config_set_mqtt_server("...");
    mgos_sys_config_set_mqtt_enable(true);
    mgos_sys_config_save(&mgos_sys_config, false, NULL);
    chrisbucher
    @chrisbucher

    @rojer what mgos version are you using? I am using 2.17.0
    I tried it again starting from scratch, but the channel is still ignored. I can confirm that I have set rpc.acl_file=rpc_acl.json.

    tried with the previosly posted rpc_acl.json: the same result with different connection types: UART, mdash, HTTP. Every RPC is allowed.
    Another weird thing: If I modify the first line to: {"method": "*", "ch_type": "WSS_out", "acl":"admin,*"} , any command requires admin auth. Shouldn't this line allow the users admin and * (so actually anyone, even without creds?)

    abhibhatia98
    @abhibhatia98

    @rojer Thanks it works.

    @abhibhatia98

    mgos_sys_config_set_mqtt_server("...");
    mgos_sys_config_set_mqtt_enable(true);
    mgos_sys_config_save(&mgos_sys_config, false, NULL);

    I need one more help do it possible to access Sys.GetInfo RPC call or some how device info structure inside C file ? I can access the same inside js file by using RPC.Local, but no idea how can I use that inside the c file

    Deomid Ryabkov
    @rojer
    @chrisbucher channel type matching was only added in 2.19 (mongoose-os-libs/rpc-common@f7c7fe5)
    you can cherry-pick that commit if you like
    @abhibhatia98 why would you want a json blob in C? what are you trying to do?
    abhibhatia98
    @abhibhatia98
    @rojer well I just want to send device info packet(mac.app_name,version,ssid,ip,id) over mqtt to some edge device.
    I wanted it like as the device powered it connects to n/w and then send info packet over mqtt. So I wanted the above parameter in C
    I have below code till now
    if (mgos_wifi_setup_sta(&sta_config)) { //retrieve device info like mac,app,version //mgos_mqtt_pub(topic, deviceInfo, strlen(deviceInfo), 1, 0); } else { //mg_rpc_send_responsef(ri, "couldn't set up sta"); }
    DrBomb
    @DrBomb
    Is there a way to reenable the idf's logging calls?
    I'm trying to troubleshoot some ethernet issues and I was wondering if I would get more info with their messages
    Deomid Ryabkov
    @rojer
    wdym re-enable? they are enabled
    DrBomb
    @DrBomb
    Hmm, right. I guess i thought some were getting eaten up but they're showing up, sorry!
    Jan
    @janko.valiska:matrix.org
    [m]
    Hi, is somewhere some good BLE MESH community? some forum or discussion rooms, etc... thanks.
    Davide Maggioni
    @TheCrypt0
    Is there a way to communicate with the modules console without UART? I'm trying to use https://github.com/mongoose-os-libs/rpc-ws but when calling mos console --port ws://192.168.1.69/rpc I get the error:
    Error: /src/cli/dev/dev_conn_impl.go:171: remote error 404: No handler for Dash.Console.Subscribe
    /src/cli/dev/dev_conn_impl.go:190: 
    /src/cli/console.go:239: 
    /src/cli/main.go:198: console failed
    I'm not trying to communicate via mDash, I just want a way to connect to multiple devices in the local network without having to connect them to the pc.
    igorkblr
    @igorkblr

    Good day everybody. Having problems with mos build using version 2.19.1. mos build fails on deps.

    https://bpa.st/5MRA

    each next run fails on other lib, i see no checking out messages, similar to the ones I have with older version builds
    rpc-service-ota: Checking out 2.10.2..

    ps. Don't know how to embed pastebin into the message

    gadget-man
    @gadget-man
    Try a clean build - it looks as though the wifi lib in your deps folder is incomplete Error: open /home/exe/Work/Slide/mos/slide/deps/wifi/mos.yml: no such file or directory. Try running mos build --clean
    igorkblr
    @igorkblr
    i do run builds with --clean flag. The actual command invoked in docker is
    mos build --clean --platform esp32 --local --verbose --libs-dir ./deps/ --lib cron:deps/cron --lib crontab:deps/crontab --lib location:deps/location --lib jstore:deps/jstore --lib rpc-service-wifi:deps/rpc-service-wifi --lib slide-file-logger:deps/slide-file-logger --no-libs-update 2>&1
    gadget-man
    @gadget-man
    You’re calling no-libs-update. Try removing that and deleting your deps folder for the wifi lib?
    igorkblr
    @igorkblr
    Thank you, moved further. Now i deal with c-code erros, that didn't exist before - but this is known area.
    igorkblr
    @igorkblr

    For some unknown reason I get an error about undefined mgos_sys_config_get_device_id()
    search for the definition does not find any reference in header files. Where it is defined?

    /home/exe/Work/Slide/mos/slide/src/rpc_service_slide.c: In function '\''slide_svc_get_info_handler'\'':
    /home/exe/Work/Slide/mos/slide/src/rpc_service_slide.c:45:51: error: implicit declaration of function '\''mgos_sys_config_get_device_id'\''; did you mean '\''mgos_sys_config_get_device'\''? [-Werror=implicit-function-declaration]
    "calib_time: %d, pos: %.2f, touch_go: %B}", mgos_sys_config_get_device_id(), mgos_sys_ro_vars_get_mac_address(),
    ^~~~~~~~~
    mgos_sys_config_get_device

    Liviu
    @nliviu
    @igorkblr It is generated in build/gen/mgos_config.h
    igorkblr
    @igorkblr
    strange, it is not there
    gadget-man
    @gadget-man
    I’m seeing a strange situation on a local test device - it failed to connect to my AP for almost 12 hours. Looking at the logs, normally I see a log entry similar to the following:
    mgos_wifi_sta.c:516 Trying Reldene AP c4:41:1e:67:69:1a RSSI -64 cfg 0 att 1
    however when it fails to connect, it boots and shows this instead:
    mgos_wifi_sta.c:516 Trying Reldene AP 00:00:00:00:00:00 RSSI 0 cfg 0 att 1
    Is the fact that it doesn’t display the mac address of the AP purely because it hasn’t found it, or should we expect that data to be saved from previous connections?
    (we know the AP was online, as another device 3m away stayed connected and online throughout…)
    Deomid Ryabkov
    @rojer
    all zero AP is "last resort" entry, i.e. we don't specify any BSSID and let the wifi library pick one (this is our way of handling hidden SSIDs, as they are not returned in scan results)
    it means that there were no APs in scan results and instead this wildcard entry was added (in case SSID is hidden)
    unless this network uses hidden SSIDs, this means that something went wrong during scan and no results were returned
    gadget-man
    @gadget-man
    Hmmm, so sounds a lot like a temporary version of the problem I was having on the device the other day (which still won’t connect). Weird this about this was it reconnected after about 12 hours and has been fine ever since.
    Deomid Ryabkov
    @rojer
    try increasing wifi-related debug level: debug.file_level=mgos_wifi=3,esp32_wifi=3
    it will print scan results it gets
    igorkblr
    @igorkblr
    how comes that there is no definition of mgos_sys_config_get_device_id() in generated mgos_config.h file? Do i need any specific define or settings for that in mos.yml file?
    Deomid Ryabkov
    @rojer
    @igorkblr that's really weird. it's defined in the core library, that is included in all apps - https://github.com/mongoose-os-libs/core/blob/master/mos.yml#L29
    nevertheless, can you check that you have core lib?
    i remember that you're using some ancient version, like 2.10
    igorkblr
    @igorkblr
    i am using the latest now, 2.19.1
    Up to 2.14 everything builds just fine. Problems start with 2.14
    abhibhatia98
    @abhibhatia98
    Hi , I am doing ota over mqtt, just curious to know, when does fw_version inside device packet got incremented ?? Do I need to increment it itself after doing OTA for getting firmware version status in future or it has some other use case?? And how can I access this inside the program, I have not found any documentation, please help.
    Deomid Ryabkov
    @rojer
    @igorkblr can you share generated final manifest? build/gen/mos-final.yml, you can do it privately if you prefer
    @abhibhatia98 fw_version comes from the version field of mos.yml
    Marcus Hoffmann
    @hoffmann-m
    @rojer Since friday all our gateways that were connected to GCP via mqtt.googleapis.com are offline! Some devices connected via mqtt.2030.ltsapis.goog are still online. The log output for mqtt.googleapis.com: The certificate is not correctly signed by the trusted CA. We are running mongoos os 2.18.0. The GlobalSign R2 ca should not expire before 2021-12-15. Do you hear or know soming about this issue? Are some Google CAs missing from the ca.pem?
    Deomid Ryabkov
    @rojer
    @hoffmann-m Google has changed the certificate chain. it is still signed by a globalsign root but by a different one
    this one expires in 2028