
Show HN: PJON v11.1 an independent, decentralized, open-source protocol - gioscarab
https://github.com/gioblu/PJON/releases/tag/11.1
======
StavrosK
I used this once to have an Arduino and an ESP8266 communicate and I love it.
I'm not great with C++, and I found the super simple implementation extremely
helpful, as I could focus on what I wanted to do rather than have to wrestle
with the protocol. The one-wire connection is similarly a boon to speed, since
I don't need to connect a bunch of stuff up, I just connect one wire and
that's it. The author was also very responsive, helping me immediately with a
bug I found.

I definitely recommend it for most use cases, if you don't need a very high
speed bus.

------
dustingetz
The wiki is a better overview –
[https://github.com/gioblu/PJON/wiki](https://github.com/gioblu/PJON/wiki)

This is an abstract network stack for raspberry pi- type devices so they can
talk to each other while sheltered from the underlying network interface
(wifi, radio, wire, light impulses, etc) and sits on top of whatever transport
protocol (UDP, TCP, Serial). By "multi-media" he means the physical layer,
"media like electricity, radio and light"

~~~
gioscarab
ciao dustin, more than "abstract" I would say "software defined" or "software
emulated". Yes, data-links are abstracted and treated by PJON "agnostically".
PJON can also use higher level protocols like UDP TCP as "data-links". I think
this, although could be considered by many as a layering violation, may be
extremely useful for building a decentralized network infrastructure while
still having the chance to hop through the internet if required

------
filar
Also check out the related ModuleInterface library
([https://github.com/fredilarsen/ModuleInterface](https://github.com/fredilarsen/ModuleInterface))
that lets devices declare their contracts for settings, outputs and inputs and
a master that synchronizes these between modules and to and from a web server
/ database.

It does data logging and storage to a database for trending and/or analysis,
as well as configuration in a web page.

It uses PJON as transport, so it can run on one or multiple of the supported
media, for example a SoftwareBitBang bus between worker devices, with a router
that connects them via UDP to a master process on Linux. Or any other
combination.

------
zaarn
PJON is a very interesting project and I've used it in the past between a RPi
and an Arduino to communicate.

Atm I'm developing my own bus protocol since PJON was having some problems
with the optocouplers I have (the line I need has almost a millisecond of lag
and doesn't allow for a frequency beyond a couple kilohertz as it needs to get
to several devices at different logic levels and has some longer lines with
higher voltages that limit response times). Surprisingly there isn't a good
bus protocol that can deal with symbolrates below 1000 per second, multi
master and really bad line conditions and long timeouts.

~~~
gioscarab
Ciao Zaarn, that is cool compliments, which sort of encoding you chose?

~~~
zaarn
Simple NRZ for both clock and data. Data integrity is provided by parity bits
in various fields and CRC32 for the payload.

I use token bus for media access control since it's fairly simple to implement
and I don't need jam detection in any components.

Token passing enables a far more simpler software for simply being a passive
client (ie, a sensor doesn't need to be able to control the bus, it only needs
to respond while someone else is controlling the bus) and the active masters
(which can cleanly pass control of the bus).

I don't mean any of this as offense to PJON either, it's an amazing protocol,
the problems I have aren't solved by any product on the market.

It's also a good engineering challenge.

~~~
gioscarab
Why not RTZ?

~~~
zaarn
NRZ is easier to do on most devices since you simply put a high on the bus to
send a one and a low on the bus to send zero, esp. if you use something like
an Attiny. Also means I can basically plug-and-play it into the i2c
connections I have setup.

------
jarvelov
I’m about to start a project where four Arduinos will be talking to each other
every other minute and also to a central server ~100 times a second and
haven’t really found a satisfactory way to handle the communication. Had been
hoping to use ZeroMQ as I have some experience with that but it looks like
there are no Arduino compatible libraries available.

However, this looks just like the thing I’ve been looking for. Serial
communication and TCP and CRC checking!

~~~
turbojerry
You could also use ROS Arduino serial library -

[http://wiki.ros.org/rosserial_arduino/Tutorials](http://wiki.ros.org/rosserial_arduino/Tutorials)

~~~
jarvelov
Thanks for the suggestion! I’ll check it out.

------
dozzie
_Protocol_ cannot be _open source_. It can have a full specification
published. A protocol does not have a source code, it's something that its
_implementation_ can have.

Also, what the heck does it do? Neither README nor title says anything about
that. The closest thing to such description is mentioning that it "supports
multimedia", whatever that means.

~~~
gioscarab
Ciao dozzie, I have omitted "implementation" from the title because I thought
that was obvious enough. It seems not.

The project proposes both an independent research in defining a specification,
and also an open-source implementation based on that specification.

If you want to know what it does, read the specifications or at least the
first sentences of the README :)

"PJON® (Padded Jittering Operative Network) is an Arduino compatible, multi-
master, multi-media network protocol. It proposes a Standard, it is designed
as a framework and implements a totally software emulated network protocol
stack that can be easily cross-compiled on many architectures like ATtiny,
ATmega, ESP8266, ESP32, STM32, Teensy, Raspberry Pi, Linux, Windows x86 and
Apple machines. It is a valid tool to quickly and comprehensibly build a
network of devices. Visit wiki and documentation to know more about the PJON
Standard."

~~~
dozzie
> Ciao dozzie, I have omitted "implementation" from the title because I
> thought that was obvious enough. It seems not.

Keep the proper terminology. If you omit words left and right, it becomes
incomprehensible garbage.

> If you want to know what it does, read the specifications

The whole point of README is to say what it does so I don't need to read
specification that will be useless to me.

> or at least the first sentences of the README :)

I read it. The wall of words you cited says _nothing_ about what it does and
what purpose it serves.

~~~
gioscarab
"... is an Arduino compatible, multi-master, multi-media network protocol. It
proposes a Standard, it is designed as a framework and implements a totally
software emulated network protocol stack that can be easily cross-compiled on
many architectures like ATtiny, ATmega, ESP8266, ESP32, STM32, Teensy,
Raspberry Pi, Linux. It is a valid tool to quickly and comprehensibly build a
network of devices". If this is a wall of words that says nothing about what
the project is for, we are not from the same universe. And also, I don't think
an omitted word in a title that must be short will make all the project an
incomprehensible garbage, considering the amount of time and effort has been
invested in docs and specs.

