GithubHelp home page GithubHelp logo

quixotesystems / nostrastic Goto Github PK

View Code? Open in Web Editor NEW
15.0 1.0 0.0 50 KB

Bridge to publish Nostr posts and send/receive DMs over LoRa using Meshtastic

License: MIT License

Python 100.00%
meshtastic nostr lora

nostrastic's Introduction

nostrastic-alargado

Bridge to publish Nostr posts and send/receive DMs over LoRa using a Meshtastic device.

Note: This is a Beta version (Proof of Concept), so I am still debugging and improving the code. PRs are welcomed.

First steps

To use Nostrastic you need at least:

  • One Meshtastic Device
  • One Meshtastic Gateway Device, this means a Meshtastic Device with internet connection and MQTT enable.
  • Running Nostrastic with a computer/server with internet connection

Configure your Meshtastic devices

First of all you have to set up certains options in your Meshtastic Device and in your Meshtastic Gateway.

  • In your Meshtastic Device (with no internet):

    • Add mqtt channel as secondary (IMPORTANT: name has to be mqtt in lower case)
  • In your Meshtastic Gateway Device (with internet):

    • Add mqtt channel as secondary (IMPORTANT: name has to be mqtt in lower case)
    • In MQTT Config:
      • Enable MQTT
      • Enable JSON output
      • Disable Encryption

Architecture

This is one simple example where meshtastic devices with no internet can send Nostr post and send/receive DMs. Notice at least one meshtastic device in the mesh needs internet connection to forward all the messages to the MQTT Server. And then Nostrastic takes events from Nostr Relay and selected messages from MQTT Server and resend to the opposite direction.

nostrastic2

Start using Nostrastic

1- Clone or Download this repo.

2- Install packages requirements:

pip install -r requirements.txt

3- Fill up with your own data .env file

## NOSTR ###################################################################
# Your Public Keys
NPUB = 'npub...'
HEX_NPUB = 'hexadecimal...'

# Your Private Keys
NSEC = 'nsec...'
HEX_NSEC = 'hexadecimal'

# Relays
# Relay where senders and receivers users have to be
RELAY = 'wss://YOUR_RELAY'

## MQTT ####################################################################
# Meshtastic MQTT Server (Default) you can change for your own MQTT server
MQTT_SRV = 'mqtt.meshtastic.org'
MQTT_PORT = 1883
MQTT_USER = DEFAULT_USER
MQTT_PASS = DEFAULT_PASSWORD
# Suscription to mqtt JSON Channel has to be this path: json/mqtt other doesnt work
SUSCRIPTION = 'msh/YOUR/PATH/json/mqtt/#'
# Channel from MQTT where message are published
PUBLISHING = 'msh/YOUR/PATH/json/mqtt/!'

## MESHTASTIC ###############################################################
# Your Meshtastic ID Device from where you are writing over LoRa (without ! symbol)
# If change the MESH_DEVICE needs to reload the enviroment variables (close and open folder VS)
MESH_DEVICE = '12345678'

4- Fill up with your Nostr contacts contacts.json file:

{
    "(nickname_1)":"npub...",
    "(nickname_2)":"npub...",
    "(nickname_3)": "npub..."
}

5- Run main.php

python3 main.py

6- Automatically it will create nostrastic.log where you can see what is happening

7- From your Meshtastic device:

  • You have to go to mqtt channel and write: (post) or (nickname) following the post text or DM message:
    • To send a Nostr post:

      (post) This is an amazing note for all nostriches. --> This will send that text like a post to your Nostr account.

    • To send a DM to your contact (remember this nickname has to be on contacts.json):

      (nickname_1) Hi Pleb! How are you doing? --> This will send that text like a DM to your contact.

If you like this project, you can help by sending me some sats:

quixote LN wallet

LN address: [email protected]

nostrastic's People

Contributors

quixotesystems avatar

Stargazers

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

Watchers

 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.