frame

LoRa-Click does not respond

Hey!

I try to use this manual:
https://www.zerynth.com/blog/getting-started-with-lorawan-and-python-using-zerynth-and-the-things-network/

My Problem starts with the programming of the Node. I try to use the example "get eui" as described but when I open the console I only get 0xFF as a return value.
The 0xFF indicates the timeout reached in the _read function in the named library. So even when I extend the timeout the board does not respond.
Did anybody have the same problem or has anybody an idea how to solve this problem?
It would be great to know how I can check if the communikation between the Flip&Click and the LoRa-click works...
I am grateful for any advice.

Max

Comments

  • Hi Max,

    this is a very weird behavior, because in the "get eui" example no connections are established with Lora Network.
    The example needs to extract the hardware unique identifier from the Lora Chip through serial command.

    If timeout is reached in _read function, it means that no serial communication is active (Lora chip does not respond to serial command); so the first check is to verify in which slot the Lora click is installed on your Flip & Click and which is the reset pin (you can check this on Zerynth Pinmap - peripherals view).

    SERIAL1 and D16 on the example code are related to Flip & Click slot A.

    The 0xFF response is also weird because if the timeout is reached in the _read function a -1 value should be returned.
    Try to put the get_hweui function in a try-except block and post me the exception (if raised).

    Hope this can help you
    Matteo Cipriani
    Zerynth Support Team
  • Thanks for your respond Matteo.
    I made a small mistake on Saturday. While trying to find the cause of the problem I converted the return value of the get_hweui() into a hex number as I expected bytes in return and no negative integer.... So, the real return value is, as you said, -1.
    Putting the call into a try-except block does not rise an exception, of course.
    I also checked the pin-mapping and slot (the last time was while writing this comment):
    I used Slot A
    Pin D16 (read from the pin-map in Zerynth is the second pin on the left side when the click is connected to the flip and click and this pin is marked with RST.

    I guess that at least the LoRa-click is powered, as there is a LED shining on the click....

    Is there a way to check both things: the serial communication of the flip and click and the serial communication of the click? to detect which part does not work?
  • Hi Max,

    If you want to check the serial data exchange between your Flip & Click and the Lora Click, you need a logic analyzer to sniff rx and tx channels.

    Otherwise, you can do a double check connecting an FTDI (USB-to-Serial) converter and interact with a general serial terminal:
     - Flip & Click and FTDI connected to serial pins: check the device sends the command "sys get hweui\r\n";
     - FTDI connected to the Lora Click (don't forget to power up the click): send the same command and check if the Lora chip responds.

    Note: serial baud rate for rn2483 chip is set by default to 57600 (see the datasheet page 9); so the FTDI must be set to this baud rate to exchange data.

    Let me know :)
    Matteo Cipriani
    Zerynth Support Team
  • Hey!

    I have only one USB-to-Serial converter for RS485. I tried it anyway and connected it to the Tx and Rx pins on the LoRa-click. The only result was that nothing happened at all. Not even the timeout respond was shown on the zerynth console...

    My setup was:
    Flip and click connected to one serial port
    USB-to-Serial on another port. moserial was listening to this port to get the exchanged data... baudrate was set to the mentioned 57600... is there any way that there could be a wrong baudrate set up in the lora-click?

  • edited December 2017
    Hi Max,

    honestly, I am near to finish the advices  :s
    We cannot replicate this issue and, from what you post, this seems clearly a serial communication problem, so you can try to:

     - check if reset pin works: to start up correctly the Lora chip it must be reset and initialized, so, with a multimeter or an oscilloscope, you can verify if D16 goes up/down correctly during the init phase (if you haven't a multimeter, you can insert a digitalRead(D16) instruction and print the state of the pin during the init phase). If for some unknown reason, this pin does not work properly you can change the reset pin and uplink the new script.

     - If the reset pin work properly you can try the Lora Click in one of the other available slot (maybe it can be a serial peripheral issue):
          - slot B - SERIAL2, D24;
          - slot C - SERIAL3, D29;
          - slot D - SERIAL3, D36.

    Let me know :)

          
    Matteo Cipriani
    Zerynth Support Team
  • Hey!
    Well, I tried your second tip first...
    and, surprise surprise, it seems that I did something wrong when I tried to connect the LoRa-click to slot B for the first time. I can report now, that the lora wokrs fine on slot B,C and D and I get the EUI each time :) . A does still not work... :'(
    So, I still have to figure out what does not work on slot A.
    But thanks a lot Matteo for your help and patience.
  • edited December 2017
    Glad to hear that B); regarding the slot A, you can do a simple test to check if the 3 pins, that handle the Lora click in the slot A, work (maybe a solder has jumped).

    If you have a multimeter you can measure the voltage of each pin during the device running a script that puts those pins at high/low level once per 2/3 second (human timing); if all works well, you should read near the 0 V when the pin is set to low and near the 3.3V when it is high.

    If you have not a multimeter, you can connect the Lora click pins to other 3 Flip & Click and run a script that, as before, puts at high/low level the Lora click pins through a digitalWrite() and read voltage level in the other 3 pins through a digitalRead(); again, if all works well, you should read a 0 logic level when low and a 1 logic level when high.

    Here a sample code for this test:

    import streams
    
    streams.serial()
    
    pinMode(D16, OUTPUT) #RST pin slot A
    pinMode(D22, OUTPUT) #RX pin of SERIAL1 in slot A
    pinMode(D23, OUTPUT) #TX pin of SERIAL1 in slot A
    pinMode(D18, INPUT)  #connected to D16
    pinMode(D19, INPUT)  #connected to D22
    pinMode(D20, INPUT)  #connected to D23
    
    while True:
        try:
            #put all Lora Click HIGH
            print("Lora Click to high level")
            digitalWrite(D16, HIGH)
            digitalWrite(D22, HIGH)
            digitalWrite(D23, HIGH)
            rst = digitalRead(D18)
            rx  = digitalRead(D19)
            tx  = digitalRead(D20)
            print("Reset Pin Level:", rst)
            print("SERIAL1 RX pin Level", rx)
            print("SERIAL1 TX pin level", tx)
            print("---------------------------")
            sleep(2000)
            #put all Lora Click LOW
            print("Lora Click to low level")
            digitalWrite(D16, LOW)
            digitalWrite(D22, LOW)
            digitalWrite(D23, LOW)
            rst = digitalRead(D18)
            rx  = digitalRead(D19)
            tx  = digitalRead(D20)
            print("Reset Pin Level:", rst)
            print("SERIAL1 RX pin Level", rx)
            print("SERIAL1 TX pin level", tx)
            print("---------------------------")
            sleep(2000)
            
        except Exception as e:
            print(e)
            sleep(1000)

    Let me know ;)
    Matteo Cipriani
    Zerynth Support Team
  • Hey!
    I did what you said. and thanks for the script!
    I measured with a multimeter and some pins I have got left.
    The result is:
    The RST pin works fine. It changes state every few seconds between 0V and 3.3V
    The same behaviour can be seen with the Rx pin.
    The problem is the Tx pin. It is always around 1.6V.
    I checkt the connections of the slots earlier and the did look normal. anyway, I listened to your advice and applied some more solder to the connection and it worked.
    Testing the LoRa-click and reading the eui worked, too.

    Thank you Matteo for your help! :#
  • Great!!! you're welcome B)
    Matteo Cipriani
    Zerynth Support Team
Sign In or Register to comment.

ZERYNTH Community

@ 2016 Zerynth.com, all rights reserved.