lorawan icon indicating copy to clipboard operation
lorawan copied to clipboard

Python bindings

Open xiaoyaodiwang opened this issue 3 years ago • 9 comments

Hi

Is Python bindings built for lorawan module? I'd like to call lorawan module using Python. Looking forward to your answer, thanks!

xiaoyaodiwang avatar Jun 04 '21 13:06 xiaoyaodiwang

Hi, Python bindings are not bundled as of now. If I remember correctly, the last time I tried the command to create the bindings threw up an error, but it was quite some time ago. Let me know if you are successful in obtaining them (this page should contain all needed instructions to generate them). I will try and look into this.

DvdMgr avatar Jun 07 '21 11:06 DvdMgr

Hi, I've built bindings successfully using NS3 API Python scanning

xiaoyaodiwang avatar Jun 07 '21 12:06 xiaoyaodiwang

Nice, good to know! I'll add them to the module once I get some time to work on this.

DvdMgr avatar Jun 07 '21 12:06 DvdMgr

When I tried import lorawan module in Python, it reports that "ImportError: /ns-allinone-3.33/ns-3.33/build/bindings/python/ns/lorawan.cpython-36m-x86_64-linux-gnu.so: undefined symbol: _ZN3ns37lorawan39CorrelatedShadowingPropagationLossModel22GetCorrelationDistanceEv". How to solve this problem?

xiaoyaodiwang avatar Jun 23 '21 11:06 xiaoyaodiwang

As a temporary workaround: can you try removing the correlated-shadowing-propagation-loss-model.cc|h files (also removing them from the wscript), provided you don't use them, regenerate the python bindings and try again?

DvdMgr avatar Jun 24 '21 05:06 DvdMgr

I've removed them, and then another error is reported: "lorawan.cpython-36m-x86_64-linux-gnu.so: undefined symbol: _ZN3ns37lorawan15EndDeviceStatus17UpdateGatewayDataESt3mapINS_7AddressENS1_15PacketInfoPerGwESt4lessIS3_ESaISt4pairIKS3_S4_EEES3_d". Then I tried to remove "end-device-status.cc|h" files, but it fails to compile without "end-device-status.h".

xiaoyaodiwang avatar Jun 25 '21 11:06 xiaoyaodiwang

Hi @xiaoyaodiwang, Did you succeed in binding the code to python?

asmanuha avatar Oct 07 '21 16:10 asmanuha

Hi @xiaoyaodiwang, Did you succeed in binding the code to python?

Yes

xiaoyaodiwang avatar Oct 10 '21 05:10 xiaoyaodiwang

Hi @xiaoyaodiwang, can you share how you were able to make this work? I'd like to include this feature in the mainline, if you want to open a pull request feel free to do so!

DvdMgr avatar Nov 19 '21 14:11 DvdMgr