How to make RPC calls over MQTT (Google Iot Core + Mongoose OS) - mongoose-os

RPC calls over MQTT
Hi,
I want to publish a telemetry event by issuing a PUBLISH message(RPC call) to an MQTT topic (${device.id}/rpc)
references:
[RPC over MQTT][(ttps://mongoose-os.com/docs/mongoose-os/api/rpc/rpc-mqtt.md)
Publishing telemetry events, Google IoT core
I am using below command to call RPC over MQTT
mos --port mqtts://mqtt.2030.ltsapis.goog:8883/projects/PROJECT_NAME/locations/us-central1/registries/iot-registry/devices/esp8266_C7E6AA --cert-file gcp-esp8266_C7E6AA.pub.pem --key-file gcp-esp8266_C7E6AA.key.pem call Sys.GetInfo
But I am getting below response
$ mos --port mqtts://mqtt.2030.ltsapis.goog:8883/projects/PROJECT_NAME/locations/us-central1/registries/iot-registry/devices/esp8266_C7E6AA --cert-file gcp-esp8266_C7E6AA.pub.pem --key-file gcp-esp8266_C7E6AA.key.pem call Sys.GetInfo
Unknown command
Command completed.
Is the above command is correct or am I doing something wrong?

I am posting this answer to save time of people who might face the same problem.
So mos --port command only works form Command line(CMD).
And if you are on windows it require some special formatting that you can find out here.
Thanks
Abhi

Related

how can I integrate web app with fablo API?

I have deployed the smart contract(go) and the fablo network , I also have my own fablo rest APIs but I need to integrate this API with my web app how can I do it?
I'm working with this repository https://github.com/fablo-io/fablo-rest
I invoked the following steps in the readme file:
1- Run the script ./hyperledger-citc.sh to install some necessary software
2- Run the command sudo ./fablo recreate to start the network
3- You may open the file fablo-config.json to view the network components. It also includes the the installation of the chaincode "asset-transfer-basic" in Golang
4- You may use the commands sudo ./fablo [down | start | stop | up | prune | reset] to interact with the network
5- We use Fablo Rest API (https://github.com/fablo-io/fablo-rest) to interact with chaincodes and execute Transactions.
6- Create an authorization token using the below command. This token expires in few minutes, so it needs to be regenerated
I have learned that I can use fetch API function but it's only receives URL as a parameter but I don't have the URL of my API
In fabric samples,Check the rest-api-typescript project which is available under asset-basic-transfer or you can search "Asset Transfer REST API Sample" with this text on Fabric sample you will get the project info.

How to read messages in a stream from rabbitmqadmin from the console

I have configured a stream on a rabbitmq docker container. I am able to use the command rabbitmqadmin to publish to it. I can also see that the message got appended to the stream when I run a rabbitmqaddmin publish. But for some reason a rabbitmqadmin get command on the stream fails saying "540 basic.get not supported by stream queues queue "xxxx" in vhost".
Looks like a different command is needed to read from a stream or cannot be done from command console. Anyone have any ideas how to over come this?

Unable to instantiate the chaincode in muticloud setup

I am trying to achieve the multicloud architecture. My network has 2 peers, 1 orderer and a webclient. This network is in Azure. I am trying to add a peer from Google Cloud Platform to the channel of Azure. For this, I created a crypto-config for 3rd peer from Azure webclient. But in the crypto-config, I made the changes like peers in Azure have their own certificates while for the 3rd peer, I placed the newly created certificates. Now I can install, instantiate, invoke and do queries in the peers(1 and 2). And I can install the chaincodes in 3rd peer. But I am unable to instantiate the chaincodes.
Getting the following error: Error: could not assemble transaction, err proposal response was not successful, error code 500, msg error starting container: error starting container: Post http://unix.sock/containers/create?name=dev-(CORE_PEER_ID)-documentCC-1: dial unix /var/run/docker.sock: connect: permission denied
Can anyone guide me on this.
Note: All the peers, orderer, webclient are running in different vm(s)
#soundarya
It doesn’t matter how many places your solution is deployed
The problem is you are running docker by using sudo command try to add docker to sudo group
Below block will help you out
https://www.digitalocean.com/community/questions/how-to-fix-docker-got-permission-denied-while-trying-to-connect-to-the-docker-daemon-socket
To learn more concept about docker.sock
You can refer to my answer in another Can anyone explain docker.sock

Connect via ssh to CF - Error

I need to debug my application , we are using version 2.65 (Diego)
.
I use the following wiki
http://docs.cloudfoundry.org/devguide/deploy-apps/ssh-apps.html
while running cf ssh myapp via cli
nothing happens , what should I do in order
1. To see the container FS
2. To be able to debug it ?
The application was deployed successfully to CF.
Im using nodejs app.
all other commands are working well.
When I run the command cf ssh myapp I got this error after two minutes :
FAILED
Error opening SSH connection: dial tcp 52.23.201.1:2277: getsockopt: operation timed out
It sounds like a platform issue using non-standard ssh port.
You can find a bit more ssh access manual steps/troubleshooting tips on https://docs.cloudfoundry.org/devguide/deploy-apps/ssh-apps.html
If you believe it is a instance issue, you can download a copy of droplet/fs using api, more on https://apidocs.cloudfoundry.org/213/apps/downloads_the_staged_droplet_for_an_app.html

How to delete sensu client from web monitoring

Hi I am trying to delete sensu client from monitoring, I have removed the sensu pack and folder from client, still its not reflecting in web monitor, I tried curl and direct removed from the web monitoring still no go.
I have googled and tried deleting redis keys from redis-cli and still no go, the particular client is showing in web monitor, please guide me on how to delete it from monitoring.
curl -s -i -X DELETE http://<sensu-server>:4567/clients/<client-name>
The above will delete the client from sensu. This information was obtained here: Clients API - Sensu Docs - https://docs.sensu.io/sensu-core/1.4/api/clients/
may have a look at the documentation:
http://sensuapp.org/docs/0.11/faq#how-do-i-delete-a-client