I tried to install this NanoHatOLED on my NanoPi Neo Air (DietPi v6.25.3) but I'm stuck somewhere.
I used python3.5 instead of python2.7, had to change some lines in bakebit but the Service ./NanoHatOLED is running so I think the program itself works.
But now my OLED screen stays black and I've got these lines in my dmesg:
i2c i2c-0: mv64xxx: I2C bus locked, block: 1, time_left: 0
i2cdetect works but does not find anything, it just fills my dmesg log with the message above... my friend google can't help or I'm just not familiar enough with this i2c stuff...
Does anybody know how to solve this? Or could this be caused by python3.5?
thank you!
edit: this error seems to be on another level. not even the pre built friendlyarm-oled image works...
[Tutorial] How to get your NanoHatOLED to work
Re: [Tutorial] How to get your NanoHatOLED to work
What does your output of look like?
This is what mine looks like (NanoPi NEO2)
Code: Select all
sudo i2cdetect -y 0
This is what mine looks like (NanoPi NEO2)
Re: [Tutorial] How to get your NanoHatOLED to work
Code: Select all
i2cdetect -y 0
Code: Select all
i2cdetect -y 1
Code: Select all
i2cdetect -y 2
Code: Select all
i2cdetect -y 3
Code: Select all
root@NanoPi:~# sudo i2cdetect -y 3
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: 30 -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
sun8i-h3-nanopi-neo-air.dts
Code: Select all
i2c@01c2b400 {
compatible = "allwinner,sun6i-a31-i2c";
reg = <0x1c2b400 0x400>;
interrupts = <0x0 0x8 0x4>;
clocks = <0x4 0x3d>;
resets = <0x4 0x30>;
pinctrl-names = "default";
pinctrl-0 = <0x2e>;
status = "okay";
#address-cells = <0x1>;
#size-cells = <0x0>;
linux,phandle = <0x7c>;
phandle = <0x7c>;
camera@3c {
compatible = "ovti,ov5640";
reg = <0x3c>;
clocks = <0x2f>;
clock-names = "xclk";
reset-gpios = <0x14 0x4 0xe 0x1>;
powerdown-gpios = <0x14 0x4 0xf 0x0>;
AVDD-supply = <0x30>;
DOVDD-supply = <0x31>;
DVDD-supply = <0x32>;
linux,phandle = <0x7d>;
phandle = <0x7d>;
port {
endpoint {
remote-endpoint = <0x33>;
bus-width = <0x8>;
data-shift = <0x2>;
hsync-active = <0x1>;
vsync-active = <0x0>;
data-active = <0x1>;
pclk-sample = <0x1>;
linux,phandle = <0x35>;
phandle = <0x35>;
};
};
Also when pressing the buttons, only k1 creates a log entry in /tmp/nanohat-oled.log
I think there is something wrong with my hardware... first attempt at I2C, already looks like a failing one

edit: deleted everything related to the camera from my device tree but all i got was another error in my messages... at least it booted...
edit2, if I add "bias-pull-up;" to all i2c devices (there is such an entry at i2c2) the scans run fast but every address is empty and my oled stays black... hmm but it did something, at least my buttons are all working now...
Re: [Tutorial] How to get your NanoHatOLED to work
I need to get better in soldering... everything solved, hardware related not software.
Re: [Tutorial] How to get your NanoHatOLED to work
Glad you managed to work out all the kinks 
On a side note I'm kinda flattered my little script modification is getting popular, I even spotted it out in the wild (only version 1 of the script though .. they really should update)
http://www.wlanpi.com/

On a side note I'm kinda flattered my little script modification is getting popular, I even spotted it out in the wild (only version 1 of the script though .. they really should update)
http://www.wlanpi.com/
Re: [Tutorial] How to get your NanoHatOLED to work
Your script is amazing to start with.
I already modified it to change between hotspot and wifi client by pressing some buttons.
After modifying some lines in main.c and some .py files NanoHatOLED now works with python 3.5 too.
Edit: why did you put so much delay in your script -> time.sleep(x) ?
also some ideas:
Return to Home-Screen when Screen Off and K1 pressed (prevent accidental shutdown if page_index==4
Prevent b' and \n on the lines CPU: MEM: Disk:
Get IP address in one line
I already modified it to change between hotspot and wifi client by pressing some buttons.
After modifying some lines in main.c and some .py files NanoHatOLED now works with python 3.5 too.
Edit: why did you put so much delay in your script -> time.sleep(x) ?
also some ideas:
Return to Home-Screen when Screen Off and K1 pressed (prevent accidental shutdown if page_index==4
Code: Select all
if page_index==0 and pageSleepCountdown==0:
Code: Select all
str(CPU, encoding='utf-8', errors='ignore')
Code: Select all
cmd = "ip a | grep wlan0 | grep inet | awk '{print $2}' | rev | cut -c4- | rev"
IPAddress = subprocess.check_output(cmd, shell = True )
Re: [Tutorial] How to get your NanoHatOLED to work
The command "sudo pip install --upgrade ssd1306" no longer works. If you have this issue, substitute the following:
Then run the other commands as listed in the tutorial.
Code: Select all
sudo pip install --upgrade luma.oled
Re: [Tutorial] How to get your NanoHatOLED to work
Hi All,
Have made a lean and clean install for NanoHatOLED (Python 3). Have made minor changes to the script adapted by Phillski (screen time-out to 30s, changed font size of details screen to make optimal use of max screen size, and changes to make script Python3 compatible).
Furthermore I have modified the install script to install all needed packages (dependencies) and Python modules.
installation instructions:
Step 1: Make sure the following components have been installed using the DietPi Software configuration tool
<Software Additional> => 130 Python Pip
<Software Additional> => 16 Build Essentials
<Software Additional> => 17 Git
Step 2: download attached NanoHatOLED.tar.gz and copy NanoHatOLED.tar.gz to installation folder (e.g. /home)
cd /home
sudo tar -pxvzf NanoHatOLED.tar.gz
cd NanoHatOLED
sudo ./install.sh
Maarten
Have made a lean and clean install for NanoHatOLED (Python 3). Have made minor changes to the script adapted by Phillski (screen time-out to 30s, changed font size of details screen to make optimal use of max screen size, and changes to make script Python3 compatible).
Furthermore I have modified the install script to install all needed packages (dependencies) and Python modules.
installation instructions:
Step 1: Make sure the following components have been installed using the DietPi Software configuration tool
<Software Additional> => 130 Python Pip
<Software Additional> => 16 Build Essentials
<Software Additional> => 17 Git
Step 2: download attached NanoHatOLED.tar.gz and copy NanoHatOLED.tar.gz to installation folder (e.g. /home)
cd /home
sudo tar -pxvzf NanoHatOLED.tar.gz
cd NanoHatOLED
sudo ./install.sh
Maarten
- Attachments
-
NanoHatOLED.tar.gz
- (423.44 KiB) Downloaded 173 times
Re: [Tutorial] How to get your NanoHatOLED to work
Thanks for your script ...Phillski wrote: ↑Wed Jul 17, 2019 6:06 am Glad you managed to work out all the kinks
On a side note I'm kinda flattered my little script modification is getting popular, I even spotted it out in the wild (only version 1 of the script though .. they really should update)
http://www.wlanpi.com/
maarten wrote: ↑Sat Feb 29, 2020 2:47 pm Hi All,
Have made a lean and clean install for NanoHatOLED (Python 3). Have made minor changes to the script adapted by Phillski (screen time-out to 30s, changed font size of details screen to make optimal use of max screen size, and changes to make script Python3 compatible).
Furthermore I have modified the install script to install all needed packages (dependencies) and Python modules.
installation instructions:
Step 1: Make sure the following components have been installed using the DietPi Software configuration tool
<Software Additional> => 130 Python Pip
<Software Additional> => 16 Build Essentials
<Software Additional> => 17 Git
Step 2: download attached NanoHatOLED.tar.gz and copy NanoHatOLED.tar.gz to installation folder (e.g. /home)
cd /home
sudo tar -pxvzf NanoHatOLED.tar.gz
cd NanoHatOLED
sudo ./install.sh
Maarten
Thanks for modifications but didn't work on my NanopiNeo2, neither with
DietPi_NanoPiNEO2-ARMv8-Stretch nor DietPi_NanoPiNEO2-ARMv8-Buster.
On the other side, the script with your modifications it works on my board but
with another ...bian distro. I just followed your step 2 and everything was allright.
In DietPi, after I followed your installation instructions, htop show me that .NanoHatOLED is running but the OLED is black.
Have any ideea what could be wrong on my Dietpi settings?
Thanks for your time
Re: [Tutorial] How to get your NanoHatOLED to work
Hi Guys,
sorry to jump in but, I have just spent most of this afternoon trying to get the OLED display to work on this great little Neo2Black... to avail.
Having gone through multiple forums and tutorials, this thread IS the most recent and comprehensive concerning what we are trying to do : get DietPI to work on the Neo2Black with an OLED display.
My ultimate goal is to get DietPI + UFW + PiHole + Unbound running on this brilliant piece of engineering.
I have tried multiple times an still no OLED.
@maarten : the new install.sh doesn't throw any errors, unlike the previous one that I boiled down to a Python 2.7 error.
I have the eMMC module with an μSD to eMMC adapter.
From a fresh eMMC flash (DietPi_NanoPiNEO2Black-ARMv8-Buster.img)
copy NanoHatOLED.tar.gz to /home folder via cp
ssh into dietpi
run dietpi-config
install 130 + 16 + 17
run ./install.sh
Still no OLED.
I'm bummed about this and have called it quits for today, and any help would be appreciated for another bash at it.
Steve
PS : The FriendlARM.img works fine with OLED BTW, but I would much MUCH prefer DietPI ;.)
sorry to jump in but, I have just spent most of this afternoon trying to get the OLED display to work on this great little Neo2Black... to avail.
Having gone through multiple forums and tutorials, this thread IS the most recent and comprehensive concerning what we are trying to do : get DietPI to work on the Neo2Black with an OLED display.
My ultimate goal is to get DietPI + UFW + PiHole + Unbound running on this brilliant piece of engineering.
I have tried multiple times an still no OLED.
@maarten : the new install.sh doesn't throw any errors, unlike the previous one that I boiled down to a Python 2.7 error.
I have the eMMC module with an μSD to eMMC adapter.
From a fresh eMMC flash (DietPi_NanoPiNEO2Black-ARMv8-Buster.img)
copy NanoHatOLED.tar.gz to /home folder via cp
ssh into dietpi
run dietpi-config
install 130 + 16 + 17
run ./install.sh
Still no OLED.
I'm bummed about this and have called it quits for today, and any help would be appreciated for another bash at it.
Steve
PS : The FriendlARM.img works fine with OLED BTW, but I would much MUCH prefer DietPI ;.)