Switch to desktop version  
Using Java to send IO values to Azure - Printable Version

+- Ewon Technical Forum (https://techforum.ewon.biz)
+-- Forum: Development (https://techforum.ewon.biz/forum-50.html)
+--- Forum: Java (https://techforum.ewon.biz/forum-53.html)
+--- Thread: Using Java to send IO values to Azure (/thread-1180.html)



Using Java to send IO values to Azure - rnicola - 19-02-2020

Hello Everyone, 

I am completely new to the use of the Ewon Flexy 205 and have a few questions in regards to setting up the Ewon properly to sending JSON formatted files to a Azure database. 

Firstly, I see that there is a MQTT -> Azure JAVA package available that can be FTP transferred to the Flexy 205 and configured. My flexy now has the AZURE IOT IO server running, so that has already been placed within the Flexy.

Second, how do I properly point this IO server at the Azure database? I see that the Flexy receives a unique Certificate and Key, but doe it also need a unique address to be pointed at the Azure instance?

Lastly, this Flexy 205 (per request of the end user) will not be using Talk2M. Since it will be on a different network than their Azure server, how do I setup this connection? Does it need a VPN? How is a third party VPN configured if needed?

If there is any documentation in regards to these topics, that would be greatly appreciated. The end goal is to setup multiple Flexy's across multiple job sites that all communicate back to Azure so that data can be collected off the IO. 


Thank you for your time.


RE: Using Java to send IO values to Azure - simon - 20-02-2020

Hi Micola,

First, if you configure the Flexy to push data to the Azure IOTHub (through MQTT using BASIC or JAVA programs, like my IOServer), you do not need any VPN.
The Azure IOT IOserver uses the URL : IotHubName + ".azure-devices.net"
So the URL depends on the IOT Hub name.

Simon


RE: Using Java to send IO values to Azure - LewisH304 - 04-04-2020

static EventData create(byte[] data)
Construct EventData to Send to EventHubs. Typical pattern to create a Sending EventData is:
i. Serialize the sending ApplicationEvent to be sent to EventHubs into bytes.
ii. If complex serialization logic is involved (for example: multiple types of data) - add a Hint using the getProperties() for the Consumer.

Sample Code:

EventData eventData = EventData.create(telemetryEventBytes);
eventData.getProperties().put("eventType", "com.microsoft.azure.monitoring.EtlEvent");
partitionSender.Send(eventData);

Parameters:
data - the actual payload of data in bytes to be Sent to EventHubs.
Returns:
EventData the created EventData to send to EventHubs.
See Also:
EventHubClient.create(String, ScheduledExecutorService)