mruby/c: IoT system for🍶 SAKE brewery 🍶
HASUMI Hitoshi @hasumikin
Monstar Lab
SWEST21 ♨♨♨ 下呂温泉 水明館
Sep. 6, 2019

MeHASUMI Hitoshi@hasumikinMatsue city,a holy place of Ruby
Sake 🍶Soba 🍜Coffee ☕MeMeMeMe旭日酒造

one of the best Japanese Sake brewery
Asahi-shuzo and I make an IoT system using mruby/cAsahi-shuzo
旭酒造(Asahi-shuzo), Yamaguchi: 獺祭(Dassai). fruity,
aromatic and sweet
朝日酒造(Asahi-shuzo), Niigata: 久保田(Kubota). clear,
dry and sharp
朝日酒造(Asahi-shuzo), Fukui: ？？？
旭日酒造(Asahi-shuzo), Shimane: 十旭日(Juji-Asahi).
tasteful, mature with years and good for お燗(warmedstyle)What is mruby/c?

What is mruby/c?
github.com/mrubyc/mrubyc
yet another implementation of mruby`/c` symbolizes compact,
concurrent and capability
especially dedicated to
one-chip microcontrollermruby and mruby/c
mruby
v1.0.0 in Jan 2014
for general embedded
software
RAM < 400KB

mruby/cv1.0 in Jan 2017for one-chip
microcontroller
RAM < 40KB

About my IoT project
IoT system for Asahi-shuzo
delivered to actual brew work in January 2018devices post temperature of Sake materials in brewing,
surrounding temperature and humidity to serverdata is displayed on smartphone app

About my IoT projectWhat is "taking temperature" ?

what is "taking temperature" ?

what is "taking temperature" ?

1st season (2017BY)

1st season (2017BY)

before mruby/c

1st season (2017BY)

1st season (2017BY) architecture
sensortags ->(BLE)-> gateway
gateway ->(WiFi)-> routerrouter ->(3G)-> internet

1st season (2017BY) architecture
sensortags ->(BLE)-> gateway
gateway ->(WiFi)-> routerrouter ->(3G)-> internet
Having a stack of multiple wirelesses is so hard😨

1st season (2017BY) architecture

1st season (2017BY) architecture

超えられない壁1st season (2017BY) architecturea thick wall
BLE couldn't through the wall

water everywhere
power suppply issue
number of instrument should be minimized

BY?

BY?
Brewing Year, from July to Junein Asahi-shuzo a BY work starts on November andfinishes on April (depends on year)2nd season (2018BY)

2nd season (2018BY)

A N EW H O P E

2nd season (2018BY)mruby/c

2nd season (2018BY) architecturedevices ->(3G)-> Internet

2nd season (2018BY) the device2nd season (2018BY) architecture2nd season (2018BY) architecture2nd season (2018BY) mruby/cmruby/c does everything
sensors - I2C, ADC
Fixnum, Float, Math

7seg LED display - transistor array
String, Mutex

3G communication module - UART
String, flow control

2nd season (2018BY)
what were difficult about mruby/c?
we can neither do step execution nor look into
appropriate memory address of mruby/c's variables
so many troubles in IoThard to find why the application doesn't work well

2nd season (2018BY)
what were difficult about mruby/c?
mruby/c was growing
bugs, lack of features, docs and examples

2nd season (2018BY)
so, was mruby/c bad?

2nd season (2018BY)
so, was mruby/c bad? - NO
IoT at work makes you hurry
you have to go back and forth between dark 10℃ storage
cellar and humid 35℃ manufacturing room
you have to amend your firmware with your small laptop in 10minutes
you will thank Ruby's descriptiveness and agility

RubyKaigi 2018

3rd season (2019BY)

RubyKaigi 2019

RubyKaigi 2019

Technology stack of IoT (1/2)
TCP/IP
cloud service
RDB and KVS
server programming
mobile programming
securitytest

Technology stack of IoT (2/2)
high school physics electricity and transistor
microcontroller and peripherals like UART, I2C, ADC,etc.
circuit and PCB artwork
soldering and wiring
3D CAD for housing
suppliers
firmware programming

Summarymruby/cmruby/cmruby/cmruby/cSummarymruby/c is a Ruby for microcontroller
mruby/cmruby/cmruby/cSummarymruby/c is a Ruby for microcontroller
mruby/c runs on Asahi-shuzo
mruby/cmruby/c

Summarymruby/c is a Ruby for microcontroller
mruby/c runs on Asahi-shuzo
mruby/c can be ensured by test
mruby/cSummarymruby/c is a Ruby for microcontroller
mruby/c runs on Asahi-shuzo
mruby/c can be ensured by test
mruby/c is readyThank you!