Home

Awesome

PJON-python

Pythonic interface to PJON communication protocol.

PJON (Github: PJON ) is an open-source, multi-master, multi-media (one-wire, two-wires, radio) communication protocol available for various platforms (Arduino/AVR, ESP8266, Teensy).

PJON is one of very few open-source implementations of multi-master communication protocols for microcontrollers.

PJON-python module in the current status enables communication with other PJON devices directly over UART (serial communication):

PJON-python module opens popular uC platforms (Arduino, ESP8266, Teensy) to the whole range of applications:

Current status:

Outstading features

PJON-python versions are aligned with PJON versions to indicate compatibility with C implementation for uC platforms.

v4 goals:

v5 goals:

Minimal client example

from pjon_python.base_client import PjonBaseSerialClient
import time

pjon_cli = PjonBaseSerialClient(1, 'COM6')
pjon_cli.start_client()


def receive_handler(payload, packet_length, packet_info):
    print "received packet from device %s with payload: %s" % (packet_info.sender_id, payload)

pjon_cli.set_receive(receive_handler)

while True:
    #             recipient id   payload
    pjon_cli.send(35,            'C123456789')  # payload can be string or an array of bytes (or any type suitable for casting to byte)
    time.sleep(1)