Copyright © https://mongoose-os.com

Mongoose OS Forum

frame

Config.Set Syntax JSON String

edited November 14 in Mongoose OS

Hi everyone,

I've got a Problem when trying to set the wifi credentials over curl command or ws with the JSON String. The chip is the AP and the other device is connected to the AP Network.

Then I tried this command to set the sta credentials: curl -d "{"config": {"sta": {"ssid": "ssid_from_network_to_set", "pass": "password"}}}" http://192.168.0.17/rpc/Config.Set

the chip is receiving the String but always response null. I also tried the String with and without the " ", but the result is the same.

Maybe the Syntax of the String isn't correct?

Thank You in advance for help.

Best regards

Comments

  • edited November 14

    I posted the wrong command: curl -d "{"config": {"sta": {"ssid": "NETGEAR86_DO", "pass": "Netgear_03052018"}}}" http://192.168.4.1/rpc/config.set

    The IP Address of the chip in AP Mode is by default 192.168.4.1

  • mamuespmamuesp Germany/Northern coast

    Two questions: is this by purpose that the JSON string has unescaped double quotes? On a Un*x system you may replace the outer quotes with single quotes, on Windows you'll have to escape the inner double quotes with a backslash. this is a common basic error. And on the other hand; why don't you use mos --port ws://192.168.4.1/rpc wifi <your SSID> <your PW> ?

Sign In or Register to comment.