GithubHelp home page GithubHelp logo

xg590 / sx1276 Goto Github PK

View Code? Open in Web Editor NEW
31.0 31.0 8.0 927 KB

MicroPython Library for SX1276 (A Long Range Radio Chip from Semtech)

License: Apache License 2.0

Python 61.76% Jupyter Notebook 38.24%
fhss lora micropython sx1276

sx1276's People

Contributors

przemobe avatar xg590 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

Watchers

 avatar  avatar  avatar  avatar  avatar

sx1276's Issues

Licensing information

Hi, thank you for writing this code. I look forward to use it as a base for my LYLIGO Lora board. However I can't find any licensing information. Please could you tell me with what license do you release this code? I want to use it according to your wishes. Cheers.

REQ not ACKed

I am trying to send REQ messages in a while loop to a receiver who receives the message and responds with some content. The REQs are not ACKed in my code.

My requester is

while True:
    if received_payload != None:
        print(received_payload)
    payload = "Node,3"
    print('[Sending]', payload)
    lora.send(dst_id=1, msg=payload, pkt_type=lora.PKT_TYPE['REQ']) # Sender's lora_id is 1 and receiver's is 0
    #Check and resend the message
    resend_count = 0
    print(lora.seq_num)
    while (int(lora.seq_num) != 0) and resend_count < 7:
        lora.send(dst_id=1, msg=payload, pkt_type=lora.PKT_TYPE['REQ'])
        print("Resending packet..."+str(resend_count))
        resend_count += 1
    time.sleep(0.05)

The receiver is

while True:
    lora.mode = 'RXCONTINUOUS'

    if received_payload != None:
        count = 0
        resend_count = 0
        
        try:
            if str((received_payload), 'UTF-8').startswith("Node"):
                print("REQ Message starts with a 'Node'")
                if len(message_list) > 0:
                    print("Sending this node's messages")
                    send_message = "Table,"  + str(message_JSON)
                    print(send_message)
                    lora.send(dst_id=3, msg=send_message, pkt_type=lora.PKT_TYPE['REQ'])
                    print(lora.seq_num)
                    while (int(lora.seq_num) != 0) and resend_count < 7:
                        lora.send(dst_id=3, msg=send_message, pkt_type=lora.PKT_TYPE['REQ'])
                        print("Resending Message..."+str(resend_count))
                        resend_count += 1
                        print(lora.seq_num)

                    if (int(lora.seq_num) != 0) and resend_count >= 7:
                        print("Message sending failed!")
                    else:
                        print("Message sent!")
                else:
                    print("This node's message list contains no entries. Sending nothing back.")
                        
        except:
            print("REQ Message Received But Payload Decode Error")
            
    sleep(0.03)

The receiver is receiving the REQ messages and is also sending the content. But somehow, the ACKs are not working.
What I found from the debug prints is that the REQ sender does not receive the ACK messages.

868 MHz Channels

Hello,
The example code has the following lines for the 914-916 MHz and 902-928 HMz.
I would like to modify the following line in the receiver and sender to set the frequency for hopping between 865.20 MHz and 868 MHz. How can I do that?

channels2Hopping = [914_000_000+200_000 * random.randint(0,10) for i in range(128)] # 914~916 MHz

channels2Hopping = [902_300_000+200_000 * random.randint(0,127) for i in range(128)] # 902~928 MHz

Start project

Hello,

I have like material :

  • 3 card ESP32 wrover dev
  • 3 DFROBOT Firebeetle Covers - LoRa 867Mhz SX1276
  • Sensors
  • 2 Grove lora 868Mhz seeed SX1276
  • 1 Gateway Indoor ( The things network gateway)

And i wish to know if the matérial are compatible with your solution to work with Micropython to create a LoRaWan Network

Multiple nodes sending to one node

I have setup two or more nodes sending data to a single node. A lot of collisions occur and "PayloadCrcError" shows up. But why does it get stuck at this? In the image below, one node is sending a sequence number and "HelloWorld" and the other is sending "HelloWorld_1".

Also, is there a way to receive maximum data from multiple nodes?

image

RutimeError

Hello,

I am trying to send an object over LoRa using your sender and receiver scripts. I am getting a runtime error in line lora.send(dst_id=0, msg=payload, pkt_type=lora.PKT_TYPE['REQ']) .

The error says RuntimeError: no active exception to reraise. I have also tried to convert the object to a byte string,

I get the same error in both cases. I can print the object as a byte string.

The string is 538 characters long.

What I found out is that when the payload length is getting longer only then the error occurs. Is there any way to send this big payload?

Declaring Parameters

I'd to like to perform FSK modulation on my hardware. it would be great if you show me how i could do that.

Retry sending a certain number of times

Hi,

Another feature that would be of great help is to set the number of retries to send a packet if the ACK is not received within the timeout.
Also, without ACK sending messages (not broadcasts), i.e., 'REQ' without ACK.

I have implemented two-way communication by defining a new packet type that builds on the "REQ" type. I'm quite not sure how to go about it.

How to fetch the source ID of the sender?

How to fetch the source ID (ID of the sender of the message) from a received packet?

Can we do something like
def onBroadcast(self, packet, SNR, RSSI):
print("[New 'Discovery' packet]", src_id, packet, SNR, RSSI)``

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.