Bake own image as development version

I baked own image according tutorial.

This tutorial said below but I guess we need -d option for bake development version.

Now to actually build a development version of balenaOS for the Raspberry Pi 3, we can run the following:

./balena-yocto-scripts/build/barys -m raspberrypi3

I baked Image without -d option and boot this image on Raspberry Pi 3 but I could not connect to device via balena ssh <local ip address>.
balena ssh <local ip address> return Permission Denied(public key).

Of course I made wifi setting file and put into /boot/system-connections/ and I could get device local IP address.

When I baked with -d option, I succeeded connect to device via balena ssh <local ip address>.
If my guess is correct, please fix tutorial for other developers.

Hi and welcome to the forums!
Thank you for your report. We’ll see what we can do to improve the guide!

As a side note, to enable local ssh to the device you can just add an sshkey to the config.json while keeping the build as it is in the guide

Thank you for your reply.

to enable local ssh to the device you can just add an sshkey to the config.json

Is this means we can balena push <local ip address> too?
I expect to enable local mode on baked image and I guess other developer expects too.

Yes we expect that command to work. Are you having any problems with it (once you add the ssh key in the config.json)?

I could access to device via balena ssh to add ssh key in the config.json. but balena push was failed :disappointed_relieved:

balena push 192.168.x.x
Debug: original argv0="/usr/local/lib/balena-cli/bin/node" argv=[/usr/local/lib/balena-cli/bin/node,/usr/local/lib/balena-cli/bin/run,push,192.168.x.x] length=4
[debug] Using . as build source
[Debug]   Checking we can access device
[Debug]   Sending request to http://192.168.x.x:48484/ping
Could not communicate with local mode device at address 192.168.x.x

Anything need to add in the config.json other than ssh key?

Hey @kubota

I believe there’s some confusion in this thread.

balena push <deviceip> will only work on a development mode device, when the supervisor is in local mode.

Adding an SSH key to the device will not enable balena push to work, and in fact SSH isn’t used at all during a balena push.

Hi @CameronDiver,
Thank you for your comment.
I understood about difference between ssh connection by adding ssh key in config.json and development (local) mode.

Actually, how we can bake own image as development mode?
I guess that we need -d option when run build command, is this correct?

Hi again,

There’s actually two different things going on here, as my colleague mentioned:

  • Development mode (not ‘local mode’) allows the injection of an SSH key that will allow you to login to the device
  • ‘local mode’ is a separate mode for the Supervisor which allows you to carry out local development on that device using balena push <ipAddress>

You can enable ‘local mode’ for any device connected to balenaCloud by going into the ‘Actions’ tab for the device and then selecting ‘Local mode’. Be aware that any application that is currently running will stop. You can find more information on this here:

Best regards, Heds

1 Like

Hi @hedss,
It’s all clear now! Thank you for your kindly supports.

Hey @kubota,

No problem at all. Please let us know if you have any future issues we can help with!

Best regards, Heds

1 Like