LoRa receiving only b''



  • Hello,

    I'm trying to get two LoPys to communicate via LoRa. The examples found at:
    https://docs.pycom.io/pycom_esp32/pycom_esp32/tutorial/includes/lora-mac.html

    and (after changing frequency to US 915 MHz)

    https://docs.pycom.io/pycom_esp32/pycom_esp32/tutorial/includes/lopy-to-lopy.html

    Are not working: the receiver is only getting b''. I've also tested several examples found in the forums and am getting the same result.

    Any ideas on how to fix this problem?

    Thanks,
    Mike K





  • Hi @Clemens, apologies this slipped through! I'm making the corrections to the docs now and will follow up when the new version is online!

    Sorry, we let you down on this one!

    Feel free to drop me an email at alex@pycom.io if you catch anything like this again!

    Sincerely,

    Alex



  • @sjgeitel Have you change the blocking mode property?

    lora_sock = socket.socket(socket.AF_LORA, socket.SOCK_RAW)
    lora_sock.setblocking(False)
    
    


  • @sjgeitel I found in RFM95 documentation some usefull information

    Mode of LoRa
    medium range: bandwidth=LoRa.BW_250KHZ,coding_rate=LoRa.CODING_4_5,sf=7
    fast short range: bandwidth=LoRa.BW_500KHZ,coding_rate=LoRa.CODING_4_5,sf=7
    slow long range: bandwidth=LoRa.BW_125KHZ,coding_rate=LoRa.CODING_4_8,sf=9
    very slow long range: bandwidth=LoRa.BW_125KHZ,coding_rate=LoRa.CODING_4_8,sf=12



  • @constantinos

    Hello Constantinos,

    I did modify my sample code with the trick as you told:
    lora = LoRa(mode=LoRa.LORA, frequency=863000000, power_mode=LoRa.ALWAYS_ON, tx_power=14, bandwidth=LoRa.BW_250KHZ, sf=7, preamble=8, coding_rate=LoRa.CODING_4_5, tx_iq=False, rx_iq=False)
    lora.init(mode=LoRa.LORA, frequency=863000000, power_mode=LoRa.ALWAYS_ON, tx_power=14, bandwidth=LoRa.BW_250KHZ, sf=7, preamble=8, coding_rate=LoRa.CODING_4_5, tx_iq=False, rx_iq=False)

    LORA communication is working well, I do not see any difference.

    best regards,
    Stephan G



  • Just tested LORA communication with version 1.6.6.b1.
    LORA communication is working well, see the sample code I am using.

    Sample code I am using into the two lopy units.
    For my LOPY unit on COM3:
    0_1488493687559_main.py

    For my LOPY unit on COM5:
    0_1488493757516_main.py

    But I have still have a question, what will be the best settings into the init settings of lora.

    lora = LoRa(mode=LoRa.LORA, frequency=863000000, power_mode=LoRa.ALWAYS_ON, tx_power=14, bandwidth=LoRa.BW_250KHZ, sf=7, preamble=8, coding_rate=LoRa.CODING_4_5, tx_iq=False, rx_iq=False)

    best regards,
    Stephan G



  • @sjgeitel

    Try this trick please

    # your original code
    lora = LoRa(mode=LoRa.LORA, frequency=863000000, power_mode=LoRa.ALWAYS_ON, tx_power=14, bandwidth=LoRa.BW_250KHZ, sf=7, preamble=8, coding_rate=LoRa.CODING_4_5, tx_iq=False, rx_iq=False)
    
    # and then again
    lora.init(mode=LoRa.LORA, frequency=863000000, power_mode=LoRa.ALWAYS_ON, tx_power=14, bandwidth=LoRa.BW_250KHZ, sf=7, preamble=8, coding_rate=LoRa.CODING_4_5, tx_iq=False, rx_iq=False)
    
    
    


  • I'm agree, I buy the lopy board for communicating with a raspberry pi with lora module as a simple gateway in earlier version the software works fine 1.6.0.b1 the firmware versions later there is communication but i missed a lot of packages. There is something changed in the firmware. I asked a couple of Times on Daniel but het give NO answer I'm verry dissapointed.



  • First Thanks to Stephan, without this hnt I would stay here still and searching for ansers why things not working.

    @Pycm Team: It's ok to have beta software and it's ok that there is a recommendation to date up the firmware before first use. But whot is not ok:

    You purchase a LoRa board and you get the advise on the bag that it is strongly recommended to update your bord but after this update your basic code for this device--LoRa--is no more working!! I spend some nights till I found this thread here. I updated the LoPys, tried different sketches froum your git side, on the documentation page and also "known working" examples from the forum. Nothing did wirk, nothing!! So it is a bit more than frustrating to have a board "simple" example sketches and nothing is transmitting data.

    I would strongly recommend that you make at least an eye-catching hit on a prominent place to worn. Or get an advice how to workaround this. It's not acceptable that you can find it only hidden in a forum post.



  • I was also getting b'' (empty string) because they did not communicate and recv() as it is run non-blocking and is returning empty buffer.
    After I added full init sequence params it started to work.
    And I am on the latest firmware (nodename='LoPy', release='1.6.4.b1', version='v1.8.6-475-g2320cb2d on 2017-02-24').



  • OK, got it figured out... you have to downgrade to 1.5.1b1. Instructions for doing this can be found at:
    https://forum.pycom.io/topic/517/downgrading-firmware-advanced-users

    Once this is done, then the raw socket example works.



  • Hello,

    I did try the complete Lora init:

    lora = LoRa(mode=LoRa.LORA, frequency=863000000, power_mode=LoRa.ALWAYS_ON, tx_power=14, bandwidth=LoRa.BW_250KHZ, sf=7, preamble=8, coding_rate=LoRa.CODING_4_5, tx_iq=False, rx_iq=False)

    This fix the same problem ( getting b") you have.

    Do you know where to find the default settings of LoRa?

    Best regards,
    Stephan G


Log in to reply
 

Pycom on Twitter