ntruchsess/perl-firmata

Support for Firmata later than 2.06

git-developer opened this issue · 12 comments

Some users of FHEM (blueberry63, Meck) try to use Perl Firmata together with a version of ConfigurableFirmata newer than 2.06. The latest version of ConfigurableFirmata that perl-firmata supports seems ot be 2.06. I saw that ConfigurableFirmata nowadays has separate version numbers for the protocol version (2.06) and the firmware version (2.10). But since the REPORT_VERSION message uses the firmware version and not the protocol version, the latest supported version is 2.06.

To solve this problem, either the user has to change the firmata version in his sketch, or perl-firmata has to be extended to support newer versions.

Please have a look at this Changelog. My forked version 0.63 provides the solution you are looking for by being firmware version independent and assuming protocol backward compatibility. I have been using it continuously for more than a year and it can be considered stable. I have not tried it with the most recent releases of ConfigurableFirmata but it should work as long as you don't need to use Firmata protocol features that have been added to the latest versions.

I could create a pull request (including the changes of my pending pull request for the software serial support) if this is of interest.

That looks promising, I'd appreciate a pull request!

@ntruchsess It seems to me that I cannot create another pull request on top of a pending pull request. I do not intend to merge pull request #25 into the master branch (although I seem to have the authorization to do so) unless you give me a go.
@git-developer U could try my version for the time being ;-)

@jnsbyr A pull request is a connection between two branches, so all commits that you put on top of jnsbyr:master will automatically be part of your pull request and merged into ntruchsess:master. If you don't want to merge all commits of jnsbyr:master into ntruchsess:master, you have to cancel the pull request and create a new one. You could create a new branch in your repo that contains only the commits you want to merge. You could also choose a different branch in the target repo; but currently, there's no other branch (e.g. ntruchsess:dev) you could merge into.

@git-developer Thanks for the explanation of the GitHub way of gitting. So all we need is #25 to be merged and this should preferably be done by the repository owner.

@git-developer I had another look at the changelog. If you currently use perl-firmata 0.61 that is based on #24 you already have protocol/firmware independence. #25 only adds a minor improvement for a special error situation. Did you make your tests with perl-firmata 0.61?

If you looking for a solution for FHEM you should know that the distro includes perl-firmata 0.59 and you need to update manually until the perl-firmata part of the FHEM distro is updated.

Sorry, I didn't test it because I run version 2.6; I created this issue because several other users shared a problem: they downloaded the latest version of ConfigurabeFirmata, made a connection to the FHEM version of perl-firmata (0.59) and ran into trouble.
So if I understand you right, it should be enough if perl-firmata in FHEM would be updated to 0.61.

Yes, but I would advise to use my version 0.63 to get all features and fixes. Please make tests with version 0.61 or 0.63 and report your results.

If you provide a link to the FHEM discussion you are referring to I could provide some additional insights that are FHEM specific.

You can find links to the FHEM discussion in my first comment. Thanks!

I made tests with version 0.63 today.

It was quite an effort for me to create a test setup with Arduino IDE 1.8.4, ConfigurableFirmata 2.10.0, RCSwitch 2.5.2 and FHEM 5.8, but I was finally able to put it all together. It worked ... nearly. The protocol version is not only requested in Platform.pm but also in 10_FRM.pm. I had to manually change a line to use get_max_supported_protocol_version. With this change, it worked.

I saw that my change has already been done on branch dev. So, to support ConfigurableFirmata later than 2.06, we need perl-firmata in version 0.63 and the changes in fhem-mirror branch dev.

@git-developer Thanks for the feedback. Your are right - to get it working with FHEM some additional changes are required to the module 10_FRM.pm. These changes have been done at the end of 2015 and I am very sorry that they did not make it into the stable branch of FHEM (yet). I forgot that I do not use the official release of this module but a customized version.

To wrap it up, perl-firmata 0.63 is working for you and it would be a good idea to merge it with the master branch.

The original issue has been resolved in the FHEM project by updating to perl-firmata 0.63. Merging #25 is recommended.