Wrap up – After implementing SwiftGarden
This article is based on the session presented at iOSDC2023, Growing apples with Swift This is an article that summarizes the contents of the presentation.
This is a continuation of the article “4. Checking data in the iOS app – Implementing Swift Charts”. If you haven’t read it yet, please read it!
In this presentation, we used Swift&RaspberryPi to automate and save labor for home gardening tasks
Summary…
- You can develop Raspberry Pi with Swift that you usually write
- There is a difference in Swift behavior between Raspberry Pi (Linux) and MacOS
- Hardware implementation requires experience and knowledge different from usual iOS development
- I feel that the environment for normal iOS development is quite blessed
- Like last year, it’s fun to improve everyday issues with ideas and implementations
- Hardware implementation + iOS application integration seems to be effective in various applications
- Growing vegetables is very difficult, I want to eat them more carefully than ever before
As I felt in last year’s announcement, hardware implementation requires different points and knowledge than usual application development, and while it has depth, I thought it needed experience
Bluetooth and so on. It seems that the width will spread more if you can use it!
I feel like I’m trying to grow vegetables myself, but it’s hard to grow vegetables as beautifully as they are sold at the supermarket, and I’m grateful that I can always buy them at the supermarket.
I thought I should eat more carefully
This time it was an alpha version development, so when I implemented it, there were various things I wanted to improve and additional things I wanted to implement
- Automatic execution with soil/temperature sensor data
- I would like to be able to set conditions such as “when the moisture content of the soil falls below XX” and “when the temperature and humidity meet the conditions of XX”, and then use those conditions as triggers to execute.
- Customize the water supply tube (ensure uniform water supply)
- Resizing the photo size (currently several hundred KB to 1MB)
- Since the image size is large now, it takes time to download, and the CloudStorage fee is also expensive
- How to take pictures at night (using an infrared camera, etc.)
- When I first implemented it, it was pitch black at night, so even if I took a picture, I couldn’t see anything.
- Make it available outdoors
- Additional measures such as ensuring power supply, waterproofing, dustproofing, insectproofing, heatproofing, and security are required
- Allow settings such as schedules from the app
- It seems difficult to reflect the settings in real time, so if you implement things like getting the Firestore setting information from the Raspberry Pi side at the specified time, you can implement it at a low cost
- Or maybe it would be possible to implement a mechanism to monitor changes on the Firestore side, which can be implemented as standard with the iOS SDK…?
In the future, when I move to a bigger house and become more immersed in it, I would like to evolve the beta version/production operation and implementation
By the way, about the pineapple I bought this time, it will take 2-3 years for it to be ready to be seen in supermarkets, so please wait until iOSDC2026 for the results~
References
- Raspberry Pi Documentation – Camera software
- https://www.raspberrypi.com/documentation/computers/camera_software.html
- Overview of Google Cloud Storage JSON API
- https://cloud.google.com/storage/docs/json_api
- Using the Cloud Firestore REST API
- https://firebase.google.com/docs/firestore/use-rest-api
- https://firebase.google.com/docs/firestore/use-rest-api
- ラズパイ – 水中ポンプを制御しよう
- https://zenn.dev/kotaproj/articles/4903ba3b416269
- https://zenn.dev/kotaproj/articles/4903ba3b416269
- Creating a chart using Swift Charts
- https://developer.apple.com/documentation/charts/creating-a-chart-using-swift-charts
- https://developer.apple.com/documentation/charts/creating-a-chart-using-swift-charts
- SwitchBot API v1.1
- https://github.com/OpenWonderLabs/SwitchBotAPI