LoRa Mesh Radio

Download as pdf or txt
Download as pdf or txt
You are on page 1of 13

instructables

LoRa Mesh Radio

by sqij

This is a fairly simple add-on for mobile phones to enable SMS-like messaging in a group when outside cell
coverage, or in disaster scenarios. It utilises Semtech LoRa radios, for low-power/long-range communications. There
are a lo t of hardware options, and I am still trying di erent devices and manufacturers, but for now this tutorial
will show how to assemble and setup one of the following boards:

TTGO ESP32 Lora with OLED


Adafruit Feather M0 RFM96

Supplies:

The hardware can be purchased here:

TTGO ESP32 Lora with OLED . -OR-


Adafruit Feather M0 RFM95

Optional items, but recommended are:

small on/o switch


Piezo buzzer
small 1S Lipo battery
USB OTG cable

LoRa Mesh Radio: Page 1


Step 1: TTGO ESP32 Setup

This board is quite nice in that it includes a nice OLED screen and Bluetooth radio. Unfortunately, the LoRa radio is
not as good as the Feather, and only seems to get about half the range.

With this board you can choose whether to connect to handset via UDB OTG cable, Bluetooth Classic or Bluetooth
LE. You simply ash the board with the appropriate rmware image (there are three di erent rmware binaries for
each connection type).

St e ps :

ash the board with the Ripple rmware image: Follow ReadMe on GitHub
wire up battery and switch
wire up the piezo buzzer: TTGO V2 -> to GND and Pin 13, other boards -> to GND and Pin 25
optional: 3D print the case

I have also designed a 3D-printable case for this, which you can download from here:
https://www.thingiverse.com/thing:3865750

Step 2: Adafruit Feather Setup

These boards are nice quality, but a bit more expensive. There is a bit more involved with these, as you need to do
some more soldering to install a LoRa antenna.

St e ps :

ash the board with the Ripple rmware: Follow ReadMe on GitHub
wire up the piezo buzzer to GND and digital pin 11 . (EDIT: NOT pin 13 as previously stated)
solder a u. antenna connector to underside, connect antenna to u.
Optional: 3D print the case. See here for the les: https://www.thingiverse.com/thing:3879020

LoRa Mesh Radio: Page 2


( O pt io na l) S o lde ring t he D ipo le Ant e nna

The 3D printable case is designed for use with this dipole antenna: https://www.banggood.com/T-Type-900MHz-
Long-Range-Receiver-Antenna-IPEX-4-for-FrSky-R9-Mini-R9-MM-p-1361029.html

It's a good antenna, but doesn't have the right connector, so you need to cut IPEX4 one o , then separate the coax
braids and solder to the antenna ground pads (see end pic above). To do this, you need to strip about 10mm of the
outer plastic o the end of the cable, then separate the very ne surrounding coax wire mesh then put some solder
onto this. Then remove about 1mm of the plastic from the inner active wire and put a small amount of solder on
this.

Next, pre-tin the antenna ground pads on the Feather, and the active antenna pad in the middle, then solder the
antenna to these pads (separated coax to ground pads, active inner wire to antenna pad).

Step 3: Setup the Ripple Messenger App

LoRa Mesh Radio: Page 3


The companion app for this is called Ripple is connected.
Messenger. Currently there is only an Android version,
which you can download from the Play store: Ripple For Bluetooth Classic, you need to make sure
Messenger bluetooth is on and you need to Pair your
handset/tablet with the board manually. Go to
Each person in your group must be allocated a unique Bluetooth setting, and select scan/refresh and tap on
numerical ID, between 1 and 254. You need to sort this 'Ripple Device' when it comes up. Go back to the
out among yourselves. There's no central server for Ripple app then tap the 'Choose Device' button and
coordinating. select 'Ripple Device' from the list.

You can also (optionally) organise into sub-groups by For Bluetooth LE you shouldn't need to pair. Just
assigning yourselves with di erent Group-IDs (again, make sure you select 'Ripple Service' in the 'Choose
between 1 and 254). By default you can all just stay in Device' screen.
group zero. The groups are like 'channels', and will
form separate mesh networks. Co nv e rs a t io ns

Adding Frie nds From the main screen you just tap on the friend you
want to chat with, which transitions to the
Once you have entered your own details in the Setup conversation screen (as pictured above). The action
screen and selected SAVE, you can then be added as a bar will show their name, and to the right is a signal
Friend to other user's handsets by scanning each indicator which will show whether that user's device is
other's QR codes. This exchanges public keys so you currently reachable, and how strong the nearest
can send messages to each other privately. Other signal is.
devices in your group will silently relay your messages,
but cannot 'open' them up. Just type messages, or tap on the 'pin' icon to the left
of the text box to send your current location.
Co nne ct ing Ra dio
When other users send their location you will see it
The radio board can be connected to the underlined, and with a calculation of how far away
tablet/handset either via USB OTG cable, or via they are and at roughly which compass heading. You
Bluetooth. You must set your preference for this by can tap on the link to see the location on Google
selecting the 'Preferences' menu from the top action Maps.
bar. There is an icon on the top action bar which will
go solid white when it has detected your radio board

LoRa Mesh Radio: Page 4


Step 4: Feedback

LoRa Mesh Radio: Page 5


This is just something I have done as a hobby, and regards,
because I enjoy this kind of work. It has been an
interesting challenge, and is ongoing. Scott Powell.

I'm still looking for better radio modules and


hardware combinations, along with 3D printing
designs to make it more like a consumer device.
Do na t e
There are likely still a number of bugs to iron out. Let If you nd this project useful and feel like throwing
me know if this has worked for you, or if you some Bitcoin my way, I'd be really grateful: My BTC
encounter problems. The feedback is very welcome. address: 1CspaTKKXZynVUviXQPrppGm45nBaAygmS

Enjoy!
Hello. BTW Grate Project I enjoy using this across all my smartphones. I do Have a question. Im
trying to add a pizo buzzer to this to let me know I have a message. However When connecting pin
25 and GND the buzzer is always on. Is this supposed to be always on? Idk how to correct this
because the sorce code is not available to view. Or is their something in the ripple app that can
alert me if I recive a new message. Thanks for your time.
Hi,
If you are using the V2 TTGO LoRa board, then you need to attach buzzer to pin 13. For the older
boards, and the Heltech ones, is still pin 25. Sorry for the confusion.
Thank you. And Good work BTW
Hey sqij a very great project, I'm very impressed, I want to ask how the form of this project series?

I want to make sure i understand the way this project works,


A board like the Feather with LoRa radio integrated is connect to a phone via bluetooth or cable
and the combination of the phones "Ripple application" and the LoRa radio gives a means to send
a measage with the users GPS coordinates when cell service is not available?
Who is the message going to, does it reach anyone in my phone contact that is in range of the
radio, or do i need to contact people through the "Ripple" app and they must also have a LoRa
radio of some sorts listening on the same frequency?
Yes, it's like a private network, where each user has their own handset and LoRa radio module.
The Ripple app has its own 'contacts' list. You just scan other user's details from the app on their
handset, to get their id and public key (for encryption).
Can you explain more about where to put the bin files and how to flash the firmware? I have the
board working in arduino ide (TTGO LoRa32-OLED v1) and can upload scripts, but there seems to
be more prerequisites than specified. Looking at your command lines I gathered you need to have
esptools and espressif arduino-esp32 (which is not required for arduino ide to support this board)
and followed the instructions here https://github.com/espressif/arduino-
esp32/blob/master/docs/arduino-ide/windows.md.
But I still can't get past the first command line as I'm getting this error:
esptool write_flash: error: argument : Must be pairs of an address and the binary filename to write
there
You can put the bin files wherever you like on your local machine. When you open the command
line (Terminal on OSX, or Command on Windows) make sure you change to this directory first.
See this article on how to add Esp32 support to Arduino: https://randomnerdtutorials.com/installing-
the-esp32-board-in-arduino-ide-windows-instructions/
Hey dude, i just upload an example to the board and saw that it's not a 3 steps line in the github
instructions. ITS JUST ONE LINE!!!!!!!!! check:
LoRa Mesh Radio: Page 6
It may have been a result of not being able to post the command line instruction as per what you
would see using cmd / Windows into the Instructables web page, it took me sometime to figure it
out - suggest going to the Github page for the tool:
https://github.com/espressif/esptool
Hey! i'm having the same issue, did you resolve it?

Found a solution:
The adafruit Feather M0 LoRa needs to be in "bootloader mode"
you need to push 2 times the reset button in the board, the led will be in pulsing mode
and the you can run the bossac line to write the firmware. :-D
i've check this because my 2nd board write without problems so i suppose that the bootloader was
in use or not available.
-----------------------------------------------------------------
Hi!
I'm stuck and i need your help or just point me in the right direction :-/
i'm on windows, so i will resume my steps:
>>board: Feather M0 LoRa
>download arduino IDE
>use the adafruit github json to install the SAMD and Feather board into arduino ide manager
(and also check if bossac its installed at the end of this process)
>test the board with the led sketch (it works)
>unplug and plug it back
>download your github firmwares, extract it and paste it @ the bossac folder
>COM11
>so now from %appdata%\Local\Arduino15\packages\arduino\tools\bossac\1.7.0-arduino3:
run : bossac.exe -i -d --port=COM11 true -i -e -w -v Ripple-USB.Feather_m0.bin -R
Set Binary mode
Set auto-baud

and get stuck here, the console don't do anything else.

thanks in advance!

Hello! I am trying to flash my LoRA TTGOv2 for BLE using windows. I have installed all requisite
things so I can upload sketches from the Arduino application. I downloaded the ".bin"s, plugged in
the board via USB, and from the command line, I entered (from the readme file, but with the paths
changed for windows)

“C:\Users\CBs\Documents\Arduino\hardware\espressif\esp32\tools\esptool” --chip esp32 --port


\dev\cu.SLAB_USBtoUART --baud 921600 --before default_reset --after hard_reset write_flash -z -
-flash_mode dio --flash_freq 80m --flash_size detect 0xe000
“C:\Users\CBs\Documents\Arduino\hardware\espressif\esp32\tools\partitions\boot_app0.bin”
0x1000
“C:\Users\CBs\Documents\Arduino\hardware\espressif\esp32\tools\sdk\bin\bootloader_dio_80m.bin”
LoRa Mesh Radio: Page 7
0x10000 C:\Users\CBs\Downloads\Ripple-BLE.TTGOV2.bin 0x8000
C:\Users\CBs\Downloads\Ripple-BLE.TTGOV2.partitions.bin

And I got the error:


esptool.py v2.1
Traceback (most recent call last):
File "esptool.py", line 2524, in <module>
File "esptool.py", line 2517, in _main
File "esptool.py", line 2246, in main
File "esptool.py", line 177, in __init__
File "site-packages\serial\__init__.py", line 88, in serial_for_url
File "site-packages\serial\serialwin32.py", line 62, in open
serial.serialutil.SerialException: could not open port '\\dev\\cu.SLAB_USBtoUART':
WindowsError(3, 'The system cannot find the path specified.')
Failed to execute script esptool

I'm clueless as to what to try next. Any guidance would be appreciated!


On Windows you would typically be specifying a COM port, like "--port COM7"

Hello Scott, and thank you for your help. I replaced the "--port \dev\cu.SLAB_USBtoUART" with "--
port COM3", and I was able to upload something to the LoRa boards using your help. This was the
output:
--
esptool.py v2.1
Connecting....
Chip is ESP32D0WDQ6 (revision 1)
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 921600
Changed.
Configuring flash size...
Auto-detected Flash size: 4MB
Compressed 8192 bytes to 47...
Wrote 8192 bytes (47 compressed) at 0x0000e000 in 0.0 seconds (effective 7281.7 kbit/s)...
Hash of data verified.
Compressed 12304 bytes to 8126...
Wrote 12304 bytes (8126 compressed) at 0x00001000 in 0.1 seconds (effective 984.3 kbit/s)...
Hash of data verified.
Compressed 1011824 bytes to 568476...
Wrote 1011824 bytes (568476 compressed) at 0x00010000 in 12.5 seconds (effective 650.1
kbit/s)...
Hash of data verified.
Compressed 3072 bytes to 128...
Wrote 3072 bytes (128 compressed) at 0x00008000 in 0.0 seconds (effective 1755.4 kbit/s)...
Hash of data verified.
Leaving...
Hard resetting...

--
Looks good to me, however, there seem to be a few issues that I can't figure out still.
First of all, there is nothing displayed on the OLED screen. This is not normal, right?
I was able to connect to a bluetooth device, but on the Ripple App, the bluetooth symbol does not

LoRa Mesh Radio: Page 8


turn white. This is another sign of trouble, right?
After creating two IDs in the same group, sharing their keys, and attempting to send a simple text,
a message at the bottom of the screen says "unable to send message"
Thanks again for your help, and I think this is a very cool project.
Try flashing the Bluethooth Classic firmware instead. There are still problems with the BLE code,
unfortunately. For Classic, you need to do the pairing first, then go to Preferences screen and do
CHOOSE DEVICE. Also, make sure only ONE of your Ripple devices is powered on at a time
while doing this! They will all have the same BT name (Ripple Device).
I'm trying to ask as few questions as possible, but I am still having trouble. I followed your advice,
and I uploaded the Bluetooth classic onto the LoRa board. It seemed to upload, with a similar
ending: "Hash of data verified. Leaving... Hard resetting..." message. I restarted my phone, I power
cycled the board. There is still nothing on the OLED display, (it hasn't been paired yet, don't know if
it only displays something once it's been paired). When I go to my phone's Bluetooth "Pair device"
screen, it shows five things titled "Tile" (don't have any Tiles unless my wife secretly bought some
as a valentine's gift or something) and there is nothing called "Ripple Device". Don't know if this
makes a difference, but I am just using the USB cable as a power source and there is no battery
power source yet. Also, the onboard red LED was pulses red (high to low) when connected to my
computer (as I think just as a power source) and when connected to just a power supply, the red
LED is just a constant low. Thanks again!
Hi,
we are Italian Red Cross volunteers and we are very interested in using this project in
emergencies.
We have 4 Heltec Lora ESP32 V2 boards to test and we think they are compatible using a v2
Heltec firmware from git-hub.

We followed the post and understood that there is no .ino file.


We have no linux/mac skills.

We wold love to test this but we need a way to write this bin file on the boards from Windows.

Does anybody know any tool to do the job?

Best greetings,
Dave
Hi Dave,
Yes, those Heltec boards should be fine. I'll get back to you on instructions for Windows. I probably
should update the readme for Windows users, so I'll try to get that out within the day.
Also, I have just published a follow up article which I'm hoping is of interest to you (for SAR):
https://www.hackster.io/scottpowell69/lora-tracker-pager-device-36bdb3
Dear Sqij,
that is a very nice project.
But we prefer having the phone/tablet manage the gps and the messages (also for end to end
crypt).
Therefore we will like more to use the first poject.
I will be glad also to send you some pictures, when we are using them, so that you can upload
them in your profile as case study reference.

P.S. (not sure, i didn't understand, if the heltec esp32 v2 can work in mesh or just point to point)
best greetings,

LoRa Mesh Radio: Page 9


Dave

Hi Dave,
That's fine, whichever you think will be most useful. Yes, the Esp32 will work in a mesh, not just
point to point.
I have dug up an old Windows laptop and installed Arduino on it. Have started to try to replicate the
install/flashing of the firmware. Hopefully by tomorrow I can get some WIndows-specific
instructions up on github.

Yes, the case study photos would be fantastic!


Hi Sqij

Finnaly i got the bin uploaded using the Flash Download Tools 3.6.7_1 here the link
shorturl.at/ekoEU with files inside (it may help)
The screenshot shows how setting to upload in Heltec esp32 v2

( oled not working but isn't a problem).

I can see the heltec bluethoot devices named "Ripple device".


I was able to add them to the two android devices.

But it loks like the bluethoot icon in the Ripple app doesn't activate (see image 1)
And the "Advanced" frequency doesn't apply if I write 868 or 915

When i try to text (after adding other phone with qrcode) it says "unable to send message"

I can't see a debug mode so i don't know what the issue can be ( i suppose blouthoot)

Dave

Have now updated the BT Classic firmware: https://github.com/spleenware/ripple#repeater-or-


messenger---433-to-915mhz-configurable--bluetooth-classic
Hi Sqij

1) I tested the new firmware but after uploading it, is not showing anymore BT on android device
scannings so i rolled back to previous firmware-

2) The "Radio Frequency" field is to set the LoRa frequency ?

3) By default on what frequency is working? with your firmware?

3) There is a sort of tilt "status" in BT we are unable to understand. The Heltec start blinking every
0.5, stil receives messages on oled, but doen't send.
Secondo status BT (it shows bright but not connected) . And it gets stuk till i reset.
Do you know what i is?

4) Tryied to send a longer packet. 50 words text, but it sasy "unable to send message". And then
LoRa Mesh Radio: Page 10
stacks as at point 3) Is that due the board, code or app limitation?

Hi Dave,

That's encouraging, that you have 'some' success. The BT Classic firmware is a bit old now. It
probably doesn't have support for the custom radio frequency, for instance. I'll try to rebuild the
Heltec V2 firmware for BT Classic, in case that helps. (Classic does chew through the battery, by
the way) I'm pretty sure the BLE firmware build is quite recent (for Heltec V2). I'll double check, and
rebuild if not. In the app, none of the messaging will work until the handset can establish the serial
link with the device, which the bluetooth icon in the top actionbar shows. There are three states:
grayed out means no connection, solid white means 'connecting', and solid white with a
'transmitting' look (has round arcs next to the bluetooth icon) means connected and handshake
successful.
CORRECTION

Everything works putting Standard Bluethoot Classic instead of LE


The oled works when i send or receive a message

Dave
That sounds great!
Thank you for supporting us

This looks like a Great Leap Forward in LoRa communications. There are quite a few good starts
out there, but none seem to have developed. Very keen to make this work.
I've edited the install script and get a good-looking write into the Heltec white board
https://heltec.org/project/wifi-lora-32/

Can you check whether the icon on the titlebar is the 'connected' one? Looks like the Bluetooth
icon with an arc next to it. Also, the icon to the far right on the toolbar should be showing at least
one bar (uses the WiFi icon) to indicate the other node is reachable/online.
Hi, thanks for getting back to me on this.
No, both the left-hand 'Bluetooth-like' icon, and the right-hand WiFi-like 'fan' seen 'in' the entry for
the other unit are both faded, on both machines (Samsung A20 & Nexus 7), and any combination
of the 4 boards that I have your Ripple-USB.ttgo-heltech.bin on.
Should I be able to communicate with the boards via serial terminal? I saw that you had posted the
commands somewhere recently, but didn't notice anything about protocol, baud rate, etc?
Do you know if anyone has it working for these boards?
I'll see if I can dig up a schematic for these things and check the connex as you gave for
ConsinusJ yesterday.
Thanks
Greg
Probably the first thing to try to verify is if the USB serial interface is working. Open up the Serial
Monitor in Arduino IDE, select 9600 baud, just Newline option, then type in 'i0,0' (without the single
quotes) and press ENTER.
There should be a response starting with "I:"
Scott,

Yes, sending 'i0,0' now gets response 'I:126,1' from the Heltec_V2 with your new firmware, thanks!
LoRa Mesh Radio: Page 11
No similar response from the TTGO boards. Should I try the earlier builds?

Also, the 'bluetooth-like' icon is now defined, and '0.3v' appears beside it. No joy on the 'WiFi-like'
icon, so the other boards aren't cooperating yet.

So maybe I'll just have to wait until the other hardware arrives - unless you're inclined to compile
for them too;)

(I can send what details I have on them, but these things seem to have poorly-documented 'micro-
versions'. Is there a sketch that I can put into them that will get a definitive response about what
they actually are?)

Hope you're enjoying whatever you celebrate today.


Kind regards
Greg
Also, I noticed it's a V2 Heltech board. I have just prepared a new firmware binary for that board,
and uploaded to the github repo. Just look in the 'Ver 2' builds, for the "Heltech V2 boards - 433 to
915MHz (configurable), (USB-OTG only)" command
How many nodes did you test simultaneously?

Hello,
does your firmware be compatible with the ESP32 T-BEAM board ?
Europeans will love a 868mhz bluetooth version :D

Many thanks for you job


Regards
Juan
I don't have that particular board, but I'll have a look into whether it needs any build config
(compared to the TTGO/Heltech ESP32 boards and the required pins).
The V2 firmware images now support user-configurable LoRa frequency, but I have yet to publish
the updated Ripple Messenger app to Google Play. (there's now a Frequency field in the
Preferences screen). I will be doing the update this weekend.
thank you for your reply.
I order two Lora32 and one Fearther, that will be my first Lora project.
Does this board will work ? (ICQUANZX Lora32 boatd)
https://www.amazon.fr/gp/product/B07VL9JVKL/ref=ppx_yo_dt_b_asin_title_o01_s01?
ie=UTF8&psc=1

Many thanks ,
Juan
Yes, it should be fine with that board. Use this V2 firmware, and the latest Messenger app, and you
can set the LoRa frequency in preferences: https://github.com/spleenware/ripple#repeater-or-
messenger---ttgoheltech-boards---433-to-915mhz-configurable--usb-otg-only
Any chance we could get a 868Mhz version? I have a lot of these TTGO LoRa32 boards, but they
are all 868 :/
Also, make sure you check your antennas on the TTGO boards, they are notorious for sending
really crap antennas or putting the same antenna for multiple frequencies.. Might account for the
range issue, but it might just be that it doesn't have a PA.

LoRa Mesh Radio: Page 12


I have just published an update to the app, along with new V2 firmware binaires which not support
configurable LoRa frequency. You can now set it to any value between 433 to 915 MHz in the
Preferences screen.
OK, I've uploaded an 868MHz build to the github repo.

Sure, I'll try to get an 868MHz build out soon. Yeah, the TTGO stock antennas are rubbish! I put
some nice dipoles on, and got over 4km range.
Thanks for share this project.
I can't download android app, I tested with several phones, I get the following error:
Your device is not compatible with this item.
Can you share APK file directly?
Installing via an APK file directly would give the same error. Your device must be incompaitlbe, eg.
doesn't support USB host mode,.
Thanks, but my device is "Huawei Nova Plus 2" and support OTG !

Try downloading the "USB OTG Helper" app from Play, and see what it says about your device
and the OTG support. I know that 'actual' OTG support varies wildly, and is unfortunately
something that is hard to get definitive data on.
good prject!
.. possible to have all the code?

No, not at this stage.

Then we could not replicate this?

Hello,
My name is Jonathan Torres, I've reed your garage project and I find it fascinating. I would like to
talk to you about the project and ask some questions. Please tell me if you have time for a little
chat on the matter.
Thanks,
Jonathan Torres Rosario

LoRa Mesh Radio: Page 13

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy