forked from just4give/birdwatcher
-
Notifications
You must be signed in to change notification settings - Fork 0
/
balena.yml
135 lines (81 loc) · 5.49 KB
/
balena.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
name: "Bird Watcher"
type: "sw.application"
description: "Make a bird watcher with a Pi4 and a camera and start classifying the birds around you. It runs Edge Impulse, Telegram and balena."
post-provisioning: >-
## What is Bird Watcher?
Bird Watcher is a Bird Feeder with a Raspberry Pi 4 with a camera running balena and Edge Impulse Machine Learning service. This project run Edge Impulse Linux SDK on balenaOS allowing you to manage a fleet of devices.
## Installation Instructions
### Hardware and software needed
* Raspberry Pi 4 Model B
* Raspberry Pi Camera or USB Camera
* [Edge Impulse account](https://edgeimpulse.com/)
* [balenaEtcher](https://balena.io/etcher/)
### Get Started
Running this project is as simple as click 'Get started` button on this page. Clicking will open a pop-up, introduce the WiFi credentials and generate the balenaOS Operating System image.
Once the OS image is downloaded on your computer, open [balenaEtcher](https://balena.io/etcher/). Flash an SD card with the OS image downloaded.
When the flashing process has completed successfully, insert your SD card into the Raspberry Pi 4 and connect the power supply.
After your device is flashed and powered up, simply open up a web browser on your computer on the same network. Enter the address: [http://birdwatcher.local](http://birdwatcher.local).
To login, use the username `birdwatcher` and password `birdwatcher`. You may change these credentials on `Settings`.
### Configure the Variables
#### Use your own Edge Impulse ML model
The project will start automatically working with Mithun's original Bird Watcher ML model. However if you would like to re-train your model and improve it, feel free to follow these instructions below:
* Go to [Bird Watcher ML model](https://studio.edgeimpulse.com/public/40986/latest) and clone it on your [Edge Impulse](https://studio.edgeimpulse.com) account.
* Go to `Keys` next to `Project Info` menu.
* Create a new Edge Impulse API Key and copy it.
* Go to [http://birdwatcher.local](http://birdwatcher.local)
* Go to `Settings` and introduce the Edge Impulse API key.
* Now you can start training your Edge Impulse ML model.
Otherwise feel free to create your own Edge Impulse ML model with other topics. Feel free to share innovations you do on the top of this project.
#### Create a Telegram bot and a Channel to share your watched birds
Follow this instructions to create a Telegram bot.
* Download the Telegram application on your mobile phone.
* Search the user `BotFather`. This is the official Telegram bot to create bots.
* Click `Menu` and select `Create a new bot` or alternatively write `/newbot` on the chat.
* Introduce a name for your bot and then introduce a username (using underscores and `_bot` ending).
* Copy the URL of your bot and the `HTTP API token` which will be the `TG_TOKEN` on the Telegram Variables on Settings.
* Go to Telegram app and create a private Channel and introduce as a subscriber the bot that you have created.
* Open a browser and type `https://api.telegram.org/bot<TG_TOKEN>/getUpdates` (change `TG_TOKEN` by the real one).
* Copy the chat id from the bot and introduce it as a `TG_GHAT_ID` on the Settings.
### Invite your community
Once you have a Telegram bot URL, feel free to share it with the share it with the community.
Create a local community with schools and others who would like to learn about birds and nature around them. Involve families, teachers and more.
### Troubleshooting
If you have any issue feel free to write on [https://forums.balena.io](https://forums.balena.io).
#### Local website does not work
If you have more than one device, the device names will increment like so: [http://birdwatcher-2.local](http://birdwatcher-2.local), [http://birdwatcher-3.local](http://birdwatcher-3.local)
The local hostname requires a multicast DNS (mDNS) service like Bonjour or Avahi:
* On Windows, check if 'Bonjour' is installed (Control Panel > Programs and Features). If not, you can download Bonjour for Windows from [https://support.apple.com/kb/DL999](https://support.apple.com/kb/DL999)
* Most 'desktop' Linux distributions ship with Avahi. Search for the installation command for your distribution. E.g. for Ubuntu: sudo apt-get install avahi-daemon
macOS comes with Bonjour built-in.
## Contributions are open
Feel free to contribute into the repo [here](https://github.com/just4give/birdwatcher).
assets:
repository:
type: "blob.asset"
data:
url: "https://github.com/just4give/birdwatcher"
logo:
type: "blob.asset"
data:
url: "https://raw.githubusercontent.com/just4give/birdwatcher/master/logo.png"
data:
applicationEnvironmentVariables:
- EI_COLLECT_MODE_IMAGE: N
- EI_API_KEY_IMAGE: ei_153fa3c6fe14b17b9bd0c03c0c4cc36dfcbb4ddc2404c816
- TG_CHAT_ID: put_your_telegram_chatbot_id
- TG_KEY: put_your_telegram_key
- ENABLE_TG: N
- ENABLE_MOTION: Y
- PIXEL_THRESHOLD: 75000
- USERNAME: birdwatcher
- PASSWORD: birdwatcher
- LATITUDE: 0
- LONGITUDE: 0
applicationConfigVariables:
- BALENA_HOST_CONFIG_start_x: 1
- BALENA_HOST_CONFIG_gpu_mem_256: 192
- BALENA_HOST_CONFIG_gpu_mem_512: 256
- BALENA_HOST_CONFIG_gpu_mem_1024: 448
defaultDeviceType: "raspberrypi4-64"
supportedDeviceTypes:
- "raspberrypi4-64"