offbeatmammal 0 Posted February 8, 2016 Share Posted February 8, 2016 I am trying to talk to the Microsoft Azure Event Hub from Energia but I'm a little baffled! Using the WiFi library I seem to be getting a successful connect (returns true) but ... nothing seems to get posted... I am trying to build the message up as in this (javascript) example http://fabriccontroller.net/iot-with-azure-service-bus-event-hubs-authenticating-and-sending-from-any-type-of-device-net-and-js-samples/ but not seeing anything (even failed messages) reported in the event hub. I wanted to stick with Energia rather than switch to anything else, but after a couple of days banging my head on a wall I'm a little suck! Any ideas would be much appreciated (as I'm probably doing something dumb!) if there's a way to debug this / get error messages from the connection or the attempt to post that would be a huge help... Gotta use the Azure end point for this, so that's the one constant. char sas[] = "SharedAccessSignature {sig from the generation example}"; char serviceNamespace[] = "{ns}.servicebus.windows.net"; char hubName[] = "{hub}"; char deviceName[] = "device01"; void loop() { ////// WiFiClient client; float t = 10.1; client.stop(); // if there's a successful connection: if (client.connect(serviceNamespace, 443)) { Serial.println("connecting..."); // send the HTTP POST request: client.print("POST /"); client.print(hubName); client.print("/publishers/"); client.print(deviceName); client.println("/messages HTTP/1.1"); client.println("Host: www.arduino.cc"); client.println("Content-Type: application/atom+xml;type=entry;charset=utf-8"); client.print("Authorization: "); client.println(sas); client.println(); client.print("{ Temperature: "); client.print(t); client.println(" }"); client.println(); // note the time that the connection was made: delay(10000); } else { // if you couldn't make a connection: Serial.println("connection failed"); delay(1000000); } } Quote Link to post Share on other sites
spirilis 1,265 Posted February 9, 2016 Share Posted February 9, 2016 It's .sslConnect, not .connect to do SSL. Another user was having trouble connecting to Azure Event Hub with .sslConnect BTW. I was able to confirm this behavior but still have no idea why it's happening. Probably requires a deep dive that I don't have time to do (i.e. spin myself up on what Microsoft's SSL restrictions might be, what the CC3100/3200 supports, etc...) offbeatmammal 1 Quote Link to post Share on other sites
offbeatmammal 0 Posted February 9, 2016 Author Share Posted February 9, 2016 thanks @@spirilis ... looks like I just found that other thread - http://forum.43oh.com/topic/9187-sslconnect-dosnt-work-with-some-servers/ - there was me hoping it would be an easy problem to solve ;( Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.