10_FRM.pm: support Firmata firmware without AnalogInputFirmata (Forum #81815)

git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@15794 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
jensb 2018-01-05 19:14:58 +00:00
parent 97410b289e
commit 7be9ff62b7
2 changed files with 33 additions and 33 deletions

View File

@ -1,5 +1,6 @@
# Add changes at the top of the list. Keep it in ASCII, and 80-char wide. # 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. # Do not insert empty lines here, update check depends on it.
- bugfix: 10_FRM: accept Firmata firmware without AnalogInputFirmata
- bugfix: 10_MYSENSORS_DEVICE: corrected S_LIGHT_LEVEL - bugfix: 10_MYSENSORS_DEVICE: corrected S_LIGHT_LEVEL
- bugfix: 93_DbRep: fix "month out of range" that causes fhem crash - bugfix: 93_DbRep: fix "month out of range" that causes fhem crash
- feature: 20_FRM_PWM: new attribute "restoreOnStartup" - feature: 20_FRM_PWM: new attribute "restoreOnStartup"

View File

@ -562,7 +562,7 @@ sub FRM_SetupDevice($) {
} elsif ($hash->{SETUP_STAGE} == 2) { # device capabilities } elsif ($hash->{SETUP_STAGE} == 2) { # device capabilities
RemoveInternalTimer($hash); RemoveInternalTimer($hash);
InternalTimer(gettimeofday() + 1, 'FRM_SetupDevice', $hash, 0); InternalTimer(gettimeofday() + 1, 'FRM_SetupDevice', $hash, 0);
my $capabilitiesReceived = $device->{metadata}{analog_mappings} && $device->{metadata}{capabilities}; my $capabilitiesReceived = $device->{metadata}{capabilities} && ($device->{metadata}{analog_mappings} || ($elapsed >= 5));
if ($capabilitiesReceived) { if ($capabilitiesReceived) {
# device capabilities have been received, convert to readings # device capabilities have been received, convert to readings
my $inputpins = $device->{metadata}{input_pins}; my $inputpins = $device->{metadata}{input_pins};
@ -634,7 +634,6 @@ sub FRM_SetupDevice($) {
# ready, init client modules # ready, init client modules
$hash->{SETUP_STAGE} = 3; $hash->{SETUP_STAGE} = 3;
FRM_SetupDevice($hash); FRM_SetupDevice($hash);
} elsif ($elapsed >= 5) { } elsif ($elapsed >= 5) {
# capabilities receive timeout, abort # capabilities receive timeout, abort
$hash->{SETUP_STAGE} = 5; $hash->{SETUP_STAGE} = 5;
@ -1464,6 +1463,9 @@ sub FRM_Serial_Close {
o OWX support o OWX support
- modified FRM_Client_AssignIOPort: use already assigned IODev - modified FRM_Client_AssignIOPort: use already assigned IODev
04.01.2018 JB
o fix capability query for Firmata firmware without AnalogInputFirmata
=cut =cut
=pod =pod
@ -1610,9 +1612,6 @@ sub FRM_Serial_Close {
<a name="FRMnotes"></a> <a name="FRMnotes"></a>
<b>Notes</b><br> <b>Notes</b><br>
<ul> <ul>
<li>ConfigurableFirmata<br>
AnalogInputFirmata must always be enabled, even if not used. Otherwise the device setup will fail with the error <i>Unhandled sysex command</i> when connecting because the pin capability query cannot be completed.
</li>
<li>Serial Ports<br> <li>Serial Ports<br>
Some serial devices can be connected to a serial port of a Firmata device acting as a serial over LAN adapter Some serial devices can be connected to a serial port of a Firmata device acting as a serial over LAN adapter
if their FHEM modules are using basic DevIo (e.g. HEATRONIC in read only mode) by changing their serial device descriptor to if their FHEM modules are using basic DevIo (e.g. HEATRONIC in read only mode) by changing their serial device descriptor to