Coder Social home page Coder Social logo

pyrn2483's Introduction

RN2483

Small Python library to interface the RN2483 (Data-Sheet, User-Guide) LoRa module over a serial connection. Once connected, the library allows to receive and transmit data over LoRa directly with the module. Supports micropython and desktop machines.

Installation

  1. Clone this repository git clone https://github.com/lorenzschmid/pyRN2483.git
  2. Change into the new directory cd rn2483
  3. Install package with pip: pip install .

Micropython Example

import pyb
from lora import LoRa

debug = True        # print debug information of current command in REPL
serial_port = 1     # indicate UART port LoRa module is connected to
timeout = 5000      # timeout of serial and lora reception
tx_data = "Hello!"  # data to be send (leave empty for reception)

# connect to module
lora = LoRa(serial_port, timeout, timeout, debug)

if tx_data != "":
    # transmit data
    lora.send_str(tx_data)
else:
    # receive and print data
    rx_str = lora.recv_str()
    print(rx_str)

Command Line Interface

Comes with a command line interface which works as following:

usage: rn2483 [-h] [-d] [-t TRANSMIT] [-r RECEIVE] [-p PORT]

Receive and transmit data via rn2483 module.

optional arguments:
  -h, --help            show this help message and exit
  -d, --debug           Debug mode
  -t TRANSMIT, --transmit TRANSMIT
                        Data to transmit
  -r RECEIVE, --receive RECEIVE
                        Timeout upon reception (in ms)
  -p PORT, --port PORT  Serial Port e.g. pyb, ttyUSB1,
                        /dev/tty.usbserial-A5046HZ5

pyrn2483's People

Contributors

lorenzschmid avatar raffh avatar vencax avatar

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.