Hackaday Prize 2023: LoShark, The Radio Debugger For LoRa

LoRa, the Long Range wireless protocol is pretty great for trickling data across long distances. There are some great embedded devices based around STM32, NRF52, and ESP32 microcontrollers. What’s been missing for quite a while is a device that allows for full access to a LoRa radio from a more capable CPU. The wait may be over, as there’s now the LoShark. It’s a USB key form factor, with a MIPS processor running a real Linux kernel. Cool!

The way debugging works is interesting, too. The team at SudoMaker is working on their Resonance runtime, which allows interacting with the onboard sx126x radio chip using JavaScript code. That chip can both send and receive, so this device should be capable of more than just capturing traffic. And if JavaScript isn’t your thing, the Linux system on the device means you can knock yourself out with C or C++ code. Who knows, we may even see Meshtastic running on this thing some day.

If this gets you excited, it’s already available for order for a reasonable $59.99. The LoShark ships in 433, 868, and 915 megahertz versions. It’s a really slick looking device, and maybe worth your time to check out. Enjoy!

24 thoughts on “Hackaday Prize 2023: LoShark, The Radio Debugger For LoRa

  1. So they stuffed Linux in front of Semtechs Lora modem (SX12XX-series) so that people can run javascript?

    I mean what is wrong with elcheapo ESP32 + SX12XX chip boards? You can basically do the same “debugging” with those boards.

    “What’s been missing for quite a while is a device that allows for full access to a LoRa radio from a more capable CPU. ”

    ESP32 is enough cabable when the interface is the Semtech chip. Full access? If the interface is same (SPI) then all the current boards have “full” access.

    I don’t see any real radio debugging going on here as the board relies on the same chip as all the other boards do.

    1. Yeah, this is confusing. I just connect ESP32 with onboard LoRa to PC via USB card and run Pyserial to pick up serial data. I can debug whatever I want. SImples. Why would I want to make it more complicated?

        1. If I wanted to change sync word or do a bit of frequency hopping, I’d just send a load of serial data back to the ESP32 for it to turn into register orientated commands. Can be done in about 10 lines of code. 20 lines max.

          1. Hi, I’m the author of this project. The LoShark is capable of running complex CPU-intensive algorithms in real-time on itself without a PC, such as software-based error correction codes, like the LDPC (you can replace the built-in coding of SX126x by setting CR to 0), and audio codecs like Codec2, Speex and Opus. It can be programmed as a data logger or a packet relay node easily. Connect it to a power bank or any USB power port, it just runs on itself for days and even months. Existing MCU-based solutions are just interfaces and cannot operate independently, and they depend on the computation power of PCs.

    2. Most of the solutions where a LoRa chip is connected directly to a Linux-capable CPU, it uses a UART scheme, not SPI. The ESP32 works, but if you try to do anything fancy, you run out of flash, ram, and CPU cycles really quickly. Dumping to serial works, but you’re a step removed from the real system.

      1. Well, in this case, JavaScript is far more quick and easier to use since LoRa is a communication protocol, it’s more like an I/O interface that JavaScript can handle much better than Python.

        We’ve just uploaded a video showing the REPL of Resonance running on LoShark. You can also write a JS file and plug the LoShark on a power bank, it’ll run on its own without a computer.

        https://youtu.be/WtPmxE7byWc

    3. You missed an important point: this device can run entirely on its own, without a computer.

      You can write applications in JavaScript instead of configuring a whole bunch of toolchains to compile a single executable (although it’s still easy enough since it only need a standard mips32r2 toolchain).

      Just see how easy it is using JS instead of commands toggling those registers: https://youtu.be/WtPmxE7byWc

        1. If you’re looking for a “neat little laptop” for this kind of debugging work, might I recommend the GPD Micro PC. It doesn’t look quite as sexy as the Pocket 2, but it comes with a proper ethernet port and even a real DE9 serial port. Also plenty of USB, micro SD, proper headphone jack etc.

          I’m not affiliated with GPD, I just really like my Micro PC and had been looking for something like it since netbooks died out a decade ago :-)

  2. I think this is a great project idea. However it seems way overkill to incorporate a full embedded Linux in this board. To me it would prove far easier with an easy to use USB enabled MCU. Keep in mind that these LoRa devices are really low data rates that is easily accomplishable by an MCU. As for code space, a simple interface to registers and full fifo for data in/out is also very possible with even the smallest of MCUs. A simple kernel module to make everything available to user space would be all that’s necessary.

    Also note that these radios are single channel only devices.

    1. This article did not represent clearly that, this device can run on its own without a computer. The JavaScript interface is for writing applications that can operate independently on the device quickly, since a full featured ES2015 runtime could indeed do much than a minified python runtime.

      Also LoRa can do much more than “low data rates”, we successfully accomplished realtime full duplex audio communications with single channel LoRa chips years ago, but on RaspberryPis. Now this can also be done with LoShark itself.

      1. What’s the intended power source? Are you thinking that someone could just use a USB power supply or power bank to drop one of these somewhere to collect data?

        1. Indeed you can. It only consumes 150mW when the CPU is idle & SX126x in RX boosted mode (that’s more than 100 days with a 5000mAh power bank, theoretically), even a small solar panel can provide enough power to get it working. The built-in RTC can maintain time accurately when the power is lost (during night, etc).

          One of the more practical usages is that you can carry it with your car, drive around and collect data for further analysis. That’s the purpose of the built-in flash. You can transfer the files between PC and LoShark easily with USB MTP, just like an Android phone.

      2. Ok, I can maybe get behind this if the intended application is for it to run stand alone and or more performant activities. I still think a MCU (maybe with DSP capabilities) would be preferable, but that’s just my opinion.

        Concerning the audio claim, the radio has a limit to only 300kbs in fsk mode. And significantly less on LoRa modes. I stand by my “low data rates” comment. This is far under the requirements for good live audio at full bandwidth (single channel 44.1Khz at 16 bits = 706kbs). The only way you can get audio through this radio is a good compression algorithm and or a reduced bandwidth. This extra processing alone would require a powerful enough processor to be able to crunch this kind of data. Either a processor like the one mentioned here or a dedicated DSP MCU. So your claim, while it is feasible, is very misleading and shrouded with many asterix.

        1. Maybe to your surprise, this chip do have the power to run these compression algorithms. Also by voice communication, it really doesn’t need to be 44100hz 16bits. You might be surprised that telephone quality audio only requires 8khz 8bit. Also there’re Codec2 sorts of algorithms that compresses audio even further and it still runs on this chip, since it has a full featured hardware float point instruction set. The only limitation here is your imagination, not the processing power.

    2. I prefer like a fipper zero (or esp)
      normal usb, normal system == linux, package system for new programs, screen, keyboard, external antena
      more bands: whole lora, cb radio, pmr, wifi, ISM

  3. I’d just get this thing interfaced with Wireshark and leave it at that.
    It may not be the most efficient way the do things but you will increase your userbase by 1000x

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.