How to modify the OpenDataCam project?

Hi there, I’ve successfully followed the tutorial on using the open data cam to count vehicles and other moving objects ( I do have it up and running, so thanks for that, it is really very impressive!

I would now like to make the URL accessible externally via the “public URL” feature. I read that for this to work I would have to modify the docker-compose file, in order to change the exposed ports. This, it seems requires that I use the development mode. As I selected production when following the tutorial, will I have to redeploy completely my application, or is there a switch I can flip?

Also, I used the “Deploy to Balena” button on the tutorial page, so I’m not sure how I get the code for me to modify locally. What is the recommended best practice for this scenario? I’m sure there must be some documentation for this, as I guess it’s a common scenario, someone following the tutorial and then wanting to make their own changes. Unfortunately, I couldn’t find any. :frowning:

Any help would be greatly appreciated, thanks! :slight_smile:

Hi @jfix, welcome to balena forums! So nice to hear that you enjoy that project.

Indeed, you need to re-purpose your device using a development variant of balenaOS. Actually we had several users so far asking for an easier method to switch between development and production OS variants. Such a feature has been deliberately disallowed originally but we might introduce some changes on that front eventually.

Deploy to Balena button’s link itself has a reference to the original source of the code deployed. Here’s the one for OpenDataCam:

(I see that this repository is already linked in the blog post but it’s totally understandable that you missed it)

So retrieve the actual code from the repository. Once you are happy with your changes you could deploy the modified code via balena command line interface and using balena push command. I find the following as useful resources to get familiar with balena CLI:

Let us know how it goes Jakob.

Thanks @gelbal, I’ll try that and report back with results. :wink: