User Tools

Site Tools


uphp:functions:firmwareupdate

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
uphp:functions:firmwareupdate [2017/03/06 12:46]
jeff
uphp:functions:firmwareupdate [2021/09/13 05:57] (current)
Line 1: Line 1:
 ======firmwareupdate====== ======firmwareupdate======
 +
 <badge>WMPRO, WMMINI FW >= 1.0</badge> <badge>WMMEGA FW >= 2.0</badge> <badge>WMPRO, WMMINI FW >= 1.0</badge> <badge>WMMEGA FW >= 2.0</badge>
  
Line 5: Line 6:
  
 ====Description==== ====Description====
-<well size="sm"><html><span style="font-size:125%;"></html>[[firmwareupdate]] ( ) 
-</well> 
  
-<alert type="warning">Make sure that the latest firmware is stored in the file 'image.hex' in the root folder of the SD Card, otherwise it will cause the device to not boot.  To recover from this situation you will need to remove the SD Card, copy a new firmware onto it, reinsert it and power on while holding the reset button at the back of the device((NOT true on a Wattmon Pro with FW 1.1051: firmwareupdate() does not attempt to update or reboot if /image.hex is missing. - Jeff 3/6/17)).</alert>+<well size="sm"><html> 
 +<span style="font-size:125%">firmwareupdate ( ) 
 +</html></well> 
 + 
 +<alert type="warning">Make sure that the latest firmware is stored in the file 'image.hex' in the root folder of the SD Card, otherwise it will cause the device to not boot.  To recover from this situation you will need to remove the SD Card, copy a new firmware onto it, reinsert it and power on while holding the reset button at the back of the device((NOT true on a [[hardware:wattmons:WattmonPRO]] with FW 1.1051: firmwareupdate() does not attempt to update or reboot if /image.hex is missing. - Jeff 3/6/17)).</alert>
  
 ====Parameters==== ====Parameters====
 +
 None None
  
-====Return Value====+====Return Values==== 
 None None
  
 ====Example==== ====Example====
-Check if the image hex file exists, and if so, initiate a firmware update:+ 
 +===Check if an image hex file exists, and if so, initiate a firmware update=== 
 <code php> <code php>
 <pre><? <pre><?
-$f=fopen("/image.hex","r"); +  $f=fopen("/image.hex","r"); 
-if ($f && filesize($f)) { +  if ($f && filesize($f)) { 
-  log("Firmware Update Initiated"); +    log("Firmware Update Initiated"); 
-  firmwareupdate(); +    firmwareupdate(); 
-} else { +  } else { 
-  print("Firmware file /image.hex does not exist!"); +    print("Firmware file /image.hex does not exist!"); 
-}+  }
 ?></pre> ?></pre>
 </code> </code>
  
 ====See Also==== ====See Also====
 +
 [[firmware:Wattmon Firmware]] - The HEX file that is flashed onto the chip [[firmware:Wattmon Firmware]] - The HEX file that is flashed onto the chip
  
uphp/functions/firmwareupdate.1488804402.txt.gz · Last modified: 2021/09/13 05:56 (external edit)