Device not going to Power off - movesense

I am reusing the following piece of code hr_wakeup app.
counter = counter + LED_BLINKING_PERIOD;
if (counter < AVAILABILITY_TIME)
{
asyncPut(WB_RES::LOCAL::UI_IND_VISUAL(), AsyncRequestOptions::Empty,
WB_RES::VisualIndTypeValues::SHORT_VISUAL_INDICATION);
return;
}
if (counter >= AVAILABILITY_TIME)
{
// Prepare AFE to wake-up mode
asyncPut(WB_RES::LOCAL::COMPONENT_MAX3000X_WAKEUP(),
AsyncRequestOptions(NULL, 0, true), (uint8_t)1);
// Make PUT request to switch LED on
asyncPut(WB_RES::LOCAL::COMPONENT_LED(), AsyncRequestOptions::Empty, true);
// Make PUT request to enter power off mode
asyncPut(WB_RES::LOCAL::SYSTEM_MODE(), AsyncRequestOptions(NULL, 0, true), // true = Force async
WB_RES::SystemModeValues::FULLPOWEROFF);
}
I have enabled Level 4 logs and I see the following
2022-01-11 13:59:52.693 14817-14817/D/LocationUpdatesServiceWithSensor: DEBUG LOG {"Body": {"Id": null, "Timestamp": 114284, "Level": 4, "Tag": "", "Message": "LedService::onPutRequest() called."}, "Uri": "184730000180/System/Debug/4", "Method": "PUT"}
2022-01-11 13:59:52.698 14817-14817D/LocationUpdatesServiceWithSensor: DEBUG LOG {"Body": {"Id": null, "Timestamp": 114284, "Level": 4, "Tag": "", "Message": "MAX3000X wake set to: 1"}, "Uri": "184730000180/System/Debug/4", "Method": "PUT"}
However, the device is not getting powered off. I can see the device in the phone.
I am using bootloader 2.0 and hence is there any change the api call I need to do ?

You should subscribe to the lead's detection in the startModule().
you will find the below code in the hrs_wakeup_app's startModule(0. do the same with your code.
// Subscribe to leads detection
asyncSubscribe(WB_RES::LOCAL::SYSTEM_STATES_STATEID(), AsyncRequestOptions::Empty, WB_RES::StateIdValues::CONNECTOR);
I am assuming you have already figured it out, as this was asked a year ago. I have started working with movesense recently and got this problem too. So just posting if anyone needs it.

Related

Dialogflow - Firestore - Webhook call failed. Error: UNAVAILABLE, State: URL_UNREACHABLE, Reason: UNREACHABLE_5xx, HTTP status code: 500

I am trying for a fulfillment in Dialogflow using Firebase. There is data in Firestore and the intent is expected to retrieve the results based on the given parameter in the related intent. The intent is enables for webhook call. But the intent returns with one of the predefined responses.
I always get the error "message": "Webhook call failed. Error: UNAVAILABLE, State: URL_UNREACHABLE, Reason: UNREACHABLE_5xx, HTTP status code: 500."
Following is the Diagnostic Info from the test console
{
"responseId": "e27d24ba-cb14-4170-a7d8-a97314aee001-cad07fe1",
"queryResult": {
"queryText": "novaluron",
"parameters": {
"chemical": "novaluron"
},
"allRequiredParamsPresent": true,
"fulfillmentText": "This molecule is useful",
"fulfillmentMessages": [
{
"text": {
"text": [
"This molecule is useful"
]
}
}
],
"intent": {
"name": "projects/ppcagent-ahe9/agent/intents/6d9df198-9517-4d61-a480-87c158accdc5",
"displayName": "ChemicalDetails"
},
"intentDetectionConfidence": 0.3,
"diagnosticInfo": {
"webhook_latency_ms": 106
},
"languageCode": "en",
"sentimentAnalysisResult": {
"queryTextSentiment": {
"score": 0.3,
"magnitude": 0.3
}
}
},
"webhookStatus": {
"code": 14,
"message": "Webhook call failed. Error: UNAVAILABLE, State: URL_UNREACHABLE, Reason: UNREACHABLE_5xx, HTTP status code: 500."
}
}
Any help will be greatly appreciated.
This error could be due to different reasons, you can check these points:
Use of insecure connection.
You need to use HTTP requests. The service must use HTTPS and the URL must be publicly accessible in order for the fulfillment to function. DialogFlow does not support self-signed SSL certs. For information on SSL setup:
Permission errors.
Server files and folders need correct permissions and ownerships set in order to work properly. If Websites request files for which the server has no access then it will lead to an error.You can see more documentation about permission.
Bad scripting.
You need to check the code and check if there are any errors and modify them.

MashupValueException when creating a Web Table Linked Service on ADF?

I'm experiencing a MashupValueException while creating a Web Table Linked Service and I wonder if someone here have come across the same issue.
The config of the Linked Service is as follows:
{
"name": "WikipediaLS",
"properties": {
"annotations": [],
"type": "Web",
"typeProperties": {
"url": "https://www.the-numbers.com/",
"authenticationType": "Anonymous"
},
"connectVia": {
"referenceName": "MySelfHostedIR",
"type": "IntegrationRuntimeReference"
}
}
}
The error happens after filling the info on the form and clicking on "Test Connection". Then the following error pops up:
Connection failed
'Type=Microsoft.Data.Mashup.MashupValueException,Message=The supplied URL must be a valid 'http:' or 'https:' URL.,Source=Microsoft.Data.Mashup.ProviderCommon,' Activity ID: c8d924b9-cc81-49c1-85c8-70abfa85c859.
I have tested the extraction of the web table using Office 2016 and it works all right.
The aim is to extract the index 0 table from "https://www.the-numbers.com/movie/budgets/all".
This is what you are facing:
You can try to use below url, it can connect to the web successfully on my side:
https://www.the-numbers.com/movie/budgets/all
The website you give seems not stable. Sometimes you cannot visit the database.

"The agent returned an empty TTS" when action is not opened separately to asking an intent

When I invoke the skill with 'okay Google, ask {skillname} to {utterance}' I get the response 'The agent returned an empty tts" and the conversation closes. It doesn't even seem to hit my backend - I've tried hosting the backend code on both a local server and on AWS and the same issue happens in both cases. There's no log of the request being made either on Stackdriver on Google or on CloudWatch on AWS. The only response I get is the following in the debug tab:
{
"response": "The agent returned an empty TTS.",
"expectUserResponse": false,
"conversationToken": "EosDS2o4d0...",
"audioResponse": "",
"ssmlMarkList": [],
"debugInfo": {
"sharedDebugInfoList": [
{
"name": "Response Validation",
"debugInfo": "The agent returned an empty TTS.",
"subDebugEntryList": []
}
],
"conversationBuilderExecutionEventsList": []
},
"visualResponse": {
"visualElementsList": [
{
"displayText": {
"content": "The agent returned an empty TTS."
}
}
],
"suggestionsList": [],
"agentLogoUrl": ""
},
"clientError": 0,
"is3pResponse": true,
"clientOperationList": [],
"projectName": "",
"renderedHtml": ""
}
Nothing in any of the other tabs. When I try invoking the phrases in the same way on my phone, I just see a loading symbol and again nothing in the logs to say it's even hitting the backend.
Weirdly, this doesn't happen when I say 'okay Google, talk to {skillname} {utterance}' - this works absolutely fine.
All the intents work perfectly well when I've opened my action first, and then invoke them. I've built this using Jovo and published on Alexa also and the problem is only happening on Google.

Movesense iOS API: devices disconnecting automatically

device firmware is custom based on 1.7.2
ios app is using the 1.28.1 cocoapod for Movesense.
app can see the device connect to it, and query the battery status. This all works fine, but a lot of times, after the battery status is queried, the device disconnects automatically, as seen via the response to MDS/ConnectedDevices, and on the device itself via debug logs:
Subscribed and listening for notifications. Press ESC to stop:
TODO not thoroughly tested
#6708 { {
"Timestamp": 5124990,
"Level": [
4,
"Verbose"
],
"Tag": "",
"Message": "BatteryChargeProvider::stoponGetRequest timeDiff: 51713"
} }
#6898 { {
"Timestamp": 5125142,
"Level": [
4,
"Verbose"
],
"Tag": "",
"Message": "Disconnect(const Address& rAddress) called"
} }
/Users/builduser/buildAgent/work/a29f59699a429e89/src/whiteboard /comm/internal/serial/SerialAdapter.cpp(246): ASSERT FAILED! [bufferData == TotalHeaderSize]
[1] 73425 abort wbcmd --port /dev/cu.usbserial-AI04RYMP SUBSCRIBESystem/Debug/4
and from the app debug:
Disconnected device: <MDSEvent at 0x282903300: header: {
"Content-Length" = 122;
"Content-Type" = "application/json";
Uri = "MDS/EventListener/23";
}
bodyDictionary: {
Body = {
Serial = 175030000645;
};
Method = DEL;
Response = {
Status = 200;
};
Uri = "suunto://MDS/ConnectedDevices";
}
0x282903300>
is anyone else seeing this? It happens randomly but frequently, and whether I'm connecting to one or multiple devices, makes no difference. When multiple devices are used, it happen to one at random. It will occur multiple times in a row: connect, get battery, disconnect, find the device, connect, get battery, disconnect.
Any help would be greatly appreciated.

WireMock: Temp disable stub response

I use WireMock to stub responses from remote server.
In folder wiremock/mappings I have many files that set rules for stub.
Here example:
{
"request": {
"method": "GET",
"url": "/merchant"
},
"response": {
"headers": {
"Content-Type": "application/json"
},
"status": 200,
"fixedDelayMilliseconds": 3000,
"bodyFileName": "stub_response.json"
}
}
As you can see, when I get request /merchant then return stubbed response from file stub_response.json.
Nice. It's work fine.
But suppose I need temporary to disable this response. Is it possible to turn off stub response and return real response from remote server?
I need flag like this : "disable" : true
Is it possible in WireMock?
You can disable a rule by using the WireMock admin interface. If you invoke a DELETE command against http://.../__admin/mappings/<guid>, then the mapping will be deleted.
You can get a list of all the guids by performing a GET command against http://.../__admin/
If you want to replace a mapping with a real response instead of a stubbed response, you can add a second mapping that has a lower priority than the stubbed response and that proxies through to the real address. Normally, your stubbed response ill be used, but when you then delete the stubbed response, Wiremock will proxy through to the real address as it will then become the highest priority mapping.
To add a proxy, add the following into the response mapping
"proxyBaseUrl" : "http://otherhost.com",
To set the priority of mappings, add the following into your mapping JSON.
"priority": 1,
There presently isn't a disable attribute to a rule. You can remove a wiremock rule and re-add it later, which would functionally be the same.
If you running Wiremock as a Stand-alone process, you can set it into recording mode, effectively this will proxy all requests to a target URL.
Open http://localhost:8080/__admin/recorder (assuming you started WireMock on the default port of 8080), on that screen you have to enter the target URL and click the "Record" button. Until you stop recording it will make this Wiremock acting as a proxy.
If the recording is not something you actually need, you can dismiss recorded stub mappings. Although this is slightly misusing the Recorder feature it is a fast and easy way to temporarily turn your Wiremock into a proxy, instead of responding with stubs.
Wiremock can select which fixture to use depending on in which state of a scenario it runs. In different states, even for same request, it can have different mappings thus behave in different ways (in one of the states can respond from a fixture, and in another state it can be forwarded to the real API).
Say if there is a Proxy scenario, which is currently in the default Started state, then all the queries will be served by stubs that are not specific to any scenario state.
But if the Proxy scenario is in Active state, and we have a mapping that is specific for that scenario state (requiredScenarioState property), and it has a higher priority than default, then this mapping will be executed for any URI to this Wiremock instance:
{
"scenarioName": "Proxy",
"requiredScenarioState": "Activated",
"priority": 2,
"request": {
"urlPattern": ".*"
},
"response": {
"proxyBaseUrl": "https://swapi.dev/api"
}
}
The value for response.proxyBaseUrl, will make all the requests to be forwarded to provided host, when this mapping is matched.
Now we need to be able to toggle Proxy scenario to Activated state and back,
so we define two more mappings for POST /proxy endpoint on this Wiremock. They will have even higher priority - 1, so they can override even the mapping for "urlPattern": ".*".
Drop a JSON file containing all three mappings to your wiremock/mappings:
{
"mappings": [
{
"scenarioName": "Proxy",
"requiredScenarioState": "Activated",
"priority": 2,
"request": {
"urlPattern": ".*"
},
"response": {
"proxyBaseUrl": "https://swapi.dev/api"
}
},
{
"priority": 1,
"scenarioName": "Proxy",
"requiredScenarioState": "Activated",
"newScenarioState": "Started",
"request": { "method": "POST", "url": "/proxy"},
"response": { "status": 201, "body": "Proxy De-activated (Stubs will be used)" }
},
{
"priority": 1,
"scenarioName": "Proxy",
"requiredScenarioState": "Started",
"newScenarioState": "Activated",
"request": { "method": "POST", "url": "/proxy" },
"response": { "status": 201, "body": "Proxy Activated (Will forward all requests)" }
}
]
}
Now you can switch the Proxy scenario to Activated state,
and after switch it back to Started state with:
curl http://localhost:8080/proxy -XPOST
Good thing about this approach that this mapping file can be copied from project to project with minimal changes.