IoT Agent provisioning - iot

I'm using these provisioning for service and device in my IoT Agent.
{
"services":[
{
"resource":"/iot/d",
"apikey":"1234",
"type":"multiSensor"
}
]
}
{
"devices":[
{
"device_id":"myDeviceId",
"entity_name":"LivingRoomSensor",
"entity_type":"multiSensor",
"attributes":[
{
"name":"a",
"type":"celsius"
},
{
"name":"b",
"type":"degrees"
}
]
}
]
}
and I noticed that the attribute "type" in services can be also named "entity_type" and it must be equals to "entity_type" of devices. If these attributes are not equals I've this error:
DEVICE_GROUP_NOT_FOUND","message":"Couldn\t find device group","code":404} in get group device
Anyway the IoT Agent works. Can I use only device provisioning in my IoT Agent?

Related

Google Actions Account Linking: doesn't work in testing

I have to develop a Google Action with a mandatory Account Linking phase that I have configured with an OAuth2 server. I'm using the online console at https://console.actions.google.com/ to develop the action.
I have set up the Start scene where the condition is user.validationStatus != "VERIFIED" . Based on the result of the condition I will go to 2 different scenes.
Here the screen of the Start scene where is checked the account linking status.
Here the Start_AccountLinking scene
But when I try to go in the "Test" section of the console after I open the action with the invocation, It doesn't pass any of the conditions and stays in the Start scene. In the log on the right, I can see that it failed both the conditions.
{
"conditionsEvaluated": {
"failedConditions": [
{
"expression": "user.validationStatus != \"VERIFIED\"",
"nextSceneId": "Start_AccountLinking"
},
{
"expression": "user.validationStauts == \"VERIFIED\"",
"nextSceneId": "AuthenticatedScene"
}
]
},
"responses": [
{
"firstSimple": {
"speech": "Benvenuto in Semiperdo",
"text": "Benvenuto in Semiperdo"
}
}
]
}
Instead of user.validationStatus use user.accountLinkingStatus. It will work!

Amazon Alexa Account Linking Does Not Present The Authorization Link on LinkAccount Card

Having gone through an endless amount of materials on the topic, would appreciate help here please:
I am setting up OAuth 2.0 account linking from an Amazon Alexa "skill" to an external service. The skill successfully identifies the lack of an access token and displays a LinkAccount card to the user. Problem is: the card contains no link to the authorization page.
Respective Authorization URI definitely is provided in the skill's account linking settings.
Intent's code:
const LaunchRequestHandler = {
canHandle(handlerInput) {
return handlerInput.requestEnvelope.request.type === 'LaunchRequest';
},
handle(handlerInput) {
const accessToken = handlerInput.requestEnvelope.context.System.user.accessToken;
if (accessToken == undefined){
const speechText = "Please use the Alexa app to link your Amazon account to the external account"
return handlerInput.responseBuilder
.speak(speechText)
.withLinkAccountCard()
.getResponse();
} else {
const speechText = 'Welcome to the Alexa Skills Kit, you can say hello!';
return handlerInput.responseBuilder
.speak(speechText)
.reprompt(speechText)
.withSimpleCard('Hello World', speechText)
.getResponse();
}
},
};
JSON Output:
{
"body": {
"version": "1.0",
"response": {
"outputSpeech": {
"type": "SSML",
"ssml": "<speak>Please use the Alexa app to link your Amazon account to the external account</speak>"
},
"card": {
"type": "LinkAccount"
}
},
"sessionAttributes": {},
"userAgent": "ask-node/2.0.7 Node/v6.10.3"
}
}
I am using Amazon developer console simulator and an iOS Alexa app for testing (no physical device).
Thank you.

Native App Install Banner not working on iOS

This manifest.json is placed per Google instructions. Android works as intended but iOS does nothing.
{
"name":"FooApp",
"short_name":"FooApp",
"icons":[
{
"src":"foo_app_icon.png",
"type":"image/png",
"sizes":"144x144"
}
],
"prefer_related_applications":true,
"related_applications":[
{
"platform":"play",
"url":"https://play.google.com/store/apps/details?id=com.es0329.fooapp",
"id":"com.es0329.fooapp"
},
{
"platform":"itunes",
"url":"https://itunes.apple.com/us/app/fooapp/id123456789"
}
],
"start_url":"https://www.es0329.com/fooapp",
"display":"standalone"
}

freeradius prevent user to login to some devices

How can I prevent some user to login to some network devices on freeradius server? I've created policy:
deny_beli {
if (User-Name == "belitest") {
reject
}
}
But I need only to ban login to network devices on subnet 172.0.0.0/23, not others. Thanks.
I changed policy:
deny_beli {
if (User-Name == "belitest") {
if(NAS-IP-Address =~ /172.0.0./){
reject
}
if(NAS-IP-Address =~ /172.0.1./){
reject
}
}
}
Now, everything is working smoothly.

Working with webinpectord

I just want to communicate with Mobile Safari using 'webinpectord' (hobby project). My aim is to just display an alert 'hi' on Mobile Safari. I know I can do this using Safari's debugging console. At the moment what things I know is Mobile Safari ('webinpectord') listen to port 27753 on localhost using IPV6 protocol. And from this page I understand the sequense of communication with Mobile Safari. I perused already working programs like remote-debug, node-iosdriver and iOS-webkitproxy. Then I tried to write a program in C which connects to localhost:27753 and then send and receive commands. My problem is I can connect and send commands to port 27753 but not getting any response from that port.
I tried to send
{ __argument: { WIRConnectionIdentifierKey: '17858421-36EF-4752-89F7-7A13ED5782C5' },
__selector: '_rpc_reportIdentifier:' }
According to this article, Mobile Safari has to send back response like
{ __selector: '_rpc_reportSetup:',
__argument:
{ WIRSimulatorNameKey: 'iPhone Simulator',
WIRSimulatorBuildKey: '10A403' } }
{ __selector: '_rpc_reportConnectedApplicationList:',
__argument:
{ WIRApplicationDictionaryKey:
{ 'com.apple.mobilesafari':
{ WIRApplicationIdentifierKey: 'com.apple.mobilesafari',
WIRApplicationNameKey: 'Safari',
WIRIsApplicationProxyKey: false } } } }
but I am not getting any response from Mobile Safari. I just can send commands to there.
Let us assume that my program is buggy !
So I tried to experiment with 'telnet'. Here also I can connect to localhost:27753 and I can send commands and not getting any response. I am attaching screen shot.
You can see that I tried many combinations like
{ "__argument": { "WIRConnectionIdentifierKey": "17858421-36EF-4752-89F7-7A13ED5782C5" }, "__selector": "_rpc_reportIdentifier: " }
{\"__argument\": { \"WIRConnectionIdentifierKey\": \"17858421-36EF-4752-89F7-7A13ED5782C5\" }, \"__selector\": \"_rpc_reportIdentifier: \"}
"{ "__argument": { "WIRConnectionIdentifierKey": "17858421-36EF-4752-89F7-7A13ED5782C5" }, "__selector": "_rpc_reportIdentifier: " }"
but nothing worked.
Lastly I tried curl to send data. That also failed !
Can anybody tell me what should I do to get response like
{ __selector: '_rpc_reportSetup:',
__argument:
{ WIRSimulatorNameKey: 'iPhone Simulator',
WIRSimulatorBuildKey: '10A403' } }
{ __selector: '_rpc_reportConnectedApplicationList:',
__argument:
{ WIRApplicationDictionaryKey:
{ 'com.apple.mobilesafari':
{ WIRApplicationIdentifierKey: 'com.apple.mobilesafari',
WIRApplicationNameKey: 'Safari',
WIRIsApplicationProxyKey: false } } } }
when sending request
{ __argument: { WIRConnectionIdentifierKey: '17858421-36EF-4752-89F7-7A13ED5782C5' },
__selector: '_rpc_reportIdentifier:' }
to localhost:27753 using 'telnet' or 'curl'.
I tried two days in different ways (wrote C program, python program and lastly tried telnet and curl) and did not get succeeded. So please help !
Mobile Safari use customized binary protocol(binary property list, see bplist-creator) to communicate with Safari debugging mode.
The correct format for this JSON command should be this:
{"__argument":{"WIRConnectionIdentifierKey":"990cc163-d8b2-4d22-8d1c-644e100a5a07"},"__selector":"_rpc_reportIdentifier:"}
Notice that every "key" should be double quoted.
You can refer the appium for details.

Resources