Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Firmware Update not Possible #242

Open
ripper121 opened this issue Feb 22, 2017 · 8 comments
Open

Firmware Update not Possible #242

ripper121 opened this issue Feb 22, 2017 · 8 comments
Assignees

Comments

@ripper121
Copy link

In 2.2.5 the FW Update from devices was possible.
Now with 2.3.0 I can click the Button, get the Info "Firmware Update Successfully" but nothing happen.
So the FW Update from ZWave Devices is not possible :(

@PoltoS
Copy link
Member

PoltoS commented Feb 22, 2017

What kind of FW update? Devices or UZB/RaZberry

@ripper121
Copy link
Author

Devices
I was in the Firmware Update Tab, Target set to 0.

@PoltoS
Copy link
Member

PoltoS commented Feb 23, 2017

@vades Please check, this was not working for me too - had to use raw API

@vades
Copy link
Contributor

vades commented Feb 23, 2017

How can I check it?
Front-end sends the following params:
file
url
targetId

Header example:
------WebKitFormBoundaryjMOGHbspzDJVKtYI
Content-Disposition: form-data; name="file"

undefined
------WebKitFormBoundaryjMOGHbspzDJVKtYI
Content-Disposition: form-data; name="url"

http://www.firmware.url
------WebKitFormBoundaryjMOGHbspzDJVKtYI
Content-Disposition: form-data; name="targetId"

1
------WebKitFormBoundaryjMOGHbspzDJVKtYI--

  • Are params OK or NOT?
  • If NOT "how they should look like?"

@ronie-z-wave
Copy link
Contributor

found this: Z-Wave-Me/home-automation@f8f121b

only change in that function since v2.2.5

@Serguei could you please have a look at it? Maybe it's still not finished?

@ronie-z-wave
Copy link
Contributor

Header example:
------WebKitFormBoundaryjMOGHbspzDJVKtYI
Content-Disposition: form-data; name="file"
undefined

will check this first and your change after ;)

@PoltoS
Copy link
Member

PoltoS commented Mar 21, 2017

Header example:
------WebKitFormBoundaryjMOGHbspzDJVKtYI
Content-Disposition: form-data; name="file"
undefined

This is ok. Because either file or url should be sent

@ronie-z-wave
Copy link
Contributor

ronie-z-wave commented Mar 22, 2017

In HA response is empty .. any idea?

[2017-03-22 10:59:00.287] [I] [core] upgrade res: {
 "status": 200,
 "statusText": "OK",
 "url": "http://SERVER_IP/dev/ota_firmwares/POPP_StrikeLock_v1_5_OTA.bin",
 "headers": {
  "Accept-Ranges": "bytes",
  "Content-Length": "98305",
  "Content-Type": "application/octet-stream",
  "Date": "Wed, 22 Mar 2017 09:58:47 GMT",
  "ETag": "\"18001-54b3bdda0a640\"",
  "Last-Modified": "Tue, 21 Mar 2017 11:22:57 GMT",
  "Server": "Apache/2.4.23 (Ubuntu)"
 },
 "contentType": "application/octet-stream",
 "data": {}
}
[2017-03-22 10:59:00.296] [E] [core] Callback execution error: TypeError: undefined is not a function
    at Function.http.request.success (automation/modules/ZWave/index.js:1606:20)

I've also tried this in HA - ZWave/index.js:

http.request({
	method: "GET",
	url: data.url,
	headers: {
			"Content-Type": "application/octet-stream", // enforce binary response
                        "Content-Disposition": "attachment;" + data.file.name,
                        "Access-Control-Allow-Origin": "*",
                        "Access-Control-Allow-Methods": "GET, POST, PUT, DELETE, OPTIONS",
                        "Access-Control-Allow-Headers": "Authorization",
                        "Connection": "keep-alive"
	},
	async: true,
	success: function (res) {
		console.log('upgrade res:', JSON.stringify(res, null, 1));
		var fw;
		if (res.data.substr(0, 1) === ":") {
		        // this is a .hex file
			fw = IntelHex2bin(res.data);
		} else {
			fw = res.data;
		}
		fwUpdate.Perform(manufacturerId, firmwareId, targetId, fw);
	},
	error: function (res) {
		console.error("Failed to download firmware: " + res.statusText);
	}
});

no change ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants