Setting mdash token fails

I’m trying to set an MDash token using MOS. I prefer not to put it into the mos.yml file.

From MOS, I have issued:

$ mos config-set dash.enable=true dash.token=Q08xxxxxxxxxxxzrtzdj0g

That used to work fine with this device but now it fails. I can flash firmware with no trouble. I’m sure the serial pot is correct. Here is what I see when issue the above command:

Getting configuration...
E0128 03:00:30.595513   86951 serial.go:273] No response to handshake. Is /dev/cu.usbserial-1410 the right port? Is rpc-uart enabled?
E0128 03:00:35.800044   86951 serial.go:273] No response to handshake. Is /dev/cu.usbserial-1410 the right port? Is rpc-uart enabled?
E0128 03:00:41.004704   86951 serial.go:273] No response to handshake. Is /dev/cu.usbserial-1410 the right port? Is rpc-uart enabled?
Error: write /dev/cu.usbserial-1410: file already closed
/private/tmp/mos-latest-20210124-3022-1391sxn/mos-fc6d88a9c4b150c1bf0538e5547057af33f5ec94/common/mgrpc/codec/serial.go:206: 
/private/tmp/mos-latest-20210124-3022-1391sxn/mos-fc6d88a9c4b150c1bf0538e5547057af33f5ec94/common/mgrpc/codec/serial.go:265: 
/private/tmp/mos-latest-20210124-3022-1391sxn/mos-fc6d88a9c4b150c1bf0538e5547057af33f5ec94/common/mgrpc/codec/stream.go:331: 
/private/tmp/mos-latest-20210124-3022-1391sxn/mos-fc6d88a9c4b150c1bf0538e5547057af33f5ec94/common/mgrpc/mgrpc.go:401: 
/private/tmp/mos-latest-20210124-3022-1391sxn/mos-fc6d88a9c4b150c1bf0538e5547057af33f5ec94/cli/dev/dev_conn_impl.go:167: 
/private/tmp/mos-latest-20210124-3022-1391sxn/mos-fc6d88a9c4b150c1bf0538e5547057af33f5ec94/cli/dev/dev_conn_impl.go:190: 
/private/tmp/mos-latest-20210124-3022-1391sxn/mos-fc6d88a9c4b150c1bf0538e5547057af33f5ec94/cli/dev/dev_conn.go:117: 
/private/tmp/mos-latest-20210124-3022-1391sxn/mos-fc6d88a9c4b150c1bf0538e5547057af33f5ec94/cli/config/config.go:86: 
/private/tmp/mos-latest-20210124-3022-1391sxn/mos-fc6d88a9c4b150c1bf0538e5547057af33f5ec94/cli/main.go:198: config-set failed
exit status 1
Command completed.

Is there an alternative way to set an MDash token, without having to put it into the mos.yml file?

UPDATE:

I do have this in my mos.yml:

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

Did you change anything ? Did you upgrade to 2.19 ?

@scaprile yes I’m frequently changing things, I need to get this product to beta in a few weeks. But I didn’t change anything relevant to RPC and I didn’t remove or add any libraries in mos.yml.

Yes, I updated a few weeks ago. I just ran mos update again:

Jims-MacBook-Pro-486:RP4N-N2K-B jim$ mos update

Update channel: latest

Running brew update

Running brew tap cesanta/mos

Running brew install mos-latest

Warning: cesanta/mos/mos-latest 202101232338 is already installed and up-to-date.

To reinstall 202101232338, run:

brew reinstall mos-latest

I also tried to get it to work with a much smaller test application, still no joy.

UPDATE: Actually, all the RPC calls are failing via the serial port, even though I can flash my ESP32. The RPC calls do work via http though…

In my experience, sometimes the UART connection times out when the hard is busy doing other stuff.
If you experience this failing “now” and you can not roll your code back, at least try to check if you find the same problem with the former release (2.18.0), you can either fix a specific version in your mos.yml (nliviu posted this a couple of times in the forum, search for it) or downgrade your mos tool (what I usually do) by doing an ‘update’ and specifying a specific release

Thanks @scaprile I’ll try that. I was able to write a small app that this works with. I may be able to have my app start, and do nothing, then update the token, then reset it to work as normal. I’m hoping not to have to back level any components, that would be a maintenance chore going forward.

I added the ability to set an mdash token from my web based UP, server my the Mongoose OS web server. I can successfully update the mdash token, but then I need to restart the board. Is there an endpoint I can call, or at least a function so I can create my own endpoint, to restart the mdash client, so I don’t have to restart the entire product?