Remotely updating a Rpi/RAK831 Gateway on Resin/Balena

Hi All,

I am having troubles with using meshed for my router on Resin because of the router address parsing issue.

Reading through the issues topics at GitHub - jpmeijers/ttn-resin-gateway-rpi it seems to have been resolved since I did my original install.

Without being able to have the gateway physically in my possession (its 400km away), can I update the image remotely?

BTW I am pretty much an amateur (to Rpi and Resin)- so you may need to talk me through some of the steps if you can please.

thanks in advance
Paul

edit: I did see these instructions - but don’t want to bugger anything up without checking

If you’d like to update the software across all the gateways in your device fleet, simply do the following:

git add .
git commit -m "Updated gateway version"
git push -f resin master

Yes, that’s the way to do it.

To be complete, you first need to do a

git pull

to get the latest upstream sources

1 Like

Great thanks, so just to check line by line?

git pull
git add .
git commit -m “GitHub - jpmeijers/ttn-resin-gateway-rpi
git push -f resin master

and on Balena - do I do this in the terminal window with the Main or Host OS session?

You don’t have to do anything on Balena

You need to do all this on your local computer where you initially did the git clone when you provisioned your gateway

So it is actually (on you local computer):

# go to you local repo
cd <where you did git clone>/ttn-resin-gateway-rpi/
# merge upstream changes
git pull
# Unless you made local changes, the above command will do a "Fast forward" merge
# and your local repo should be up-to-date.
# If it is not the case you might have to resolve conflicts manually. After that add
# changed files and commit your work
git add .
git commit -m 'Your commit comment'
# Now you are ready to push your new code to Balena, this will trigger the build
# and you will get a nice unicorn
git push -f resin master
# All done,  Balena will start deploying the new container on your node soon after
# You can monitor that on the console.

It is important to understand that it is a zero risk operation. Worst case, you could push nonsense to your gateway and the packet forwarder could be broken, but Balena will not, and you always have opportunity to push new code to fix the issue (obviously LoRaWan will be down, but not the gateway itself)

2 Likes

Thanks, now if I could only remember my SSH passphrase

If you don’t manage to remember, just make a new one and upload your new public key in your Balena profile…

Thanks, had to make a new one but now have it all working and updated