LoRa Chat

Decentralised LoRa based Chat firmware for ESP32 boards by Heltec (and clones)

Similar projects worth following
A decentralised PoC chat program for the Heltec ESP32 based LoRa capable boards.

Each board can become a node and join in chatting to other boards! It is an ad-hoc setup, and will work so long as you have radio line of sight to the other interlocutors!

These little boards are great! They have a fast ESP32 uC with a built in OLED and LoRa chipset for comms.

*) Add a limited re-transmission option - so nodes will retransmit messages to others, to increase the range of the potential 'mesh-net' :P
*) Add optional encryption layer
*) Maybe add some level of message trust/integrity
*) Check code doesn't have any low-hanging fruit vulns (BOF could be likely - I'm not that familiar with how secure String types are in Arduino libs)
*) Make general/cosmetic improvements
*) Support a capacitive touch keyboard or other input device...
*) Add a cool logo to start up screen (desirable)

We're making the most of the board's capabilities - we're using hte LoRa.h file by Sandeep Mistry, as well as the SSD1306.h driver for the ESP8266 (it's compatible here). This gives us an SPI interface to the LoRa chip, as well as an interface for the OLED screen. 

NB - the setup() code and header choices were taken from here:

Most of the code is actually making stuff look ok... The only processing is to check first if the LoRa stack has a packet for us, and then process it. Then we read chars from the serial port in, and assemble them with the user's Nickname.

We send the nickname with the message in the LoRa packet, so no node has to keep track of users at all - they just process data. This keeps it nicely decentralised - you wanna change your nick? Just reset the board... :P

At the moment - it's a requirement for the boards to be connected to a laptop or some other interface for sending serial data. You could easily use this code to write a wrapper for XMPP (just dump data to serial and back again, though you'd need to figure out channels) and you could integrate data from other sources over WiFi without any issues. With a bigger screen and some sort of input device, you could build IM-Me style devices, no problem - it's really easy!

LoRa is very long range, if a little slow on the data rate. In theory you could have these dotted around the place - fair warning, they don't do too well with walls or stuff getting in the way, so line-of-sight is important.


First Version - mirrored from the GitHub (check the git link for latest)

x-arduino - 3.66 kB - 10/21/2017 at 12:01


  • 1
    Install Dependencies for Board

    Arduino IDE has support for ESP32 boards, so add this using the Board Manager.

  • 2
    Install Libraries

    You will need the following libraries:

    • LoRa Library by Sandeep Mistry
    • ESP8266 oled driver for SSD1306 by Daniel Eichorn and Fabrice Weinberg
  • 3
    Compile and Upload

    It's a simple as Ctrl + U (or Ctrl + R to check first...)

View all 3 instructions

Enjoy this project?



ia wrote 10/23/2017 at 17:55 point

1) what You thing about sound modem for baofeng and increase range?

2) can You add solar panel for offgrig machine?

  Are you sure? yes | no

Mark C. wrote 10/24/2017 at 07:16 point

Re: 2) absolutely! adding a solar panel charging circuit, small LiPo batt and solar panel would make it effectively hugely portable! That's a really good idea - I'll look into it, and let me know if you give it a go!

RE: 1)  I had wondered if it would integrate into a known radio, but the protocol is quite specific for LoRa (and even more so for the LoRaWAN stack). I guess if you could get data out of the baofeng (over an SPI interface), you could use it to control the SX1278 chip?
Cheers! M.

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates