Communication of devices via AWS greengrass core - aws-lambda

I am pretty new to AWS IoT. Can you please guide me or refer me some helpful material to implement whole greengrass. I want to use raspberry pi as my greengrass core in gg group and I want to establish communication between different devices which in my case are esp8266 and esp32 through raspberry pi.
I followed the official documentation given on aws site and implemented all examples given. In 4th module of aws greengrass core documentation they have shown an example in which two devices; publisher and subscriber, communicate with each other. As they mentioned I set up my computer as end device and run that basicDiscovery.py file in one terminal as publisher and subscriber in other terminal and it worked.
Now, instead of terminal in my computer I want to use one esp8266 as publisher and another esp8266 as subscriber and exchange data between them via raspberry pi (greengrass core). I have no idea if I have to install device SDK on esp or what? I am finding no way out from here.
Thank you so much for help.

You asked what software you need to run on your ESP8266 device in order to interact with AWS Greengrass. You have two software options to run on the ESP8266 that I'm aware of:
FreeRTOS (FreeRTOS) is a very stable OS, and allows you to code in C.
MongooseOS is a new OS and allows you to code in Javascript.
Arduino (This instructables article walks you through registering a device with AWS IOT, which should allow you to connect it to Greengrass, but I recommend the above two options.)
Amazon FreeRTOS
To install the FreeRTOS software on your device, here are two tutorials:
install the FreeRTOS software on your device.
Here is another tutorial: AWS IOT with FreeRTOS example.
Once you have the FreeRTOS software installed, you can continue in Module 4 that you mentioned by adding the AWS IOT device (your ESP 8266) into your AWS Greengrass group.
MongooseOS
First, install the mos utility on your computer.
Next, use the mos utility to flash your device with MongooseOS software.
Then, upload code to your device (example) to connect to AWS Greengrass Core (or, continue on with Module 4) as you noted.
Good luck!

First you should read about Greengrass which you can find useful information and how to install it on RaspberryPi here.
Then you should choose which kinds of OS you want to use for your ESPs. You can use:
Amazon FreeRTOS
MongooseOS
Zerynth
Or bare-metal programming with C/C++ using different IDEs like Arduino
I would recommend to use Amazon FreeRTOS because it is well-known and the documentations are very good. You can find more information to get started with it here.
If you want to use MongooseOS, I should mention that the documentation is not good and you may lose your time for connecting your ESP to Greengrass group, although you can find more information about it in their blog here.
You can also use Zerynth which is based on python. It has also well documentation. Although, it doesn't support variety of micro controller manufacturers. You can find more information about it here.
If you want to use Arduno you can find more information here.
Basically, Any AWS IoT device can connect to an AWS Greengrass core but you should consider the following hints:
All of your devices (RaspberryPi and ESPs) should be in the same network and you should set the IP of the broker in your ESPs to the IP of your RaspberryPi in your local network.
Also you should set the devices to be in same group in AWS IoT console and deploy the configuration to the Greengrass.
The policies for IoT devices should allow them to publish/subscribe.
For connecting to the AWS broker all of devices should have valid certifications and for connecting ESPs(or any other devices) to the Greengrass network, CA root certificate should be replaced by Greengrass group certificate.

Related

TwinCat 3 Remote Deploy to XAR

I'm was trying to deploy my code to a device with XAR, but I only find solutions that I've to be in the same network...
Is it possible to deploy to a device with XAR which is not in my network? I want to be at the office and try to deploy and connect to a PLC in a factory...
As with anything networking related, this is possible but will require a great deal of assistance from your company IT Team.
All that is needed to allow for deployment from one network to another is the ADS network ports opened for communication as detailed in Infosys. If you cannot gain access to the factory network for external connection then you will need to work through another solution.

IoT management page with P2P connection

I'm really looking for advice and a starting point more than anything. So I'll try my best to explain my end goals and the challenge. I want to set up a local WiFi connection (P2P) between a Rpi3 (or any embedded system really, running linux) and a laptop. The Pi should be the server and laptop the client. The raspberry PI is going to be reading samples over USB from an SDR. I want the laptop to be able to connect to the network the pi throws up, and be able open a browser and view the results. I'm guessing what i need to read up on is ports/sockets and web programming in general. The cheepy IoT sensors and light bulbs seem to be able to do this (opening network and forwarding data) relatively easily but i cannot find any information online to aid in my quest. All the Best and thanks in advance.
Since the embedded system will be running Linux, you can do something along the following lines:
setup the wifi as an Access Point (example). Also setup DHCP Server (example), so the wifi will assign an IP address to connecting laptop.
Install a webserver (e.g. Apache).
Create the webpage/ web application you need to "serve" the data. Install this into Apache.
Ask follow-up questions if you like.

Remote Access Windows IoT core device over the internet

I am working with Windows IoT core on a Gateway to Run some Edge services, all the ways to connect to the IoT core device is locally, so basically you have to be on the same network, Any possible way to access the device via the internet?
It is a generic network question. There are a two options, depending if this is for private or commercial grade use.
Configure 'port forwarding' on your router.
Using cloud service which have a published IP address. Your device 'publish' on a known location and your clients access a known place. For example, you can use Microsoft Azure IoT Hub. The purpose of remote connection is nothing more than managing the device. You can use Azure IoT Device Management.

Record IoT device activity to secure domain for debugging

I have an IoT device (standalone) that I need to debug Wifi connectivity (if we're sending up the right requests, or if they're coming down proper). I have 5 secure domains that I need to log all traffic to and from. I can get any new hardware/software needed, but I need to basically store all activity and then use a service to upload remotely for comparison on the server side.
Any great suggestions on best approaches for this? I can't install a proxy on the device, so Charles/Wireshark (my regular go-tos) are out. I can buy a router and setup DD-WRT or something, or just root a laptop with a special brew of linux.
Please advise. I need to get the setup put together as quickly as possible. Trying to debug a serious problem.

USB sync of local database to WP7

I have a requirement where data on SQL server needs to be synced to WP7 devices through USB.
I initially thought of writing a WCF Lib., but it'll go online & sync even if device is connected to USB in local network (Where it's easy & cheaper to get data over local network rather than go to internet & get it).
I have coded isolated storage to save the data synced, but i need an efficient way of getting data from local network, while it's connected to local network.
My questions are:
Is there a way to request data from local network when connected to local network in WCF?
Does someone have a C# code i can use to write synchronization routines to usb over local network? (I would love to have the code, if anyone has this)
Is there a better way of achieving what I'm trying to do?
I'm hoping for some quick answers for this problem, any help is greatly appreciated.
Thanks.
My recommendation would be for your WCF API to have an DNS name pointing to an internal IP address, which is not available outside of the local network and in the routing it will get resolved through USB and another DNS name pointing to an external IP Address which is only available outside of the local network. Your application would try to connect using the local IP address first, which should go through the local network and if it fails it should retry the with external option.
You can use NetworkInterface.NetworkInterfaceType to detect a connection of type Ethernet.
Implementing a full sync protocol is complicated and not something I would recommend attempting unless you really have to.
If you do go down this route I'd recommend using item based message queues and then syncing the queues (and replaying as necessary) rather than trying to sync database tables. It'll depend on the requirements of your application and nature of the data though.
Further to both Murven and Matt's answers, I'd recommend looking into the Microsoft Sync Framework, which supports WP7 as a client, commonly uses WCF on the server, and has great support for a wide range of edge cases.
You can then, as per Matt's answer, watch for connectivity changes and, on USB connection, start a sync to a local IP.
When it comes to targeting mango, you can implement it as a ResourceIntensiveTask and it will run when USB is connected, even if the app isn't running.

Resources