Skip to Content
Technical Articles
Author's profile photo Naoto Sakai

Setup note for Sigfox – SAP Cloud Platform Internet of Things Cloud Foundry Environment —

Introducing

This is a note when I set up SAP Cloud Platform Internet of Things Cloud Foundry Environment and Sigfox. This is the place where the customer misunderstood when setting up. I think this is useful information and I will publish it.

Java virtual machine

This is a problem you may encounter if you build the “Internet of Things Edge Platform” on Windows. Be sure to use the 64-bit version JVM. In the 32-bit version, even if the hardware has sufficient memory, you cannot start because of a heap memory problem.

config_gateway_rest.xml

Unfortunately, the “config_gateway_rest.xml” file output by “build rest-sigfox” command is difficult to understand.
I prepared a template to make the settings more understandable.

First , please login to your IoT Service cockpit , then move to your tenant.

Then , please memo of URL. maybe this URL is like following.
https://xxxxxxx-xxxx-xxxxx-xxxx-xxxxxx.xxxx.cp.iot.sap/yyyyyy-yyyyyy-yyyyyy-yyyyyy-yyyyyyyyyy/iot/cockpit/#/tenant/zzzzzzzzzz
Please extract from here as follows.
https://xxxxxxx-xxxx-xxxxx-xxxx-xxxxxx.xxxx.cp.iot.sap/yyyyyy-yyyyyy-yyyyyy-yyyyyy-yyyyyyyyyy/iot/cockpit/#/tenant/zzzzzzzzzz

Then, replace the <HOSTNAME>,<INSTANCENAME>,<TENANTNAME> part in the XML below with the following.

<HOSTNAME> to xxxxxxx-xxxx-xxxxx-xxxx-xxxxxx.xxxx.cp.iot.sap
<INSTANCENAME> to yyyyy-yyyyyy-yyyyyy-yyyyyy-yyyyyyyyy
<TENANTNAME> to zzzzzzzzzz

Sigfox user and password

The user ID and password specified in <cnf:apiUsername> and <cnf:apiPassword> are NOT the ones used when logging in to Sigfox portal (https://backend.sigfox.com).

You must generate this user ID and password on Sigfox portal.

Login to your sigfox portal.Then move to ‘Group’ .

Choose your group.Then, Click ‘API Access’ of left side .
If you don’t use API ACEESS feature , click ‘New’ button.
Please fill in the API Access information box. Name is free.
You must assign ‘DEVICE MANAGER[W]’ profile.
Then , click ‘OK’ button.
OK, User id and password are generated . You should use these values for <cnf:apiUsername> and <cnf:apiPassword>.
Memo these values as <SIGFOXAPIUSER> and <SIGFOXAPIPASSWORD>

gatewayAlternateId

You need to swap <GATEWAYALTERNATEID> to your gateway alternate id. It will be use as following on your IoT Service Cockpit.
The number 1122334455667788 is used in the manual, but it is better to make it easy to understand.

 

 

Template of config_gateway_rest.xml

OK , you can prepare the value of <HOSTNAME>,<INSTANCENAME>,<TENANTNAME>,<SIGFOXAPIUSER>,<SIGFOXAPIPASSWORD>,<GATEWAYALTERNATEID>.

Let’s replace these with the XML below and use it as config_gateway_rest.xml .

<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml-stylesheet type="text/xsl" href="cnfTransform.xsl"?>
<cnf:configuration xsi:schemaLocation="http://sap.com/iotservices/xsd/config"
	xmlns:cnf="http://sap.com/iotservices/xsd/config" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
	<cnf:amq>
		<cnf:connectors>
			<cnf:client>
				<cnf:connectionString>failover:(nio+ssl://<HOSTNAME>:61616?daemon=true&amp;soTimeout=60000&amp;verifyHostName=true)?initialReconnectDelay=5000</cnf:connectionString>
				<!-- <cnf:connectionString>failover:(nio://<HOSTNAME>:61619?daemon=true&amp;soTimeout=60000)?initialReconnectDelay=5000</cnf:connectionString> -->
				<cnf:streamTTL>5000</cnf:streamTTL>
				<cnf:TTL>200000</cnf:TTL>
				<cnf:soap_over_jms_tmo>60000</cnf:soap_over_jms_tmo>
				<cnf:concurrentProducers>5</cnf:concurrentProducers>				
				<cnf:concurrentConsumers>5</cnf:concurrentConsumers>
				<cnf:ackMode>1</cnf:ackMode><!-- AUTO_ACKNOWLEDGE = 1 / SESSION_TRANSACTED 
					= 0 -->
				<cnf:nonPersistent />
				<cnf:maxConnections>8</cnf:maxConnections>
			</cnf:client>
		</cnf:connectors>
	</cnf:amq>
   	<cnf:coreConnection>
        <cnf:address>https://<HOSTNAME>/iot/core/api/v1/tenant/<TENANTNAME></cnf:address>
        <cnf:timeout>60000</cnf:timeout>
        <cnf:authentication>BASIC_AUTH</cnf:authentication>
        <cnf:mutual>false</cnf:mutual>
    </cnf:coreConnection>
	<cnf:gatewayBundle gatewayver="REST">
		<cnf:endpoints>
			<cnf:cxf lan="true">
				<cnf:address dev="gateway"><HOSTNAME></cnf:address>
				<cnf:soapPort client_rx_tmo="60000" client_conn_tmo="60000">8170</cnf:soapPort>
			</cnf:cxf>
		</cnf:endpoints>
		<cnf:amq>
			<cnf:brokerName>mqtt-bus</cnf:brokerName>
			<cnf:connectors>
				<cnf:server>
					<cnf:transportConnectors>
						<cnf:transportConnector name="mqtt-bus-connector"
												uri="mqtt+nio+ssl://<HOSTNAME>:61698?needClientAuth=true&amp;transport.soTimeout=60000"/>
					</cnf:transportConnectors>
					<cnf:defaultTTL>30000</cnf:defaultTTL>
					<cnf:expireMessagePeriod>200000</cnf:expireMessagePeriod> <!-- 200 seconds -->
					<cnf:pendingMessageLimit>200000</cnf:pendingMessageLimit> <!-- After this, start checking TTL -->
					<cnf:stream_expireMessagePeriod>5000</cnf:stream_expireMessagePeriod> <!-- 5 seconds -->
					<cnf:stream_pendingMessageLimit>200000</cnf:stream_pendingMessageLimit> <!-- After this, start checking TTL -->
					<cnf:offlineDurableSubscriberTimeout>3600000</cnf:offlineDurableSubscriberTimeout> <!-- 1 hour -->
					<cnf:offlineDurableSubscriberTaskSchedule>120000
					</cnf:offlineDurableSubscriberTaskSchedule> <!-- 2 minutes -->
					<cnf:memoryUsage memory="64" store="50000" temp="10000"/>  <!-- in mBytes -->
					<cnf:destinationPolicies></cnf:destinationPolicies>
				</cnf:server>
			</cnf:connectors>
		</cnf:amq>
		<cnf:gateway gatewayAlternateId="<GATEWAYALTERNATEID>">
			<cnf:technology>rest</cnf:technology>
			<cnf:vendor>sigfox</cnf:vendor>
			<cnf:gateway_comm>
				<cnf:media>API</cnf:media>
				<cnf:useAsServer>true</cnf:useAsServer>
				<cnf:jmsConnectionString>failover:(vm://mqtt-bus?waitForStart=30000&amp;create=false)</cnf:jmsConnectionString>
				<cnf:socket_host>https://backend.sigfox.com/</cnf:socket_host>
				<cnf:socket_port>80</cnf:socket_port>
				<cnf:apiUsername><SIGFOXAPIUSER></cnf:apiUsername>
				<cnf:apiPassword><SIGFOXAPIPASSWORD></cnf:apiPassword>
				<cnf:disableGatewayContentSent>true</cnf:disableGatewayContentSent>
			</cnf:gateway_comm>
			<cnf:trigger_comm>
				<cnf:media>Command</cnf:media>
			</cnf:trigger_comm>
			<cnf:startSinkAsCoord>true</cnf:startSinkAsCoord>
			<cnf:persistTopology>true</cnf:persistTopology>
			<cnf:waitBeforeNextWrite>0</cnf:waitBeforeNextWrite>
			<cnf:simulData>false</cnf:simulData>
			<cnf:defaultRFDWakeUp>7500</cnf:defaultRFDWakeUp>
			<cnf:defaultFFDLoadShedding>7500</cnf:defaultFFDLoadShedding>
			<cnf:minRouterBufSize>100</cnf:minRouterBufSize>
			<cnf:waitBeforeParentRemove>1800</cnf:waitBeforeParentRemove><!-- 30mins: 
				30*60sec -->
			<cnf:periodicalDataReports>
				<cnf:periodicalAlternateId>11:22:33:44:55:66:77:88</cnf:periodicalAlternateId>
			</cnf:periodicalDataReports>
			<cnf:nodePositions>
				<cnf:nodePosition>
					<!--coord -->
					<cnf:posAlternateId>00:0c:29:bb:fe:53:00:00</cnf:posAlternateId>
					<cnf:posX>230</cnf:posX>
					<cnf:posY>120</cnf:posY>
					<cnf:posZ>0</cnf:posZ>
				</cnf:nodePosition>
			</cnf:nodePositions>
			<cnf:defaultValues>
				<cnf:defaultSensorTypeAlternateId>1</cnf:defaultSensorTypeAlternateId>
				<cnf:positioningSensorAlternateId>0</cnf:positioningSensorAlternateId>
			</cnf:defaultValues>
		</cnf:gateway>
		<cnf:wsnLifecycle>
			<cnf:generatePingReq>false</cnf:generatePingReq>
			<!--<cnf:strokingTime></cnf:strokingTime> -->
			<cnf:rfdVitalityOn>true</cnf:rfdVitalityOn>
			<cnf:defaultRfdTolerance>0.50</cnf:defaultRfdTolerance>
			<cnf:missingAfterMiss>5</cnf:missingAfterMiss>
			<cnf:useRfdStdDeviation>false</cnf:useRfdStdDeviation>
			<cnf:samplingTimeout>2000</cnf:samplingTimeout>
			<cnf:burstDelta>5000</cnf:burstDelta>
			<cnf:reportingTime>120000</cnf:reportingTime>
			<cnf:policyType>DATA_TRAINING</cnf:policyType>
		</cnf:wsnLifecycle>
		<cnf:buffering active="true">
			<cnf:queueMaxElement>100000</cnf:queueMaxElement>	<!-- max number of element in PriorityBlockingQueue -->
			<cnf:bufferTrigger>80</cnf:bufferTrigger>			<!-- percentage of the maximum heap size that triggers Gateway buffering -->
			<cnf:maxFileDimension>100</cnf:maxFileDimension> 	<!-- max file dimension * 1000 (2 -> 2KB) -->
			<cnf:maxDisk>4096000000</cnf:maxDisk> 				<!-- space dedicated to buffering file -->
			<cnf:saturation>70</cnf:saturation>					<!-- percetage of hd use -->
			<cnf:checkMemory>false</cnf:checkMemory>			<!-- true if you want to flush the buffer once memory is critical -->
		</cnf:buffering>
		<cnf:propertyMap>key10=Value10
			nodeAcceptedByDef=true
		</cnf:propertyMap>
	</cnf:gatewayBundle>
	<cnf:keepAlive>
		<cnf:stopSystemOnFault>false</cnf:stopSystemOnFault>
	</cnf:keepAlive>
	<cnf:security>
		<cnf:active>true</cnf:active>
		<cnf:useLANendpoints>false</cnf:useLANendpoints>
	</cnf:security>
</cnf:configuration>

I have confirmed the run with OTCHCP56_0-70002561 (on Windows) .

 

Safe life.

Assigned Tags

      Be the first to leave a comment
      You must be Logged on to comment or reply to a post.