Orange Pi i96 Getting Started Guide

Orange Pi i96
Orange Pi i96

Recently I reviewed the Orange Pi Zero 2 and thought it was a fantastic board. I really like the amount of polish that the Orange Pi line of products have as it is the closest I have seen to anything approaching a Raspberry Pi experience. We also benchmarked the Orange Pi Zero 2 and determined it’s a very capable board.

I recently got a Orange Pi i96 (thanks munecito!) and this board is very exciting because it was purchased on sale for ~$10! That is insanely cheap. The reason it’s so cheap is because it’s a headless board that doesn’t contain any display-out ports.

If you are going to be using the board headless anyway (I use most of my SBCs headlessly) you may be able to save a fortune with this board. Let’s get started!

Hardware Used

Orange Pi i96
Orange Pi i96

The Orange Pi i96 is a low-cost board from the Orange Pi line of SBCs. It uses the RDA8810 SoC and has 256MB LPDDR2 SDRAM. It’s well suited for headless tasks and is astonishingly cheap.

Links: Amazon.com*, AliExpress.com*, Amazon.ca*, Amazon.co.uk*, Amazon.de*, Amazon.es*, Amazon.fr*, Amazon.it*, Amazon.sg*

Geekworm Copper Heatsink Set
Geekworm Copper Heatsink Set

The Geekworm copper heatsink set is designed to fit many different single board computers. It uses thermal conductive adhesive which many “cheap” heatsink kits for SBCs don’t have. Eliminates hotspots and reduces throttling. Can be further enhanced by powered cooling over the heatsinks.

Links: Amazon.com*, Amazon.ca*, Amazon.co.jp*, Amazon.co.uk*, Amazon.de*, Amazon.es*, Amazon.fr*, Amazon.it*

Getting Started

First head to the official Orange Pi downloads page:

Orange Pi - Official Downloads Page
Orange Pi – Official Downloads Page

Now select the Orange Pi i96 from the list. I will be using Ubuntu Linux for this guide but you may use Armbian as well.

If you are wanting to try Android I highly recommend seeing my Orange Pi Android Installation Guide as the installation process is different than Linux.

EDIT: I now recommend using my fixed Orange Pi i96 image as it will fix your USB port to be able to operate at full speed and give you a much newer OS of Debian Bullseye.

Writing the Image

The images are typically distributed as a .tar.gz file. The name of the Ubuntu image tar.gz file at time of writing was OrangePi_i96_ubuntu_xenial_server_linux3.10.62_v0.0.4.tar.gz.

We will need to extract this file. If you are using Windows then grab 7-zip to be able to extract a .tar.gz file.

Inside this file will be a .img file. Since I downloaded the Ubuntu image the name of my file was OrangePi_i96_ubuntu_xenial_server_linux3.10.62_v0.0.4.img. This is the image that we are going to write to our SD card.

There are several choices to write the image to your SD card. If you are on Windows I recommend Win32DiskImager. Etcher is also available for Windows/Linux/Mac OS X.

Write the image to the SD card using your preferred software.

First Startup

Before starting up you should make sure that the Orange Pi’s switches are in these positions (indicating to boot from SD card):

Orange Pi - SD Startup Position
Orange Pi – SD Startup Position
Orange Pi - SD Startup Position
Orange Pi – SD Startup Position

We’re ready to put the SD card into the Orange Pi i96. But how are we going to connect to the device? There’s no network port and the device isn’t configured to connect to our WiFi yet.

Connection Option #1

If you happen to have a USB to Ethernet adapter that is the easiest way to connect to the device for initial configuration:

USB to Ethernet Adapter
USB to Ethernet Adapter

Connection Option #2

The Orange Pi is configured to connect to a pre-set wireless point with the SSID of orangepi and a password of orangepi.

Most phones these days have an option to set up a wireless hotspot. If your phone allows it then one way to do your initial connection to the Orange Pi i96 is to set up a hotspot with the SSID of orangepi and a password of orangepi. If you set up a point with these credentials the Orange Pi will connect to it and you can access it over SSH via your phone. There are many apps for both Android and iOS that allow you to make SSH connections and any of these will do.

Once you know the IP of the Orange Pi you can connect to it using the username orangepi and the password orangepi or:

ssh orangepi@192.168.X.X

Connection Option #3

If you have a TTL to USB serial debug adapter you can use that as well. See the OrangePi instructions for that method.

Initial Configuration

orangepi-config Utility

Once you’ve connected it’s time to do some basic configuration. We will use the tool orangepi-config:

sudo orangepi-config

You may now set the WiFi settings, etc. The orangepi-config is just like raspi-config if you’ve ever used that on a Raspberry Pi.

Don’t reboot before doing the next section.

Fix Second Startup (Debian / Ubuntu)

You will notice if you reboot the device it will often not come up the second startup. This is especially likely if you performed a sudo apt dist-upgrade.

To prevent this I recommend removing the alsautils package. This will impact sound functionality on the board but as I was not using it and intended to use this more as a headless board this was fine for me.

sudo apt purge alsa-utils

If you need to have the sound working on the board there is an alternate solution available here.

This is not necessary in my Legendary image as it has kernel fixes for these issues (highly recommended)

Set Timezone

Replace my timezone with yours in the following commands:

rm /etc/localtime
ln -s /usr/share/zoneinfo/America/Denver /etc/localtime

Setup Locales

Setting the locales isn’t in orangepi-config (such as it is in raspi-config) but here’s a quick way to set them:

sudo apt install locales -y
sudo dpkg-reconfigure locales

Setup Wireless CRDA Regulatory Domain

For the wireless to function very well at all you need to set the wireless regulatory domain.

If you are not using my image then you will first need to install the crda package with:

sudo apt install crda -y

Now we can set the regulatory domain by editing the following file:

sudo nano /etc/default/crda

At the bottom of the file there is this line:

REGDOMAIN=

Put the 2 letter country code for your country. Mine is “US”. Once finished press Ctrl+X then Y to save the file.

Optional – Upgrade Debian OS to Buster/Bullseye

Note that this will not upgrade the kernel. You can upgrade everything else though including all the way up to Bullseye. You should do this one release at a time and start with “Stretch” and then do “Bullseye” afterward.

If you are using the Debian installation you can upgrade to Buster by editing your /etc/apt/sources.list file.

Change all instances of “stretch” in the file to “buster” and then do the following:

sudo apt update && sudo apt dist-upgrade -y

Once this has completed reboot the system (make sure you’ve done my fix second reboot section first by purging alsa-utils). Verify you are on Buster with

cat /etc/os-release

for example:

root@orangepii96:/# cat /etc/os-release
PRETTY_NAME="Debian GNU/Linux 10 (buster)"
NAME="Debian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"

Now you can upgrade to Bullseye. It’s almost the same as upgrading from Stretch to Buster but there has been a change in the security updates server format. Here is a working “Bullseye” apt sources file for the Debian Orange Pi i96 image:

root@orangepii96:/# cat /etc/apt/sources.list
deb http://ftp.debian.org/debian bullseye main contrib non-free
#deb-src http://ftp2.cn.debian.org/debian bullseye main contrib non-free
deb http://ftp.debian.org/debian bullseye-updates main contrib non-free
#deb-src http://ftp2.cn.debian.org/debian bullseye-updates main contrib non-free

deb http://security.debian.org/ bullseye-security main contrib non-free
#deb-src http://security.debian.org/ bullseye-security main contrib non-free

Once you’ve changed the files do a sudo apt update and make sure you don’t see any errors. If everything looks okay start the Bullseye upgrade with:

sudo apt full-upgrade -y

After a reboot you should be on Bullseye! We can verify this with cat /etc/os-release:

orangepi@orangepii96:~$ cat /etc/os-release
PRETTY_NAME="Debian GNU/Linux 11 (bullseye)"
NAME="Debian GNU/Linux"
VERSION_ID="11"
VERSION="11 (bullseye)"
VERSION_CODENAME=bullseye
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
orangepi@orangepii96:~$ uname -a 
Linux orangepii96 3.10.62-rel5.0.2+ #4 PREEMPT Wed Mar 18 18:49:25 CST 2020 armv7l GNU/Linux

Notice that the kernel has not changed at all (as cautioned at the beginning of the section) but everything else on the system will be Bullseye!

Performance Benchmarking

I benchmarked the board using a SanDisk Extreme SD card on my Pi Benchmarks web site. This gives us comparable results between boards and there are over 30,000 benchmarks submitted for various boards / storage devices.

I had a total score of 497. This was below average or off from an average Raspberry Pi setup by about 47%.

To be clear the storage performance on the board is relatively low compared to the Orange Pi Zero 2 or a Raspberry Pi (Zero or 4). That is to be expected for a price of around ~$7-$10.

I’m not sure I would say this is a disappointing result though. We are talking about a board that is a single digit number of dollars. For the price point that is fantastic performance! In fact for the price point it’s a wonder that it works at all.

Conclusion

It’s a great board. At a price point of $7-$10 it reminds me of the really, really old Raspberry Pi Zero days where you could actually get a Raspberry Pi for around that price point.

The Zero 2 is a significantly more powerful board. It benchmarked much higher than the i96 but it also costs significantly more. If you need more power that board will be a better choice. If you’ve never had an Orange Pi before I would recommend the Zero 2 first as this board is quite a bit trickier and has more outdated software available for it.

The version of Ubuntu on this board is also quite old (Ubuntu 16.04 / Xenial) compared to the Orange Pi Zero 2 which is actually running a modern 5.X kernel whereas this one is a 3.X kernel. Make sure that is not going to be a problem or you will want to step up to a higher Orange Pi. The i96 is definitely meant for simple services / projects that don’t need a lot of power. It’s perfect for those.

If you need a headless board then the Orange Pi i96 may very well fit the bill for you, the price is certainly right! Don’t skip the heatsinks though. It got very warm during testing (warm enough to freeze once during consecutive benchmarks) and Orange Pis are known to get quite hot!

Other Resources

I highly recommend using the Legendary i96 Debian Bullseye image available here

Don’t miss my Orange Pi Zero 2 Review / Tips / Guide for another great board (with display connections)

If you’re trying to set up Android definitely see my Orange Pi Android Installation Guide

For the fastest storage options check out my Linux storage benchmarking script

guest

261 Comments
Inline Feedbacks
View all comments

Marco
Marco
16 days ago

howto attach nand as extra space:

bootargs:
mtdparts=rda_nand:-(extra_space) ubi.mtd=0

this basically repartitions the nand, without changing the kernel
boot into it, and execute the following commands:

ubiformat /dev/mtd0 # formats the whole nand
ubimkvol /dev/ubi0 -N extra -m # creates an ubivol with the name extra
mount -t ubifs ubi0:extra /extra # mount it on /extra

if you want to do this via fstab, add the following entry to /etc/fstab
ubi0:extra /extra ubifs

thats it, enjoy πŸ™‚

MZA
MZA
18 days ago

Hi James,

I have a version of libwiringpi for the i96.
Let me know if you can compile it and add it to the rootfs.
https://github.com/MehdiZAABAR/WiringPi
Regards.

MZA
MZA
18 days ago
Reply to  jamesachambers

Great James.
I’m back to my SPI screen now that the GPIO are more or less working with the wiringPi( not all of them, there still some pins that do not output HIGH on the header when set to 1, but its the same behavior with opio, may be a schematic error ?).
My screen remains dead with two test applications, I think that the spidev3.0 does not work, I’ll update my image to your latest then dig around the spi declaration you’ve added to the kernel or maybe try to work with another SPI port.

MZA
MZA
18 days ago
Reply to  jamesachambers

Yes nice.
Ok, let’s start, pin assignment seems not correct, mosi should be SPI2_DIO which is on RDA pin 3, miso is pin 4.
On the I96 header, only SPI2_CS1 is available, so if only spidev3.0 is available, pin assignment (.controller_data) should be pin 6.
I’ll rebuild the kernel and give it a try.

Now, second point is, if spi_gpio is the driver to use for spi communication, then pins should be assigned to GPIO not to SPI2, this is not what I see : opio and gpio tools display the alternative function to the related pins. I’ll try for force the io mux to set them back to gpio but we should consider working the native rda spi driver.
My Best.

MZA
MZA
17 days ago
Reply to  MZA

I confirm from the first static tests, the pins MOSI and MISO were inverted.
My test was to wire a GPIO ( A28, Header 32) out to SPI2_DI ( A4 H10) => what ever value output by the GPIO, spidev_test received 00. After kernel update, spidev_test reads the GPIO value.
Now, my screen is still dead, I’ll check the CS pin mode.

MZA
MZA
17 days ago
Reply to  MZA

Chip select remains desperately low, ( it shows 2mV when spidev_test runs with a very low speed and a big frame to transfer). A physical loop on the SPI2_DIO to SPI2_DI does not bring neither the DEADBEEF.
Driver Loop mode ( #spidev_test –loop ) is not supported by the spidev driver, to my surprise. It displays spidev spi3.0: setup: unsupported mode bits 20, can’t set spi mode: Invalid argument. Any hint ?

MZA
MZA
17 days ago
Reply to  jamesachambers

It does not matter the loop is not supported, this just provides an answer to a previous comment on testing spi loop that fails with spidev_test.
I used a physical loop and it does not read the “DEADBEEF” string, although it can read a GPIO output. This means RX works but TX does not. ( weird huh ?)
Now what disturbs me is that the rda_spi nodes are not created after boot and that in the rda_spi_board_info table ( where you inserted the spidev driver) they are not listed. I’m still on this topic. May be SPI would work with the native rda_spi drivers if we register them properly and create the device nodes in /dev.

MZA
MZA
17 days ago
Reply to  MZA

This line in spi-rda.c makes sens with the spidev_test LOOP problem
/* the spi->mode bits understood by this driver: */
master->mode_bits = SPI_CPOL | SPI_CPHA | SPI_CS_HIGH;

MZA
MZA
16 days ago
Reply to  jamesachambers

I got the device nodes created, I have changed the devices declaration.
ex:
RDA_SPI_PARAMETERS spi2_controller_data = {
.inputEn = true,
.clkDelay = RDA_SPI_HALF_CLK_PERIOD_0,
.doDelay = RDA_SPI_HALF_CLK_PERIOD_0,
.diDelay = RDA_SPI_HALF_CLK_PERIOD_1,
.csDelay = RDA_SPI_HALF_CLK_PERIOD_1,
.csPulse = RDA_SPI_HALF_CLK_PERIOD_0,
.frameSize = 8,
.oeRatio = 8,
.rxTrigger = RDA_SPI_RX_TRIGGER_4_BYTE,
.txTrigger = RDA_SPI_TX_TRIGGER_1_EMPTY,
};
static struct spi_board_info rda_spi_board_info[] = {
#ifdef CONFIG_FB_RDA_DPI
{
.modalias = RDA_DPI_PANEL_DRV_NAME,
.max_speed_hz = 500000,
.bus_num = 0,
.chip_select = 0,
//.controller_data =
},
#endif
{
.modalias = "tlv320aic23-spi",
.max_speed_hz = 1000000,
.bus_num = 0,
.chip_select = 1,
.controller_data = (void *)&tlv320aic23_spi,
},
{
.modalias = "spidev", // driver name
.max_speed_hz = 20000000,
.mode = SPI_MODE_0,
.bus_num = 1,
.chip_select = 0,
.controller_data = (void *) &spi1_controller_data,
},
{
.modalias = "spidev", // driver name
.max_speed_hz = 20000000,
.mode = SPI_MODE_0,
.bus_num = 1,
.chip_select = 1,
.controller_data = (void *) &spi1_controller_data,
},
{
.modalias = "spidev", // driver name
.max_speed_hz = 20000000,
.mode = SPI_MODE_0,
.bus_num = 1,
.chip_select = 2,
.controller_data = (void *) &spi1_controller_data,
},
{
.modalias = "spidev", // driver name
.max_speed_hz = 10000000,
.mode = SPI_MODE_0,
.bus_num = 2,
.chip_select = 0,
.controller_data = (void *) &spi2_controller_data,
},
{
.modalias = "spidev", // driver name
.max_speed_hz = 10000000,
.mode = SPI_MODE_0,
.bus_num = 2,
.chip_select = 1,
.controller_data = (void *) &spi2_controller_data,
},
};

Now, the spidev_test transfer is executed but I have strange behavior, I see the txed frame in the rx.
There is a note in the rda-spi controller driver that says ” This is a DMA-only driver.” but when RDA SPI DMA flag is enabled, there are unstoppable warning flags about the master having already the ddr. I disabled it.
In both cases, with or without DMA, I have the same rx result with spidev_test. It seems worse than before, at least I was reading the gpio output when using a physical loop ( SPI2_DIO to A28), now no more.
RXed frame
00 00 00 00 00 00
00 00 00 00 00 00
00 00 00 00 FF FF
FF FF FF FF FF FF
FF FF DE AD BE EF
BA AD F0 0D FF FF
FF FF

when Txed frame is
0xFF, 0xFF,
0x40, 0x00, 0x00, 0x00, 0x00, 0x95,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xDE, 0xAD, 0xBE, 0xEF, 0xBA, 0xAD,
0xF0, 0x0D, 0xFF, 0xFF, 0xFF, 0xFF,

MZA
MZA
15 days ago
Reply to  jamesachambers

Hi,
I’ve got the spi-gpio driver work with only gpio pins, it was hard but now I can go back to what was failing and have fixes. I’ll post my devices.c file through github.
I suppose that spi-gpio did not work on the previous trials because pins were not assigned to gpio function. We used the spi2 pins and we did not set them manually to gpio function. the driver did not do it either.
The rda-spi driver ( native spi driver) did not work and that is another problem that should be debugged.

Marco
Marco
20 days ago

Hey again, i created a telegram group where we can write instantly and share opinions and progress about anything i96 related:
https://t.me/orangepii96_dev

Everyone is welcome, but mostly devs are needed to get it running.

Marco
Marco
20 days ago

I have another idea which could be interesting in general.
Since we are powering the i96 over the OTG-port, couldnt we somehow integrate a serial connection over it?
This would be nice because it would allow us to do the initial programming (or when something fails) directly by connecting it to a pc/laptop or whatever you prefer.

Marco
Marco
20 days ago
Reply to  jamesachambers

I cant get it to work, i guess its because musb on the otg port is not set to host, cant figure it out

Marco
Marco
19 days ago
Reply to  jamesachambers

i can see this happening in dmesg

root@orangepi:~# dmesg | grep usb
[ 0.374511] v_usb: 1800 2800 mV normal standby
[ 0.397766] usbcore: registered new interface driver usbfs
[ 0.398376] usbcore: registered new interface driver hub
[ 0.399047] usbcore: registered new device driver usb
[ 0.704589] usbcore: registered new interface driver usb-storage
[ 0.706542] platform disable musb
[ 0.706787] musb-hdrc: ConfigData=0x1a (UTMI-8, HB-ISO Rx, HB-ISO Tx, SoftConn)
[ 0.707763] musb-hdrc: HDRC RTL version 2.0
[ 0.708312] gpio-vbus gpio-vbus: registered host 'musb-hdrc'
[ 0.808837] usbcore: registered new interface driver usbmouse
[ 0.903564] musb_gadget_pullup android usb didn't ready
[ 0.905395] android_usb gadget: Mass Storage Function, version: 2009/09/11
[ 0.906066] android_usb gadget: Number of LUNs=1
[ 0.907592] android_usb gadget: android_usb ready
[ 0.908020] gpio-vbus gpio-vbus: registered gadget 'musb-hdrc'
[ 0.908752] musb-hdrc musb-hdrc: MUSB HDRC host driver
[ 0.909423] musb-hdrc musb-hdrc: new USB bus registered, assigned bus number 1
[ 0.911560] platform enable musb
[ 4.898315] usb cable connect...
[ 6.714355] usb cable disconnect...

usb cable disconnect? huh

Marco
Marco
19 days ago
Reply to  jamesachambers

well, the i96 has a battery input port, ill try to use some of my 18650 cells and see if it will power from that and if the otg port is usable then

Marco
Marco
19 days ago
Reply to  jamesachambers

modprobe g_serial wont be working because the module doesnt exist

Marco
Marco
19 days ago
Reply to  Marco

pi is working from a 18650 cell, these are the messages i get rn:

[ 0.374511] v_usb: 1800 2800 mV normal standby
[ 0.397705] usbcore: registered new interface driver usbfs
[ 0.398315] usbcore: registered new interface driver hub
[ 0.399047] usbcore: registered new device driver usb
[ 0.703613] usbcore: registered new interface driver usb-storage
[ 0.705505] platform disable musb
[ 0.705749] musb-hdrc: ConfigData=0x1a (UTMI-8, HB-ISO Rx, HB-ISO Tx, SoftConn)
[ 0.706665] musb-hdrc: HDRC RTL version 2.0
[ 0.707336] gpio-vbus gpio-vbus: registered host 'musb-hdrc'
[ 0.808776] usbcore: registered new interface driver usbmouse
[ 0.903625] musb_gadget_pullup android usb didn't ready
[ 0.905456] android_usb gadget: Mass Storage Function, version: 2009/09/11
[ 0.906127] android_usb gadget: Number of LUNs=1
[ 0.907653] android_usb gadget: android_usb ready
[ 0.908020] gpio-vbus gpio-vbus: registered gadget 'musb-hdrc'
[ 0.908752] musb-hdrc musb-hdrc: MUSB HDRC host driver
[ 0.909423] musb-hdrc musb-hdrc: new USB bus registered, assigned bus number 1
[ 0.911560] platform enable musb
[ 6.779724] musb-hdrc musb-hdrc: VBUS_ERROR in a_wait_bcon (80, <SessEnd), retry #1, port1 00000100
[ 7.745727] musb-hdrc musb-hdrc: configured as A device timeout
[ 7.869689] musb-hdrc musb-hdrc: VBUS_ERROR in a_wait_bcon (80, <SessEnd), retry #2, port1 00000100
[ 8.845275] musb-hdrc musb-hdrc: configured as host timeout
[ 9.919677] musb-hdrc musb-hdrc: VBUS_ERROR in a_wait_bcon (80, <SessEnd), retry #3, port1 00000100
[ 10.878601] musb-hdrc musb-hdrc: configured as host timeout
[ 11.959960] musb-hdrc musb-hdrc: VBUS_ERROR in a_wait_bcon (80, <SessEnd), retry #3, port1 00080108

Marco
Marco
19 days ago
Reply to  Marco

root@orangepi:/sys/class/android_usb/android0# cat state
DISCONNECTED

i cant get it to work via android_usb either, seems that otg is somehow not in host mode?
too bad for now

Marco
Marco
19 days ago
Reply to  jamesachambers

i did everything you can imagine according to the usual manuals
i put for example rndis in functions, put some iProduct idVendor and set it to enable,
nothing happens. for example:

root@orangepi:/sys/class/android_usb/android0# ls
bDeviceClass bcdDevice f_acm f_charge_only f_mtp functions iSerial power uevent
bDeviceProtocol enable f_adb f_ffs f_ptp iManufacturer idProduct state
bDeviceSubClass f_accessory f_audio_source f_mass_storage f_rndis iProduct idVendor subsystem
root@orangepi:/sys/class/android_usb/android0# cat idProduct idVendor
0001
18d1
root@orangepi:/sys/class/android_usb/android0# lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
root@orangepi:/sys/class/android_usb/android0# echo rndis > /sys/class/android_usb/android0/functions
root@orangepi:/sys/class/android_usb/android0# echo 1 > /sys/class/android_usb/android0/enable
root@orangepi:/sys/class/android_usb/android0# ip link set rndis0 up
dmesg result is
[ 349.881469] rndis_function_bind_config MAC: 00:00:00:00:00:00
[ 349.882141] android_usb gadget: using random self ethernet address
[ 349.882812] android_usb gadget: using random host ethernet address
[ 349.904052] rndis0: MAC ba:9d:23:2d:6f:9c
[ 349.904357] rndis0: HOST MAC 8e:a7:0b:00:4f:41
[ 353.588073] rndis0: eth_open
[ 353.590881] IPv6: ADDRCONF(NETDEV_UP): rndis0: link is not ready

but still:
root@orangepi:/sys/class/android_usb/android0# cat state
DISCONNECTED

whats more curious is, when i power the i96 over battery, the normal usb port is not available anymore, devices not getting recognized.
so its a total failure.

also via the lsusb command you can see that the otg port is set as HOST, so i could propably attach a usb device on the otg port, but its sad that the normal usb port dont work anymore

Marco
Marco
19 days ago
Reply to  Marco

but when i let the otg cable connected to power instead and boot the pi up, the usb port works normally tho….
so this seems to be a complete clusterfuck, the whole driverbase is most or less useless and has to be refactured and reprogrammed

Steve Gotthardt
Steve Gotthardt
19 days ago
Reply to  jamesachambers

Hi – the serial driver I needed was out of the USB-A to a 3D printer control that uses a CH340 chip (goes from USB to TX/RX). The PR did not have anything to do with the OTG functions.

Marco
Marco
19 days ago
Reply to  jamesachambers

i digged a little bit into the config, and i found a variable called:
CONFIG_USB_RDA_OTG

the result is followed by:
drivers/usb/musb/rda.c: In function β€˜rda_start_host’:
drivers/usb/musb/rda.c:136:5: warning: unused variable β€˜power’ [-Wunused-variable]
CC net/ipv6/xfrm6_mode_beet.o
LD drivers/usb/musb/musb_hdrc.o
LD drivers/usb/musb/built-in.o
make[3]: *** No rule to make target 'drivers/usb/otg/rda_otg.o', needed by 'drivers/usb/otg/built-in.o'. Stop.
make[3]: *** Waiting for unfinished jobs....
CC drivers/usb/otg/otg.o

so there basically was the idea behind it, to switch the otg port from host to client mode, which is exactly what i need, but it seems that it is not programmed…
shush….

Marco
Marco
18 days ago
Reply to  Marco

so i looked more into it and this is kind of funny:

we found out that when the OTG port is not plugged in, the usb port is not working anymore because musb-hdrc doesnt work anymore, who knows why this is bound to the otg port.

anyway, the musb-hdrc is ONLY working for the usb-port and not for the OTG port, so whenever i change something in the rda.c, this only affects the main usb port and not the OTG port.

however /sys/devices/platform/musb-rda.0/musb-hdrc/udc/musb-hdrc/is_otg is 1, so i think that the otg port is forced into udc mode already, but now iam stuck, iam not a linux kernel/module dev

there are already some people in the telegram group, but we need more πŸ˜€

Marco
Marco
18 days ago
Reply to  jamesachambers

yes of course youre right, i run into the same issues, i propably could find a way around that but on my researches i found something else which is way more interesting:
https://wiki.pbeirne.com/patb/i96/wiki/Useful_Info

USB
It appears there is only one USB bus, shared by the typeA and micro connectors

if thats true, we cant use the otg port for usb at the same time as we use the type A usb-port. so my goal is not achievable.

Dustin
Dustin
11 days ago
Reply to  jamesachambers

I’ve done a bunch of USB stuff on Android and I’ve never seen a microUSB device that can be in OTG mode (aka USB host) and charge. It might be a hardware/spec restriction. You might be able to write a USB Host driver on the PC side that acts as a terminal. Note: USB C can both charge and be a host.

Isaac
Isaac
21 days ago

Hey James,

Thanks for this information and the work around setting up a good resource for this board. I wanted to get your take on the radio. There are some features I see in the spec sheet related to the Bluetooth and being able to set this up as an access point but I’m not finding any success with either of those features. Do you think there were never any Linux drivers written to use these features? I’m almost tempted to set up android on this to see if the features are configured on the android side.

Marco
Marco
20 days ago
Reply to  Isaac

thats what i found regarding bluetooth so far: havent tested:
https://github.com/wissanu49/RDA5991_BT_patchram

And here are external drivers for the chip i found so far, regarding the FM
https://github.com/linuxium/3188-SRC-ORIG/tree/master/kernel/drivers/net/wireless/rda5990

seems that i96 without 2G doesnt have audio ouputs mapped to the board, so you wont be able to get the output.

sorry, and this:

https://github.com/jelly/sunxi-rda5990

the specs around rda5990 are rare, there is not full documentation about the chip online. only 9 pages pdf… from 126pages… hilarous, this could be such a nice device…

there are so many sources or indices to get it working:

https://github.com/rockchip-android/external-rk-pcba-test/blob/rk3399-box-7.1/bt_test.c
https://github.com/Zaphod-Beeblebrox/device_rockchip_rk3188/blob/kitkat/bluetooth/pcba/system/bin/hciattach_5990

if i would just have more time to dig into it. i bet we could get away with a good working wifi and bt driver

Marco
Marco
20 days ago
Reply to  jamesachambers

hey, propably because of wrong management of the driver .
bt_rfkill_set 1
suggesst that rfkill is set to 1 .
this requires really driver digging i guess

MZA
MZA
20 days ago
Reply to  jamesachambers

Hey James and Marco,

I’ve already tried to enable the bluetooth. I unblocked the controller but it could not find a controller and I think that it has a very old driver that is no more compatible with the latest BLE devices. I gave up and postponed this action. The information on the net about this problem are mostly of raspberry. It did not surprise me since all the philosophy about this board was to make it an alternative to the Raspberry. I think its a wrong way and Raspberry PIs do not have the best distributions or management tools.

Marco
Marco
20 days ago
Reply to  jamesachambers

nice, at least its a progress, have a look at https://github.com/wissanu49/RDA5991_BT_patchram, i think we are not that far away to be honest.
when you unblocked rfkill, did you see some messages about it in dmesg?

Marco
Marco
20 days ago
Reply to  jamesachambers

i got the driver working an recognized, but as stated in the RDA5991_BT_patchram repository, scanning is not working

Marco
Marco
18 days ago
Reply to  jamesachambers

hey sorry i didnt saw your response. well this patchram utility didnt work out of the box, i needed to “patch” it, you need to replace all occurenced of WLAN_VERSION_91_E to WLAN_VERSION_91_G.
What i also tested was removing bt_uart_write_array and bt_uart_write_array calls in bt_init. but nothing worked, you cant connect to a device which you havent scanned yet, so i wasnt able to use the bluetooth at all.

the original post is from this site, he claimed to have the 2G version. http://surfero.blogspot.com/2017/06/orange-pi-2g-iot-bluetooth-21-howto.html

as you can see from the screenshot, he indeed was able to scan. so were stuck here too

Marco
Marco
17 days ago
Reply to  jamesachambers

Uhm those are the same repositories….
the one you posted as example doesnt work anymore

Marco
Marco
17 days ago
Reply to  jamesachambers

I really digged into the Android SDK, and i found the drivers for the 5991G version, which is built into the i96, so with enough time, i guess i could recreate the patchram for our device πŸ™‚

kernel/drivers/net/wireless/rdaw80211/rdacombodev/rda_combo_power_main.c
kernel/drivers/net/wireless/rdaw80211/rdacombodev/rda_5991g_power_ctrl.c
kernel/drivers/net/wireless/rdaw80211/rdacombodev/rda_combo.h
device/rda/haiyan/factory/inc/cust_bt.h
device/rda/common/res/firmware/rda_firmware.h
device/rda/common/res/firmware/rda_firmware.cpp
device/rda/jebi/factory/inc/cust_bt.h
device/rda/slt/factory/inc/cust_bt.h
device/rda/etau/factory/inc/cust_bt.h
device/rda/krosa/factory/inc/cust_bt.h
hardware/rda/bluetooth/rdabt_poweron.c
hardware/rda/bluetooth/bt_rda.h
hardware/rda/bluetooth/rda5991g_init.c

everything is here !

πŸ™‚

Marco
Marco
17 days ago
Reply to  jamesachambers

i had some success:

my repository:
https://github.com/well0nez/RDA5991g_patchram

i can discover the orangepii96 bluetooth on another device, scanning still dont work, and connection also dont work, but its a start. guys i need help from you,
files above includes everything we need

Marco
Marco
17 days ago
Reply to  jamesachambers

my bad, scanning is working now. seems to be little issues again, but its a very nice start πŸ™‚

Marco
Marco
17 days ago
Reply to  jamesachambers

and now iam connected to my computer, discovery mode needs to be deactivated to be able to connect to a device πŸ™‚
hell yea!

Marco
Marco
17 days ago
Reply to  Marco

sorry for this many messages, iam able to connect with my pc, i have setup obexpushd and i was able to transfer a file from the computer to the pi πŸ™‚

dont know what else has to be done to make the bluetooth more reliable but this is a very nice start

Marco
Marco
17 days ago
Reply to  jamesachambers

would you mind to join the telegram chatgroup?

Marco
Marco
16 days ago
Reply to  jamesachambers

Ouh, iam sorry about that. its okay for me and you dont owe me anything, thanks for the explanation.

there is just so much i found and worth discussing, but i totally get your point about waisting time at i96.

I dont use github that much, but i think anytime soon, i will send some patches, about bluetooth mac beeing saved. also i found out that there is a firmware file of the rdacombo, but its not used, at least i couldnt find any, but its included in the android build and maybe it could work better when its included, but yea.. its time consuming and i need also to focus on other thinks.
but iam proud i got this little peace of work done.

good luck and thanks for your efforts.

Marco
Marco
16 days ago
Reply to  jamesachambers

dont forget to add bluez-tools πŸ˜‰

Isaac
Isaac
15 days ago
Reply to  jamesachambers

This is honestly amazing – I was like, I’m going to dive into this on the weekend – and come to find out you guys already fixed the Bluetooth drivers. Incredible!

SCCMOG
SCCMOG
19 days ago
Reply to  jamesachambers

I’m struggling with his at the minute. Cheat sheet? Been battling with it for hours… I’m glad I’m not the only one!

SCCMOG
SCCMOG
18 days ago
Reply to  jamesachambers

Yea precisely what I was running but still can’t get a default controller listed.

The only difference is that I was using the git repo: https://github.com/wissanu49/RDA5991_BT_patchram
I have ordered 4 Small USB Bluetooth 5.1 dongles as I want to use this board for “Room-Assistant” as I can’t get my hands on any Raspi Zero’s at the min.

I will keep a close eye on this thread as I’d prefer to use the homegrown functionality of the chip.

MZA
MZA
21 days ago

Hi James,
I was trying to port the WiringPi library to the board, I’m on the way but it takes time. I returned to this lib because most of all SPI LCD drivers available on the net use this lib and are for raspberry. So porting this lib and understanding the gpio assignement problems can help going faster on identifying non functional i96 peripherals.
One thing that upset me is that I could not cross compile for the board, the linaro toochain is provided to build the kernel and uboot and not for compiling user own applications and more userland tools. It has a problem using any –sysroot I used.
So I spent few hours trying to have a complete cross compiler with sysroot build by yocto.
Here it is. Users can install the SDK simply and have a cross compiler for the i96. Check README.txt
https://github.com/MehdiZAABAR/OrangePi-I96-Work.git
Regards.

Michael
Michael
22 days ago

Hello James,
I tried to test your Images with the SPI fix. But it didn’t work. The loopback connection did not return the sent information.
I also managed to build my own image from your GitHub project. But then the USB to Ethernet adapter stopped working with my new built images. With your 1.9 it is still ok. I did not alter any files besides the devices.c.