Deploying Python on the edge: Mistakes, pain and learnings of scaling Python applications on millions of IoT devices

Vipul Gupta (~vipulgupta2048)




Deploying Python applications on IoT devices presents unique challenges. The software constraints of building for multiple architectures and using open-source tools to develop, ship, and maintain applications for multiple devices is hard enough. Edge devices also have hardware challenges, and quite recently the world been recovering from a significant chip shortage that leads to supply chain issues all across the world.

This talk is an insight into Python for the embedded ecosystem. It summarizes the past four years of experience building and helping people build robust, scalable use cases with Python on Single Board Computers (SBCs). Through practical demonstrations and real-world examples, the attendees will get insights into more AI/ML use cases running on tiny devices or porting your application for the best hardware-architecture combo. After the talk, attendees will be equipped with practical knowledge and actionable insights to confidently deploy and scale Python applications on IoT devices. The session is geared towards experienced developers seeking to optimize their edge deployments. The talks focuses on pains faced when scaling Python applicaions on IoT fleets between thousands of devices. We will start the topic with:

  • Explaining a usual Software Development Lifecycle of product.
  • How does the development of software on IoT hardware differs?
  • Brief examples on how this difference leads to pains when you have to scale hundreds, maybe thousands of devices. Like, a Python script writing to storage on a resource contrainted device can lead to memory corruption and your device dying in the middle of the underwater expedition.

With introduction of the topic complete, my presentation will solely focus on practical insights into reducing pain, scaling fleets, building production ready applications for the embedded ecosystem. Few come to mind that I mentioned in my topics covered list.

  • How to create clean reproducible, self healing application setups when running Python applications on embedded devices (You can turn them off and on without sending someone to the device)
  • IoT devices with their storage considerations will need a focused effort on exponentially more with less. Since everything will need space. Code, dependencies, databases, data, logs etc. Everything needs ram and CPU compute, so battles have to be picked accordingly.
  • Using tools like Docker, Hardware-in-the-loop pipelines and Pyinstaller we can test applications exactly on the hardware and architecuture they will be running on to build fault tolerant applications

Will bring as many usecases and learnings I have had in the work that I have been doing full-time collaborating to building customer applications on edge devices.

In the end, I want folks to understand that no matter the differences. They too can use the context, lessons and mistakes that I will discuss in my talk to take better engineering decisions and build applications that will run on millions of devices.

Key Topics Covered:

  1. Understanding the unique considerations of deploying Python on IoT devices (Setup, dependencies, resources available)
  2. Best practices for memory management, optimizing dependencies, and the development process
  3. Packaging, testing, and distribution techniques using PyInstaller, Docker, Hardware-in-the-loop pipelines and virtualization.
  4. Monitoring, logging, and debugging strategies for edge deployments (Especially holding back logs)
  5. Addressing challenges in scaling Python applications on IoT devices
  6. Real-world examples, learnings, and pitfalls to avoid. Funny but expensive stories of that one time in the Sahara dessert…

The session promises valuable takeaways, no hand waving, and real hands-on experience to empower your journey in deploying Python on edge.



Content URLs:

  • This session was selected and presented in PyDelhi Conference 2023:

  • I work as a Product Owner for balena, an IoT fleet management company managing 10 million+ devices for our customers since 2020. As part of my job, I work with customers closely to optimize their Python use cases and get insights on making the process more frictionless. This session is going to be a summary of 4 years of my work experience in IoT:

  • I have been a speaker in the past at conferences and meetups likePyDelhi. Documented here:

  • The session can be delivered as a lightning talk if the schedule is packed. It will be tough but can make it work.

  • Blog:, Documentation initiative:

Speaker Info:

Vipul Gupta is a seasoned software developer specializing in IoT applications and is passionate about open-source docs, sustaining communities and adding faces to usernames.

Occasionally reads, meticulously documents, and continuously automates, Vipul has been part of various initiatives like Google Summer of Code, ALiAS AMA program & Google Code-in.

Offline, he is the comms lead for PyCon India, runs an OSS community called ALiAS to mentor college students, and organizer for several developer groups in New Delhi.

In his full-time role as a Product Owner at balena, Vipul is currently building an open-source hardware-in-the-loop pipeline aiming to expedite the testing process for embedded developers transforming days or weeks of work validating software into a few hours by automating an actual device using a jig called autokit.

Speaker Links:

https// https// https//

Section: Embedded Python and IOT
Type: Talks
Target Audience: Advanced
Last Updated: