-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using this protocol in similar projects? #10
Comments
Hi you might find these pages helpful: https://github.com/sudomesh/disaster-radio/wiki/Layered-Model https://github.com/sudomesh/disaster-radio/wiki/Protocol#addressing |
OOH those links were super helpful. Most of the packets in my project are actually broadcasts, do you have any plans/ideas wrt handling broadcast for nodes that are more than one hop distant? One way I might be able to help your project if I used your layer1/2/3 in my project is: provide a transport at the bottom based on my modified version of the RadioHead RF95 driver. You might like this more than arduino-LoRa because:
I needed to do this mostly because I wanted my device to be able to run on battery for a long time (and I didn't have the option of changing the hw design to use a lower power main CPU - though this approach is not ESP32 specific). Currently the run time is about 3 days between recharging, but with a small amount more more it should be 8 days. |
btw - my thoughts on how to solve the mesh problem are not nearly as mature as yours, but here's what they were: https://github.com/geeksville/Meshtastic-esp32/blob/master/docs/sw-design.md#mesh-broadcast-algoritm (in particular: approach 4 - because of my 'broadcasts are a large percentage of the packets' problem) I initially used the RadioHead mesh router, but I have that turned off right now because I mostly onyl care about the broadcast case. |
One other idea: Have you considered using T-BEAMs for your project? I have no connection to the company but it seems like it checks almost all of your boxes and possibly easier to get wide adoption if users don't don't need to build hardware? https://disaster.radio/build/ |
Those power savings certainly sound appealing! I'm unqualified to answer but @paidforby or possibly @beegee-tokyo may have a view on it. Is your 60mA with clock speed at 240MHz? If so you may see further savings by dropping to 80MHz In terms of tbeam there is some experimental support https://github.com/sudomesh/disaster-radio/wiki/Devices--&-Hardware |
oh yes - I think the power draw for most of the boards you list is dominated by the CPU and if you jiggle things around so that the CPU is mostly clock-stopped (in ESP32 land they call that light-sleep) you can achieve much lower power draws than what is in that table. I'm assuming a mesh that is mostly not talking - of course if packets are being sent/received 100% of the time (unlikely for my use case) the CPU is almost always stopped unless the user just pressed a button or a packet just arrived or we just sent something. But even in the 100% case the savings from clock-stopping are substantial, because the sematech chip is so slow you can have the CPU clock-stopped 90% of the time while sending/receiving packets) [ I haven't yet added this optimization though ]
That was when I was still running at 240MHz. I'm now at 80MHz most of the time, but I haven't remeasured because 80 vs 240 doesn't make much difference in my case because the CPU clocks aren't running at all (except briefly because of press or packet activity). So 1mA. |
In two LoRa (no Mesh) customer projects I was able to learn some things about power savings. But this is mainly based on the newer Semtech SX126x LoRa transceivers, which are better in power consumption than the SX127x chips used in the RFM95/96 modules. I really prefer the SX1262 LoRa chips over the RFM95 modules because they are much better in power consumption and offer higher TX power. The problem is that the Arduino support is limited. So far there is only RadioLib from Jan Gromes and my own library SX126x-Arduino. And from HW side there is only one breakout board (Adafruit Feather compatible), but that is only available here in the Philippines. Some info about my paid customer projects: Project 1Sensor nodes using LoRa to send every 15 minutes sensor data to a loRa/GSM gateway. Project 2Insight ISP4520 based boards running permanently measuring sensor data and sending data every 30 seconds to a WiFi gateway based on ESP32. |
Thanks for SX1262 info @beegee-tokyo @geeksville Just to clarify this is the code you're proposing? https://github.com/geeksville/Meshtastic-esp32/blob/master/src/CustomRF95.h https://github.com/geeksville/Meshtastic-esp32/blob/master/src/CustomRF95.cpp Also cc @Juul |
Yes - and the associated RF95 base class which had some refactoring
compared to the original RadioHead version. It is in geeksville/RadioHead.
Though if I changed to use your router, if also need to change RF95 to be a
bit smarter about header length and longer node addrs.
(Though using a full 6 byte macaddr I think I'd a bit expensive. So
perhaps: drop the 3 byte OUI and instead use something shorter there)
(Sent from a phone - please ignore typos)
…On Fri, Feb 28, 2020, 01:25 samuk ***@***.***> wrote:
Thanks for SX1262 info @beegee-tokyo <https://github.com/beegee-tokyo>
@geeksville <https://github.com/geeksville> Just to clarify this is the
code you're proposing?
https://github.com/geeksville/Meshtastic-esp32/blob/master/src/CustomRF95.h
https://github.com/geeksville/Meshtastic-esp32/blob/master/src/CustomRF95.cpp
Also cc @Juul <https://github.com/Juul>
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#10?email_source=notifications&email_token=AABXB2LHKA3FSH54ZJY7MGDRFDKAXA5CNFSM4K4QANL2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOENH3M6Q#issuecomment-592426618>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABXB2P6VWVYMBYVIUBUMDLRFDKAXANCNFSM4K4QANLQ>
.
|
@samuk have ya'll given any thoughts on how to handle broadcast in the general mesh network case? |
@geeksville I agree with the 6 bytes address being too expensive. But, just my experience regarding skipping the OUI and using only the 3 byte NIC, Espressif uses different OUI for the ESP32 (I saw at least 2 different ones). So maybe a 4 byte ID with the lower 3 byte being the NIC and the high byte being the lowest byte of the OUI will go around both above restrictions. |
Yep. I agree.
(Sent from a phone - please ignore typos)
…On Sat, Feb 29, 2020, 20:35 Bernd Giesecke ***@***.***> wrote:
@geeksville <https://github.com/geeksville>
Some thoughts about the device ID.
I agree with the 6 bytes address being too expensive.
But, just my experience regarding skipping the OUI and using only the 3
byte NIC, Espressif uses different OUI for the ESP32 (I saw at least 2
different ones).
Also ESP32 is a 32bit machine and works best with 32bit variables. A 3
byte array will either slow it down or the the compiler aligns it to 4 byte
address, wasting memory.
So maybe a 4 byte ID with the lower 3 byte being the NIC and the high byte
being the lowest byte of the OUI will go around both above restrictions.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#10?email_source=notifications&email_token=AABXB2KQ4Q6NF3BTRXQ2G3DRFHCVZA5CNFSM4K4QANL2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOENMRCYQ#issuecomment-593039714>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABXB2KY6BZMP3WKMKSGJTLRFHCVZANCNFSM4K4QANLQ>
.
|
Hi ya'll, So I've poked around a bit more and I think this library/protocol could work well for my application with some tweaks (I would be switching from my RadioHead RH_Mesh proof of concept). Proposed tweaks (I'd happily do these and send in PRs and adjust based on our discussion/feedback):
Related things from my project that might be useful for you and I'd be totally up for mergifying efforts:
Work I'm willing to sign up for in the near but not immediate term (< 3 mos):
Thoughts? Would that fit with what ya'll want to achieve? Also - in the next couple of days I'll be updating my duty cycle spreadsheet based on some guesses on the cost of routing and I'll add a link here. |
@samuk, @beegee-tokyo, @Juul - any thoughts on this idea? |
@paidforby is the maintainer and author of this code. It certainly sounds good to me, but it would be up to him to feedback. |
Sorry I didn't jump into to this discussion sooner, I was distracted and had a large backlog to catch up on. To repsond to your prosposals
Sure, you just need to write another Layer1 cpp file, something like
By "naive flooding" do you mean that nodes forward every broadcast packet they receive? I added something like support for this recently, if you look at the
I typically test on the LILY TTGO V2 dev board, though I've also be expanding support to the T-Beam and the Pycom LoPy4. I know other people have used the Sparkfun 1 channel and the Heltec V2 boards. Our custom, open source board is still in development, AFAIK. If your RF95 code works on any of the aforementioned boards, I'm happy to review and test once you have some code to merge.
GUIs are cool. Currently we have a web-based chat app that is very spartan and a nicely designed BLE android app . I'm not sure what all you intend for your device, so I doubt these will be the kind of GUIs you are looking for, but they are worth glancing at.
Cool idea, @beegee-tokyo wrote that android app, maybe you could integrate it into that, that'd be a great feature for disaster-radio to utilize also.
Great! Encryption is awesome! I haven't put too much thought into any sort of encryption. Mostly I'm worried about the limited packet size and over-utilization of airtime, but if you think there's a type of encryption that is small enough for LoRa packets then go for it.
Sure, I like the idea of having intelligent flooding. I'm curious to see what you would come up with. Finally, I agree with the comments about the 6 byte address being to long, I mostly used it out of convenience. I like @beegee-tokyo idea for a 4 byte node address. I may implement this soon since it will break backwards compatibility and I already have one recent change that broke backwards compatibility, so I might as well make them both at the same time. |
This may put you in a seriously bad situation where nodes keep looping the same packet, I'm not sure the best way to avoid this scenario.
By naive flooding I mean't some thing like 2.1 in this:
https://www.microsoft.com/en-us/research/wp-content/uploads/2009/04/msr-tr-2009-37.pdf
There isn't a problem with looping in this standard mesh flooding algorithm
(because packets get discarded if a duplicate packet ID comes in (I'm happy
to add this). The worst cast performance is bad though, with lots of
duplicate retransmissions (but no looping). Mostly I'd be doing this to
have some sort of working flooding implementation which could handle my use
case and still respect FCC duty cycle limits (my real world meshes will
almost certainly never be more than about 20 nodes and 3 hops). Real soon
though it would be good to replace it with something more robust
(multipoint-relay probably).
re test hardware
Okay, that sounds great, I also mostly use TBEAMs. I'll target those for
my development. Do you have a standalone app built on top of this lib that
I should make sure keeps working? I'd be happy to test against that also.
re GUIs
Yeah - I hadn't realized ya'll even existed when I wrote our android app &
device code ;-). It is not too ugly and does the usual chat features, with
location and distance for channel members and a QR/URL for channels. It
only has a few users so far though (<80 but >30).
https://github.com/meshtastic/Meshtastic-Android Mostly it is there to
support my usecase of "a bone simple device & app that works better than
all those close-sourced mesh+GPS radios - with a polished end-user experience". Eventually I'd like to offer it as an transport for Signal (by talking from the Signal app to the service in the back of this phone app).
How about I try to have a set of PRs for you by the end of the week?
Though it might have to wait till next week if my new box of goodies from
TTGO doesn't arrive soon. Supposedly they air shipped it, but
unsurprisingly the tracking number doesn't work ;-) (also they are still in
super Corona shutdown mode)
|
btw: here's my general (not an expert) thinking on mesh routing (and the various approaches listed are more just notes than real ideas): https://github.com/meshtastic/Meshtastic-esp32/blob/master/docs/software/mesh-alg.md I initially used the RadioHead mesh implementation (which seems to be a clone of data source routing). MPR seems to be similar to naive flooding, except with heuristics to preselect a limited set of relay nodes. I'd probably start with rssi as a quick proxy for link quality. |
I made a ESP OTA update from Android app in another project, but it used WiFi, not BLE. But I can look into the possibility to add it to the current Android app. For the usage of another LoRa library, I had a problem when testing DisasterRadio, because I have only 1 RFM95 module, but plenty of devices with a Semtech SX1262 LoRa transceiver. What I did was to write a wrapper around my SX126x-Arduino library that geve the same function calls as the DisasterRadio's LoRa lib. Worked perfectly and was not much effort. Maybe a simple way to use @geeksville LoRa lib. Not as perfect as your mesh routers, but I am working on my own LoRa Mesh utilizing the SX126x LoRa chips and it works ok so far (testing with 6 to 12 nodes only). The mesh allows both addressed and broadcast messages and detects disconnected nodes. But it is very specific for the SX126x chips and FreeRTOS. It runs on Nordic nRF52 and Espressif ESP32. |
@beegee-tokyo cool beans. I took at look at your new project: https://github.com/beegee-tokyo/Emy-Chat Any interest in joining up and we share effort? It seems like we have almost identical desires in our recreational futzing. It is a fun/friendly/chill project. ;-) |
(alternatively, @beegee-tokyo, could I have your email address? mine is [email protected]) |
@geeksville |
@beegee-tokyo we also have an android app that could be yours to do with as you wish ;-) https://github.com/meshtastic/Meshtastic-Android/ But do whatever you enjoy! |
I think next week I'll finally have time to work on this (my meshtastic time got sucked into user report based bugfixing and being out six days with mystery disease). I'll port it to have an adapter so it can work with my RF95 class and change our app to use it rather than our current solution. Ya'll okay with me changing the addressing to be 4 byte node addrs? @paidforby do you have a test app I should use to make sure I didn't break anything? |
Awesome! Good luck, let me know if you need any help adapting it you your platform.
Go for it. I was gonna attack this myself sometime soon, but if you get to it first then great.
When you change to 4-byte addresses, it will break lots of functionality until I update the Layer 3 code to work with 4-byte addresses also. Once you have it working for yourself, then make a pull request and I will review it, test existing disaster.radio functionality, and resolve any conflicts with minimal changes. |
@geeksville see d533eea |
woot! Thanks for the note. I'm running a bit behind on some other tasks
so I think I'm about fourish days from starting on this.
…On Tue, Apr 7, 2020 at 1:15 PM grant_____ ***@***.***> wrote:
@geeksville <https://github.com/geeksville> see d533eea
<d533eea>
I've updated LoRaLayer2 to use 4 byte addresses. I have tested this with
the full disaster radio firmware and it appears to be working.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#10 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABXB2KLXZIYPFEYBKYZE2TRLOCWJANCNFSM4K4QANLQ>
.
|
@geeksville fyi, I just created a very simple example. When you start working on your merge you can test that LoRaLayer2 is still working by flashing the router_beacon example to a device and confirming that the fake node address (which defaults to |
@paidforby cool beans! I'm (finally) working on this now. I should have something for you to review in a few days. |
/me leaves a note to follow a discussion amongst LoRa mesh implementors. |
A few questions questions (I'm working on this now):
|
Sure, I wasn't familiar with how to make it Layer1 fully async, but that would be great if it was.
The only target it must run on is the ESP32. So believe the answer to your question is yes.
That's fine with me, I would probably just switch to using the async API once you create it. But this sounds like a good way to start. Note, that I just pushed some changes today, mostly just replaced the push/pop buffers with fifo buffers and cleaned up and reorganized the code. Hopefully it helps. |
sounds good. btw - this is the plan/branch I'm going from. I hope to have a PR for you by Friday. https://github.com/geeksville/Meshtastic-esp32/blob/removeradiohead/src/rf95/kh-todo.txt |
Alas. I have some bad news. As I got into the process of mergifying our code I realized I underestimated the size of the task. I don't think I'll be able to sign up for this after all. Sorry for wasting your time in this discussion :-(. As it turns out my fork of RadioHead gets a lot of benefit from depending on Protocol Buffers (also they are great for things like node addresses because PBs nicely compress uint32s down to a smaller number of bits when possible. The process of taking those concepts out and changing to your layer2 was beginning to look like a lot more work to instead just doing a simple implementation of DSR (cribbing from the existing radiohead version and RFC 4728). So I'm just going to implement a subset of DSR (+ naive flooding). DSR also seems nicer for my usecase (a generally quiet network very concerned about battery life) vs your algorithm (which periodically shares updated routing tables). I will make this available as a library in case it is useful for any other project. So I don't think I'll be able to merge after all. |
I totally understand. I'm going to look into implementing something like DSR in LL2 based on comments in other issues. I'm guessing it will take me some time, so don't hold your breath. |
Thanks for your understanding. If my DSR routing works you are welcome to
snarf it if useful ;-)
…On Fri, Apr 17, 2020 at 7:28 AM grant_____ ***@***.***> wrote:
I totally understand. I'm going to look into implementing something like
DSR in LL2 based on comments in other issues. I'm guessing it will take me
some time, so don't hold your breath.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#10 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABXB2O5STBUCOPRT5TVPWTRNBRRBANCNFSM4K4QANLQ>
.
|
Hi,
So I had googled this project but somehow never found ya'lls github. A kind commenter on my similar (but more focused on hikers, etc...) project pointed me this way. I had initially used the (not ideal) RadioHead mesh routing but I'm looking into other options for when I add mesh back in. Are you interested in collaborating? I would happily use this lib and help with development, send PRs etc...
I just sent an email to sign up on your mailing list, so when I get blessed for that we can talk over there if that is easier.
The text was updated successfully, but these errors were encountered: