Skip to content

Commit

Permalink
fix demo OTA php script
Browse files Browse the repository at this point in the history
  • Loading branch information
rherget committed Feb 4, 2016
1 parent 3b2ea52 commit dbcf674
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion doc/ota_updates/ota_updates.md
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,7 @@ $db = array(
);

if(isset($db[$_SERVER['HTTP_X_ESP8266_STA_MAC']])) {
if($db[$_SERVER['HTTP_X_ESP8266_STA_MAC']] != $_SERVER['HTTP_X_ESP8266_VERSION']) ) {
if($db[$_SERVER['HTTP_X_ESP8266_STA_MAC']] != $_SERVER['HTTP_X_ESP8266_VERSION']) {
sendFile("./bin/".$db[$_SERVER['HTTP_X_ESP8266_STA_MAC']]."bin");
} else {
header($_SERVER["SERVER_PROTOCOL"].' 304 Not Modified', true, 304);
Expand Down

4 comments on commit dbcf674

@Humancell
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also noticed that on line 511 I think it should be .".bin" ... instead of ."bin" as the concatenation is creating a filename that does not end with .bin

@rherget
Copy link
Contributor Author

@rherget rherget commented on dbcf674 Feb 8, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe yes, but I think that's more a thing how you like to have your filenames. It's not really a bug.

@tablatronix
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as in no extensions ? hmm..

@Humancell
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just know it was confusing to a group of newbies we were teaching here, as the Arduino IDE creates the file with the ".bin" extension ... and they didn't realize why the script was failing when they put the files on the server. So we had to edit the script.

I do understand your thought @rherget on how you get to choose the filenames, but in that case there should not be any extension in the script ... and the array should contain the full filename and extension.

The PHP script seems to insinuate there is a ".bin" extension ... but then it fails to include the "." and so it breaks.

Please sign in to comment.