gotthardp / lorawan-server

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

HTTP Backend Connectors #148

Closed Quentintin closed 7 years ago

Quentintin commented 7 years ago

Hi,

I would like to know if you plan to add HTTP/HTTPS Backend connectors ? It will be awesome if you can provide it. 👍

Thanks for response :)

gotthardp commented 7 years ago

Simple connector making one HTTP/S request per frame, without support for downlinks is quite easy. The reason why it's not implemented is that I was not sure if anyone needs such simple thing, because there may be a lot of variations (HTTP GET vs. HTTP POST and various content types).

What are your needs? Where are you connecting to?

Quentintin commented 7 years ago

I created backend to receive messages from Sigfox and LoRaWAN Operators. Most of them provides callback methods with HTTP/S. My backend is a part of a Web Platform to manage IoT devices. I implemented HTTP restAPI used by users and Operator's backend to push messages. That's why I need this.

If it simple for you, you should implement it because i'm pretty sure lot of people will ask you for that connector.

gotthardp commented 7 years ago

So far you are the first asking for this :) but I can do that. Do you have some examples how this HTTP API often looks like? What URI, Content-Type, Body?

Quentintin commented 7 years ago

The perfect callback for me is POST method :

Firstly you can do easy way with static url/body, and later allow custom fields.

Sorry for my english :/ And thank you again

gotthardp commented 7 years ago

Thanks. Will do. :-)

stephanedavid commented 7 years ago

Some news about this topic, we are also very interested by this connector ?

gotthardp commented 7 years ago

Not yet, but the more people are interested the higher priority it gets. ;-)

Is your view on a perfect HTTP callback the same as described above, or you have some other needs?

stephanedavid commented 7 years ago

Exactly the same view. Thanks

mkpuig commented 7 years ago

Hello, i'm interested too. Thanks a lot for your great work!

El 19 jul. 2017 12:05, "Stéphane David" notifications@github.com escribió:

Exactly the same view. Thanks

— 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/148#issuecomment-316337294, or mute the thread https://github.com/notifications/unsubscribe-auth/AKLDQBHChQSjHVJM00t3YNHrsYzn1vzEks5sPdT7gaJpZM4OPsE2 .

gotthardp commented 7 years ago

@Quentintin @stephanedavid @mkpuig I started to work on this. In the 'master' branch there is an experimental implementation already available (which you can try): you can create an HTTP(s) connector and define some "Published Topic". The content-type is determined based on the handler format.

If you encounter some error, just let me know.

I am still not satisfied with the error handling, so in case an error occurs the system may crash in a not so nice way. This will be fixed in the coming week(s).

Kralg commented 7 years ago

Hello, I would like to test the server version with REST commands for txframes. Can you send me the compiled version? I would also like to know when it is possible to expect the 0.4.8 version? It would be really great to get it.

gotthardp commented 7 years ago

Hello. I want to do some more testing to make sure I didn't destroy anything, but hope to release 0.4.8 today,

gotthardp commented 7 years ago

v0.4.8 released Feel free to open a new issue if something goes wrong.