Deep sleep balenafin

Hi,
I’m looking for a best way to move my balenafin with cm3 in sleep mode.
Any suggestions?

Hi

We have a coprocessor on the balenaFin which you can use to put the Fin to sleep. Some of my colleagues have created a block to help with such things. For example see fin/02-usage.md at master · balenablocks/fin · GitHub

In the above example you will see a REST endpoint that you can use to put the Fin to sleep.

May I ask what application you are working on? Are you thinking of running the Fin off a battery?

I’m running a balenafin 1.1.1 with a cm3 module with 8gb with raspbian 0.1.0 installed, when trying to build the docker image i run out of disk space

Hi,

You can add the pre-built block to your docker-compose file with this reference: balenablocks/fin:latest - you then won’t need to build the image.

If you’re not using docker on the device then you’ll need to use the flasher to ensure you have a known version of firmata flashed to the co-processor:

then you can use firmata to sleep the device:

Hi, thanks for your help.
I just create a simple docker-compose.yml with this content
version: “2.0”
volumes:
fin:
services:
fin:
restart: always
image: balenablocks/fin:latest
network_mode: host
privileged: true
volumes:
- “fin:/data/firmware”
labels:
io.balena.features.supervisor-api: “1”
io.balena.features.balena-api: “1”
environment:
- “DEBUG=firmata,flasher,downloader,supervisor,eeprom,main”
- “AUTOFLASH=1”
- “AUTOCONFIG=1”
expose:
- “1337”

If I try to get device sleep I will not get response
curl -X POST http://localhost:1337/sleep -H ‘Content-Type: application/json’ -d ‘{“sleepTime” : 4, “sleepDelay” : 1}’

If I run
curl -X GET http://localhost:1337/version
{“fin”:11,“firmata”:{“firmataName”:"",“firmataVersion”:"",“implementationVersion”:""},“block”:“3.6.0”}

curl -X GET http://localhost:1337/firmware
{“firmataName”:"",“firmataVersion”:"",“implementationVersion”:""}

Any suggestions?

Hi again,

Are you still running on rasbian, and is this device being used with balenaCloud?

It looks, to me, from the output of the firmware endpoint like the co-processor has not been successfully flashed with a version of firmata, and so will not be able to sleep the board.
Looking at the code, there is balenaCloud-specific functionality that may stop the flashing process from succeeding if it fails:

Furthermore, the block assumes it can contact the supervisor that runs on all balenaOS devices, in order to reboot the device once the flashing process has finished.

I don’t currently have a balena Fin available that I can run Raspbian on to test - and this block does not seem to be supported on non-balenaOS devices.

I think your options are:

  • move the device to balenaOS if possible
  • use the block source code to make your own scripts to flash and sleep the device
  • raise an issue in the block GH, and ask the maintainer if they intend on supporting non-balenaOS applications.

Phil

Hi Philip,
Yes the device running on raspbian, but it’s not connected to balenaCloud. Maybe this block not working on raspbian

Hi @luca1 ,

As Phil mentioned, this block was intended to be used with balenaOS, so it is likely that it doesn’t work on Raspbian.

I’ve created a GitHub issue on the repo for the maintainers to take a look.
In the meantime, you can try the OS-independent solution that consists of:

Cheers,
Nico.