Girgitt / PJON-python

Pythonic interface to PJON communication protocol.
Other
26 stars 4 forks source link

Physical connections with PJON-python #2

Open rtarb41323 opened 7 years ago

rtarb41323 commented 7 years ago

Greetings! GREAT python library with some great examples! Is it possible, that you could show a list, or schematic, of the connections that you used to test PJON-python on a raspberry pi?

For instance, on a raspberry pi, can I use PJON-python with a single GPIO pin, or do I need to use the UART TX and RX pins?

gioblu commented 7 years ago

Ciao @rtarb41323 I am Giovanni, the creator of the PJON protocol.

SoftwareBitBang physical layer is not still implemented (as far as I know) on multitasking machines. I do think that the implementation proposed in the official repository it is not compatible with concurrency. With this I don't want to say that is impossible but that probably a porting would not work out of the box and simply a fresh codebase with a different approach could be necessary to get it work, but I am so busy I had never the chance to try it out of the box on RPI. What is possible to do, is to use a small arduino device as a router, connecting rpi to it with ThroughSerial strategy and then with another io pin (of the arduino device) instance a new PJON object with SoftwareBitBang having there on one single wire as many devices as you need!

@Girgitt seems now busy, as soon as I will have a feature complete C++ version, will keep back in hands python, fork this repo and make it compliant with the new specification and features recently specified.

Girgitt commented 7 years ago

@gioblu I did some planning to support v6 but the current level of complexity needs changing a simple port to a more python-specific implementation with a cleaner code and better design patterns for easier maintenance in the long run.

@rtarb41323 just like @gioblu mentioned - for now the easiest way to support communication with SoftwareBitBang strategy from python is to use simple arduino proxy: PJON-python talks over serial to arduino and arduino sends packets to other bus (softwareBitBang) and vice-versa.

gioblu commented 7 years ago

Ciao @Girgitt happy to hear from you. This is an amazing news!

Girgitt commented 7 years ago

As for Aug 2017 only serial strategy is implemented.

However since PJON-python in the current version wraps C++ client compiled from PJON sources (the client is maintained in a sub-project PJON-piper) if additional strategies will be implemented in C++ and made available for RPI and Windows platforms such additional communication strategies will be added to PJON-python.

Currently here are the available options to interface with embedded systems:

  1. Using el-Cheapo board like Arduino Nano: load proxy example code provided with PJON and use such proxy board as a transparent communication gateway to any of the available communication strategies. Proxy board will protect (to some extent) a more expensive PC / RPI platform from damage.
  2. Using USB-RS-485 transceiver to talk directly to many PJON drops using ThroughSerial strategy
  3. Using transparent serial-radio modules like "HC-12" to create half-duplex, multi-drop network based on ThroughSerial strategy.
  4. A mixture of any of the above options.