美文网首页
alexa-avs-sample-app跑alexa和dureo

alexa-avs-sample-app跑alexa和dureo

作者: orangepi | 来源:发表于2018-10-08 09:42 被阅读0次

    步骤


    javaclient

    amazon config

    {
        "productId":"CLOCK_V1",
        "dsn":"001234567890",
        "provisioningMethod":"companionService",
        "wakeWordAgentEnabled":false,
        "locale":"en-US",
        "avsHost":"https://avs-alexa-na.amazon.com",
        "companionApp":{
            "localPort":8443,
            "lwaUrl":"https://api.amazon.com",
            "sslKeyStore":"/home/oazon/avs/alexa-avs-sample-app/samples/javaclient/certs/server/jetty.pkcs12",
            "sslKeyStorePassphrase":""
        },
        "companionService":{
            "serviceUrl":"https://localhost:3000",
            "sslClientKeyStore":"/home/oazon/avs/alexa-avs-sample-app/samples/javaclient/certs/client/client.pkcs12",
            "sslClientKeyStorePassphrase":"",
            "sslCaCert":"/home/oazon/avs/alexa-avs-sample-app/samples/javaclient/certs/ca/ca.crt",
            "sessionId":"59e6df3f-6258-47b5-9753-eb3beb09861b"
        }
    }
    

    dureos config

    {
        "productId":"CLOCK_V1",
        "dsn":"001234567890",
        "provisioningMethod":"companionService",
        "wakeWordAgentEnabled":false,
        "headless":false,
        "locale":"en-US",
        "avsHost":"https://dueros-h2.baidu.com",
        "companionApp":{
            "localPort":8443,
            "lwaUrl":"https://openapi.baidu.com",
            "sslKeyStore":"/home/oazon/avs/2017-8-19/alexa-avs-sample-app/samples/javaclient/certs/server/jetty.pkcs12",
            "sslKeyStorePassphrase":"123456"
        },
        "companionService":{
            "serviceUrl":"https://localhost:3000",
            "sslClientKeyStore":"/home/oazon/avs/2017-8-19/alexa-avs-sample-app/samples/javaclient/certs/client/client.pkcs12",
            "sslClientKeyStorePassphrase":"123456",
            "sslCaCert":"/home/oazon/avs/2017-8-19/alexa-avs-sample-app/samples/javaclient/certs/ca/ca.crt",
            "sessionId":"f034a263-6b8d-4509-9fb2-3120bdd6168f"
        }
    }
    

    log4j2 修改日志打印级别

    <Root level="debug">
        <AppenderRef ref="file" level="DEBUG"/>
        <AppenderRef ref="stdout" level="DEBUG"/>
    </Root>
    

    pom.xml 版本对应

    <alpn-boot.version>8.1.7.v20160121</alpn-boot.version>
    

    run

    mvn validate
    mvn install
    mvn exec:exec
    

    companionSerivice

    amazon config

    var config = {
        clientId: 'amzn1.application-oa2-client.4456a4dc6672470ea75e96c9eaf4c354',
        clientSecret: 'ff9fc22ed28b1fa85fa67bb3e85baa9965bed8d1a88048bae446f41d357d171e',
        redirectUrl: 'https://localhost:3000/authresponse',
        lwaRedirectHost: 'amazon.com',
        lwaApiHost: 'api.amazon.com',
        validateCertChain: true,
        sslKey: '/home/oazon/avs/alexa-avs-sample-app/samples/javaclient/certs/server/node.key',
        sslCert: '/home/oazon/avs/alexa-avs-sample-app/samples/javaclient/certs/server/node.crt',
        sslCaCert: '/home/oazon/avs/alexa-avs-sample-app/samples/javaclient/certs/ca/ca.crt',
        products: {
            "CLOCK_V1": ["001234567890"], // Fill in with valid device values, eg: "testdevice1": ["DSN1234", "DSN5678"]
        },
    };
    
    module.exports = config;
    

    dueros config

    var config = {
        clientId: '95lhyXvotvRuix5lniy4flStAVE66axY',
        clientSecret: 'lWo2n9LaSsQcFEH4La4ZQTWG5KcYyoPM',
        redirectUrl: 'https://localhost:3000/authresponse',
        lwaRedirectHost: 'openapi.baidu.com',
        lwaApiHost: 'openapi.baidu.com',
        validateCertChain: true,
        sslKey: '/home/oazon/avs/2017-8-19/alexa-avs-sample-app/samples/javaclient/certs/server/node.key',
        sslCert: '/home/oazon/avs/2017-8-19/alexa-avs-sample-app/samples/javaclient/certs/server/node.crt',
        sslCaCert: '/home/oazon/avs/2017-8-19/alexa-avs-sample-app/samples/javaclient/certs/ca/ca.crt',
        products: {
            "CLOCK_V1": ["001234567890"], // Fill in with valid device values, eg: "testdevice1": ["DSN1234", "DSN5678"]
        },
    };
    
    module.exports = config;
    

    run

    npm install
    npm start
    
    

    添加log

    import org.slf4j.Logger;
    import org.slf4j.LoggerFactory;
    
    public class MultipartContentProvider implements ContentProvider.Typed {
    
        private static final Logger log = LoggerFactory.getLogger(MultipartContentProvider.class);
        
        //... ...
        
        log.info("==================:\n{}",stringBuilder.toString());
    }
    

    run

    cd /avs/2017-8-19/alexa-avs-sample-app/samples/companionService
    npm start
    
    cd /avs/2017-8-19/alexa-avs-sample-app/samples/javaclient
    mvn exec:exec
    

    相关文章

      网友评论

          本文标题:alexa-avs-sample-app跑alexa和dureo

          本文链接:https://www.haomeiwen.com/subject/tyjdaftx.html