mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-03-10 03:06:37 +00:00
changed flash command to use fhem firmware directory (by HCS)
git-svn-id: https://svn.fhem.de/fhem/trunk@6512 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
549f08cbf9
commit
6e446a89f2
@ -1,5 +1,7 @@
|
||||
# Add changes at the top of the list. Keep it in ASCII, and 80-char wide.
|
||||
# Do not insert empty lines here, update check depends on it.
|
||||
- feature: 36_JeeLink: changed flash command to use fhem firmware
|
||||
directory (by HCS)
|
||||
- feature: 70_ENIGMA2: new attribute lightMode for old/slow devices
|
||||
limited restricted functionality
|
||||
- added: 98_CustomReadings.pm (maintainer: HCS)
|
||||
|
@ -77,7 +77,6 @@ JeeLink_Initialize($)
|
||||
$hash->{SetFn} = "JeeLink_Set";
|
||||
$hash->{AttrFn} = "JeeLink_Attr";
|
||||
$hash->{AttrList} = "Clients MatchList"
|
||||
." hexFile"
|
||||
." initCommands"
|
||||
." flashCommand"
|
||||
." DebounceTime BeepLong BeepShort BeepDelay"
|
||||
@ -210,23 +209,27 @@ JeeLink_Set($@)
|
||||
my $hexFile = "";
|
||||
my @deviceName = split('@', $hash->{DeviceName});
|
||||
my $port = $deviceName[0];
|
||||
my $defaultHexFile = "./hexfiles/$hash->{TYPE}-LaCrosseITPlusReader10.hex";
|
||||
my $firmwareFolder = "./FHEM/firmware/";
|
||||
my $logFile = AttrVal("global", "logdir", "./log") . "/JeeLinkFlash.log";
|
||||
|
||||
|
||||
if(!$arg || $args[0] !~ m/^(\w|\/|.)+$/) {
|
||||
$hexFile = AttrVal($name, "hexFile", "");
|
||||
if ($hexFile eq "") {
|
||||
$hexFile = $defaultHexFile;
|
||||
my $detectedFirmware = $arg ? $args[0] : "";
|
||||
if(!$detectedFirmware) {
|
||||
if($hash->{model} =~ /LaCrosse/ ) {
|
||||
$detectedFirmware = "LaCrosse";
|
||||
}
|
||||
elsif($hash->{model} =~ /pcaSerial/ ) {
|
||||
$detectedFirmware = "PCA301";
|
||||
}
|
||||
}
|
||||
else {
|
||||
$hexFile = $args[0];
|
||||
}
|
||||
$hexFile = $firmwareFolder . "JeeLink_$detectedFirmware.hex";
|
||||
|
||||
|
||||
return "No firmware detected. Please use the firmwareName parameter" if(!$detectedFirmware);
|
||||
return "The file '$hexFile' does not exist" if(!-e $hexFile);
|
||||
|
||||
return "Usage: set $name flash [filename]\n\nor use the hexFile attribute" if($hexFile !~ m/^(\w|\/|.)+$/);
|
||||
|
||||
$log .= "flashing JeeLink $name\n";
|
||||
$log .= "detected Firmware: $detectedFirmware\n";
|
||||
$log .= "hex file: $hexFile\n";
|
||||
$log .= "port: $port\n";
|
||||
$log .= "log file: $logFile\n";
|
||||
@ -988,14 +991,18 @@ sub JeeLink_getIndexOfArray($@) {
|
||||
sending the 'new battery' flag will be created.
|
||||
</li><br>
|
||||
|
||||
<li>flash [hexFile]<br>
|
||||
<li>flash [firmwareName]<br>
|
||||
The JeeLink needs the right firmware to be able to receive and deliver the sensor data to fhem. In addition to the way using the
|
||||
arduino IDE to flash the firmware into the JeeLink this provides a way to flash it directly from FHEM.
|
||||
arduino IDE to flash the firmware into the JeeLink this provides a way to flash it directly from FHEM.<br><br>
|
||||
|
||||
The firmwareName argument is optional. If not given, set flash checks the firmware type that is currently installed on the JeeLink and
|
||||
updates it with the same type.<br><br>
|
||||
|
||||
|
||||
There are some requirements:
|
||||
<ul>
|
||||
<li>avrdude must be installed on the host<br>
|
||||
On a Raspberry PI this can be done with: sudo apt-get install avrdude</li>
|
||||
On a linux systems like Cubietruck or Raspberry Pi this can be done with: sudo apt-get install avrdude</li>
|
||||
<li>the flashCommand attribute must be set.<br>
|
||||
This attribute defines the command, that gets sent to avrdude to flash the JeeLink.<br>
|
||||
The default is: avrdude -p atmega328P -c arduino -P [PORT] -D -U flash:w:[HEXFILE] 2>[LOGFILE]<br>
|
||||
|
Loading…
x
Reference in New Issue
Block a user