Add Google IOT Device to Google Home as Device - google-cloud-pubsub

I read around 9 tutorials and 6 similar SO topics similar to what I ask, but none were conclusive or actually depicted what I need. So here goes.
I have a raspberry pi setup with a DTH22 sensor to send data to google iot cloud on pub/sub. Data is coming, all good.
Now, the end result here is to make a routine on google home that reads the sensor data (basically temperature) and issue a command to an added AC, based on temperature.
How do I add that sensor data as a device to google home to create that routine? Or is there another way to achieve this and I am coming at this completely wrong?
This is the first time I'm trying this so be kind. Ask anything, if I can, I will answer.

Well nothing was found. So I ended up using Assistant Relay on the Raspberry Pi, which uses a node server to catch and transmit text based commands to google assistant (linked to the same account of the google home). In the script where I check the temperature and humidity from the DHT22 sensor I just added a few more lines to send commands to the local node server to turn on / off the ac, just as I would do via voice commands on my phone.
https://github.com/greghesp/assistant-relay

Related

OpenCV with React for real time image processing

I have a fully running CV project on Python, running on a Raspberry Pi. I would like to convert this to a web app (I've just started using react).
My idea is to have a video-stream source that connects to my Wi-Fi. This videostream would then be accessed through a web-app (i.e. by typing the hardware IP address). Once the user logs into the web-app, there'll be a live feed of the camera and buttons/functions that allows to perform different CV tasks on the source live-stream (i.e. object detection, colour detection, etc.). How should I go about creating this? In particular:
On the hardware side, I was thinking of just having a Raspberry Pi with a camera, streaming the live feed via Wi-fi. Couple of questions:
where should the computer vision algorithms be sitting? I assume on the web-app side? Currently everything is done on the Raspberry Pi side, but I feel I reached the limit in terms of computational power
would the Raspberry Pi be completely dumb? I.e. just stream the camera feed?
what's the best way to stream the camera feed to the React App? Websockets?

XBee3 Coordinator cannot find End_Device during Network Discovery

Currently, I am running XBee3 International Mesh Kit and tried following the given example in the documentation.
https://www.digi.com/resources/documentation/Digidocs/90001942-13/?utm_source=packaging&utm_medium=insert&utm_campaign=xbee3&utm_content=XBeeZigbeeMeshKit#tasks/t_configure_zigbee_modules.htm%3FTocPath%3DGetting%2520started%2520with%2520XBee%2520Zigbee%7CExample%253A%2520basic%2520communication%7C_____4
I tried implementing the Network Discovery for the three devices using Micropython REPL.
The following is the configuration I have for my 3 XBee devices.
Parameters for the 3 XBee Devices
I am running the following code on the Coordinator and End-Device for network discovery
https://www.digi.com/resources/documentation/digidocs/90001539/#reference/r_node_discovery_micropython.htm%3FTocPath%3DGet%2520started%2520with%2520MicroPython%7CMicroPython%
Now when I try to run the python code for Network discovery on the Coordinator (XBee_A), it does not find any End-Device in the node list. The only Router comes up in the search.
But when I run it on the End-Device, it does find the Coordinator and Router.
My idea was to get the details of the End-Device using network discovery, gets it network ID (NI) and then send a command to the device.
Do you know what I am doing wrong?
Have you tried going into command mode and executing an ATND? What are your sleep parameters? If the end device is sleeping longer than the node discovery time limit, it won't be awake to respond to the discovery broadcast.
Try reducing the sleep duration on the end device, or increasing the node discovery timeout (ATNT) on the Coordinator.
I ran into the same issue where the coordinator just couldn't discover any node in the same network. Spending hours digging through other documentations and just to sadly realize the updated XCTU has both DH and DL defaulted to 0 so the default dash for DL in Digi's Mesh Kit User Guide should manually be set to FFFF instead for the coordinator to work. Not the best documentation and there are quite a few errors and information missing out then leave you guessing or pay them for support.

Setting Cinterion BGS2-W modem certificates in code

I'm trying to use AT commands to setup a BGS2-W modem on a custom board to connect to a site over TLS, but the modem is not reacting to my commands and no certificates are being set.
I'm using the command
AT^SBNW
to send the commands as documented in Transport Layer Security for Client
TCP/IP Services doc (https://ptelectronics.ru/wp-content/uploads/organizatsiya_bezopasnogo_ssl-soedineniya.pdf#page=8).
Unfortunately, the document provides no examples, and I haven't been able to find any samples showing the usage of this command online.
The document linked has a java commandline tool attached that will send a cert from a PC, however I am unable to use this tool (I don't have the connection to the modem).
If anyone has any idea's on how to use this command I could very much use the help.
Note: I'm trying to set the certificates from within code running on a PIC18 - this isn't a final incarnation, I just need the certificates loaded so I can connect to our secure server.
Well, guess this one isn't going to find an answer anytime soon :)
So, its fairly easy to capture the output from the javatool - I'm using Com0Com to emulate 2 connected ports, then using termite to manually input on one port while telling the java app to connect to the other.
The first query from the java app expects an "OK" response, I find it easiest to send the response before starting the java app (I guess it gets cached in the recv buffer of the emulated port).
The javatool then sends "AT^SBNW=is_cert,1\r", and you can type in the reply in termite "SECURE CMD READY: SEND COMMAND ..."
After this a large binary dump comes through. You can decode the dump using the structure described in Application Note 62 (https://ptelectronics.ru/wp-content/uploads/organizatsiya_bezopasnogo_ssl-soedineniya.pdf). That should get all the data required to generate the same binary within code.

App Communication on Windows IoT

i want to run 2 different BackgroundTasks - one for the communication with my arduino - and one for the communication with other devices by using a webservice. These tasks should be able to write and read from ONE database. But my problem is, that the Windows.Storage.ApplicationData does not provide the SharedLocalFolder. It is null, if I want to use it. Is there any other way where i can store my database that both BackgroundTask can connect to it?
Additionally I found now this path:(Windows.Storage.ApplicationData.Current.GetPublisherCacheFolder(...)). This look very interesting, but if i want to use it I cant write there. I think, because the resolved file path does not exist..
Any other ideas?
Sincerely,
App2App Communication via WebServer (Blinky WebServer):
You can refer Microsoft's IoT sample provided for Blinky Webserver which also depicts the concept of App2App Communication. But you need to read it thoroughly to modify and reuse it up-to your expectation.
Right now I have no experience about Windows IoT and database. Once I got my hands on it, I'll update.

Intercepting network traffic for a particular application

I am working on Windows. Lets say I am running a Twitter app. I want to intercept all the network packets that this app is sending or receiving at runtime. I wish to look for certain packet (segment) features like TCP destination port, windows size etc. and based on this information I wish to perform certain actions. Basically I want all the information that is available to a traffic analyzer like Wireshark or MS Network Monitor. How can I accomplish this on Windows?
I'm not sure to understand completely what you're aiming at - from what I understand, you could start Wireshark, log the relevant info, and then perform "certain actions" based on the data you could retrieve from this log - even automatically with some scripting.

Resources