Ikawa Home Open Source App Idea - ET Probe with Custom App

Discuss roast levels and profiles for espresso, equipment for roasting coffee.
Esteve
Supporter ♡

#1: Post by Esteve »

Hi,

This is my first post in this forum, been a long time reader but never had much to say :?

Short story, got my IKAWA home roaster this January and really loved the machine. Reading this forum really convinced it was the right option for me. I struggled with the software and not being able to get data outside. So I have reversed engineered the bluetooth protocol of the roaster, built a replacement APP that also reads an ESP32 with a PT1000 placed as an ET probe. And some small website and API to interact with the data. So far I have used this app for about 80 roasts and I am quite happy with it.

The app is now made with Flutter and is both Android and iPhone compatible. Tested on both.

What I would love is if anyone would be willing to join in an effort to open source this. Right now the base code works well but lacks a ton of testing, documentation and security. I do not feel it could be released as is... And honestly I wish I had more time.

The other issue (important) is that any firmware update could break the whole app and require a lot of work again. Would really appreciate honest feedback on how useful would be this software for other people.

The last thing I have been playing with, is doing a roast with a target ROR. I believe having an open system will allow us to experiment in different ways, this is just an example. But seeing how creative this place is cool things could happen.
  1. I have a target ROR curve that I got from a previous roast and modified a bit.
  2. Integrate this ROR over time and add T0 temp, to get a ET line.
  3. Do a reference roast with the desired beans at the same fan speed as the final profile. With this I get the relationship between ET and Ikawa In Temp.
  4. Using this reference curve transform integrated ROR (ET) to Ikawa Temperature
  5. Sample this curve and transform into an Ikawa profile.
  6. Send profile to roaster and test. Get the new ROR.
  7. Repeat : Modify profile to adjust until desired ROR is obtained.
Ok, now the long story with picture follows :D

My idea is to build a "suite" of tools to experiment using this roaster ( and other roasters if this is useful ).

What I have so far is the following, it's a 3 or 4 part application :
  • Ikawa Emulator. A linux python program that helps test the app. Emulates an Ikawa, was useful to get started. This is not part of the app and not sure would help much now.
  • Mobile App, Communication with the sample roaster ( send profile, log ) The app allows to send custom profiles, log temperatures, state ... The app also reads from the ESP32 PT1000 sensor.
  • Realtime view: A simple website for realtime roast visualisation. I got inspired by Decent's visualizer.coffee
  • API for Experiment creation and analysis: Here I go with python approach. Using python you can create profiles, and analyse them. So far it allows for creation of profiles, has a few parametric functions to define experiments and on the analysis side it lets you compare different roast parameters of the said experiment.
  • Website for Experiment creation and analysis: This one I have just started, and so far it's not much. But the idea is to have the functionalities that the python allows but on a more user friendly website. A place to keep track of all the sample greens, see the profiles, and create new profiles as well as experiment groups.
This is the video I used to submit to Apple's TestFlight on May, the app is about the same now only difference is that it lets you track FC ( also left some green beans outside the chamber, don't kill me :shock: )

IKAWA home + PT1000(HEL-707) + ESP32 Blutetooth



Realtime Visualization App. Inspired on Decent's visualizer.coffee:



Post roast analysis using Python and Jupyter notebooks:





Defining an experiment, compressing a curve and generating multiple profiles ( needs to be re-thought as I don't find it super useful ):
From a profile, define 5 variations (+5c ,-5c, 90% time, 85% time, 10% longer)




Random example of how I modify a profile, this is where the website tool would help. It gets complicated too fast...


Well , that is what I have been playing with recently. Hope you find it interesting and if someone has the time and expertise to help me open source it please contact me!

GDM528

#2: Post by GDM528 »

Nice!

I've installed TestFlight, so I'm ready!

Philosophical musing: does communicating with the IKAWA via third party apps, void the warranty?

Your app could eliminate the hassle of transcribing roast profiles from my spreadsheets into the IKAWA app and integrate my thermal logs all in one place. In effect, you'd be duplicating the Pro app (which IKAWA could offer Home users with the subscription editor).

FWIW, and it's just my perspective, I'm hoping to eliminate the need to monitor BT/ET altogether, by modeling the Inlet-to-BT relationship. An overarching characteristic of IKAWA owners, is zillions of roasting runs because of the tiny batch size. I've got a crazy and crushing number of roast logs - too many IMHO. I'd rather be thinking about what I want from the next roast - perhaps this is where a roast-simulating app could really shine.

Esteve (original poster)
Supporter ♡

#3: Post by Esteve (original poster) »

Great!

Yes, the app started as an easy way to synchronise Inlet and ET temps and get logs. It also has the IKAWA fan speed and states (pre-heat, roasting ...).

I've sent you a private message asking for your email, I'll send the TestFlight link and credentials so you can get started.
Philosophical musing: does communicating with the IKAWA via third party apps, void the warranty?
The usual disclaimer for this kind of projects: "I don't know". The app has been tested on 1 IKAWA home. In theory it should work also on the PRO, but never tested.

I began the app only reading values from the IKAWA, then I was more adventurous and added the profile sending... If do not hit the "Send Profile to Roaster now" the app does not write anything into the IKAWA. I have not reversed the firmware binary, just the bluetooth protocol.

Regarding ET logging. The app should work without it, but if you can modify your own BlueTooth as long as it complies with this, it will work:
BLEDevice::init("ESP32_PT1000");
#define SERVICE_UUID        "19763624-d8ea-4221-aa30-bbf6f1717140"
#define CHARACTERISTIC_UUID "cb239101-6a43-42c5-8484-db880c08ebab"

temp = int(max_31865.temperature(1000,RREF)*10);
temp = temp & 0xFFFF;
byte frame_end[4]={126,highByte(temp),lowByte(temp),126};
pCharacteristic->setValue(frame_end,4);
So far I only do Celsius. The database I believe should be in C and then the apps around can easily do the conversion.

If at any point the app does not work as intended restart it or restart IKAWA. With my machine BT connection works much better/faster than with the original IKAWA Home app. But it might just be that any small tweak was to fix my setup.

1- Login. Top left menu, there is a context menu, press log-in and enter the credentials.


2 - Welcome screen. Once logged in the buttons should be blue.


3 - Connect to IKAWA. Hit connect button, since it will not find the ESP32 sensor this will take a 8 seccond timeout. Once connected you should see something like this.


4 - Bottom of the app you have the navigation. 1 is home screen, 2 is the send profile view, 3 is where the profile library is. The following is a screenshot of the library.


5 - If you got to the send profile you'll see something like this. By default the app gets the profile stored in your IKAWA.


Logging a roast
It is important that you have your phone connected to the internet and do not use it while logging. iPhone dosn't let you send and receive while you app is in background. I've worked around it by keeping the phone screen on while logging.

You can open on a computer browser the visualiser to see the realtime process. Refresh for the graph, or otherwise you should see the numbers update.
  • First you'll need to send a profile. You can skip this if you want, but then the visualiser web won't know what were your set points.
  • Once the profile is in the IKAWA go to main screen ( the little home , or 1 in the screenshot)
  • Press Log PROFILE NAME
  • Enter your beans, weight and any comment.
  • Press log. At this point if it all went well you should see some text on the CSV state message box. This is a CSV of all data collected, if you press the box it will let you send it as an email ( just developing purposes ).
  • If everything is working so far you can perform you roast on the IKAWA, drop the green beans into the chamber, close it, press the button and you should see the graph on the app.
  • Once the whole roast is finished and you have your roasted beans press stop.



Let me know how it goes! Thanks :)

GDM528

#4: Post by GDM528 »

Awesome - can't get to it right away, but have a few questions in the meantime:

So, the logging appears pretty specific to ESP32 hardware I'm not familiar with (although I see an Adafruit board is involved). I'm guessing it's open source - can you provide some links to it?

Is the Library in your app created within the app, or is it being pulled off the roaster?

You state the phone must be connected to the internet, but technically, isn't just Bluetooth enough? I use an Android phone to control my roaster, with cellular and WiFi disabled - works just fine, and starts up quickly. I've observed it taking longer to connect to the roaster when my phone is connected to the cloud, which has me suspecting there's some sort of handshake/registration with IKAWA's servers before connecting to the roaster.

Regarding the warranty question:
If I were IKAWA, I'd claim that the factory app has built in all the necessary limits and error traps to keep both the roaster and the owner safe from thermal disasters. Unauthorized third party apps may not be able to provide those same assurances, although I expect/hope that safety is built into the firmware and hardware. Apologies for saying the paranoid part out loud, but I will be careful before messing with a 2KW appliance. I saw the phrase "open source" mentioned, so posting the code for others to review could go a long way to calming concerns. Perhaps the Artisan experts on this forum can offer some advice here.

BTW, I applaud your skills in decoding their Bluetooth protocol - not a lot of people on the planet that can do that.

Esteve (original poster)
Supporter ♡

#5: Post by Esteve (original poster) »

So, the logging appears pretty specific to ESP32 hardware I'm not familiar with (although I see an Adafruit board is involved). I'm guessing it's open source - can you provide some links to it?
This is a small/ bluetooth temperature sensor I assembled from available boards. The communication is not based on any standard. I can totally share the code. Hardware wise the most expensive is the PT1000 but any other could be used, but I really like this one in terms of size and responsiveness and precission.

- ESP32-S3-DevKitC-1-N32R8V , bought on mouser for 18€ , probably an overkill a simpler ESP32 would totally work.
- Adafruit PT1000 RTD MAX31865 - 16€ , used to interface the PT1000 with the ESP32 via SPI. I use their library to calibrate and read.
- PT1000, HEL-707-U-1-12-00 -56€ on mouser also. Thin insulated cable that fits well without modifying the IKAWA.
Is the Library in your app created within the app, or is it being pulled off the roaster?
The iPhone app polls the IKAWA for the Inlet temperature using IKAWA protocol, and then polls the bluetooth ESP32 sensor. This is the core of the application. I think I am able to get every half second resolution, which works well for me.
You state the phone must be connected to the internet, but technically, isn't just Bluetooth enough?
The iPhone app is "dumb" it collects the data from both ESP32 ET sensor and Ikawa variables and logs them to a firebase database on the cloud. This is what allows to have a web application for realtime logging, sharing roasts and so on.

In this image you can see what gets stored in the database:



which has me suspecting there's some sort of handshake/registration with IKAWA's servers before connecting to the roaster.
To my knowledge it just sends some log information, maybe roast count and last time used.
Regarding the warranty question:
If I were IKAWA, I'd claim that the factory app has built in all the necessary limits and error traps to keep both the roaster and the owner safe from thermal disasters. Unauthorized third party apps may not be able to provide those same assurances, although I expect/hope that safety is built into the firmware and hardware. Apologies for saying the paranoid part out loud, but I will be careful before messing with a 2KW appliance. I saw the phrase "open source" mentioned, so posting the code for others to review could go a long way to calming concerns. Perhaps the Artisan experts on this forum can offer some advice here.
Totally agree still now that I got a bit overconfident sending my own profiles to the roaster I think about this... The idea of this post was to see if apart from testing the app someone can help me manage this project as open source. Last time I contributed to an open source project, GitHub didn't even exist :) also the security of the whole app is not perfect... and it interacts with a database in the cloud and would have user information, even if it just email and machine info... So I need help to opensource it (and time).

Thanks a lot for your feedback!

Esteve (original poster)
Supporter ♡

#6: Post by Esteve (original poster) »

Hi,

This is the first part to open source this app.

This is the code for an Ikawa Roaster Emulator, this should help understand the bluetooth protocol:

https://github.com/esteveespuna/IkawaRoasterEmulator

Next I'll open source the Bluetooth sensor (hopefully in a week), which is pretty simple.

To open source the iPhone/Android app I need some help, if anyone else is interested please let me know.

Hope this helps understand better the roaster.