9 ms·
How we made the PJON network protocol from scratch
- gioscarab 6y agoMore info here: https://github.com/gioblu/PJON https://github.com/gioblu/PJON
- jdaandersj 6y agoVery interesting! I enjoyed testing PJON with 2km of twisted pair cable for my university project: https://jda.tel/pdf/lanc_video_camera_control.pdf https://jda.tel/pdf/lanc_video_camera_control.pdf
- jlgaddis 6y agoGiovanni, Can you highlight some "real world" use cases where PJON is/was used? I'm curious what folks have used PJON for, especially over RF (excluding Wi-Fi), such as the "video camera control" project in another comment.
- gioscarab 6y agoCiao jlgaddis Jack in Video Camera Control used PJON over PJDL which is a wired data link that needs only ground and a data cable to connect up to 255 devices, cables can be up to 2km long at the slowest baudrate (1.97kB/s - 15808Bd). PJDL in few words is a sort of open 1-Wire with a longer range, support for more devices and a stronger immunity to noise. See: https://github.com/gioblu/PJON/blob/master/src/strategies/SoftwareBitBang/specification/PJDL-specification-v5.0.md https://github.com/gioblu/PJON/blob/master/src/strategies/So... The core of the community uses PJON over PJDL in home automation systems, irrigation systems, feeding systems ecc. Soon Mysensors will include PJON over PJDL in their list of supported transports. PJON works also over TCP, UDP, MQTT, ESPNOW, LoRa ecc. so generally a router is built and programmed to run 2 instances of PJON for example PJDL and MQTT, to then route data to and from a process running on a real-time operative system See: https://github.com/gioblu/PJON/blob/master/examples/routing/ARDUINO/Network/Router/Router/Router.ino https://github.com/gioblu/PJON/blob/master/examples/routing/... which can also run PJON thanks to the wide support of the implementation. See: https://github.com/gioblu/PJON/wiki https://github.com/gioblu/PJON/wiki Looks to be handy for many to connect devices, even on different media. Although many also use PJON to implement mesh or peer-to-peer networks, there is a group in Australia building such a network using PJON over LoRa. I must say I hope we will be able to start building a private network infrastructure with it, that would be awesome. Companies and institutions are also implementing PJON within their products and services. AD24, a Czech company, recently created a mesh network over PJON to connect advertising monitors around the city of Prague. It looks there are also few companies in Germany which use PJON to create real world automation systems. Recently contacted by the Universitat Politècnica de València (UPV) to support the development of a PJON network of temperature and humidity sensors to monitor the vault of the Cathedral of Valencia and avoid its decay, I hope this will end up done, it would be really rewarding.
- jlgaddis 6y agoI appreciate your in-depth response as well as the replies from the others as well. Before asking. I did spend perhaps 15-20 minutes exploring the web site and Git repo. I found the "how?" and "why?" but I was having trouble coming up with valid, "real world" use cases for PJON and wasn't finding a lot of examples. I was impressed by all of the (minimal) hardware and mediums/transports that could be used -- I just couldn't think of what to actually do with it! I've just recently started to become interested in "home automation", though -- mostly because I'm a geek and, as I looked around, I realized that there's so much data that I could be gathering and things that I could be controlling and/or interacting with or, at the least, monitoring. Knowing what others are using PJON for is enlightening, however, and is giving me ideas and inspiration. Hopefully I'll think things through and come up with a real plan before I go on a shopping spree and end up with even more piles of electronics laying around! Thanks again -- to you and the others -- for taking the time to enlighten me! (On a side note, I sincerely feel that it's a shame that your "Show HN" got flagged and I apologize on behalf of HN. I can only say that, like anything else, it isn't perfect and odd things can happen at times. At the least, though, your submission was successful in making PJON more widely known!)
- jdaandersj 6y agoThe main thing that originally sparked my interest in PJDL was multi master, which is clearly a massive advantage over 1-wire
- gioscarab 6y agoYes Jack is right, another massive advantage is that with PJDL devices can arbitrarily transmit data safely, enabling new ways of building things, for example sensors and actuators can communicate directly with each other without a master in the middle.
- gryzli133 6y agoI use PJON in combination with MYSENSORS in my smart home system. It is the first wired protocol that works so stable and don't even need extra hardware - just one free IO pin. I have over 200 smart sensors and devices around my house. PJON was a perfect solution for all problems I was facing with wired and wireless communication for DIY smart home solutions. With some luck PJON will be officially supported by MySensors already from next release - beta test are already done. I think this will make PJON more common.
- filar 6y agoI have used PJON, with the SWBB and DUDP strategies, for my home automation setup for at least 4 years. I do not need the kilometer range of SWBB, but have stretches of tens of meters running alongside 220V AC wires with no problems, in both star and daisy-chained topologies. The system is very stable, and I would like to point out that the alternatives I looked at before required me to buy extra hardware/shields that cost more than the Arduinos themselves to get going. With PJON it is just connecting to the pins in the most inexpensive way. This plus multimaster, the strength against interference, the long cable lengths and few topology limitations makes it a clear choice for many purposes. Plus, it is free :-)
- SV_BubbleTime 6y agoSo he remade CAN without requiring a specific physical layer? This jumps around a bit between the transport and phy a bit, I guess I didn’t really get where the special sauce is. I also never saw a kbps number. There is potential I would have use for such a thing I guess. Although LIN works pretty well over 1wire and is built in to most UARTs now. It makes me cautious when I read these things and don’t see specific talk about what hardware module is expected to do the work. Yea, they got two wire twisted pair distance, is that using a specific transceiver? Does that hook to a USART or CCP or SPI? It sounded async because of the longer bits as start of frame, but bit banging and capture/compare kinda sucks.... IDK maybe it addresses this all and I missed it. What I didn’t miss is he is selling a book at the end.
- gioscarab 6y agoHere you can find the implementation of PJDL used by Jack Anderson to determine the maximum range: https://github.com/gioblu/PJON/tree/master/src/strategies/SoftwareBitBang https://github.com/gioblu/PJON/tree/master/src/strategies/So... All devices listed in the compatibility section are able to communicate over a twisted pair with no additional hardware, as Fred well noted, you just need one wire and connect directly the IO pins. And up to 255 devices can share the same twisted pair. As you can read in Video Camera Control Jack just used two arduinos, 2km of wiring within his university's network and a couple of pull-down resistors. The protocol works even when the human body is used as a conductor as shows the gif present in the article. On social compare someone made this: https://socialcompare.com/en/comparison/comparison-of-network-buses https://socialcompare.com/en/comparison/comparison-of-networ... I think the comparison between PJON and LIN there is revealing. As you can see LIN handles up to 16 devices, it is master-slave and has a range of 40, with a complex front-end at a relatively high voltage. PJON is free for use, it is all open-source. We do sell products to fund the development of the project.
- SV_BubbleTime 6y agoThanks, that helps. I had to check quick at a gas station and post this. For the most part, I took away 27kbps, and it seems the intention is software bit bang. Sure, it’s not master/slave like LIN, and with an arbitration scheme more like CAN. But, without hardware codec, DMA buffering and interrupts, I feel it’s a lot less useful to me as my embedded projects are already pushing their limits with hardware communication. Still, while it’s not good for me, I do see utility in a bit bang format for LED, IR, simple RF, etc. This makes sense and seems well thought out.
- gryzli133 6y agoI use PJON in combination with MYSENSORS in my smart home system. . It is the first wired protocol that works so stable and don't even need extra hardware - just one free IO pin. I have over 200 smart sensors and devices around my house. PJON was a perfect solution for all problems I was facing with wired and wireless communication for DIY smart home solutions. With some luck PJON will be officially supported by MySensors already from next release - beta test are already done. I think this will make PJON more common.
- jmnicolas 6y ago> over 200 smart sensors and devices around my house I need to know!
- slaymaker1907 6y agoImpressive work! The first programming class I took had us implement communication using IR LEDs between Arduinos as a final project. It's a more difficult problem than it seems at first because of all the constraints. The Arudino Uno only has 2K RAM which means you need to be very conservative with buffers. Additionally, you usually want the RNG for the two nodes to be different which means you can't just use the time to seed it and need to look for other sources of entropy like reading the voltage on an open port.
- BoldAndBald 6y agoI use PJON as communications protocol in my self build smart home controlling lights, door bells motions sensors. Fantastic work and fabulous support from the team.
- vt_rack 6y agoI had a constraint of having to use existing unshielded and untwisted wires in parallel to 220V mains wiring. Basically I'm doing DIY thermostats for floor heating and only 4 copper conductors were available. Stumbled on PJON with Softwarebitbang and it seemed to fit the bill, although they do recommend twisted and/or shielded cabling. With no background in hardware and Arduino there was a lot of learning to do, but in the end I'm really happy that it's been working flawlessly for a few months now and one copper conductor is even unused. Don't have an oscilloscope so no idea how "ideal" the situation is on the wire with regards to electrical interference, but for anyone interested, it's running in a star topology with wire lengths about 20 metres on, with ESP32's as the microcontrollers. edit: thanks for PJON, gioscarab!
- gioscarab 6y agoThank you for your feedback, happy to know it helps :)
- capableweb 6y agoIt's beyond suspicious that 4 newly created users all have positive experience with PJON and only posted on this submission. - https://news.ycombinator.com/threads?id=vt_rack https://news.ycombinator.com/threads?id=vt_rack - https://news.ycombinator.com/threads?id=jdaandersj https://news.ycombinator.com/threads?id=jdaandersj - https://news.ycombinator.com/threads?id=gryzli133 https://news.ycombinator.com/threads?id=gryzli133 - https://news.ycombinator.com/threads?id=BoldAndBald https://news.ycombinator.com/threads?id=BoldAndBald I wonder if there are other similar submissions that also "creates more accounts" than usual and why that is.
- shash7 6y agoAll created between a 8 hour range. Definitely something fishy going on.
- vt_rack 6y agoI guess there is no way to prove it either way (option A: bunch of shills or option B: honest feedback) Mine is a throwaway account for privacy reasons, because I don't want details about my home to be linked to any other bit of information online.
- dang 6y agoProbably just a bunch of users trying to help out and not realizing it would backfire.
- filar 6y agoI have been here a lot longer than that, and I do recognize some of these comments coming from long-time PJON users parttaking in the PJON gitter channel, asking for advice from other users, asking for new features, etc. What is wrong with users of an open-source library commenting on the library? Who is better qualified to comment, and what is to be gained -- it is open source, free for all?
- jdaandersj 6y agoI am the author of the report I linked in another comment, if you care to verify please visit the website linked from the report and use the email address there to contact me. Hopefully the size and detail of the report will show I am genuine.