Multitech conduit and Lopy "Not joined yet"



  • Hi guys,

    I am new here and am looking for some help with connection of my Lopy. I have done a trial connection with a Multitech Mdot and it works fine but when i configure a Lopy OTAA I can see it listed on the conduit as a node but the Lopy continues to print "Not joined yet". any ideas??

    <

    import binascii
    import pycom
    import socket
    import time
    from network import LoRa
    # Colors
    off = 0x000000
    red = 0xff0000
    green = 0x00ff00
    blue = 0x0000ff
    # Turn off hearbeat LED
    pycom.heartbeat(False)
    # Initialize LoRaWAN radio
    # lora = LoRa(mode=LoRa.LORAWAN)
    # Initialize LoRa in LORAWAN mode.
    # Please pick the region that matches where you are using the device:
    # Asia = LoRa.AS923
    # Australia = LoRa.AU915
    # Europe = LoRa.EU868
    # United States = LoRa.US915
    lora = LoRa(mode=LoRa.LORAWAN, region=LoRa.AU915)
    # create an ABP authentication params
    # dev_addr = struct.unpack(">l", binascii.unhexlify('00 00 00 05'.replace(' ','')))[0]
    # Set network keys
    app_eui = binascii.unhexlify('1122334455667788')
    app_key = binascii.unhexlify('11112222333344445555666677778888')
    # Join the network
    #lora.join(activation=LoRa.OTAA, auth=(app_eui, app_key), timeout=600)
    lora.join(activation=LoRa.OTAA, auth=(app_eui, app_key), timeout=0)
    pycom.rgbled(green) # green
    # Loop until joined
    while not lora.has_joined():
        print('Not joined yet...')
        pycom.rgbled(off)
        time.sleep(0.1)
        pycom.rgbled(red)
        time.sleep(2)
    
    print('Joined')
    pycom.rgbled(blue)
    
    s = socket.socket(socket.AF_LORA, socket.SOCK_RAW)
    s.setsockopt(socket.SOL_LORA, socket.SO_DR, 5)
    s.setblocking(True)
    
    i = 0
    while True:
        count = s.send(bytes([i % 256]))
        print('Sent %s bytes' % count)
        pycom.rgbled(green)
        time.sleep(0.1)
        pycom.rgbled(blue)
        time.sleep(9.9)
        i += 1
    >
    


  • This post is deleted!


  • @jmarcelino

    Hi I was trying the code on Leo Gaggl's blog page .

    Cheers

    Sean



  • @jmarcelino

    Hi I have been changing settings to try and make it work but here is what it is at the moment. I have changed to FSB 2 in case I want to use the TTN in the future.

    Cheers

    Sean0_1522878494362_LORA.jpg



  • @monsteroz
    Can you post what are you current gateway settings please?



  • Hi guys,

    I reset to factory setting on the conduit and just added ID nd Key .. still no luck with the lopy..

    Sean



  • @jmarcelino

    I did not change the Join Delay but I have now changed it to 5 seconds with no change

    thanks

    Sean



  • Thanks @monsteroz

    I'm not an expert on Multitech but I think your "Join Delay" isn't according to the specification.

    That should be 5 (seconds) as Robert already pointed out. Did you change it already?

    Do keep the sub channel selection code. That's also necessary, but not sufficient.



  • @jmarcelino Hi,

    If I lock it to sub band 4 it seems to just hang

    # Europe = LoRa.EU868
    # United States = LoRa.US915
    lora = LoRa(mode=LoRa.LORAWAN, region=LoRa.AU915)
    select_subband_au915(lora, 4)
    # create an ABP authentication params
    
    

    If I add the below I get the same 'Not joined yet" message

    lora = LoRa(mode=LoRa.LORAWAN, region=LoRa.AU915)
    def select_subband_au915(lora, subband):
        if (type(subband) is int):
            if ((subband<1) or (subband>8)):
                raise ValueError("subband out of range (1-8)")
        else:
            raise TypeError("subband must be 1-8")
        
        for channel in range(0, 64):
            lora.remove_channel(channel)
        
        for channel in range((subband-1)*8, ((subband-1)*8)+8):
            lora.add_channel(channel, frequency=915200000+channel*200000, dr_min=0, dr_max=5)
    select_subband_au915(lora, 4)
    # create an ABP authentication params
    app_eui = binascii.unhexlify('1122334455667788')
    app_key = binascii.unhexlify('11112222333344445555666677778888')
    # Join the network
    #lora.join(activation=LoRa.OTAA, auth=(app_eui, app_key), timeout=600)
    lora.join(activation=LoRa.OTAA, auth=(app_eui, app_key), timeout=0)
    


  • @jcaron
    The Lopy and Lopy4 just does not exit the loop and says "not joined yet."



  • @monsteroz
    Ok some problems...

    In the AU915 region need to restrict the LoPy to what your gateway is set to:
    Frequency Sub-Band 4

    Because as configured the LoPy expects to use all valid 72 channels. However most real world gateways are limited to only 8 channels, hence the full channel map is partitioned into subbands.

    So add a function like this

    def select_subband_au915(lora, subband):
        if (type(subband) is int):
            if ((subband<1) or (subband>8)):
                raise ValueError("subband out of range (1-8)")
        else:
            raise TypeError("subband must be 1-8")
        
        for channel in range(0, 64):
            lora.remove_channel(channel)
        
        for channel in range((subband-1)*8, ((subband-1)*8)+8):
            lora.add_channel(channel, frequency=915200000+channel*200000, dr_min=0, dr_max=5)
    

    the call select_subband_au915(lora, 4) to remove all channels which don't belong to sub-band 4 after initialising your LoRa object (and before joining)



  • @jcaron There were complaint about the in another thread.



  • @robert-hh Never had an issue with RX2 on the receiving side. What kind of issue are you seeing?



  • @monsteroz said in Multitech conduit and Lopy "Not joined yet":

    I am still getting my head around Lora :)

    I'm still at the beginning too, starting with LoRa a few weeks ago.



  • @monsteroz I do not understand all the settings, but some comments.

    • The xxPy software has problems with the RX2 window, so always the RX1 should be used.
    • The OTAA join delay is 5 seconds.


  • @robert-hh Thanks Robert. I am still getting my head around Lora :)



  • @monsteroz said in Multitech conduit and Lopy "Not joined yet":

    What does the " dr=config.LORA_NODE_DR)

    It sets the data rate, and in my example it is set to 5.



  • @robert-hh

    Hi this is the config and the history

    1_1522019679824_lora setup.jpg 0_1522019679820_lora log.jpg



  • @jcaron someone fixed it for me ????



  • @robert-hh The values in the script are correct as this is just a testbed to get things working. I did not use the Dev_eui as I read it will use a default address. What does the " dr=config.LORA_NODE_DR) " do?

    Cheers

    Sean


 

Pycom on Twitter