Giter Site home page Giter Site logo

loshark's Introduction

LoShark

The next-gen USB LoRa debug tool

  • Best-in-class hardware: Ingenic X1501 & Semtech SX126x with DC-DC and TCXO
  • Runs Linux 6.x (boots mainline Linux) on itself
  • Powered by our ResonanceJS, provides versatile JavaScript ES2015 interface allows access to every SX126x chip register easily
  • Modern Web-based dashboard
  • Large flash storage allows long-time data collection
  • Works with any modern PC

image

image

EE4A1247

Hackaday link: https://hackaday.io/project/192129-loshark

Hackster link: https://www.hackster.io/reimunotmoe/loshark-1069d0

Buy it in our store: https://shop.sudomaker.com/products/loshark-l1

Contents

  • Hardware: PDFs of schematic and component placement on the PCB
  • Software: rootfs, Linux kernel, bootloader and USB firmware update

Usage

Booting

Connect LoShark to your PC (or a power bank, if you have loaded your program inside it).

The LED shows the boot progress:

  • RED: kernel is booted and /init in initramfs started running
  • Yellow: rootfs is fscked & mounted successfully and /sbin/init started running

Connecting to LoShark's serial console

PuTTY is the recommended software. But you can use anything you like.

Baud rate is ignored since this is USB CDC ACM.

Default Login information

Username: root

Password: loshark

Changing password requires the rootfs to be mounted read-write (see below).

Autostart

When the LoShark is finished booting, the script /data/app/app.sh will be executed.

This is programmed to launch the Resonance runtime by default. You can edit it to suit your needs.

Resonance REPL console

Use the command app-console to attach to the console. Use Ctrl-\ to detach.

Only use Ctrl-C if you want to terminate the Resonance runtime.

JavaScript Example

const {SX126x} = loadModule("loshark/sx126x");
const {GPIOControllerLinux} = loadModule("gpio/linux");
const {SPIControllerLinux} = loadModule("spi/linux");

const gpioa = new GPIOControllerLinux(0);
const pa19 = gpioa.open(19, "SX126x NRST");
const pa18 = gpioa.open(18, "SX126x BUSY");
const pa17 = gpioa.open(17, "SX126x DIO1");
const pa16 = gpioa.open(16, "SX126x DIO2");

const spi0 = new SPIControllerLinux(0);
const spidev0_0 = spi0.open(0);

const cfg = {
  chip: "SX1262", // "SX1268" if you have the 433 (410-510 MHz) version
  tcxo: { voltage: 0x2, timeout: 32 },
  gpio: { reset: pa19, busy: pa18, dio1: pa17, dio2: pa16 },
  spi: spidev0_0,
};

mdm = new SX126x(cfg);

mdm.on("receive", msg => console.log("packet received:", msg));
mdm.on("receive", () => {pkt_cnt++; console.log("pkt cnt:", pkt_cnt);});
mdm.on("signal", sig => console.log("signal:", sig));
mdm.on("event", ev => console.log("event:", ev));

mdm.open().then(() => {
    console.log("modem opened");
    mdm.setProp("sx126x.lora.crc", false);
    mdm.setProp("sx126x.lora.sf", 12);
    mdm.setProp("sx126x.lora.bw", 250);
    mdm.setProp("sx126x.lora.cr", "1/1");
    mdm.setProp("sx126x.lora.ldro", true);
    mdm.setProp("sx126x.lora.preamble_len", 12);
    mdm.setProp("modem0.rf.tx_power", 22);
});

mdm.listProp().then(console.log);

mdm.getProp("sx126x.rssi_inst").then(val => {console.log("RSSI:", val);});

mdm.transmit('cafebcafebcafebcafebcafebcafebcafebcafebcafeb').then(console.log);

Making rootfs read-write

mount / -wo remount

Run sync to ensure your changes are written to the flash.

Setting date/time

Use the TZ environment variable or the /etc/TZ file to set the timezone. Only the UTC+X format is supported.

Also read this article: https://unix.stackexchange.com/questions/104088/why-does-tz-utc-8-produce-dates-that-are-utc8

Use date to set the system time.

Use hwclock -u -w to sync system time to RTC.

If you're using a Linux PC, use this one liner to sync your PC time to LoShark:

echo 'date -u -s @'`date +%s` > /dev/ttyACMx

Here ttyACMx is the LoShark terminal you're currently logged in.

Transferring files

The MTP protocol is implemented.

You probably need to use some 3rdparty software if you use MacOS.

For advanced users: The lrzsz package is also installed.

Run sync in the LoShark console to ensure your changes are written to the flash.

Resizing data partition on 4GB devices

The data partition image is suitable for the 256MB version. If you have the 4GB version, run mount /data -o remount,resize on LoShark to resize it to maximum size after flashing this partition.

Notes

If you have any questions, feel free to open an issue or ask in our Discord server.

loshark's People

Contributors

classicoldsong avatar reimunotmoe avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

loshark's Issues

real sending data

If it working with lora why not put https://reticulum.network/ inside? simple python only needed.
Video with mesh network 3 devices that can send message trought 1 km in city will be great.

Sending data is more than video from test. I need send max bitrate data trought device

BTW is any C library for EFI or similar embeding in any other language like rust, ruby, haskell?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.