PicoRuby with Practical MQTT

PicoRuby aims to bring Ruby into the world of microcontrollers, where severe memory and execution constraints make practical networking difficult. In this talk, I present a real-world implementation of a practical MQTT client on PicoRuby with mruby/c, built on top of picoruby-net.

Unlike CRuby, mruby/c provides no threads, limited socket abstractions, and very restricted memory. Implementing MQTT in this environment required careful design of packet construction and parsing, buffer management, connection lifecycle handling, and interaction with garbage collection, while preserving a Ruby-like programming model.

This session explores what it actually takes to implement a non-trivial network protocol in Ruby under extreme constraints. It shows how far Ruby can realistically be pushed toward bare-metal environments and where it must adapt.

  • Ryosuke Uchida
    Ryosuke Uchida

    Ryosuke is a software engineer who works as a freelancer. He is personally developing IoT and has great interest in the future brought by IoT. He is also an organizer of Roppongi.rb, a regional .rb for Rubyists.