SOLVED - BLE_HOST_TIMEOUT error (-2) on watch but not simulator

Hi, Tesla modified the headers when doing POST calls to their servers by needing

    "Content-Type" => Communications.REQUEST_CONTENT_TYPE_JSON

in it, but although that addition works successfully in the simulator, it returns BLE_HOST_TIMEOUT on my Venu watch and others' watch.

Anybody knows what I can do to fix this? I'm at lost here :-(

This is an example of the MakeWebRequest call I have

        Communications.makeWebRequest(
            url,
            {
                "on" => value
            },
            {
                :method => Communications.HTTP_REQUEST_METHOD_POST,
                :headers => {
                    "Authorization" => _token,
				   "User-Agent" => "Tesla-Link for Garmin",
                   "Content-Type" => Communications.REQUEST_CONTENT_TYPE_JSON
                },
                :responseType => Communications.HTTP_RESPONSE_CONTENT_TYPE_JSON
            },
            notify
        );

  • It appears that since the Tesla API update, the application/json content header is required even for posts that don't include content (such as wake_up, charge_start and charge_stop). Could it be the call is returning -2 because it can't find the content? If so, should I flag this as a bug and hope Garmin fixes it? I can't really ask Tesla because this is an unsupported API.

  • Well, after trying many things, that last attempt was the right one. I added a dummy content to the body of those POST without any body, as in

            Communications.makeWebRequest(
                url,
                {
                    "dummy" => "dummy"   <=== THIS BLOCK
                },
                {
                    :method => Communications.HTTP_REQUEST_METHOD_POST,
                    :headers => {
                        "Authorization" => _token,
    				   "User-Agent" => "Tesla-Link for Garmin",
                       "Content-Type" => Communications.REQUEST_CONTENT_TYPE_JSON
                    },
                    :responseType => Communications.HTTP_RESPONSE_CONTENT_TYPE_JSON
                },
                notify
            );

    So far, Tesla isn't balking on them and the calls now successfully completes :-)