gotthardp / lorawan-server

Compact server for private LoRaWAN networks
https://gotthardp.github.io/lorawan-server
MIT License
956 stars 329 forks source link

installation on Raspberry Pi 2 Latest Jessie Fails. #160

Closed Rustie0125 closed 7 years ago

Rustie0125 commented 7 years ago

Non of the menthods used in the installation guides works correctly. fresh jessie install run the package as follows but nothing Get the latest sources by:

git clone https://github.com/gotthardp/lorawan-server.git cd lorawan-server If you already obtained the sources you can upgrade to the latest version by:

cd lorawan-server git pull make upgrade Then build and release the lorawan-server by:

make release

does not succesfully upgrade or release

Rustie0125 commented 7 years ago

This Issues with the documentation is still not solved. I Have tried running the windows based build and after a week of not being able to locate the file as per your directions in the "lorawan-server/bin" location I ran the .bat in the script folder which resulted in windows being corrupted and crashed my complete PC. I have now finally gotten back online and the same question still remains. please update the documentation on how to find, install and use the Binary file as none of the available files for download results in a lorawan-server/Bin directory.

Rustie0125 commented 7 years ago

Here is the screenshot of my release unzipped on the desktop. no BIN folder is present. image

gotthardp commented 7 years ago

Hello. You need to unpack the binary release, i.e. the .tar.gz file. I just clarified this in the documentation.

Rustie0125 commented 7 years ago

Thanx Petr

Now it works.thank you for the clarification.

I am working with two different Nodes(devices) I have added the nodes to the nodes list (see screen shot) but I keep getting a "BAD_MIC" or a " {unexpected_data,{rxdata,15,10,<<74,23>>,false,true}}" error

image image image

The one node is a standard microchip mote RN2483 and the other is a Adafruit Feather.

gotthardp commented 7 years ago

bad_mic means the NwkSKey or AppSKey is not matching the keys configured in the device. Double check you are using the right keys.

unexpected_data means the keys are configured well, but you set the application to 'SemtechMote' or 'MicrochipMote' although your device is sending some other data. Change the 'Application' field to 'WebSocket' for example to get rid of this.

Rustie0125 commented 7 years ago

Thank you

Changed to websocket but now it reports "{uplinks_lost,11}"

gotthardp commented 7 years ago

That doesn't have to be an error, it could also mean that the gateway or server was off while the device was sending data. It's rather "uplinks_missed".

Rustie0125 commented 7 years ago

Okay, I see. Im trying to send the received packet from the server via a MQTT message to a MQTT server. do you have an example of someone that has done this ? I did look at this page https://github.com/gotthardp/lorawan-server/blob/master/doc/Integration.md but can not seem to get it to work on windows, the Mosqiuto project latest download has errors when trying to install and Rabit is to complicated to even try.

gotthardp commented 7 years ago

RabbitMQ works well with Windows. If you want MQTT broker on windows, use that.

altishchenko commented 7 years ago

Or you can use emq from http://emqtt.io LoRaWAN server uses its client (emqttc) to build mqtt connections in the background.

The one thing to look out - is the contents of the data you send. Some MQTT servers which are combined with sort of visualizing app and most of the free portals out there, like Adafruit IO, will insist on the JSON structure of their own which is not yet implemented currently.

Cheers, Alexander Tishchenko mob: +7 (916) 704-61-57 atishch@gmail.com

10 авг. 2017 г., в 12:12, Petr Gotthard notifications@github.com написал(а):

RabbitMQ works well with Windows. If you want MQTT broker on windows, use that.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/gotthardp/lorawan-server/issues/160#issuecomment-321496843, or mute the thread https://github.com/notifications/unsubscribe-auth/ASj_3zfvR6PowwMzPyO96NfGuZ09FeLlks5sWsmZgaJpZM4OYNBP.

Rustie0125 commented 7 years ago

Hi Alexander

Tried following the installation steps. just running the console command does not result in an accessable webpage and added the server as a service as per the installation docs gives an error of file is not in the directory. http://emqtt.io/docs/v2/install.html#installing-on-windows

altishchenko commented 7 years ago

Rustie, can you show me the output? From the console run and output from the install.

Rustie0125 commented 7 years ago

Will Do

altishchenko commented 7 years ago

Ah, and try running it in Admin console :)

Rustie0125 commented 7 years ago

image see attached.

I am running the lorwan server on the same PC. and to access the lorawan server i use " http://localhost:8080" so even with out the errors above what must i use to access the MQtt server ?

Rustie0125 commented 7 years ago

Erlang output emqttd 2.3 is running now 12:05:28.939 [error] CRASH REPORT Process <0.247.0> with 0 neighbours exited with reason: no match of right hand value undefined in emqttd_sysmon_sup:init/1 line 31 in gen_server:init_it/6 line 352 12:05:28.942 [info] Application emqttd started on node nonode@nohost 12:05:28.942 [info] Application lwm2m_coap started on node nonode@nohost 12:05:28.942 [info] Application jsx started on node nonode@nohost 12:05:28.942 [info] Application recon started on node nonode@nohost 12:05:28.943 [info] Application luerl started on node nonode@nohost 12:05:28.943 [info] Application eldap started on node nonode@nohost 12:05:28.943 [info] Application poolboy started on node nonode@nohost 12:05:28.943 [info] Application bson started on node nonode@nohost 12:05:28.944 [info] Application mongodb started on node nonode@nohost 12:05:28.948 [info] Application ecpool started on node nonode@nohost 12:05:28.985 [info] Application mysql started on node nonode@nohost 12:05:28.985 [info] Application epgsql started on node nonode@nohost 12:05:28.985 [info] Application eredis started on node nonode@nohost 12:05:28.986 [info] Application base64url started on node nonode@nohost 12:05:28.986 [info] Application jwt started on node nonode@nohost Eshell V8.3 (abort with ^G) 1>

altishchenko commented 7 years ago

What I can see here is: for some reason escript.exe is not found or not recognized by your system. This may be a serious issue. It is an important tool in Erlang. Can you try and locate it in the server directories? The port where you can find your EMQ dashboard is 18083. Use admin/public to get in. Did you get the right download for your windows?

Rustie0125 commented 7 years ago

I can not find that File in any directory. Downloaded the Windows release twice. both times none of them worked

altishchenko commented 7 years ago

Ok, I just downloaded this one: emqttd-windows10-v2.3-beta.1.zip http://emqtt.io/downloads/latest/windows10 and have the file in erts-8.3/bin/escript.exe as it should be. What version of windows are you at?

altishchenko commented 7 years ago

As a side thought, you may try with the stable 2.2.0 release. It is a bit lower on the downloads page.

Rustie0125 commented 7 years ago

windows 10. if i look in the same file, this is what i have image

Rustie0125 commented 7 years ago

Ill try 2.2

altishchenko commented 7 years ago

Oh. The file listing looks bad to me. Is it possible, that an anti-virus of yours gets a little excited about escript.exe? Can you try disabling it before downloading the zip?

altishchenko commented 7 years ago

And, sorry if that sounds a bit stupid, it is not a good idea to run things right out of the zip on windows, it is much safer to extract it into some directory first. My apologies, if I misunderstood how you did it.

Rustie0125 commented 7 years ago

I got it working now. I did extract it I did switch my anti virus off. it was a program called C cleaner that removed the exe

altishchenko commented 7 years ago

Well 👍 You never know with windows :)

Rustie0125 commented 7 years ago

Lol Ya. Anyway any link on how to get this working with Petr Lorawan server ? documentation ?

altishchenko commented 7 years ago

Well, all you do is: create some users/passes and feeds in the broker, then you configure (per Integration.md) the same stuff in backend and handler on the server, assign the handler to your device/node with the 'Group' field. And then you go off and configure your 'Application' that listens to the feed on the broker and digests data received from your nodes. If you choose JSON format, be ready to tailor your application to receive a full data json as per JSON.md, if you choose RAW, than your application should be able to deal with bits an' bytes as sent by the node itself. For the moment, it is not possible to do neither complete custom JSON, nor Up/Down processing on RAW, but Petr is working on it right now.

altishchenko commented 7 years ago

In order to keep the number of backends to a minimum, I'd suggest using {deveui} or {devaddr} macro expansions in the feed topics, this way your 'Publish' containing 'some/node/feed/{devaddr}' will be turned into 'some/node/feed/007c130c' when the device with that number is sending some data. Also, pay attention to 'Received Topic' it is also pattern-matched like publish, and differs from subscribe, cause in subscribe you can have 'some/node/feed/#' - which means all nodes under this heading, but given 'some/node/feed/{devaddr}' in 'Received' will send your data back to the proper node. All in one and same backend.

Rustie0125 commented 7 years ago

Im afraid I dont understand. I understand what you are saying about the backends but im not there yet, Can the eMQ server be configured to work with the lora server via the the web interface ? or does it all have to be done via "mosquitto_sub -t topic -q 2" type commands ?

altishchenko commented 7 years ago

Nonono. What you do is: you create some users/passwords/topics in EMQ. Then, you configure your backend with the link mqtt://localhost and the proper user/password/publish-topic, then you create your handler that just says how you would like the data, sent by the device, to be processed and attach that handler to your device in the 'Group' field, with 'Application' set to 'backend'. Then, when your device sends anything the MQTT client kicks in and publishes the data under your 'Publish' topic to the EMQ. The MQTT client is builtin into the server, you don't need any mosquitto crutches to get it working. Like this: 2017-08-10 15 02 40

Rustie0125 commented 7 years ago

Thats how I understand it but looking at the EMQ interface. where is the " Add topic" username and password button ? image

altishchenko commented 7 years ago

Have a look here: http://emqtt.io/docs/v2/guide.html under User Guide section.

Rustie0125 commented 7 years ago

that does not tel me anything. there referes to CMD type commands. which I asked is that the only way to create new topics and users. you said no ?

altishchenko commented 7 years ago

Wait, I said No to pushing the data into EMQ by means of shell/cmd commands, I didn't say anything about creating users/topics etc. Like for myself I just used the admin/public pair in my tests - it is just that simple, but when you are out in the real world, you should be using mqtts and proper authentication. There are a number of plugins there - MySQL for the start and LDAP if you feel inclined. If you want things simple to test, you'd go for just Client Id auth, there is a field for that in the LoRaWAN server.

altishchenko commented 7 years ago

Do keep in mind, that with EMQ (and MOST other servers) the topic can be created on the fly on the first publish..

altishchenko commented 7 years ago

Saves you a lot, when you have your publish like 'some/feed/{devaddr}' and just keep adding the devices for the same connector.

Rustie0125 commented 7 years ago

Hi Petr

Hope you keeping well. I am trying to use your COmpact server again with a Lorawan complaint Node buoght from NKE watteco, this one ( https://drive.google.com/file/d/0B6TBYAxODZHHdElKMDdEejRqOHM/view)

The only details provided is the information in that link and two addresses on the front of the enclosure.

50-70-017-000 and 70:B3:D5:E7:5E:00:0B:67

From what I can see thsi device supports OTAA and ABP but for some reason I can not get it to register properly on the server. I get bad_mic or unkown address when setting up my own keys and the server does not allow auto generation like TTN does. how do I register this device with those numbers ? There is no software or access to the node to check or set the keys.

http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail Virus-free. www.avg.com http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail <#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

On Thu, Aug 10, 2017 at 2:47 PM, Alexander Tishchenko < notifications@github.com> wrote:

Saves you a lot, when you have your publish like 'some/feed/{devaddr}' and just keep adding the devices for the same connector.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/gotthardp/lorawan-server/issues/160#issuecomment-321540894, or mute the thread https://github.com/notifications/unsubscribe-auth/Aaphctfkgw94vFTTfiKyafSkjiPBfKoBks5sWvvWgaJpZM4OYNBP .

--

Kind Regards Johann Van Niekerk

Your time true opinion and honesty is appreciated

gotthardp commented 7 years ago

Hello. Well, the larger key is the DevEUI probably and you will need also the AppKey. The device manufacturer should tell you where to get the key. Without ability to get/set the key you cannot connect to any network.

Rustie0125 commented 7 years ago

Sureley the Appkey is negotiated over OTAA ? TTN Auto generates that key .

See this link for more detail https://www.thethingsnetwork.org/docs/devices/registration.html

http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail Virus-free. www.avg.com http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail <#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

On Thu, Oct 19, 2017 at 1:29 PM, Petr Gotthard notifications@github.com wrote:

Hello. Well, the larger key is the DevEUI probably and you will need also the AppKey. The device manufacturer should tell you where to get the key. Without ability to get/set the key you cannot connect to any network.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/gotthardp/lorawan-server/issues/160#issuecomment-337879946, or mute the thread https://github.com/notifications/unsubscribe-auth/Aaphcufq86wXPiA_tpAW24ALeQSimTXWks5stzKdgaJpZM4OYNBP .

--

Kind Regards Johann Van Niekerk

Your time true opinion and honesty is appreciated

gotthardp commented 7 years ago

AppKey is not negotiated. It is pre-configured.

sjobyt commented 6 years ago

Rustie0125, I have the same issue with NKE Watteco devices. Same two numbers the DEVEUI and a similar number as 50-70-000-006. Did you talk to NKE and found out what is needed to join their devices? thx

Rustie0125 commented 6 years ago

Yes you have to contact them with your device id’s and the will provide missing keys

Please safe our environment and do not print this email.

On Nov 1, 2017, at 00:18, staalej notifications@github.com wrote:

Rustie0125, I have the same issue with NKE Watteco devices. Same two numbers the DEVEUI and a similar number as 50-70-000-006. Did you talk to NKE and found out what is needed to join their devices? thx

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or te they mute the thread.vide

sjobyt commented 6 years ago

Thanks for the quick response, I will contact them.