I am working on a project that needs more of hardware resources of the board, I am new to balena and docker and dont know if this is a small issue but i was not able to figure it out yet, As of now I am able to get GPIO working but not able to get UART and I2C on orange pi zero board.
RUN pip3 install pyserial
RUN pip3 install OPi.GPIO
CMD [ “python3”, “./blink.py” ]
UART code :
import time
import os
import sys
#SERIAL#
import serial
ser = serial.Serial ("/dev/ttyS1", 115200) #Open port with baud rate
def serialReceive():
received_data = ser.read() #read serial port
data_left = ser.inWaiting() #check for remaining byte
received_data += ser.read(data_left)
print (received_data)
while True:
serialReceive()
I am getting the error as :
11.10.19 16:09:14 (+0530) main raise SerialException(“Could not configure port: {}”.format(msg))
11.10.19 16:09:14 (+0530) main serial.serialutil.SerialException: Could not configure port: (5, ‘Input/output error’)
please have a look at it and suggest me the solution.
Thank you!
Hi @mich unfortunately currently the way the Orange Pi family is implemented, the are no dtoverlays, so the interfaces can’t be dynamically changed, so you can only use the ones that are compiled by default. To enable other ones, it would be necessary to add the right dt fragments into the Device tree and rebuilt the OS image with yocto. We do plan to eventually add a similar overlay mechanism similar to what armbian.txt has for OPI devices, but its quite a bit of work and currently we don’t have a lot of usage on the orange pi devices so it hasn’t been prioritised.
If you can describe which specific interfaces you would like to enable and on which device type exactly, we could get @floion to look into adding them on the device as default, provided they don’t conflict with any of the other default interfaces.
Thank you very much for the information.
I exactly have one use case in my mind - sensors network based on Orange Pi Zero.
I would like to use:
Orange Pi Zero (Allwinner H2+)
I2C enabled HTU 21 thermometer (i2c-0 or i2c-1)
UART enabled PMS7003 particle concentration sensor (ttyS1 or ttyS2)
I already have everything programmed on Armbian with python, but I would be great if I could migrate to Balena solution. Managing tens of such devices without good system is very painful.