-
-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create dataPublisher
for Azure Event Hub REST API
#411
Comments
dataPublisher
for Azure Service Bus MessagingdataPublisher
for Azure Event Hub
dataPublisher
for Azure Event HubdataPublisher
for Azure Event Hub REST API
@SRGDamia1, I'm having a bunch of trouble getting this to work with the new EnviroDIY LTEBee (SIM7080), and I need your help. The short story is that although I'm able to connect to the server and send a properly formatted POST Request (that works in Postman), on the Mayfly + SIM7080 modem, the data aren't going through and I'm not getting any response from the server. Note that this uses HTTPS via port 443, which this modem seems to support. By specifying that port, I was able to get a connection to the endpoint server (but no connection with Port 80), so I think I'm OK on that. To troubleshoot and solve this, I think I need to dive in to deeper use of the TinyGSM library functions, but I'm really new to that library and it's functions. Can you offer suggestions? |
@GArrigotti-cws, @GArrigotti, I also added `platformio.ini` files that you can use for testing on your side. Connected to #411
@GArrigotti-cws, @GArrigotti, with the last commit 4b624c7, I also tested on a Digi radio and got the same result: no response from the server, even when the entire request is identical to the raw request that works in Postman. In that last commit I included |
In commit 8bc473c from work done on 4/20/22, I figured out the main issue here. The key was to use This fully enabled HTTPS. It turns out that specifying Port 443 in src/publishers/EventHubPublisher.cpp (rather than Port 80 which is used for HTTP) was not sufficient. @SRGDamia1, let's connect to discuss ideas on how to best implement HTTPS across all modems and publishers in ModularSensors. For example, it would be ideal to start migrating to HTTPS for new EnviroDIY stations posting to MonitorMyWatershed.org |
@SRGDamia1, I would like to pick up this conversation about how to best architect the As I mentioned above in #411 (comment), depending on the Publisher's endpoint, we need to instantiate the I got this working, but only for That work is presently all in the I'll look at it more closely in the coming week or two and set up a time to discuss options with you. |
Add support for streaming data to a Microsoft Azure EventHub service REST API endpoint with authentication via a Shared Access Signature (SAS) token.
Documentation for Event Hubs service REST:
A example POST request looks like this:
The key innovation here is to write a SAS signature, for which we first need to complete:
Generate a Shared Access Signature (SAS) for Azure Event Hub
SAS Format:
Where:
sig
- URL-encoded HMACSHA256 signature.urlencode(base64(hmacsha256(urlencode('https://<yournamespace>.servicebus.windows.net/') + "\n" + '<expiry instant>', '<signing key>')))
se
- Token expiry instant. Integer reflecting seconds since the epoch 00:00:00 UTC on 1 January 1970 (UNIX epoch) when the token expires.skn
- Name of the authorization rule.sr
- URL-encoded URI of the resource being accessed.The text was updated successfully, but these errors were encountered: