But I’m still a bit confuse.
So I installed this in my VirtualBox without loraserver and then in my real machine that has loraserver only still waiting for any message?
Another point, I need to install lora gateway bridge in my machine which contains the loraserver?
I mean my script, it won’t work as the lorawan package has changed and I haven’t got the time to update it right now. But as I said, you could check that package and try to fix what’s wrong (the errors you got before).
For this to work, your particular deployment doesn’t matter much (i.e., if loraserver/lora-app-server/lora-gateway-bridge are in same or different machines) as long as you have the MQTT broker running and they are all connected to it. The script (if fixed) publishes to the broker.
I’d recommend you give a thorough read to the loraserver architecture and the docs in general.
Firstly, I want to thank you for your support.
I just want to know if I need to change the value that you have in appEUI because the errors that appears me is from the line 322 - 409 and some reason I think it provides from that appEUI that you say in your go file we need to replace, and I don’t know for what I need to replace
/*
*
* To test OTAA activation, send a join request.
* Replace appKey, devEUI and appEUI with the correct ones.
*
*/
appKey := [16]byte{2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2}
appEUI := [8]byte{1, 1, 1, 1, 1, 1, 1, 1}
devEUI := [8]byte{2, 2, 2, 2, 2, 2, 2, 2}
this thing is in line 77-85
The problem is bigger than just changing some EUI or removing a legacy one: the program won’t compile as the package lorawan has changed and it depends on it. That’s why it throws error about missing methods and things like that.
I’m pretty sure I’ll be able to rewrite it some time before friday, hope that helps.
Alright, I did a quick fix at work and got it going for an ABP device, LoRaWAN version 1.0.2 and regional parameters B. But it was still a messy script, so later at home I rewrote it to be a package that can be imported.
Sadly, I can’t test that from home, so I’m hoping nothing got messed up in the rewrite. I’ll test it tomorrow at work and fix any issue that I may have missed now. You can check it here, it’s been renamed to show the change: https://github.com/iegomez/loraserver-device-sim
Now, bear in mind that it’s horribly simple right now and just allows to send an Uplink or a JoinRequest, and only for version 1.0.X of LoRaWAN. I’ll be adding some more functionality as I get the time, but hope that helps in the meantime. Take a look at the examples folder for an uplink example program.
Well yes, lds.go is a package, not a runnable program. On the other hand, uplink_example.go declares the package and function main, so it can be compiled to en executable binary that may run, and imports the package loraserver-device-sim to call the exported functions.
I tested the change today and it’s all working fine here. You probably mixed up the keys, didn’t relax frame counter, selected a different lorawan mac version on device-profile, etc. Here is my device profile :
Note that the first 3 keys are used with lorawan mac version 1.1, so they are all the same and correspond to NwkSKey on version 1.0. Also, on my package the application session key is set in the device as AppSKey. Make sure those are correct.
You set them. In ABP (activation by personalization) you provide the keys, they are not negotiated by the device and server. So you may press “Generate random key” at the UI and then use those (device address, nwskSKey and AppSKey) when creating a device with my package (remember to leave the same for the 3 keys that come after the device address).
Your lora-app-server is running fine. I don’t know how you configured it, but by default it should expose the UI at localhost:8080. Anyway, I think you need to give a read to the docs before even trying to simulate a device . I doubt you have a device configured to receive the packets if you haven’t looked at the UI (unless you are doing everything through the API).
Please, read the docs I referenced carefully to get to know the whole loraserver infrastructure. You need to understand those before trying to do more advanced things. It’ll also guide you through the basics, like creating users, organizations, adding gateways, applications, devices, etc.
It is a good amount of information and probably not something to cover in this forum thread, which is getting totally off topic. Also, many of the questions you may have when going through it may already be answered at the forum, so remember to search for them before.
In the example you have devEUI := [8]byte{0, 0, 0, 0, 0, 0, 0, 2}, which in hex would be 0000000000000002, so the latter is what you need at Device EUI.