change & wifi config

  1. My goal is: To create a method of provisioning an ESP32 device in as close to automated fashion as possible. I am currently using a bash script for this approach. I want to set a custom before registering the device on GCloud.
  2. My actions are: 1) Run: mos config-set 2) Run: mos wifi MY_SSID MY_PASS 3) …GCloud config
  3. The result I see is:
  4. My expectation & question is: If I run either of the 2 commands above individually, they work fine. It is only when both commands are run (in either order) do I get the same error. I assume the error on Line 37 is the problem but I don’t know why.

The error comes from here
wifi_sta_set_host_name fails because the which is used as hostname in the absence of wifi.sta.dhcp_hostname has a length>32.


Many thanks @nliviu!! I ended up stripping the ‘-’ chars out of my UUID with: dhcpHostname=$(echo "$deviceId" | sed -e 's/-//g') and setting that as the wifi.sta.dhcp_hostname & it worked!

1 Like

Well, it looks like running mos license resets the so I’m thinking about just giving up on setting a custom id.

Setting gcp.device to a custom uuid gets overwritten during mos gcp-iot-setup too - oh well.