Coder Social home page Coder Social logo

gotthardp / lorawan-server Goto Github PK

View Code? Open in Web Editor NEW
915.0 97.0 323.0 5 MB

Compact server for private LoRaWAN networks

Home Page: https://gotthardp.github.io/lorawan-server

License: MIT License

Erlang 78.92% JavaScript 17.87% HTML 1.51% Shell 0.34% Batchfile 0.42% Makefile 0.33% CSS 0.24% Dockerfile 0.37%
erlang lora lorawan lorawan-server

lorawan-server's Introduction

Compact server for private LoRaWAN networks

Open-source LoRaWAN Server that integrates both the network-server and the application-server. This is useful for application providers that operate their own LoRaWAN network, or for device and application developers.

Warning This is a development version 0.7.0. Use the stable 0.6.x instead, please. After a major version upgrade you are required to review and complete the configuration before connecting any gateway or device!

  • After migrating to 0.7.x you need to
    • Remove the /admin suffix from Server -> Admin URL.
    • Make sure all Gateways are assigned to an Area with a specified Region.
  • After migrating from version 0.5.x to 0.6.x you need to assign Profiles to Groups and Gateways to Areas.
  • Migrating from version 0.4.x to 0.5.x will preserve the Device/Node addresses and security keys, but will delete many ADR parameters, which got moved to the Profile settings.

The server:

The server aims to be an all-in-one software package for small private LoRaWAN networks. However:

  • You still need to buy your LoRaWAN Gateway.
  • You will need to deploy and maintain it yourself. (With my support.)
  • It will probably never support the sophisticated management features of the commercial-grade network-servers.

The maximum amount of gateways, devices and nodes the server can support depends on the server load and hardware performance. There are no hard limits.

The API may change and some functions may not be implemented. To ask questions or request features please join the lorawan-server mailing list. We will gladly assist you. If you find a bug, you may also add an Issue.

Documentation

The lorawan-server includes all functions required to run a private LoRaWAN network. It integrates your LoRaWAN network directly with your backend IT systems. The server is provided as a comprehensive package with a single configuration file and a single administration tool. You only need to install the Erlang/OTP 21.0 or higher.

The main components of the lorawan-server are shown in the following figure:

alt tag

Usage

The server behaviour is described in the Introduction.

The Installation Instructions describe how to build, install and upgrade the server. You can use a Debian package, download the binary release and run it manually or build the server from source codes.

Follow the Configuration Instructions to correctly setup your server.

Run the lorawan-server release by:

cd lorawan-server
bin/lorawan-server

Don't forget to set the server address and port (by default 1680) in the LoRaWAN gateways you want to use with the server.

You can terminate the lorawan-server by:

bin/lorawanctl stop

You can administrate and manage the server via a set of web-pages or via a REST API as described in the Administration Guide. By default you can access the administration at http://server:8080, using "admin" as both username and password. After the installation you have to:

  • Change the default password to something more secure.
  • Set parameters of your Network and add LoRaWAN Gateways you want to use.
  • Define the device Profiles, one for each device type that you will have.
  • Configure each device you want to use, either as a personalized Node (ABP) or as an Commissioned and over-the-air activated (OTAA) device.

Integration

You can integrate lorawan-server with external applications using Backend Handlers and Connectors. Instructions on how to integrate with some major clouds such as AWS or Azure are provided in the Integration Guide.

You can also use the internal web server and develop internal applications, which may offer custom REST APIs. The lorawan-server is designed to be highly extensible. I encourage you to Learn You Some Erlang and develop your own modules.

To implement an internal application you need to create a new module implementing the lorawan_application behaviour as described in the Custom Application Guide and Development Guide.

Troubleshooting

Build Status

First of all, please read the documentation.

If the server doesn't do what you expect, please review the server logs and consult the Troubleshooting Instructions for the most common problems.

If the problem persists, please verify you have the latest version. I recommend to always use the latest release. If you use the latest sources, please verify the "build" icon above is green and then try upgrading by running:

cd lorawan-server
git pull
make upgrade
make release

If the "build" icon above is red, please wait few minutes (or hours) until it gets green again.

If nothing helps, please contact the lorawan-server mailing list or review the existing issues to verify the problem was not already reported and then create new issue.

Public References

The server is used (both commercially and non-commercially) by various companies and institutions. It was mentioned by the following blogs and articles:

Please let me know if you use the lorawan-server and want to be listed here.

Copyright and Licensing

The lorawan-server is distributed under the terms of the MIT License. See the LICENSE.

Copyright (c) 2016-2019 Petr Gotthard

lorawan-server's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

lorawan-server's Issues

difference devices/links and websockets usage

Hi.

I'm not sure to have understood the difference between the devices and the links section. In the doc (
doc/Administration.md), I read that "Once the device joins the network, the Link field will contain a reference to the Links list."
Does that mean that the devices section is there for devices that will go through a join procedure in the OTAA phase ? If that's the case and if I want to use ABP, can I directly enter a link that will not have a corresponding device entry ?

From the official lorawan spec, section 6, "end device activation", I understand that I don't need (nor can) specify the DevEUI in the case of ABP.
I'm trying to access data from a device activated through ABP through the websocket raw interface (http://:8082/admin/ws.html ), but I need the DevEUI for that, and when creating a link I enter only the DevAddr, not the DevEUI.

Did I miss something ?
(I'm using your 0.2.0 release).

Thanks,

Regards,

MichaEl

OTAA not working when server is co-located with gateway

I am learning about handlers and I would like to ask how is it possible to implement OTAA joining. I have tried ABP, in this case I created a link and I can see the frames from my device in /admin. But if I try to join the network (and create corresponding device) it seems that gateway do not respond at all to the join requests (Application:websocket, Can join:true I can see in the dashboard that device got Link number and that Last join time is right now and updates, but in WiMod LoraWan endnode studio (for wimode lorawand end device configuration) I can see Error: device not activated and do not receive the address, on SDR I do not see no response on joining RF packets).

Is this a bug or is there any way to automatically run OTAA, or do I have to implement my handler for this? Maybe somebody has already done this before?

Refreshing Received Frames

Hi Petr,
There are 2 pages, that contains received frames. Received frames displaying correctly, but refresh done manually. Cool, if data refreshed automatically.
Kind Regards!

unknown devaddr is an error ?

Hi.
I'm quite new to lorawan, but I wonder why an unknown devaddr is reported as an error.
From my understanding, the gateway job is not to filter anything, but to forward all packets to the server. If that's correct, why is an unknown node considered as an error ? I suppose it will be a common scenario on private networks that the gateway pickups other nodes (ie not the ones that I deployed).

Should the error message be changed to a simple debug or info, or I'm wrong in my assumptions ?

(based on commit 6403eda)

Troubles with websockets

Please help me to debug websockets issue.
Cannot use ws.html page.

Lora server: Ubuntu 16.04 .Compiled from sources, Jan 5.
Client: Firefox, Ubuntu.
Page: zzz.zz:8080/admin/ws.html

Logs (F12 key in Firefox)
Firefox can’t establish a connection to the server at ws://zzz.zz:8080/ws/00000000000000FF/raw

Wireshark from client (network sniffer)

Frame 13: 653 bytes on wire (5224 bits), 653 bytes captured (5224 bits) on interface 0
Hypertext Transfer Protocol
GET /ws/00000000000000FF/raw HTTP/1.1\r\n
Host: zzz.zz:8080\r\n
User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:48.0) Gecko/20100101 Firefox/48.0\r\n
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8\r\n
Accept-Language: en-US,en;q=0.5\r\n
Accept-Encoding: gzip, deflate\r\n
Sec-WebSocket-Version: 13\r\n
origin: http://zzz.zz:8080\r\n
Sec-WebSocket-Extensions: permessage-deflate\r\n
Sec-WebSocket-Key: cGa4Ye3GBYRDb+Ig15hMFQ==\r\n
Authorization: Basic YYYYYYYYYYYYYYYYYYYYY\r\n
Connection: keep-alive, Upgrade\r\n
Pragma: no-cache\r\n
Cache-Control: no-cache\r\n
Upgrade: websocket\r\n
\r\n
[Full request URI: http://zzz.zz:8080/ws/00000000000000FF/raw]
[HTTP request 1/1]
[Response in frame: 16]

Frame 16: 196 bytes on wire (1568 bits), 196 bytes captured (1568 bits) on interface 0
Hypertext Transfer Protocol
HTTP/1.1 400 Bad Request\r\n
Content-Length: 0\r\n
Date: Tue, 10 Jan 2017 08:24:03 GMT\r\n
Server: Cowboy\r\n
Keep-Alive: 60\r\n
Via: HTTP/1.1 proxy10030\r\n
\r\n
[HTTP response 1/1]
[Time since request: 1.237749933 seconds]
[Request in frame: 13]

Server log
Nothing if correct DevEUI is specified.
If I enter wrong DevEUI, it shows;
lorawan-server[1354]: 09:55:22.147 #33[1;33m[warning] WebSocket for unknown DevEUI: <<0,0,0,0,0,0,0,250>>#33[0m

Missining AppID setting in configuration panel

Hi

I cannont find AppID field in Device configuration, see my screenshot below

1

In your documentation you show an example where AppID is present

2

Now I'm not sure how to use websocket:
/groups/ABC/... Connects to all websocket devices whose AppID is set to ABC

  • what to put instead of ABC if AppID is not visible in configuration.

My goal is to receive data from several sensors under single websocket connection. I guess I need to assign the same AppID to all sensors.

bad argument crash report

The following error report may appear some time after someone connected to the web-admin

04:33:19.253 [error] CRASH REPORT Process <0.641.0> with 0 neighbours exited with reason:
      bad argument in call to erlang:port_get_data(#Port<0.7508>) in prim_file:sendfile/8
04:33:19.253 [error] Ranch listener http terminated with reason:
      bad argument in call to erlang:port_get_data(#Port<0.7508>) in prim_file:sendfile/8

This is just a harmless message, nothing to worry about.
It has been reported as ninenines/cowboy#1144.

single channel gateway on US 902.3 MHz frequency using SF7

Hi, I'm trying to get your lorawan-server running in a docker contain and seem to have it running but can not see data getting into the lorawan-server from my single channel gateway. What I've done is:

boot the container and manually executed the Dockerfile commands, edited the sys.config file to use the 902.300 frequency and then run bin/lorawan-server.

On my Single Channel Gateway I've set ports to 1680 and set the router address to 172.17.0.2. I can see and use the lorawan-server admin console on port 8080 so I know the server works and the IP address is correct. Next I added my gateway using the EUI specified from the single channel gateway web interface/page. I just made up a NetID, 0123AB

Any information on what I might be doing wrong and where to debug next? Thank you.

Compact and auto-refreshing list of frames

We should get rid of the table header on every line to make the list more concise and implement the auto-refresh to display the most recent frames.
For this we could avoid using ng-admin and re-implementing the list directly in AngularJS.

error on euint test.

Server installed and performing ok. But error coming in eunit test as bellow:
Please, advice on that issue.

23:18:51.066 [info] Application lager started on node nonode@nohost
23:18:51.068 [info] Application cowlib started on node nonode@nohost
23:18:51.072 [info] Application ranch started on node nonode@nohost
23:18:51.074 [info] Application cowboy started on node nonode@nohost
23:18:51.329 [info] Application mnesia started on node nonode@nohost
23:18:51.334 [info] Application jsx started on node nonode@nohost
23:18:51.335 [info] Application iso8601 started on node nonode@nohost
23:18:51.338 [info] Application lorawan_server_api started on node nonode@nohost
23:18:51.409 [debug] Lager installed handler lager_backend_throttle into lager_event

Pending:
module 'loramote_tests'
%% Unknown error: {abort,
{setup_failed,
{error,
{badmatch,
{ok,{{"HTTP/1.1",401,"Unauthorized"},
[{"date","Sat, 11 Mar 2017 15:18:51 GMT"},
{"server","Cowboy"},
{"www-authenticate",
"Basic realm="lorawan-server""},
{"content-length","0"}],
[]}}},
[{test_admin,post_json,2,
[{file,
"/home/ulzii/lorawan-server/build/test/lib/lorawan_server/test/test_admin.erl"},
{line,21}]},
{loramote_tests,'-loramote_test
/0-fun-0-',0,
[{file,
"/home/ulzii/lorawan-server/_build/test/lib/lorawan_server/test/loramote_tests.erl"},
{line,15}]}]}}}

Top 10 slowest tests (0.000 seconds, 0.0% of total time):
lorawan_admin:bits_test_/0:147
0.000 seconds
lorawan_mac_commands:bits_test_/0:211
0.000 seconds
lorawan_mac_commands:bits_test_/0:219
0.000 seconds
lorawan_mac_region:region_test_/0:200
0.000 seconds
lorawan_mac_region:region_test_/0:202
0.000 seconds
lorawan_mac_region:region_test_/0:198
0.000 seconds
lorawan_admin:bits_test_/0:151
0.000 seconds
lorawan_mac_commands:bits_test_/0:215
0.000 seconds
lorawan_admin:bits_test_/0:149
0.000 seconds
lorawan_mac_region:region_test_/0:201
0.000 seconds

Finished in 0.718 seconds
24 tests, 0 failures, 1 cancelled
===> Error running tests

error when trying to edit fcnt

Hi.

I'm experimenting with your lorawan-server (my complete setup includes two loramotes and one kerlink gateway).

I'm using a build from your latest commit (205c666 - 21dec2016).

I have encountered an issue when I try to edit the FCnt fields in the Links tabs from the http admin interface. (I understand that it should not be needed, but unfortunately the behavior of the loramotes seems to be to restart fcnt at 0 on reset).

Anyway, when I click on the "save changes" button, I get the following error:

[error] CRASH REPORT Process <0.16296.0> with 0 neighbours exited with reason: bad argument in call to erlang:binary_to_integer(undefined, 2) in lorawan_admin:parse_adr/1 line 119
[error] Lager event handler error_logger_lager_h exited with reason {'EXIT',{{case_clause,[http,<0.16284.0>,9,<0.16296.0>,badarg,[{erlang,binary_to_integer,[undefined,2],[]},{lorawan_admin,parse_adr,1,[{file,"/home/gl/gotthardp/lorawan-server/_build/default/lib/lorawan_server/src/lorawan_admin.erl"},{line,119}]},{lorawan_admin,'-parse_admin/1-fun-0-',1,[{file,"/home/gl/gotthardp/lorawan-server/_build/default/lib/lorawan_server/src/lorawan_admin.erl"},{line,83}]},{lists,map,2,[{file,"lists.erl"},{line,1238}]},{lists,map,2,[{file,"lists.erl"},{line,...}]},...]]},...}}

Web socket client - no received frame

Hi Petr,
I've checked web socket client and its connection ok.
But no received frame yet.
Send data it displays:
2017-3-13 20:06:12 SEND: 0909
Please, advice...
Best Regards!

Brocaar's Loraserver comparison

Hi Petr,

Trying to compare your work and Brocaar implementation (https://github.com/brocaar/loraserver), do you consider both projet beeing directly comparable ? I am wondering what was your motivation in starting this project from scratch whereas you may have forked an existing one.

By the way thank you very much for opensourcing such a great work !

Devices grouped by Application / AppID

Please, add AppID and group devices under Applications. So several applications to be connectd to the server. Currently, Websocket ws.html connecting to server by group/device., it will be connect by AppID and send all devices payloads with correct AppID.

Logs show device/node ID's in decimal

Input of device/node link settings(IDs, keys, etc ) are in hex but logs show decimal representations. It would be more helpful if the logs also showed the values in hex.

ex: ERROR: {unknown_devaddr,<<38,1,38,83>>}

Errorneous frame causes abnormal handler Termination

While watching the console regarding the websocket issue, I saw this come though the console and it looks like something triggered a failure of a handler:

12:56:33.857 [error] Error in process <0.559.0> on node lorawan@kubuntu with exit value:
{{badmatch,<<94,113,117,104,221,162,128,13,175,45,115,180,233,39,105,229,175>>},[{lorawan_mac,process_frame1,5,[{file,"/home/dlarue/mnt/sda5/home/dlarue/Projects/FabLab/LoRaWAN/lorawan-server/_build/default/lib/lorawan_server/src/lorawan_mac.erl"},{line,88}]},{lorawan_gw_router,process_frame,3,[{file,"/home/dlarue/mnt/sda5/home/dlarue/Projects/FabLab/LoRaWAN/lorawan-server/_build/default/lib/lorawan_server/src/lorawan_gw_router.erl"},{line,136}]}]}
12:56:33.857 [error] Hanler terminated: {{badmatch,<<94,113,117,104,221,162,128,13,175,45,115,180,233,39,105,229,175>>},[{lorawan_mac,process_frame1,5,[{file,[47,104,111,109,101,47,100,108,97,114,117,101,47,109,110,116,47,115,100,97,53,47,104,111,109,101,47,100,108,97,114,117,101,47,80,114,111,106,101,99,116,115,47,70,97,98,76,97,98,47,76,111,82,97,87,65,78,47,108,111,114,97,119,97,110,45,115,101,114,118,101,114,47,95,98,117,105,108,100,47,100,101,102,97,117,108,116,47,108,105,98,47,108,111,114,97,119,97,110,95,115,101,114,118,101,114,47,115,114,99,47,108,111,114,97,119,97,110,95,109,97,99,46,101,114,108]},{line,88}]},{lorawan_gw_router,process_frame,3,[{file,[47,104,111,109,101,47,100,108,97,114,117,101,47,109,110,116,47,115,100,97,53,47,104,111,109,101,47,100,108,97,114,117,101,47,80,114,111,106,101,99,116,115,47,70,97,98,76,97,98,47,76,111,82,97,87,65,78,47,108,111,114,97,119,97,110,45,115,101,114,118,101,114,47,95,98,117,105,108,100,47,100,101,102,97,117,108,116,47,108,105,98,47,108,111,114,97,119,97,110,95,115,101,114,118,101,114,47,115,114,99,47,108,111,114,97,119,97,110,95,103,119,95,114,111,117,116,101,114,46,101,114,108]},{line,136}]}]}

Docker based install

Hi,

at the bottom of this issue, you will find a working Dockerfile to run this project in a docker container. There is one issue though. For now its not possible to change the values of the sys.config. It would be best, if the config values could be changed through environment variables.

The workarounds for this would be mounting a config file into the container.
Or include the config at image build time

FROM solarisbank/erlang:19.0

RUN apk --no-cache add nodejs curl git
RUN curl -o /usr/bin/rebar3 "https://s3.amazonaws.com/rebar3/rebar3" && chmod +x /usr/bin/rebar3
RUN git clone https://github.com/gotthardp/lorawan-server.git && cd lorawan-server && rebar3 release

WORKDIR /lorawan-server/_build/default/rel/lorawan-server

CMD bin/lorawan-server foreground

Range Test, Last Seen Online and other questions

Good day,

Thank you for such good software.
But there are several questions, if you could answer, would definitely help me out.
Thanks in advance.

Before I ask here is what I am using:

  1. RPi 2 Model B
  2. ic880a (IMST) connected via SPI (reset is made by using script)
  3. Raspberry has installed: lorawan_gateway and packet_forwarder (found here on GIT)
  4. iu880B USB (IMST). Used as a node, to test, to send to gateway.
  5. Your server. Installed on Windows right now on a laptop.

Questions:

  1. Which UTILS do I need to launch for this chain to work? (Maybe I am mistaking, but I see everything working when these run: packet logger, packet forwarder, your server) Is this correct?

  2. Is it possible to get a status like: Last Seen Online? Example: I unplug my iu880B and see on webpage, that Last Seen Online: 5mins ago / 1 second ago etc.

  3. Could you suggest me, please, how to perform a range test with this software/hardware? (Technically last seen online could kinda solve this)

  4. How can I use collected packet data by your server in my own Web Interface or Mobile apps? Query to database?

  5. How does exactly Gate and Node work between each other? I mean - When does gateway knows to receive data from node or not?

Thanks again.

unknown_mac and registering the gateway

Hi Petr.
I run lorawan-server in docker (Thank you for the Dockerfile).
And I got an issue on registering the gateway (Kerlink, PROD_FW=wirmaV2_wirgrid_v2.2, LORABOARD_TYPE="868-27dBm").

After configuring the packet_forwarder I see server log messages:

11:55:43.298 [error] ERROR: {unknown_mac,<<0,0,2,75,8,14,14,41>>}

As I understand, the server receives packets from my GW station but doesn't handle it.

I've tried to register my GW in the Web Admin "Create new gateway" form.
As I understand, the MAC field is the MAC address of my LoRaWAN Gateway.
The Web form filters the MAC field with:
ng-pattern="[A-Za-z0-9]{16}" placeholder="e.g. 0123456789ABCDEF".
So it doesn't allow enter my value 02:4B:08:0E:0E:29.
I've tried a few converted values (https://www.vultr.com/tools/mac-converter/) in REST API:

curl -H 'Authorization: Basic YWRtaW46YWRtaW4=' -H 'Content-Type: application/json' -d '{"mac":"02:4B:08:0E:0E:29","netid":"000000","gpspos":{"lat":1,"lon":1},"gpsalt":1}' http://lorawan-server:8080/gateways
curl -H 'Authorization: Basic YWRtaW46YWRtaW4=' -H 'Content-Type: application/json' -d '{"mac":"02:4b:08:0e:0e:29","netid":"000000","gpspos":{"lat":1,"lon":1},"gpsalt":1}' http://lorawan-server:8080/gateways
curl -H 'Authorization: Basic YWRtaW46YWRtaW4=' -H 'Content-Type: application/json' -d '{"mac":"024B080E0E29","netid":"000000","gpspos":{"lat":1,"lon":1},"gpsalt":1}' http://lorawan-server:8080/gateways
curl -H 'Authorization: Basic YWRtaW46YWRtaW4=' -H 'Content-Type: application/json' -d '{"mac":"2521280941609","netid":"000000","gpspos":{"lat":1,"lon":1},"gpsalt":1}' http://lorawan-server:8080/gateways
curl -H 'Authorization: Basic YWRtaW46YWRtaW4=' -H 'Content-Type: application/json' -d '{"mac":"02:4b:08:00:00:0e:0e:29","netid":"000000","gpspos":{"lat":1,"lon":1},"gpsalt":1}' http://lorawan-server:8080/gateways
curl -H 'Authorization: Basic YWRtaW46YWRtaW4=' -H 'Content-Type: application/json' -d '{"mac":"02:4b:08:ff:ff:0e:0e:29","netid":"000000","gpspos":{"lat":1,"lon":1},"gpsalt":1}' http://lorawan-server:8080/gateways
curl -H 'Authorization: Basic YWRtaW46YWRtaW4=' -H 'Content-Type: application/json' -d '{"mac":"02:4b:08:ff:fe:0e:0e:29","netid":"000000","gpspos":{"lat":1,"lon":1},"gpsalt":1}' http://lorawan-server:8080/gateways
curl -H 'Authorization: Basic YWRtaW46YWRtaW4=' -H 'Content-Type: application/json' -d '{"mac":"00:4b:08:ff:fe:0e:0e:29","netid":"000000","gpspos":{"lat":1,"lon":1},"gpsalt":1}' http://lorawan-server:8080/gateways

curl -H 'Authorization: Basic YWRtaW46YWRtaW4=' http://lorawan-server:8080/gateways

[{"gpsalt":1,"gpspos":{"lat":1,"lon":1},"netid":"000000","mac":"0234B3083FF3FE30E30E32"},{"gpsalt":1,"gpspos":{"lat":1,"lon":1},"netid":"000000","mac":"252128094160"},{"gpsalt":1,"gpspos":{"lat":1,"lon":1},"netid":"000000","mac":"024B080E0E29"},{"gpsalt":1,"gpspos":{"lat":1,"lon":1},"netid":"000000","mac":"0234B30830E30E32"},{"gpsalt":1,"gpspos":{"lat":1,"lon":1},"netid":"000000","mac":"0034B3083FF3FE30E30E32"},{"gpsalt":1,"gpspos":{"lat":1,"lon":1},"netid":"000000","mac":"0234B3083FF3FF30E30E32"},{"gpsalt":1,"gpspos":{"lat":1,"lon":1},"netid":"000000","mac":"0234B30830030030E30E32"}]

And all time I got same log message:

11:55:43.298 [error] ERROR: {unknown_mac,<<0,0,2,75,8,14,14,41>>}

So, please clarify, how to register the GW.

web sockets for Links inop

I have 2 clients, the demo(localhost:8080/admin/ws) and a Chrome app but nether one receives anything after connecting and I trigger the device/link to send a message.

The admin/ws demo shows:
4/3/2017 9:27:13 PM CONNECTED
4/3/2017 9:27:13 PM Connecting to: ws://localhost:8080/ws/links/26021B1B/json

Received Frames listing shows:
2017-04-03 21:29:25 18FE34FFFFCE8D6B 26021B1B websocket myWebSocket 10 0 1 0303032A4A9B41084CCA42

If I enter an incorrect link device Address the connection doesn't occur so it seems web sockets in the server process is there.

Missing MQTT interface

MQTT is heavily used to integrated IoT with other system such as MS Azure. We much implement an MQTT interface. Discussed in Issue #21.

"Error when reading cookie: einval" on openwrt

Hi, we would like to run this on OpenWrt,

root@OpenWrt:~# ./loraserver/bin/lorawan-server
{error_logger,{{2017,2,8},{12,3,49}},"Error when reading /root/.erlang.cookie: einval",[]}

And there shouldn't be any problem with .erlang.cookie, so we totally stuck here.

Is there anyone can help? Thanks!

lorawan-server.bat doestn't work

Just found out the batch script does not work on my win7. And found the causes:
a. my erl.exe is located under folder "Program Files (x86)/" instead of "Program Files/".
b. my erl.exe has a suffix ".exe" instead of just call "erl". I guess if I make Win7 hides the suffix, maybe it will just be "erl", but not tested yet.

So I just replaced the first section of code with "set ERLDIR="C:\Program Files (x86)\erl8.1\bin\erl.EXE", and it works. Besides, my erl.exe is included in the %PATH%, so I think maybe we don't need to try to find the full path, but use "erl" or "erl.exe" is enough.

Gateway connectivity check

It will nice, if there are PING and RESET button in admin.
So can do remote reset and check Ping to gateway.
Thanks

Store gateway GPS position

Hi Petr.
I run the lorawan-server in docker.
I've configured 3 gateways (Kerlink, PROD_FW=wirmaV2_wirgrid_v2.2, LORABOARD_TYPE="868-27dBm") to this host and saw log messages like:

11:26:33.966 [error] ERROR: {unknown_mac,<<0,0,2,75,8,14,16,2>>}
11:26:34.682 [error] ERROR: {unknown_mac,<<0,0,2,75,8,14,14,41>>}
11:26:36.850 [error] ERROR: {unknown_mac,<<0,0,2,75,8,14,14,30>>}

Then I've registered gateways (with default location) and after some time I got log messages like:

12:00:37.356 [error] ERROR: {unknown_devaddr,<<0,0,80,151>>}
12:00:37.368 [error] ERROR: {unknown_devaddr,<<0,0,80,151>>}
12:00:37.369 [error] ERROR: {unknown_devaddr,<<0,0,80,151>>}

It's expected because I didn't registered the end device.

But I see that only one gateway got actual location.

$ curl -H 'Authorization: Basic YWRtaW46YWRtaW4=' http://lorawan-server/gateways
[{"gpsalt":_hide_,"gpspos":{"lat":_hide_,"lon":_hide_},"netid":"010203","mac":"0000024B080E0E29"},{"gpspos":{"lat":48.88,"lon":14.12},"netid":"010203","mac":"0000024B080E0E1E"},{"gpspos":{"lat":48.88,"lon":14.12},"netid":"010203","mac":"0000024B080E1002"}]

I expected that all 3 gateways obtained actual location.

steps for new connection

I'd like to move gateway and devices to your server.Server installed at local ubuntu PC.
I used all (EUI, key) IDs from loriot.io and configured Gateway to 192.168.0.100 (IP of my ubuntu PC).
Added gateway and device. send packet from device. Not received data yet. Please,advice short checklist.
Thanks

Start server on Windows 10 machine

Firstly, thank you very much for your job and excuse my ignorance. I'm absolutely unfamiliar with erlang...

I'm trying to set up your lorawan-server on my Windows 10 machine for local testing puporses. I downloaded erlang 19.2 and I installed without problems. I could test it with erlide and works.

I have downloaded your release and unzipped. On created folder, I go to 'bin' folder and launch lorawan-server.bat. A quick CMD window opens but dissapears in a brief... Anything more happen.

I open my chrome browser and I try to navigate to localhost:8082, localhost:8082/admin but no response... In sys.config port is set at 8082. Seems like any server is running...

Am I doing anything wrong?? Could you guide me??

Again, thank you very much. Regards.

Development & Troubleshouting guide

These two guides are useful for both contributors and users. Please, include detailed server structure.
Seen some other open source server written in Go, but Erlang is robust and was born for this kind of application. So Petr's server is visionary movement. Thank you!

something wrong about 'application' when try to add node

Hi, Developers:
when try to "add new device" or "create new link", I've encountered the same problem when try to fill the form about "Application". From the config I can see below lines:
{plugins, [
{<<"semtech-mote">>, lorawan_application_semtech_mote},
{<<"microchip-mote">>, lorawan_application_microchip_mote}]},
So I think I should be able to fill with 'semtech-mote', but it always complained with "Invalid form". And although the form contains a down arrow, it shows no items after I click it.

So it looks like the applications are not enabled. I've tried both the binary and source code, but just the same issue. Then what may be wrong? Thanks.

websocket_timeout still occurs with message transmissions

Using Node setup( ABP ) and websocket application the lorawan-server still closes the websocket connection after the amount of time specified in the sys.config file. In my case, 1 hour. The admin/ws.html client gets disconnected while the Google Chrome app WebSocket Client just stops getting JSON messages.

sys.config entry:
% websocket expiration if client sends no data
{websocket_timeout, 3600000} % ms

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.