Having successfully built and tested all of the pieces of this project while connected to my computer, it is now time to try running it stand-alone.
We can actually run anywhere where we can plug it in and connect to WiFi, but for ease of testing I decided to just keep things nearby.
To start with, I thought I'd just make sure the Nicla Vision with the Honey-Bee-Safe firmware on it would work by itself, so I plugged the USB cable into a little charger, instead of into my computer, and pointed the camera at the bee.
It didn't take long for the UI to show that a bee was spotted - Success!
As you can see in the picture, the UI shows that the bee count is now 1.
This might not look like much, but we just had a number of successes to get to that point:
Firstly, the tiny Nicla Vision board:
1. successfully connected to WiFi
2. successfully took pictures with the camera
3. successfully identified a bee in a picture
and,
4. it successfully sent an MQTT message to Mosquitto on my Raspberry Pi server to report the bee that was spotted
On the Raspberry Pi Server:
1. The MQTT message was successfully received by Mosquitto
2. Node-Red successfully received the MQTT message from Mosquitto
3. Node-Red successfully interpreted the message, interpreted the results, did some math
and then,
4. Node-Red created the webpage UI
Then on my phone, we successfully displayed the results in the browser.
That's a lot of things that went right
I don't know about you, but I'm pretty impressed at what that little Nicla Vision board is capable of!
I'm also still quite impressed at what that little Raspberry Pi can do too :)
There's a certain magic to all this.
Let's see that again, in video to add more excitement...
Having confirmed that things are working well, I moved over to the other side of my office to the blossomy tree for showtime!
Not all the tests went well, I'm not sure if maybe I didn't always have the bee and hornet in the right place or at the right angle, but sometimes it was just being stubborn. I did design the firmware to only check once every 10 seconds, to avoid multiple counts of one bee, so it might be that I just had the bee in the wrong spot at the critical times.
Most of the time it actually worked very well, often to my happy surprise
This following test went very well, with the bee being detected very quickly.
This next test was quick too, but it mistakenly also thought a hornet was spotted. You can see the hornet count go up. This would be a false positive, and a good reason for it to store the images for review.
The stored picture shows the two different coloured circles, on the bee:
For some reason in this next picture it thought the little bee (green) was being attacked by TWO hornets in this image!
The pictures stored on the Nicla Vision drive also showed me that I wasn't always flying the bee and hornet in the correct place!
But, even though only the bottom of the stunt-double hornet was visible, it was properly identified and recorded:
In this picture I must've been moving the stunt hornet just as a picture was being taken, but even though it was blurry it was identified correctly.
Here is the video of the hornet being detected:
And here is a video of a bee, and a hornet being detected. The hornet detection took a while. I almost gave up :D
It's difficult making movies with animal actors