Skip to content

Conversation

tekka007
Copy link
Contributor

@tekka007 tekka007 commented Apr 19, 2019

@tekka007 tekka007 force-pushed the PJONSupport branch 12 times, most recently from 38d5bab to 8025917 Compare April 22, 2019 17:13
@henrikekblad
Copy link
Member

@gioblu, @4ib3r, @gryzli133, would have be great if you could help out to do some tests on this PR before it goes in...

@tekka007 tekka007 force-pushed the PJONSupport branch 2 times, most recently from 92fa3d8 to 069a713 Compare April 28, 2019 13:17
@gioblu
Copy link
Contributor

gioblu commented May 1, 2019

Ciao @tekka007, @henrikekblad thank you very much for pushing this through, although studying in detail your license here I think including the PJON source within MySensors would cause a license compatibily issue with the "Open Source Licensing GPL V2", not sure about the "Commercial Licensing" which clause is not public.

Following the stands of the Apache Foundation:

Despite our best efforts, the FSF has never considered the Apache License to be compatible with GPL version 2, citing the patent termination and indemnification provisions as restrictions not present in the older GPL license. The Apache Software Foundation believes that you should always try to obey the constraints expressed by the copyright holder when redistributing their work.

Also following this discussion here seems it is considered incompatible even the mere linking of an Apache 2.0 library within a GPL v2.0 project. From the Apache clause:

You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.

For you to switch to LGPLv3 may be favorable because projects licensed Apache 2.0 would be compatible and could be linked in MySensors so for example externally use the PJON library in MySensors, or even include the source of PJON with its own Apache 2.0 license if I am not mistaken, see here:

Apache 2 software can therefore be included in GPLv3 projects, because the GPLv3 license accepts our software into GPLv3 works. However, GPLv3 software cannot be included in Apache projects. The licenses are incompatible in one direction only, and it is a result of ASF's licensing philosophy and the GPLv3 authors' interpretation of copyright law.

quick-guide-gplv3-compatibility

Consider also that external linking of third party libraries (and not their inclusion in a subdirectory of MySensors as it is now, that makes you a distributor) would let you have more freedom in using external tools and reduce the chances of stumbling in a license compatibility issue like this one.

@henrikekblad
Copy link
Member

Yeah, the licensing is a bit of a mess. The best solution I've found so far (when doing some googling previously) seems to be to make MySensors available under 3 licenses GPLv2, GPLv3 and LGPLv3. A popular library, QT, made this switch some a couple of years ago.

We already have an ongoing issue on the license problems here: #1242

@Actpohomoc
Copy link

I asked for an expert on licenses, and he suggested looking at this article: http://www.apache.org/licenses/GPL-compatibility.html

@gioblu
Copy link
Contributor

gioblu commented May 3, 2019

Ciao @henrikekblad and @Actpohomoc thank you for your feedback.
I hope the license issue will get resolved not only to let this pull-request pass through, but also to simplify the integration of other non-GPL tools in the future.

@Swiftnesses
Copy link

Just spotted this now, the possibilities this single wire interface brings is amazing. Hope to see it merged soon :)

@gryzli133
Copy link
Contributor

What is the next step? Will PJON will be available in next Release of MySensors? :-)

@tekka007
Copy link
Contributor Author

@gryzli133 The license issue is currently under discussion and we will proceed with the PR ASAP. In the meantime, we need ppl testing this PR and providing feedback.

@gryzli133
Copy link
Contributor

How can I download the version that includes PJON? Sorry for noob questions, but I completely skipped git etc while do PLC programming

@gioblu
Copy link
Contributor

gioblu commented Jun 23, 2019

Ciao @gryzli133 I think you should download 98d3d33 and give it a try :)

@gioblu
Copy link
Contributor

gioblu commented Jul 6, 2019

Ciao @tekka007 thank you for pushing this forward, @Swiftnesses @gryzli133 would you give a try to b24711f?

@tekka007
Copy link
Contributor Author

tekka007 commented Dec 6, 2020

Hi @gryzli133 & @gioblu - I've updated this PR to include PJON 13.0. If time allows, can you retest and provide feeback?

@paultbarrett
Copy link

paultbarrett commented Dec 6, 2020 via email

@gryzli133
Copy link
Contributor

Hi @tekka007, can you send me download link to the latest version? Or maybe even better - can you tell me how can I find it by myself next time?
Did you also include the changes for using the non-blocking version and polling for at least 2 milliseconds?

@tekka007
Copy link
Contributor Author

tekka007 commented Dec 11, 2020

@gryzli133 https://github.com/tekka007/MySensors/tree/PJONSupport

No, I didn't inlcude the changes you mentioned - please feel free to add them

@gryzli133
Copy link
Contributor

Ciao @gryzli133 that's a good news :), so @tekka007 have only to change the code using the non-blocking version and remember to poll for at least 2 milliseconds, then the transport should be ready to go.

Hi @gioblu, could you take care about that two changes to be included in the latest release? Then I will start testing new version. Thank you in advance!

@gioblu
Copy link
Contributor

gioblu commented Dec 17, 2020

@gryzli133 where I can find your source?

@gryzli133
Copy link
Contributor

@gioblu at the moment I'm still using the old version 98d3d33 with the modifications you gave me for non-blocking version:

  1. implement transportSend function accordingly
bool transportSend(const uint8_t to, const void *data, const uint8_t length, const bool noACK)
{
      const char *datap = static_cast<const char *>(data);
      char *dataToSend = const_cast<char *>(datap);
      uint16_t res = bus.send(to, dataToSend, length, (noACK) ? (bus.config & ~PJON_ACK_REQ_BIT) : PJON_NO_HEADER);
      bus.update();
      if(res == PJON_FAIL) { 
        PJON_DEBUG(PSTR("!PJON:SND:FAIL\n"));
        return false;
      } else return true;
}
  1. to work properly the reception or polling should last some time, for example 1 millisecond, so changing in the function transportDataAvailable at line 104 bus.receive(1000); (it may have more sense to use a predefined constant / setters and getters for the duration so users can change that).
  2. Add a line to transportDataAvailable after line 104, adding bus.update();

@gioblu
Copy link
Contributor

gioblu commented Dec 19, 2020

@tekka007 I have done as @gryzli133 requested, here it is https://github.com/tekka007/MySensors/pull/1/files

@tekka007 tekka007 force-pushed the PJONSupport branch 4 times, most recently from 7484fc1 to bd4a236 Compare December 19, 2020 20:37
@gryzli133
Copy link
Contributor

@tekka007 I just wanted to make some test with new version of MySensors, but I'm getting some troubles for ESP8266. I have copied my portable version of Arduino 1.8.12 where the first PJON implementation is working fine. Everything is the same, just MySensors is updated. Now with cdc0ef2 I'm getting this faults:
image

I will continue tests with serial and Ethernet gateway, but for fast setup wifi gateway is very useful.

@tekka007
Copy link
Contributor Author

tekka007 commented Jan 2, 2021

Hi @gryzli133, did you update the esp8266 board files to the latest version, i.e. 2.7.4?

@gryzli133
Copy link
Contributor

Thank you @tekka07, I did some tests and it looks very good so far ;-) Do you already have a plan when will be next official release and if PJON will be included? Will PJON be also supporte by Multitransport feature?

@gioblu
Copy link
Contributor

gioblu commented Feb 18, 2021

Ciao @tekka007 any update on this? When the new version will be released?

@tekka007 tekka007 merged commit 2e00bf6 into mysensors:development Mar 20, 2021
@dgertych-monterail
Copy link

Great to see PJON support merged 🎆

@kofec
Copy link

kofec commented Mar 23, 2021

Can we have example for RS485 and PJON ?

@fabyte
Copy link

fabyte commented Mar 25, 2021

@tekka007 @gioblu So the license issue has been solved? I wonder how that went?

@tekka007
Copy link
Contributor Author

@fabyte In dev for testing & feedback. Evaluating setup using the Arduino library dependency manager (https://arduino.github.io/arduino-cli/latest/library-specification/) to link to PJON

@gryzli133
Copy link
Contributor

Hi @tekka007,

do you know when MySensors will be released with official PJON support? At the moment I'm currently running a MySensors network connected with PJON including:

  • 1x Gateway - Arduino Mega with Ethernet Shield
  • 18x Thermostat Nodes - ESP8266 with switch off WiFi (used only for OTA)
  • 21x Arduino Mega - controlling lights, blinds and contactrons

At the moment I'm facing no problem, so I would say - PJON integration is ready for community use ;-)

Many thanks for your support @tekka007 and @gioblu !

tekka007 added a commit to tekka007/MySensors that referenced this pull request Jul 25, 2022
* Add PJON transport layer

* Update PJON 13.0

* PJON transport now non-blocking, fixed polling

Co-authored-by: Giovanni Blu Mitolo <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature request: implement PJON protocol for wired communication