houluy / lora-mote-emulator

This is a device (mote) emulator for LoRaWAN protocol(1.0 & 1.1). Completely realized by Python 3.6
MIT License
22 stars 12 forks source link

OTAA device and join request #2

Closed Gillani0 closed 4 years ago

Gillani0 commented 4 years ago

Hi, I'm having some trouble to create an OTAA device and send a join request. Apparently there's only the ABP command available to create ABP compliant device. Can you please help me in this matter. Cheers

Syed

houluy commented 4 years ago

hi, would u provide some details?

What happens exactly? Which LoRaWAN verison were u using? Which LoRa server is used?

Gillani0 commented 4 years ago

Hi,

I'm using LoRaWAN 1.0, when I tried to create the device with the new command and join type:

pipenv run python main.py -n join

I always gets the error: ERROR - You need to finish Join procedure before sending application data and nothing is received on the UDP port.

However, it should send a join request to the server.

houluy commented 4 years ago

I guess the problem is that the config/device.yml is not properly configured, an example looks like this,

Device:
    JoinEUI: '0000000000000000'
    DevEUI: '1234567890ABCDEF'
Keys:
    AppKey: 4c0892904bb3544138b5070c5c4069cd
    NwkKey: be60e113de86d73b52fc0005bf5d89e8
Gateway:
    GatewayEUI: 4e7b2799b9bfd427

If you're using LoRaWAN 1.0.2, change the AppEUI to JoinEUI, and make NwkKey field equal to AppKey field. However, LoRaWAN 1.0.2 is not well tested, it may have some compatibility issues.

There is an older commit that may work well with LoRaWAN 1.0.2, check this commit if you need:

72b776071bf9329e5a9481a868b35f75d90b5d44
commit message: update pyyaml version
Gillani0 commented 4 years ago

Thanks @houluy I think you should update your documentation since it's not clear how to use OTAA and requires some iterations. Cheers

houluy commented 4 years ago

Thanks a lot! I'll fix the document.