PJON

gioblu更新放缓

兼容 Arduino 的多主多介质网络协议,让单片机、ESP32、树莓派等设备通过 LoRa、MQTT 等介质组网通信。

PJON (Padded Jittering Operative Network) is an experimental, arduino-compatible, multi-master, multi-media network protocol.

13.1发布于 2022-02-10 21:49 UTC2,836star243fork同步于 2026-11-07 07:29 UTC

怎么上手

由 README 提炼,执行前请确认
README 未给出安装命令,请参考 documentation/README.md 与 specification/PJON-protocol-specification-v4.0.md
硬件要求按 README 说明

README 未说明显存或 GPU 要求;面向 ATtiny、ATmega、SAMD、ESP8266、ESP32、STM32、Teensy、树莓派及 Linux、Windows x86、Apple、Android 等平台,无需额外硬件即可运行。

下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

由 README 自动翻译提炼

实验性多主多介质网络协议,让单片机用软件定义方式组网通信

兼容 Arduino 的多主多介质网络协议,让单片机、ESP32、树莓派等设备通过 LoRa、MQTT 等介质组网通信。

核心能力

  • 用策略抽象层支持单线、串口、RS485、LoRa、UDP、TCP、MQTT 等多种介质
  • 支持多主通信与热插拔,增删设备无需重启系统
  • 模块化数据包仅含所需字段,开销 5–35 字节
  • 用 CRC8 与 CRC32 多项式做错误检测,可选确认与 MAC 地址
  • 通过接口抽象层可交叉编译到 ATtiny、ESP32、STM32、Linux 等平台

容易踩的坑

项目自述为实验性协议,README 明确提示按现状提供、使用风险自负;SoftwareBitBang 等总线测试需遵循抗干扰与保护电路指南;OverSampling、ThroughSerial、ThroughLoRa 无线电测试前需确认频率与功率符合当地法规。

内容由模型根据 README 生成,可能不完整或不准确,以官方文档为准。看原文 README

最近发版

5 个版本13.1
  1. 13.113.1 stable最新正式版2022-02-10 · 2022-02-10 21:49 UTC

    Changelog:

    Bugfix:

    Backward compatibility is preserved.

  2. 13.013.0 stable2020-11-10 · 2020-11-10 22:09 UTC
    查看更新说明

    New specifications:

    • PJON v4.0 includes the hardware identification, the hop count and deprecates the asynchronous acknowledgement
    • PJDL v5.0 includes a coherent specification of timing and tolerance of each mode, a new preamble able to reduce retransmissions and specifies the timeout to be derived from the length of the frame instead of requiring a common static configuration
    • TSDL v3.0 includes a more reliable acknowledgement exchange

    Changelog:

    • Sender's and recipient's MAC address can be optionally included and used for addressing
    • The hop count is included in shared mode to enable more advanced routing schemes
    • The library can now be included and used more easily, see configuration
    • SoftwareBitBang implements PJDL v5.0
    • SoftwareBitBang full support for STM32F103/BluePill added by @jcallano
    • ThroughSerial implements TSDL v3.0 and receives data asynchronously
    • Zephyr support and examples by @Cimex97
    • Routing improvements and examples by @fredilarsen
    • The LINUX interface now uses termios2 for generic baudrate support by @callalilychen
    • The LINUX interface delayMicroseconds now uses select to reduce the CPU usage by @Girgitt
    • ESPNOW can use MAC addresses directly by @porkyneal
    • Send functions can now receive a PJON_Packet_Info, see documentation
    • The asynchronous acknowledgement has been removed
    • Bus id getter and setter added

    Bugfix:

    This version is not backward compatible! If you need help see update from 12.x to 13.0

  3. 12.112.1 stable2020-03-19 · 2020-03-19 16:12 UTC
    查看更新说明

    New specifications:

    • PJDL v4.1 includes the maximum range of each mode experimentally determined by @jdaandersj
    • PJON v3.2 is updated with more detailed description of the model and its procedures

    Changelog:

    • PJONLocal class implements a subset of the PJON protocol's features and it was developed to enable PJON networking on very limited microcontrollers, where even few bytes of ram can make a difference
    • MQTTTranslate strategy can connect PJON networks and more standard applications with each other using MQTT, developed by @fredilarsen
    • SoftwareBitBang maximum range is 800-2000m, experimentally determined by @jdaandersj
    • SoftwareBitBang ATmega328PB support added by @Willie68 (#309)
    • PJONVirtualBusRouter detection of missing/moved devices added by @fredilarsen
    • ESPNOW PlatformIO examples added by @justoke
    • Enhanced routing documentation

    Bugfix:

    Backward compatibility is preserved.

  4. 12.012.0 stable2019-10-25 · 2019-10-25 16:04 UTC
    查看更新说明

    New specifications:

    • PJDL v4.0 includes the response initializer to avoid a set of vulnerabilities in multi-master mode
    • PJDLR v3.0 is now able to keep the medium busy in between an exchange and includes the response initializer to avoid a set of vulnerabilities in multi-master mode

    Changelog:

    • The Dynamic addressing feature has been moved in the OSPREY repository because of development ease
    • SoftwareBitBang now implements PJDL v4.0 and it is more secure if used in multi-master mode
    • OverSampling now implements PJDLR v3.0, it is more secure and it supports multi-master mode without requiring a common configuration for all devices
    • LocalFile strategy uses a file present on the hard drive to let multiple processes communicate on the same machine, can be used for inter-process communication, simulation, test applications and networks on a real time operative system. Developed by @DetAtHome and @fredilarsen
    • ThroughLoRa does not support anymore the synchronous acknowledgement and retransmission because of the inherent limitations of LoRa (ALOHA) and its usage policy
    • InteractiveRouter synchronous acknowledgement transmission added (https://github.com/gioblu/PJON/issues/292) proposed by @chestwood96
    • SoftwareBitBang SAMD21 (Arduino Zero) supported pins added and timing optimized
    • Early support for Android added by @gnomathibus
    • Added support for STM32-duino installed via boards.json by @chestwood96
    • Optional separation of functions declarations for linux interface by @mattze96
    • PJON data buffer was of type char now changed in uint8_t
    • PJON send functions payload parameter is now of type const void *
    • Strategy send_string and receive_string method names changed to send_frame and receive_frame
    • Security policy added

    Bugfix:

    If you want to know more and support PJON see the PJON protocol handbook and the PJON 12.0 big box.

    This version is not backward compatible!

  5. 11.22019-01-22 · 2019-01-22 04:55 UTC
    查看更新说明

    New specifications:

    • PJON Protocol specification v3.1 simplifies the model, and more clearly specifies the encoding
    • PJDL v3.0 more clearly specifies the medium access method and the communication modes
    • TSDL v2.1 more clearly describes the medium access method and the limits of multi-master mode

    Changelog:

    Bugfix:

    If your setup using W5x00 Ethernet shield and UDP freezes after an undetermined amount of time, it is affected by a bug present in the Ethernet library isolated and fixed by fred here.

    Backward compatibility is preserved.

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    PJON 13.1

    PJON (Padded Jittering Operative Network) is an experimental, multi-master, software-defined network protocol that can be easily cross-compiled for many microcontrollers and real-time operating systems such as ATtiny, ATmega, SAMD, ESP8266, ESP32, STM32, Teensy, Raspberry Pi, Zephyr, Linux, Windows x86, Apple, and Android. PJON operates over a wide range of media, data links, and existing protocols like PJDL, PJDLR, PJDLS, Serial, RS485, USB, ASK/FSK, LoRa, UDP, TCP, MQTT, and ESPNOW. For more information, visit the documentation, the specification, or the wiki.

    Join the chat at https://gitter.im/gioblu/PJON

    Why PJON?

    • New technology: PJON is an experimental network protocol stack crafted through 10 years of research and experimentation. It was originally developed as an open-source alternative to i2c and 1-Wire, but during development, its scope and features were extended to cover use cases where IP is generally applied. PJON has been engineered to have a variable footprint (4.2–8.2 kB program memory) and overhead (5–35 bytes per packet) depending on its configuration.
    • Multi-media support: PJON operates over a wide range of protocols including TCP, UDP, MQTT, ESPNOW, USB, Serial, RS485, and LoRa. The PJON network protocol stack also specifies and implements PJDL that operates over a single wire of up to 2000m shared by up to 255 devices, PJDLR that operates with many ASK/FSK/OOK radio modules and PJDLS that operates wirelessly with light pulses using off-the-shelf LEDs and laser diodes.
    • Increased reliability: Many widely applied protocols expose significant vulnerabilities, have weak error detection algorithms, and are not resilient to interference. PJON is based on years of analysis and study to avoid the mistakes present in most alternatives and provide with a simpler and more efficient solution.
    • High flexibility: PJON is fully software-defined and designed to be easily extensible. It builds out-of-the-box on all supported devices and operates transparently on top of any supported protocol or medium.
    • Low cost: With no additional hardware needed to operate, minimal network wiring requirements, and direct pin-to-pin or LED-to-LED communication, PJON is extremely energy-efficient, inexpensive to implement, and maintain. This experimental reference implementation is kept up to date thanks to the strong commitment of its growing community.

    Features

    • Cross-compilation support with the interfaces system calls abstraction.
    • Multi-media support with the strategies data link layer abstraction.
    • Modular packet format that includes only the fields used (overhead 5–35 bytes).
    • Hot-swap support, no need for a system reset or shutdown when replacing or adding devices.
    • Flexible local (device ID) and shared (bus ID) network identification.
    • Safe error detection using modern CRC8 and CRC32 polynomials.
    • Optional inclusion of MAC addresses.
    • Optional acknowledgement.
    • Error handling.

    Academic studies

    Researchers are active in many universities worldwide using PJON in different environments. The following list contains known published academic studies about PJON:

    Contribute

    Feel free to send a pull request sharing something you have made that could help, if you want to support this project you can also try to solve an issue. Thanks to support, expertise, kindness and talent of the following contributors, the protocol's documentation, specification and implementation have been strongly tested, enhanced and verified:

    Fred Larsen, Zbigniew Zasieczny, Matheus Garbelini, sticilface, Felix Barbalet, Oleh Halitskiy, fotosettore, fabpolli, Adrian Sławiński, Osman Selçuk Aktepe, Jorgen-VikingGod, drtrigon, Endre Karlson, Wilfried Klaas, budaics, ibantxo, gonnavis, maxidroms83, Evgeny Dontsov, zcattacz, Valerii Koval, Ivan Kravets, Esben Soeltoft, Alex Grishin, Andrew Grande, Michael Teeww, Paolo Paolucci, per1234, Santiago Castro, pacproduct, elusive-code, Emanuele Iannone, Christian Pointner, Fabian Gärtner, Mauro Mombelli, Remo Kallio, hyndruide, sigmaeo, filogranaf, Maximiliano Duarte, Viktor Szépe, Shachar Limor, Pantovich, Mauro Zancarlin, Franketto, jzobac, DanRoad, fcastrovilli, Andrei Volkau, maniekq, DetAtHome, Michael Branson, chestwood96, Mattze96, Steven Bense, Jack Anderson, callalilychen, Julio Aguirre, Cimex97, der-schne, porkyneal, der-schne, Rainer Schoenberger, jgOhYeah and kuchendieb.

    Compliant tools

    • ModuleInterface - easy config and value sync between IoT modules by Fred Larsen
    • PJON-cython - cython PJON wrapper by xlfe github user
    • PJON-piper - command line wrapper by Zbigniew Zasieczny
    • PJON-python - python interface by Zbigniew Zasieczny
    • PJON-gRPC - gRPC server-client by Oleh Halytskyi
    • PjonHL - PjonHL is a highlevel wrapper around PJON

    License

    All the software included in this project is experimental and it is distributed "AS IS" without any warranty, use it at your own risk. Licensed under the Apache License, Version 2.0.

    Safety warning

    When testing PJON, take extreme care to avoid any danger. The implementation is experimental and may not behave as expected; use it at your own risk. If devices are connected to AC power, you face a high risk of electrocution unless the hardware is installed carefully and correctly. If you lack sufficient experience, seek assistance from a qualified technician, and be aware that many countries prohibit uncertified installations. When testing a SoftwareBitBang bus follow interference-mitigation and protective-circuitry guidelines. When experimenting with an AnalogSampling setup, wear safety glasses and operate transceivers cautiously to prevent eye injuries. Before testing OverSampling, ThroughSerial or ThroughLoRa radio communication, ensure that the frequency, power, and hardware comply with local regulations. When connecting a local bus to the Internet, treat all devices as potentially compromised, manipulated, or remotely actuated against your will. As a best practice, avoid connecting to the internet systems that could cause damage (fire, flood, data leakage) if hacked.