OCR Tesseract Docker App on BalenaCloud Deployed to Jetson Nano

I deployed my first app to a Jetson Nano using balenaCloud, GitHub - ricktorzynski/balena-ocr-tesseract-docker: OCR Tesseract Docker app deployed to Jetson Nano device using BalenaCloud. I came across a reference to balenaCloud through a Google ad - I recognized Balena, as I use Balena Etcher to flash OS images to my embedded devices. I didn’t realize that Balena also offered a source-to-build service, which is much like Redhat’s OpenShift PaaS - you use source repositories to build applications which are deployed as Docker containers. In the same way, you push your repository to an app on your balenaCloud account, and the app is built and deployed to the connected device(s). That’s the cool thing about balenaCloud - you can push the app to one device or a whole fleet of devices. If you need to make code changes, you just push the changes to the app repository, and the app is automatically rebuilt and deployed to all connected devices using a rolling deployment. Which means no downtime. And if the build is unsuccessful, then the code is not merged and the device continues running the last successful build.

To create an app in balenaCloud you make a new app providing the name and what device the app is for. I chose Jetson Nano (which is in beta), but you can also choose other devices like Raspberry Pi or any of 40+ other devices. You then select the connection type, download the created balenaOS image, flash it to an SD card using Balena Etcher, and then connect your device. Then you set a remote origin for the repository, which is a balenaCloud repository for your app. When you push to that repository, the app is built and deployed as a Docker container. And I believe there are 2,000+ different Docker containers available through balenalib on Docker Hub.

I used ethernet only connection - when I tried to use ethernet + wifi, I could not connect via wifi even though I have the wifi card on my Jetson Nano. When I used ethernet, I didn’t have any problem.

I deployed an OCR app using Tesseract and OpenCV (to clean up the images) deployed to a Docker container running Python Flask (a light-weight web server). The only real problem was getting OpenCV installed (which always seems to be an issue) and I used OpenCV 3.2 as I couldn’t get OpenCV 4 to compile correctly - ran into dependency issues.

Once your application is deployed, you also have access through balenaCloud to a Control Panel GUI which has a log window and a terminal window, so you can connect to the Host OS (balenaOS) or the Main application. This is very handy for debugging your app. You can also set a Public URL for your device, making it publicly accessible.

I highly recommend balenaCloud if you are interested in IoT - makes deploying code to embedded devices very easy. Especially if you are used to deploying applications using Docker containers.

The code for my application is available from my Github account at GitHub - ricktorzynski/balena-ocr-tesseract-docker: OCR Tesseract Docker app deployed to Jetson Nano device using BalenaCloud. You can sign up for a free balenaCloud account (first 10 devices are free) at https://balena.io. This project was also featured on the Jetson Project page at https://developer.nvidia.com/embedded/community/jetson-projects.

Cheers!

Hi,

Thanks for sharing.

By the way, if you want to compile OpenCV 4.0 on Jetson Nano.
Here is a script can automatically do this for you:
[url]https://github.com/AastaNV/JEP/blob/master/script/install_opencv4.0.0_Nano.sh[/url]

Thanks.