Firmware update for ManagedGateway on Python - ibm-cloud

In the Python GitHub documentation i see reference to ManagedGateway, however, unlike the Java documentation on Watson IOT site, the Python docs doesn't have any reference for firmware update.
Does the Python package supports Firmware update for Gateways?, or all must be done through the Notification function or by using a ManagedDevice ?

#Yarh We are working on this functionality. However, check the
ibmiotf.gateway.ManagedClient class, that provides ManagedGateway functionality.
In case that one does not address your requirements, please elaborate the requirement.

Related

Why doesn't SwiftyZeroMQ support epgm:// and pgm:// transport-classes?

We currently want a way to pass data between devices with sockets so we used ZeroMQ on our server-side with a python script and everything seems to be working. Our protocol address currently is epgm://224.0.0.1:28650, However, we need to communicate with the python script so we decided to use this Swift library. Currently, I'm directly using the library from this repository and it seems to be using ZeroMQ library version 4.2 with patch level .2. Then, using this function, I'm checking whether or not the library has the .pgm protocol which my app reports that there it doesn't support it.
Although the library has this function to check whether or not it supports a certain protocol, I'm unable to find ANYTHING on google regarding how I would get the library to support the pgm protocol.
After looking through the original swift library, I was able to find zmq.h which, from what I can tell is what the swift library is using as it's ZMQ library. So, after discovering this, I attempted to recompile libzmq with the "--with-pgm" build option that we used to fix the issue on PyZMQ. However, I haven't really had much luck with this and I'm not even sure this is how I'm supposed to proceed. I'm currently at a loss and any help would be appreciated. Thanks.
Here's the Swift code that we're currently using:
import SwiftyZeroMQ5
class communicationClass{
var context: SwiftyZeroMQ.Context?;
var subscriber: SwiftyZeroMQ5.SwiftyZeroMQ.Socket?;
init(){
do{
context = try SwiftyZeroMQ.Context();
subscriber = try context?.socket(.subscribe);
try subscriber?.connect("epgm://224.0.0.1:28650");
}
catch{
print("error - \(error)")
}
}
}
Here's the error that it outputs: error - Protocol not supported
Q : "Why doesn't SwiftyZeroMQ support epgm:// and pgm:// transport-classes?"
Documentation is clear & sound on this:The as-is package does explicitly state, it does not support epgm://-transport class as of 2020-10.
The next step:
Try using the pgm://-transport-class, instead of the epgm:// and if that fails, file an issue at the package maintainers' incident-management queue, as they claim it should work.
So, due to the lack of support of EPGM and PGM, we have decided to use raw UDP with ZeroMQ's dish/radio draft apis. These draft apis are supposed to replace EPGM and PGM but they're still in development. The apis work for our use case but it may vary depending on your use case.
EDIT:
So, there's a better answer to this question. The reason why SwiftyZeroMQ (at least my version) doesn't support the EPGM and PGM protocols is that you need to compile ZMQ yourself with the openpgm option.

Apple Homekit setup hash

I'm trying top write my own Apple Homekit HAP server.
Looking on the official documentation for discovery over IP, using bonjour, there is a TXT record called sh (Setup hash).
I'm guessing this is the code that i need to input into the home app so that it starts pairing. However, i cannot find any more details about this in the documentation. It says "See (”?? ??” (page ??))".
Where could i find more details about this, or is there some more detailed documentation that i could use?
Thanks
the setup hash is new in specification revision 2 and does not appear in specification revision 1. In my homekit project (https://github.com/jlusiardi/homekit_python) I did not update this after specification revision 2 came out.
HTH

How can I use faunaDB on the flutter?

As FaunaDB documentation, it seems that there is no dart API nor REST API. Also, I can't find the FaunaDB package in the Flutter Packages.
Is there any way to use the FaunaDB on the flutter?
I think the easiest way to use Flutter with FaunaDB is to use FaunaDB's GraphQL interface and Dart package graphql_flutter.
I recently managed to read data from FaunaDB using graphql_flutter, and will update this post when I have tested it more.
Currently we don't offer first party support for flutter. You can build a third-party driver for Dart based on our current open source drivers if you'd like. They do use json/http under the hood. If you are targeting android another option might be to fork the java driver and switch out http clients to be android friendly and use a platform channel.
Dart is able to use javascript libraries
How to use JavaScript libraries in your Dart applications
You can simply use the javascript driver
https://github.com/fauna/faunadb-js
https://medium.com/flutter-community/building-a-simple-application-with-flutter-and-graphql-5786764df102
Recently there was a new package published that can help you to use faunaDB with dart/flutter: faunadb_http This library also provides query classes that closely mimic FQL functions.

OpenAPI (aka Swagger) in Azure Functions V2

I'm creating a V2 Function App and want to use Swagger/Open API for docs, however it is not yet supported in the Azure Portal for V2 Functions.
Any suggestions on how I can use Swagger with V2 Functions in VSTS to create the docs on each build?
TL;DR - Use the NuGet package to render Open API document and Swagger UI through Azure Functions.
UPDATE (2021-06-04)
Microsoft recently announced the OpenAPI support on Azure Functions during the //Build event.
The Aliencube extension has now been archived and no longer supported. Please use this official extension.
As of today, it's in preview. Although it's in preview, it has more features than the Aliencube one.
Acknowledgement 2: I am still maintaining the official one.
Microsoft hasn’t officially started supporting Open API (or Swagger) yet. But there is a community-driven NuGet package currently available:
Nuget > Aliencube.AzureFunctions.Extensions.OpenApi
And here’s the blog post for it:
Introducing Swagger UI on Azure Functions
Basically its usage is similar to Swashbuckle — using decorators. And it supports both Azure Functions V1 and V2.
Acknowledgement 1: I am the owner of the NuGet package.
For anyone looking into this, Microsoft still hasn't added Open API support for Azure Functions +v2 and there hasn't been any major movement toward it.
I faced this same issue recently and I found a pretty good solution.
If you aren't aware yet, check this out: https://github.com/RicoSuter/NSwag
NSwag is a toolchain that integrates with .NET to produce the Open API documentation and UI, but also generates the respective API clients for you.
I've used this tool for the past 2 years when working with Angular and .NET apps, it saves a lot of time and seamlessly integrates with my whole development workflow.
For Azure Functions +v2, a contributor created a generator that in less than 10 lines of code, allow us to expose the Swagger endpoint for an Azure Function class:
https://github.com/Jusas/NSwag.AzureFunctionsV2
Now, if you design HTTP-Triggered Functions using DI, grouping related operations under the same class and leveraging model binding, you might not even need to apply any custom decorator, it just works!
Here's an example of how one real API would look like:
(ignore the base class. It is part of a personal pattern I follow, unrelated to Swagger)
And this is how it looks like using a swagger UI:
There is official library Azure Functions OpenAPI Extension. It is still in preview, but looks great.
Can you drop your V2 Function to run on v1 of the runtime by starting over with a blank function app first?
The MSDN documents for Create an OpenAPI definition for a function (with a date of 11/2018 interestingly enough) example states:
By default, the function app you create uses version 2.x of the
runtime. You must set the runtime version back to 1.x before you
create your function.
But one can't just move the setting to 1:
To pin your function app to the version 1.x runtime, choose ~1 under
Runtime version. This switch is disabled when you have functions in
your app.
Which implies one must create the Function app, publish/create it, set it to V1 and then put in a function before adding a function app.

how to upgrade jwplayer 5 to 6.x

My question here is simple : how to upgrade my JWPlayer 5 Pro to the current version which is 6.10. I have my own server where the version 5.6 is located but i cant find out whats the upgrade process. I have read the official documentation but for me it does not look that easy
Thanks folks!
There's no simple "process" for doing the upgrade, and no automation is available. In effect, you need to rewrite your pages to use the embedding methods of JW6, which are radically different from JW5.
A synopsis of the changes: http://support.jwplayer.com/customer/portal/articles/1404037-migrating-from-jw5-to-jw6
The basic embedding method of JW6: http://support.jwplayer.com/customer/portal/articles/1406723-mp4-video-embed
The embedding options reference: http://support.jwplayer.com/customer/portal/articles/1413113-configuration-options-reference
My own collection of simple examples: http://misterneutron.com/