title: AWS Iot Connection using legacy TCP Firmware
body: <p>I have an existing solution for acquired IoT devices that have proprietary legacy firmware, that uses raw TCP.</p>
  <p>The solution involves an application written in Node.JS running on an AWS EC2 instance. It creates a TCP server that opens a socket to listen to the device (each of them). Every time the IoT device pings the server, the server must ping back the device with a default message (created using the original message) as validation the connection is still online.</p>
  <p>After pinging back, it then unscrambles the TCP data parsing it into Json and adding to a MongoDB database. Which then is used for displaying data to the customers.</p>
  <p>Also, on the same EC2 instance, another application is deployed on-demand via front-end APIs requests to send commands to the IoT devices and logs it into the same DB, sometimes changing constants that are defined to each device separately.</p>
  <p>As we are developing new devices in MQTT protocol, we are creating new serverless architecture using AWS IoT Core. I'm looking for an innovative serverless solution to integrate the legacy devices in this more robust and less demanding architecture (more cost effective).</p>
  <p>As I can't change the protocol, it must still be a TCP, i'm looking for something to convert the TCP into MQTT and then forward it to the general IoT Core. That way, i can use the same architecture for both new and old devices. Giving me time to slowly decommission the older devices, not having to maintain both infrastructures.</p>
  <p>The closest thing I've found is Amazon IoT Greengrass (<a href="https://aws.amazon.com/blogs/iot/converting-industrial-protocols-with-aws-iot-greengrass/" rel="nofollow noreferrer">https://aws.amazon.com/blogs/iot/converting-industrial-protocols-with-aws-iot-greengrass/</a>), which appears to run a TCP client in an AWS lambda function, and then forwarding it as MQTT into AWS IoT Core.</p>
  <p>We are testing this now, but i would like to know if anyone had similar issues with legacy protocols using Greengrass or other solutions.</p>