Getting started with RevPi Core and Balena OS

I have tried creating a balena application with the code in this repo: GitHub - balena-io-playground/revpi-core3-test
First i have flashed the RevPi Core 3 with balena os 2.31.5Rev2.
Then i have put the config.rsc in the balena boot partition root folder.
The device is booted and online in balena. When accessing the terminal of the container I cd into piControl/piTest.
In this folder I run following command to turn on the status LED A1 with red as explained here: Revolution Pi : Tutorial 00 EN - Quickstart - YouTube (6:39min).

./piTest -w RevPiLED,2

The result is failing silently:


The Status led is not changed.

Running ./piTest -d shows the connected devices with success.
Any suggestion on how to debug this problem?

Hi, did you see Kunbus Revolution Pi RevPi Core 3 and DIO module - #9 by mcomisso
can you check the last post there to see if it helps?

Hi, yes i did try it and when it did not work for me I tried to boil it down to the bare minimum for it to work by removing all the stuff about MQTT and revpimodio2. I then found the above repo which should be a bare minimum for testing the setup. I might miss some very obvious stuff since both the github repo and the other thread is having success with this.

Hi there, just to confirm youā€™ve tried these steps and you are still observing the issue?

After some debugging I have now discovered that it is only the status LED that i canā€™t get to work. The IO ports are working just fine if the DIO is on the left side of the core. There is a need for updating the config.rsc file if the DIO is on the right side. That is where my initial problem was.

so does it work as expected now? What was the change you are referring to in the config.rsc file?

Yes the I/O part is working now. To my understanding the config.rsc file contains information on the IO modules and the position relative to the Core Module. A I/O module placed on the left side of the Core module will have a different config.rsc than if the I/O module is placed on the right side of the Core module. I have verified this with trying two different configurations in the picTory software that the config files are different.
Iā€™am still have a challenge getting the LEDā€™s (A1 and A2) to respond on the core module.

Hey @savnik,

To my understanding the config.rsc file contains information on the IO modules and the position relative to the Core Module. A I/O module placed on the left side of the Core module will have a different config.rsc than if the I/O module is placed on the right side of the Core module.

Thanks for the tip

I do not have a similar device to test,. Referring to the piTest documentation, I would suggest

  • try to read the value of the RevPiLED variable using ./piTest -r RevPiLED ?
  • Are you able to use piTest to toggle other pins? eg O_1, O_2 etc
  • Are you using a privileged container? can you please confirm if you have the following device: /dev/piControl0? piTest controls peripherals via this device based on the source
  • I saw you commented on the other forum thread

COPY config.rsc /etv/revpi/config.rsc
Hi, Iā€™am trying to reproduce this in my own setup.
Is it a typo or intention in the path /etv/ā€¦ ?

I believe it is. If you want to modify the file when building the image, it should be COPY config.rsc /etc/revpi/config.rsc

I hope this gives you enough to continue debugging.

Cheers

Hi @rahul-thakoor

We got the sample repo working here:

Also implemented the comment about the position.

Yes Iam using a privileged container and the O_1 and I_1 is working perfect using both code and piTest tool. Also tested with the basic example linked from the git repo above.

/dev/piControl0 is available in the container.

I will continue to try figuring out why the LEDs is not working. It can also be the test tool or config file which is causing my problem.

Hi Peter,

Thanks for the update. Please do let us know how your debugging goes.

Phil#

Hey Peter, and progress updates on debugging your Digital I/O Module?

Hi, I was able to run balenaOS on a RevPi with the help of this posts:

Iā€™m able to read from the RevPi (AIO and DIO), but itā€™s not possible to write.
So piTest -w O_1,1 is not working and writing to the LED A1 and A2 is not possible either.
Running the RevPi with the original image was working without problems.
Any suggestion on how to debug this problem?

Hey Peter,
does your command return any error? Looking at piControl/piTest.c at master Ā· RevolutionPi/piControl Ā· GitHub I would expect to see some outputā€¦
Does dmsg or journalctl show any problems?
Did you make any other changes to config.rsc?
Is there any other differences on the available devices in /dev/* between the balena and the stock image?

Hi,
No it does not return an error. It returns like it was successful.
dmsg and journalctl does not show anything abnormal.
No the only change to config.rsc was the side the module was attched to. But i did test with both.
All devices looks to be available in /dev/*.
As written above I got the I/O part working so it is only the status leds

Same behavior on my device. All the things are normal, but writing to LED or output is not working. Seems like the container has no rights to write, but strangely there are no errors when it is not working.

Hi, the supervisor is using the LED and this may interfere with how your service can use the LED device. Some users have been asking for this feature to allow their service to control the LED. We have created an issue to track it here: Allow the ability to tell the supervisor to not use the on device LED Ā· Issue #1375 Ā· balena-os/balena-supervisor Ā· GitHub.

A particular workaround from the community is to modify the /etc/resin-supervisor/supervisor.conf file in the HostOS and setting LED_FILE=/dev/null. This should allow your service to use the onboard LED device. I hope this helps while a permanent configuration path is not yet available.

1 Like

Hi,
I have downloaded the config.rsc from github but in the device section there are only 2 elements (RevPiCore and RevPi DIO, not AIO). I immagine you cloned the DIO section.
Can you help me to configure AIO module in config.rsc ?
Thank you.