iegomez / lds Goto Github PK
View Code? Open in Web Editor NEWLoraserver device simulator with a simple GUI.
Loraserver device simulator with a simple GUI.
I'm facing an issue using the encoded data function.
I activated the encoded option and I kept the default data objects :
However, Chirsptack don't seem to receive the whole data when i sent it as you can see :
So I tried to add another object and sent a new data payload but the number of encoded digits is still the same.
ERRO[1899] processing uplink frame error data_base64=“AAgHBgUEAwIBAAAAAAAAAAAAAMyVJYI=” error=“join-request to join-server error: unmarshal response error: invalid character ‘<’ looking for beginning of value”
Thank you !
Dear Ignacio,
I tried to run the "make" command in the lds folder, but it stops with an TLS authentication problem.
I fixed it by reinstalling "Go", with this manual:
for Ubuntu 18.04 LTS
Maybe you want to put it in your "read.me", so anyone can use it directly.
Best Wishes
Max
I was trying to run this on docker but not successful is there any way
using a image of golang:1.12
docker run --rm -it -v "$PWD":/usr/src/lds -w /usr/src/lds golang:1.12
then install the dependencies
root@e16a31086b10: apt install build-essential xorg-dev libgl1 libgl1-mesa-dev libgl1-mesa-glx redis-server
and run the "make" but the executable didn't work
PD: Exelente Trabajo, Saludos desde Mexico.
Hello,
I've tried yesterday the simulator. I succcesfully run the gui version and so i've decided to try the cli with the same configuration file but each time i do a : run go main.go
I have an error that say :
# command-line-arguments ./main.go:171:15: undefined: lds.DataRate ./main.go:190:7: undefined: err ./main.go:212:14: undefined: lds.RxInfo ./main.go:246:4: unknown field 'Timestamp' in struct literal of type "github.com/brocaar/loraserver/api/gw".UplinkRXInfo ./main.go:276:22: device.Uplink undefined (type device has no method Uplink)
I'm a beginner to go so I don't truly understand where it's come from so if you can add some documentation on the cli version and how to run it, it'll be a great help.
It is very useful for some non-developer users to have the compiled version of the program, so adding it to the respository could be amazing.
It could be accomplished using the github actions.
Hi,
I would like to make some simulations with the device simulator (stress tests, statistical verifications, etc.).
I thought of maybe extracting the relevant parts of the code, or write an automation that would click on the UI.
Is there a better way to do it? Like using the LDS as a Library?
How do you suggest to approach this problem?
Thank you very much!
Hi,
I tried (and then looked at the code) to send a join request thorough the packet forwarder but it seems like it's only supported with MQTT server. Is there a way (or you thinking of extending it) to send join request and receive it through the packet forwarder. Cheers
Syd
Hii, @iegomez
i have downloaded release source code but how can i run in windows platform
can you please provide step for open in windows platform
Thanks
Hi, I got some very annoying GUI crashes when scrolling the output console window.
Seems related to imgui.
Do you have any workaround ?
Thx
error logs below :
panic: Assertion failed!
File: imgui.cpp, Line 3618
Expression: draw_list->_VtxCurrentIdx < (1 << 16) && "Too many vertices in ImDrawList using 16-bit indices. Read comment above"
goroutine 1 [running, locked to thread]:
github.com/inkyblackness/imgui-go.glob..func1(0xc00009e000, 0x73, 0xc0002d4540, 0x9, 0xe22)
/home/nico/go/pkg/mod/github.com/inkyblackness/[email protected]/Assert.go:18 +0x179
github.com/inkyblackness/imgui-go.iggAssert(0x0, 0xcff5e8, 0xcfe741, 0xe22)
/home/nico/go/pkg/mod/github.com/inkyblackness/[email protected]/Assert.go:31 +0xad
github.com/inkyblackness/imgui-go._cgoexpwrap_52ca0b464ede_iggAssert(0x7fff00000000, 0xcff5e8, 0xcfe741, 0xe22)
_cgo_gotypes.go:2462 +0x45
github.com/inkyblackness/imgui-go._Cfunc_iggRender()
_cgo_gotypes.go:2029 +0x41
github.com/inkyblackness/imgui-go.Render(...)
/home/nico/go/pkg/mod/github.com/inkyblackness/[email protected]/imgui.go:56
main.main()
/home/nico/work/go/lds/main.go:388 +0x421
To overcome IMGUI limitations. Will be collected in feat/gui-port branch
Hey, @scartill!
I've given it some thought and I don't believe I'll be doing any more changes nor will I be reviewing to this repo, I just can't find the time and there are other priorities I prefer to attend to. Since you've done some great work with it and I know some people still use the project to aid in their ChirpStack testing, I'd be happy to transfer it to you if you'd be willing. Let me know what you think, but feel no pressure at all! If you aren't able to gain ownership, I'll just archive it and put a notice for others to fork and continue any work if they think it's worth it.
Thanks again and cheers!
Hi everyone!
I am working in an environment with separate machines for the Chirpstack Network Server, Application Server, and the Device Simulator. I am trying to send a Join Request using the following configuration.
encoded_type = []
log_level = ""
[mqtt]
server = "tcp://lora-ns:1883"
user = ""
password = ""
downlink_topic = "gateway/abcdabcdabcdabcd/event"
uplink_topic = "gateway/abcdabcdabcdabcd/command"
[forwarder]
nserver = ""
nsport = ""
[band]
name = "US_902_928"
[device]
eui = "1111111111111111"
address = "22222222"
network_session_encription_key = "33333333333333333333333333333333"
serving_network_session_integrity_key = "44444444444444444444444444444444"
forwarding_network_session_integrity_key = "55555555555555555555555555555555"
application_session_key = "66666666666666666666666666666666"
marshaler = "protobuf"
nwk_key = "22222222222222222222222222222222"
app_key = "76757279736563726574"
join_eui = "0000000000000000"
mac_version = 0
profile = "ABP"
joined = false
skip_fcnt_check = true
[gateway]
mac = "abcdabcdabcdabcd"
bridge_version = ""
[data_rate]
bandwith = 125
spread_factor = 7
bit_rate = 0
[rx_info]
channel = 0
code_rate = ""
crc_status = 0
frequency = 0
lora_snr = 0.0
rf_chain = 0
rssi = 0
[raw_payload]
payload = ""
use_raw = false
script = "\n// Encode encodes the given object into an array of bytes.\n// - fPort contains the LoRaWAN fPort number\n// - obj is an object, e.g. {\"temperature\": 22.5}\n// The function must return an array of bytes, e.g. [225, 230, 255, 0]\nfunction Encode(fPort, obj) {\n\treturn [];\n}\n"
use_encoder = false
max_exec_time = 100
js_object = ""
fport = 0
[redis]
addr = ""
password = ""
db = 0
[window]
width = 1200
height = 1000
[provisioner]
hostname = ""
username = ""
password = ""
path = ""
Token = ""
Where:
For some reason, I can see the message arrive to the mqtt on the Network server, but I do not see the Network Server handle it, and the message is not forwarded to the Application Server.
I also have a few questions:
I hope you can help me (or redirect me to some relevant documentation)!
Thank you very much!
Hi everyone,
I am trying to build a virtual LoRa environment for testing, based on Chirpstack's server infrastructure.
For some reason, when trying to use this tool, I get segmentation faults when trying to join. I get a segmentation fault at least 50% of the times I click on "Join". Here is one of the error messages:
`panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0xa0 pc=0x91a48a]
goroutine 1 [running, locked to thread]:
github.com/iegomez/lds/lds.(*Device).Join(0x0, 0xcd29c0, 0xc00000c1e0, 0x0, 0x0, 0x0, 0x0, 0xc0000920a0, 0xc0000676c0, 0x46a4ff, ...)
/home/lora/Desktop/lds/lds/lds.go:112 +0x3a
main.join()
/home/lora/Desktop/lds/device.go:376 +0x4df
main.beginDeviceForm()
/home/lora/Desktop/lds/device.go:125 +0xb9d
main.main()
/home/lora/Desktop/lds/main.go:375 +0x312
^C
[1]+ Exit 2`
This happened with different configurations... This specific error happened when I tried to join a second time, after a first time fail.
I also got this segmentation fault error (I don't remember how):
`panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x91a310]
goroutine 1 [running, locked to thread]:
github.com/iegomez/lds/lds.(*Device).SetMarshaler(0x0, 0xbb7d65, 0x4)
/home/lora/Desktop/lds/lds/lds.go:73 +0x40
main.beginDeviceForm()
/home/lora/Desktop/lds/device.go:84 +0xd69
main.main()
/home/lora/Desktop/lds/main.go:375 +0x312
^C
[1]+ Exit 2 ./gui`
Thank you very much! Hope it helps :)
Hi,
This is probably a newby issue but please bear with me:
I have chirpstack running via docker-compose and am trying to get your client to connect to it.
I've registered a gateway in chirpstack with an gateway ID of DEADBEEFDEADBEEF
I then run the client with no other parameters (i.e. default configuration), and tell it to connect to the MQTT server (localhost:1883)
In the chirpstack log I can see the connection being made, but the it immediately disconnects
mosquitto_1 | 1597846740: New connection from 172.20.0.1 on port 1883.
mosquitto_1 | 1597846740: New client connected from 172.20.0.1 as lds-1597846740191835856 (p2, c1, k30).
mosquitto_1 | 1597846740: Socket error on client lds-1597846740191835856, disconnecting.
The log from the client shows teh connection, but it then exits without any error being shown:
phil@pol-r:~/go/github.com/legomez/lds$ ./gui
time="2020-08-19T15:17:28+01:00" level=info msg="open conf.toml: no such file or directory"
time="2020-08-19T15:17:28+01:00" level=error msg="devEUI error: lorawan: exactly 8 bytes are expected"
time="2020-08-19T15:19:00+01:00" level=info msg="MQTT connecting..."
time="2020-08-19T15:19:00+01:00" level=info msg="connection established"
time="2020-08-19T15:19:00+01:00" level=info msg=subscribed
The last line is an extra log statement I added to check that its getting past the call to mqqtClient.SubScribe()
Looking at the code I can't even see where it would be going next as this seems to be the complete callback on the "connect" button.
Any ideas or suggestion on what I can do to debug this further ?
I am trying to use your software to simulate a device connected to the ChirpStack platform I had deployed in a server. However, when I try to connect it, after sucessfully conected the MQTT client of your software, I had some error messages from the software.
The configuration file I use is:
encoded_type = []
log_level = ""
[mqtt]
server = "tcp://192.168.27.51:1883"
user = ""
password = ""
downlink_topic = "gateway/%s/command/down"
uplink_topic = "gateway/%s/event/up"
[forwarder]
nserver = ""
nsport = ""
[band]
name = "AU_915_928"
[device]
eui = "0201010101010103"
address = ""
network_session_encription_key = ""
serving_network_session_integrity_key = ""
forwarding_network_session_integrity_key = ""
application_session_key = ""
marshaler = "json"
nwk_key = ""
app_key = "03010101010101010101010101010103"
join_eui = "0000000000000000"
mac_version = 0
profile = "OTAA"
joined = false
skip_fcnt_check = false
[gateway]
mac = "647fdafffe007f9f"
bridge_version = ""
[data_rate]
bandwith = 125
spread_factor = 10
bit_rate = 0
[rx_info]
channel = 0
code_rate = "4/5"
crc_status = 1
frequency = 915200000
lora_snr = 7.0
rf_chain = 1
rssi = -57
[raw_payload]
payload = "DEEFF"
use_raw = true
script = "\n// Encode encodes the given object into an array of bytes.\n// - fPort contains the LoRaWAN fPort number\n// - obj is an object, e.g. {\"temperature\": 22.5}\n// The function must return an array of bytes, e.g. [225, 230, 255, 0]\nfunction Encode(fPort, obj) {\n\treturn [];\n}\n"
use_encoder = false
max_exec_time = 100
js_object = ""
fport = 2
[redis]
addr = ""
password = ""
db = 0
[provisioner]
hostname = ""
username = ""
password = ""
path = ""
Token = ""
In the chirpstack server I got:
chirpstack-application-server_1 | time="2021-07-15T16:05:11Z" level=info msg="backend/joinserver: request received" message_type=JoinReq receiver_id=0000000000000000 sender_id=000000 transaction_id=4219271299
chirpstack-application-server_1 | time="2021-07-15T16:05:11Z" level=info msg="device-keys updated" ctx_id="<nil>" dev_eui=0201010101010103
chirpstack-application-server_1 | time="2021-07-15T16:05:11Z" level=info msg="backend/joinserver: sending response" dev_eui=0201010101010103 message_type=JoinAns receiver_id=000000 result_code=MICFailed sender_id=0000000000000000 transaction_id=4219271299
chirpstack-network-server_1 | time="2021-07-15T16:05:11Z" level=info msg="lorawan/backend: finished backend api call" message_type=JoinReq protocol_version=1.0 receiver_id=0000000000000000 result_code=MICFailed sender_id=000000 transaction_id=4219271299
chirpstack-application-server_1 | time="2021-07-15T16:05:11Z" level=error msg="join-server returned error: response error, code: MICFailed, description: invalid mic" dev_eui=0201010101010103 type=OTAA
chirpstack-application-server_1 | time="2021-07-15T16:05:11Z" level=info msg="finished unary call with code OK" ctx_id=5c998266-780a-4ddb-af4e-4aaee13a42be grpc.code=OK grpc.method=HandleError grpc.service=as.ApplicationServerService grpc.start_time="2021-07-15T16:05:11Z" grpc.time_ms=1.388 peer.address="172.18.0.10:36222" span.kind=server system=grpc
chirpstack-application-server_1 | time="2021-07-15T16:05:11Z" level=info msg="integration/logger: logging event" ctx_id=5c998266-780a-4ddb-af4e-4aaee13a42be dev_eui=0201010101010103 type=error
chirpstack-application-server_1 | time="2021-07-15T16:05:11Z" level=info msg="integration/mqtt: publishing event" ctx_id=5c998266-780a-4ddb-af4e-4aaee13a42be dev_eui=0201010101010103 qos=0 retain=false topic=application/1/device/0201010101010103/event/error
chirpstack-network-server_1 | time="2021-07-15T16:05:11Z" level=info msg="finished client unary call" ctx_id=106d5046-94db-4c0a-a165-fbe9982d27c4 grpc.code=OK grpc.ctx_id=5c998266-780a-4ddb-af4e-4aaee13a42be grpc.duration=1.867165ms grpc.method=HandleError grpc.service=as.ApplicationServerService span.kind=client system=grpc
chirpstack-network-server_1 | time="2021-07-15T16:05:11Z" level=error msg="uplink: processing uplink frame error" ctx_id=106d5046-94db-4c0a-a165-fbe9982d27c4 error="join-request to join-server error: response error, code: MICFailed, description: invalid mic"
In the debug messages from the app:
time="2021-07-15T11:24:57-05:00" level=debug msg="Incoming Downlink len=235"
time="2021-07-15T11:24:57-05:00" level=debug msg="original dlmessage: \n\x16`\x1c\xa5o\x00\xaa|\xc7\x03\x00\x00\x00p\x03P\xff\xff\x01 J\xf5\x1a\x12/\n\bd\u007f\xda\xff\xfe\x00\u007f\x9f(\xa0ᡸ\x030\x1b`\x01\x82\x01\x04\x01\x02\x03\x04B\f\b\xf4\x03\x10\a\x1a\x034/5 \x01r\x04\n\x02\b\x01\x18\x83\xaf\x01\"\x10W\x83Km\x03\xfeF\f\xa2\xe3\xe6X\xe3\xf0\x1cU*?\n\x16`\x1c\xa5o\x00\xaa|\xc7\x03\x00\x00\x00p\x03P\xff\xff\x01 J\xf5\x1a\x12%(\xa0ᡸ\x030\x1b`\x01\x82\x01\x04\x01\x02\x03\x04B\f\b\xf4\x03\x10\a\x1a\x034/5 \x01r\x04\n\x02\b\x01*?\n\x16`\x1c\xa5o\x00\xaa|\xc7\x03\x00\x00\x00p\x03P\xff\xff\x01 J\xf5\x1a\x12%(\xa0ᡸ\x030\x1b`\x01\x82\x01\x04\x01\x02\x03\x04B\f\b\xf4\x03\x10\f\x1a\x034/5 \x01r\x04\n\x02\b\x022\bd\u007f\xda\xff\xfe\x00\u007f\x9f"
time="2021-07-15T11:24:57-05:00" level=error msg="downlink error: invalid character '\\x16' looking for beginning of value"
time="2021-07-15T11:24:57-05:00" level=warning msg="[redis] missing ulFcnt key: dial tcp [::1]:6379: connect: connection refused"
time="2021-07-15T11:24:57-05:00" level=warning msg="[redis] missing dlFcnt key: dial tcp [::1]:6379: connect: connection refused"
time="2021-07-15T11:24:57-05:00" level=warning msg="[redis] missing join nonce key: dial tcp [::1]:6379: connect: connection refused"
time="2021-07-15T11:24:57-05:00" level=warning msg="[redis] missing dev nonce key: dial tcp [::1]:6379: connect: connection refused"
time="2021-07-15T11:24:57-05:00" level=error msg="redis convert error (fNwksSIntKey): dial tcp [::1]:6379: connect: connection refused"
In the ChirpStack aplication server there is a device with the EUI: 0201010101010103 with AppKey 03010101010101010101010101010103
Could you please, help me with this setting.
Hi,
Building on Ubuntu 18.04 I found that I also needed the following to get the build to work:
sudo apt-get install libgles2-mesa-dev
Small point I know, but you might want to update the readme.
Hi,
I noticed that my chirpstack server discard uplink frames using packet forwarder from lds because tmst parameter type is wrong. Indeed it is supposed to be unsigned 32b from the spec and it is defined as uint64 in lds code.
Name | Type | Function |
---|---|---|
tmst | number | Internal timestamp of "RX finished" event (32b unsigned) |
Do you confirm ?
Hi,
I made successfull activation test in OTAA between lds and chirpstack server.
However, I noticed that it fails in ABP because device addr stays 0 when sending uplink frames (when reading data from redis)
I did some slight modification in the code to make it works but I am surprised that nobody reported the issue maybe I missed something in the conf.
Hi there,
I built the compiled file and I correctly have the "gui" compiled file which appears using the "make" command.
When i tried to load it with ./gui it results in the following error :
time="2021-04-12T14:36:56+02:00" level=warning msg="[redis] missing ulFcnt key: redis: nil" time="2021-04-12T14:36:56+02:00" level=warning msg="[redis] missing dlFcnt key: redis: nil" time="2021-04-12T14:36:56+02:00" level=warning msg="[redis] missing join nonce key: redis: nil" time="2021-04-12T14:36:56+02:00" level=warning msg="[redis] missing dev nonce key: redis: nil" time="2021-04-12T14:36:56+02:00" level=error msg="redis convert error (fNwksSIntKey): redis: nil" time="2021-04-12T14:36:57+02:00" level=fatal msg="floating point fbos not supported (attempted [(0x1909, 0x1909, 0x8d61): 0x8cd6 (0x1908, 0x1908, 0x8d61): 0x8cd6 (0x1908, 0x1908, 0x1406): 0x8cd6])"
The 5 first error lines don't seem to be an issue for the code loading but the last one stop the window's launching.
I seaked out a fix on the web but nothing worked for me.
Can you help me please?
PS : Sorry for the topic I'm not very familiar with the go programming language
Informations about my environment.
OS : Linux UBUNTU 18.04 LTS
OpenGL version : 3.3
Go version : 1.16.3 linux/amd64
I've compiled lds on osx: Redis is answering pong at ping command, GUI is ok and connection to our lora server works.
By the way at device join click on the lds gui interface I receive the following error in the built-in console:
level=error msg="redis get key error: redis: nil"
Hi, sorry i´m newbie... i have installed the chirpstack server, bridge and app... they are running now and i need some help for connect it with the "Loraserver device simulator".
I think the messages are published on my server, but I can't..
It`s my con.toml
#Configuration.
log_level = "info"
[provisioner]
hostname = "https://example.com"
username = "username"
password = "password"
path = "path/to/devices.csv"
[mqtt]
server = "tcp://localhost:1883"
user = "username"
password = "password"
uplink_topic="gateway/03004a527e341cb9/event/up"
downlink_topic="gateway/03004a527e341cb9/command/down"
[gateway]
mac = "03004a527e341cb9"
[band]
name = "AU_915_928"
[device]
eui="2e640e99456a3bf5"
address="01cfada6"
network_session_encription_key="dc5351f56794ed3ac17c382927192858"
serving_network_session_integrity_key="dc5351f56794ed3ac17c382927192858"
forwarding_network_session_integrity_key="dc5351f56794ed3ac17c382927192858"
application_session_key="ec1b4ccf453ebeaf7d388092fb846b20"
marshaler="json"
nwk_key="77f1c2393bfa664daf4173f73f776688"
app_key="ec1b4ccf453ebeaf7d388092fb846b20"
join_eui="0000000000000002"
mac_version=1
profile="ABP"
joined=false
skip_fcnt_check=true
[data_rate]
bandwith = 125
spread_factor = 10
bit_rate = 0
[rx_info]
channel = 0
code_rate = "4/5"
crc_status = 1
frequency = 916800000
lora_snr = 7.0
rf_chain = 1
rssi = -57
[raw_payload]
payload = "ff00"
use_raw = false
script = "\n// Encode encodes the given object into an array of bytes.\n// - fPort contains the LoRaWAN fPort number\n// - obj is an object, e.g. {"temperature": 22.5}\n// The function must return an array of bytes, e.g. [225, 230, 255, 0]\nfunction Encode(fPort, obj) {\n\treturn [\n obj["Flags"],\n obj["Battery"],\n obj["Light"],\n ];\n}\n"
use_encoder = true
max_exec_time = 500
js_object = "{\n "Flags": 0,\n "Battery": 65,\n "Light": 54\n}"
fport = 2
[[encoded_type]]
name = "Flags"
value = 5.0
max_value = 255.0
min_value = 0.0
is_float = false
num_bytes = 1
[[encoded_type]]
name = "Batería"
value = 80.0
max_value = 255.0
min_value = 0.0
is_float = false
num_bytes = 1
[[encoded_type]]
name = "Luz"
value = 50.0
max_value = 255.0
min_value = -0.0
is_float = false
num_bytes = 1
[redis]
addr = "localhost:6379"
password = ""
db = 10
[window]
width = 1200
height = 1000
[forwarder]
nserver = "192.168.5.71"
nsport = "1680"
When trying to join an already joined device via UDP, "downlink error : MACPayload must be of type*MACPayload" happens
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.