{"id":15297321,"url":"https://github.com/anujdutt9/aws_iot_python","last_synced_at":"2026-04-09T08:02:17.089Z","repository":{"id":79123238,"uuid":"70950304","full_name":"anujdutt9/AWS_IoT_Python","owner":"anujdutt9","description":"Publish and Subscribe to Data using AWS IoT and Python3","archived":false,"fork":false,"pushed_at":"2016-11-04T15:41:57.000Z","size":21,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-25T13:14:55.715Z","etag":null,"topics":["aws","aws-iot","aws-iot-python","iot","linux","mqtt","mqtt-protocol","paho-mqtt","python-3-5","raspberry-pi","windows"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/anujdutt9.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-10-14T22:02:59.000Z","updated_at":"2017-06-01T12:45:05.000Z","dependencies_parsed_at":null,"dependency_job_id":"304bc6d8-29b0-48c8-8e7f-9e2609b1ad1c","html_url":"https://github.com/anujdutt9/AWS_IoT_Python","commit_stats":{"total_commits":15,"total_committers":1,"mean_commits":15.0,"dds":0.0,"last_synced_commit":"61ac34ed863e61631d9640018bb13e2b099bcf48"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anujdutt9%2FAWS_IoT_Python","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anujdutt9%2FAWS_IoT_Python/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anujdutt9%2FAWS_IoT_Python/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anujdutt9%2FAWS_IoT_Python/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/anujdutt9","download_url":"https://codeload.github.com/anujdutt9/AWS_IoT_Python/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245467615,"owners_count":20620216,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws","aws-iot","aws-iot-python","iot","linux","mqtt","mqtt-protocol","paho-mqtt","python-3-5","raspberry-pi","windows"],"created_at":"2024-09-30T19:16:41.977Z","updated_at":"2026-04-09T08:02:12.059Z","avatar_url":"https://github.com/anujdutt9.png","language":"Python","readme":"# AWS_IoT_Python\nThis repository contains the steps and the code to Access the AWS IoT service using Python3, Paho-MQTT on Raspberry Pi3.                                                                                                                                                                                                                                                                                      **Note:** To make this code work for Windows, Linux/Ubuntu, just remove the RPi imports and GPIO's and insert the Interface I/O's according to your OS.                                                                                         \n\n# Requirements:\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t   \na) **Python 3.4 or above** [https://www.python.org/downloads/] (https://www.python.org/downloads/) \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t   \n\nb) **Paho-MQTT**\n```\n\"pip install paho-mqtt\"\t\n```\nc) **SSL**               \n```\n\"sudo apt-get install libssl-dev\"\n```\n\n## Reference:\nAWS IoT Tutorial [http://docs.aws.amazon.com/iot/latest/developerguide/iot-device-sdk-c.html] (http://docs.aws.amazon.com/iot/latest/developerguide/iot-device-sdk-c.html)\n\n## Steps for Setup:\n1. Go to Amazon IoT website [https://aws.amazon.com/iot/] (https://aws.amazon.com/iot/)\n2. Follow this link [https://aws.amazon.com/iot/](https://aws.amazon.com/iot/). Click on \"Get started with AWS IoT\" and \"Sign In\" with your Amazon Account. \n2. Click on **Create a Resource**.\n3. Choose **Create a thing**, type a name for the thing, and then choose Create. The **thing** is a shadow of the Hardware device that you want to connect to the AWS IoT service.\n4. In addition to a confirmation message, the View thing button will be displayed.\n5. Choose View thing to display information about your \"thing\". \n6. Choose the **Connect a device** button on the side panel to download a **key pair** and a **certificate** generated by AWS IoT.\n7. On the Connect a device page, select the **SDK** to use, and then choose Generate certificate and policy. Choose **Embedded C** here.\n8. This will generate an X.509 certificate and key pair; activate the X.509 certificate; and create an **AWS IoT policy** and attach it to the certificate.\n9. Next you will get to see the Download Links for the certificates and the keys. Download them all.\n10. Choose **Confirm \u0026 start connecting**.\n11. On the next page you will get a sample format of the code. Save that in a text file for the reference.\n\n## Download the Code: \nYou can either clone this repository using git clone:\n```\ngit clone https://github.com/anujdutt9/AWS_IoT_Python.git\n```\nor download it as a \".zip\" file.\n\n## Running the Code:\nThe example code in the repository is for **Publisher and Subscriber**                                                                                                   \n\nThe **Publisher and Subscriber** folder contains **AWS_IoT_pub.py** file that **publishes(sends)** the data to the AWS IoT service and **AWS_IoT_sub.py** that **subscribes** to the service and shows(get) the data from the AWS IoT on the second Terminal. Currently, **AWS_IoT_sub.py** subscribes to any topic and will show all of the received msgs but we can customize it to get a perticular message.                         \nThe publisher code reads the state of the pins of **Raspberry Pi3** (change Pin Numbers for other Raspberry Pi Boards) and sends this to the AWS IoT updating the state as its changed.                                                                                                                                                                                                                                                                                                                                                                     For this, we have connected some LED's to the pins of the Raspberry Pi that represent the state of the pins.                             \nIf the LED's glow, it's state is '1' else '0' (You can make changes in the code as you want).     \n\nThe subscriber code fetches the state of the LED's from AWS IoT and prints it on the second terminal.\n                                                                                                                                                                                                                                                                               \n\n## To Test the sample Python Programs:                                                                                                   \ni) In one terminal, run the **AWS_IoT_pub.py** code using \n```\npython3 AWS_IoT_pub.py\n```\nii) In second terminal, run the **AWS_IoT_sub.py** code using\n```\npython3 AWS_IoT_sub.py\n```\nFollow the same steps for the Raspberry Pi code.\n\nYou can check the sources and modify the topics used by both the programs. \n                                      \n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanujdutt9%2Faws_iot_python","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanujdutt9%2Faws_iot_python","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanujdutt9%2Faws_iot_python/lists"}