Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Freakwan: A MicroPython driver for the SX1276 LoRa chip (github.com/antirez)
119 points by throwoutway on May 10, 2023 | hide | past | favorite | 45 comments


>completely independent from Internet and the cellular phones networks.

I love this and I am going to try it but like all UHF and up radio communications systems this will depend on line of sight. Lora sweep modulation doesn't make your signal go through hills. The only solution is getting enough reliable electrical power up high above the surrounding terrain to have line of sight to the next transceiver. That's why cell networks work: they pay big money to build towers to put their antennas up high where they can see the users' handsets.

Non-line of sight VHF/UHF propagation like tropospheric ducting are unpredictable and extremely low duty cycle. Alternately the more reliable tropospheric scatter mode is a brute force solution requiring high output powers of a kilowatt or more with big horn antennas.

Software can only do so much. I get the feeling the game changer for community radio networks will be a way of cheaply and reliably getting some antennas up very high. Weather that's multi-copters, tethered aerostats, or just up a tree in the yard it'll need obscure tech like single wire surface wave transmission lines sending RF power to implement it cheaply (coax and DC power are heavy and expensive).


> The mostly unpredictable and extremely low duty cycle modes of non-line of sight VHF/UHF propagation like tropospheric ducting are not a realistic option for communications networks. Alternately the more reliable tropospheric scatter is a brute force solution requiring high output power of a kilowatt or more with big horn antennas.

A friend and myself are currently prototyping a solution where we transmit data using the near vertical incidence skywave (NVIS). Possibly the only option, when you want to avoid infrastructure at all costs. Of course you have the disadvantage of huge HF-antennas. To make this setup usable at all, we are trying with 20m long copper cables close to the ground. If this does not work we will try magnetic loop antennas.


In case you have something to share even if on documentation level, I'd invite you to join https://github.com/radio3-network so more people can help.

Over there we are building an operating system for ESP32 which then controls the LoRa module. Some boards are already coming with LoRa built-in and is possible to talk with chinese manufacturers to customize them.


Not only will the antennas have to be huge (or really inefficient like electrically small mag loops which throw away ~20dB of signal versus a resonant size antenna) but the legal limits on channel bandwidth and baud rate kick in.

You cannot legally do high rate networks on HF NVIS.


It's true, this will certainly not be a high speed network as 2.7 kHz is the max allowed bandwidth (compared 500 kHz for LoRa). But it should be fast enough for transmitting text messages.

Antenna size is problematic, but NVIS does not require the antenna to be high up in the air. Also the polarisation must not be vertical, so throwing a simple wire dipole on the ground, might actually do the job. But we will see, it's an experiment.


This might be interesting for you: https://www.kk5jy.net/LoG/


Antennas in cellular networks are higher on poles to extand coverage, yes, but the key for coverage is that they are cellular. They add more antennas/base stations to cover huge areas and the whole complexity of these networks is in managing this.


You've got it backwards. The key to cellular networks is that they pay money for height above terrain and thus line of sight for the cells' antennas. Otherwise it'd be infeasible. Trying to build a cellular network with the antennas at ground level is worse than a fools errand. Just look at the number of basestations required for deployal of mm-wave networks in urban cores.


Macrocells have 'macro' coverage because they are indeed better located and more powerful (and lower frequency than mm-wave).

But this tends to get smaller and smaller because of higher throughput and higher capacity demands. 5G/mm-wave/densification means more, smaller cells.

In any case, the key to ubiquitous coverage is the cellular aspect: You don't build a taller mast with a more powerful transmitter. You add more cells.


I had a mixed bundle of fun and stress writing a rust LoRa driver and an abstraction library atop it for the popular low-cost RFM66HCW/RFM98W LoRa transceiver/breakout board a few years ago [0]. In order to test both send and receive with two such modules connected to the same STM32 MCU (with no OS), I ended up converting/rewriting the driver to use async/await and futures, all with no_std and no alloc.

It was really eye opening to me how much Rust’s language-level features (as opposed to std library features) really unlock the ability to do in an embedded/driver/kernel context with zero abstraction and overhead.

The most annoying part was making it generic over the MCU’s hardware. I ended up with function prototypes 20+ lines long with all the insidiously pervasive generic constraints tacked on a propagating everywhere but I think I would just rip those out and use &dyn instead as I don’t think it was worth the effort and hit to ergonomics it took to avoid the dynamic dispatch.

I asked around to see if anyone would be interested if I published the code at the time but didn’t really get any interest; I think I can still have it on my code server somewhere if someone would benefit from it.

[0]: at the time, these were the cheapest and most available with breakout boards going for a couple of dollars from the Chinese web. Adafruit has them for $10 but you can find them on the usual Asian sites for a dollar or two a piece, which is great because you can’t have too many!

———

Do note that there are a number of restrictions on how you can transmit on the ISM bands, which the LoRa transceivers use, at least in both the USA/Canada and EU. They notably do allow encrypted payloads, which isn’t allowed for a lot of the other free-for-all frequencies such as the HAM radio frequencies.


I’m definitely interested! Was just looking over this code and wishing it were in rust or C.


The context as written by the author of this project: https://twitter.com/antirez/status/1632664864538738688


It's amazing what we can build now on our garage. We used to build walkie talkies and now we can build our own cellular like network with data and voice capabilities. We can even build our own complicated project case because of 3D printing.


How do you build your own cellular network?


It seems the routing algorithm used in the project is uncontrolled flooding with TTL. Obviously this won't scale. Any plans for more sophisticated routing?


Unfortunately with LoRa a more sophisticated approach is not possible (for the way the RF protocol itself works). When you transmit in a given spreading, anyway you are distrupting the current communications. The maxium you can do is listen before talk which we already implemented, and then random timeouts, and ACKs only when absolutely needded (and opt-in). What makes working with LoRa even more problematic is that message time-on-air is huge. In theory we could use multiple channels, but this makes sense only when we want a one-to-one communication, instead the goal of the project is to create a WAN-style network.


Author is also the redis guy. He's got some pretty good range.


It's not his first radio software. Almost a decade ago he wrote the rtl-sdr ADS-B software dump1090 https://github.com/antirez/dump1090 . It was much easier to set up and use than prior GNU Radio 3.6 gr-airmodes (c++/python) + Virtual Radar (java) options. It went on to be forked and improved upon and it is now the community standard.


dump1090 is still very alive, I recently gave FlightAware‘s fork a spin: https://www.justus.pw/posts/2023-05-09-ads-b-aircraft-tracki...


he's also the original author of hping[0], now a novel author[1] and he built and sold a couple somewhat popular websites in the Italian internet years ago.

And an overall nice guy :)

[0] https://en.wikipedia.org/wiki/Hping [1] https://www.amazon.com/Wohpe-English-Rimmel-Salvatore-Sanfil...



love this space, looks like an alternative to meshtastic.


I feel like the readme goes over a few different areas, went over my head a bit

Does this target a particular end-user device? It talks about OLEDs?

How does one find things on this network? Do you run TCP/IP on it?


The mention of OLED is sideways to the network stuff, it just so happens the device he chose has an OLED screen.

The protocol is FreakWAN, so there’s no TCP/IP involved. LoRa devices send messages opportunistically and listen out for other messages they can understand and then maybe act on if they choose to. It’s about as simple as you can imagine.


It runs on Lilygo ESP32 boards, so they have built-in wifi and bluetooth.

This is pretty awesome. Gonna get a lora module and try it out.


I thought the chirps where actually not spanning more than a channel band worth of frequency?

Also you cannot control the frequencies according to the spec.

You need lower frequencies for range and control over those frequencies to not saturate the ether.

The bandwidth will be low for these radiomesh networks, but if you build a robust enough routing and get enough channels (300 with 5KHz separation) you can scale.

I'm going to use the upper part of the open 169MHz in Europe.


What you using to reach 169Mhz? Is than band unlicensed?


In EU yes.


OK, how are you using it?



I was hoping for an open implementation of the protocol and a software radio based implementation from someone at some point. I know the hardware is cheap but seems like having an open protocol would be best.


Are there any mobile phones that also supports LoRa standard?


The pinephone has a lora add-on:

https://pine64.com/product/pinephone-pinephone-pro-pindio-lo...

Given that they're still not daily drivers due to patchy support for calls (last I checked) this would actually be a pretty cool use for them.


Not that I know about, albeit you can connect LoRa externally as USB module or by bluetooth to a device with LoRa.


This LoRa vs that (Low Rank Adaptation) LoRA :D


Something I wonder about is how many people you can get on these relays without saturating it.


oh this is about the useless enthusiast wireless network, not a co-processor for large language models


Kind of difficult to argue it's a useless enthusiast network when there is 6 million gateways and 300 million end devices deployed worldwide. And no other technology that gives a better combination of low power use + high range.


LoRa is actually a technology built by a massive consortium of vendkrs. Enthusiasts use it creatively in ways like this, and much of the rest of the time this technology is deployed for anything from silly IoT chicken coop controllers to disaster zones and mountain rescue, plus much else beside.


Not useless at all, these kind of ad-hoc mesh networks are perfect for communication during protests or other organizing, particularly when state actors are trying to monitor or disrupt cellular (like what happened in Ukraine protests years ago).


> Not useless at all, these kind of ad-hoc mesh networks are perfect for communication during protests or other organizing, particularly when state actors are trying to monitor or disrupt cellular (like what happened in Ukraine protests years ago).

LoRa is not going to be useful for that at all. It's for small messages over long range, at long intervals (38 bytes sensor data, for example)/


No that's absolutely perfect, it's enough to send a warning back to a bigger group or base that the police/government/bad actors are here.


The post describes quite clearly that there are means to message over these links. It wouldn't be a perfect solution, but a lot of good often comes from things that aren't perfect.


Hey! We had LoRa first!


wan didn't give you a hint?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: