Giter Club home page Giter Club logo

u6143_ssd1306's Introduction

U6143_ssd1306

Preparation

sudo raspi-config

Choose Interface Options Enable i2c

Clone U6143_ssd1306 library

git clone https://github.com/UCTRONICS/U6143_ssd1306.git

Compile

cd U6143_ssd1306/C
sudo make clean && sudo make 

Run

sudo ./display

Add automatic start script

  • Open the rc.local file
sudo nano /etc/rc.local
  • Add command to the rc.local file
cd /home/pi/U6143_ssd1306/C
sudo make clean 
sudo make 
sudo ./display &
  • reboot your system

For older 0.91 inch lcd without mcu

  • For the older version lcd without mcu controller, you can use python demo
  • Install the dependent library files
sudo pip3 install adafruit-circuitpython-ssd1306
sudo apt-get install python3-pip
sudo apt-get install python3-pil
  • Test demo
cd /home/pi/U6143_ssd1306/python 
sudo python3 ssd1306_stats.py

Custom display temperature type

  • Open the U6143_ssd1306/C/ssd1306_i2c.h file. You can modify the value of the TEMPERATURE_TYPE variable to change the type of temperature displayed. (The default is Fahrenheit) EasyBehavior

Custom display IPADDRESS_TYPE type

  • Open the U6143_ssd1306/C/ssd1306_i2c.h file. You can modify the value of the IPADDRESS_TYPE variable to change the type of IP displayed. (The default is ETH0) EasyBehavior

Custom display information

  • Open the U6143_ssd1306/C/ssd1306_i2c.h file. You can modify the value of the IP_SWITCH variable to determine whether to display the IP address or custom information. (The custom IP address is displayed by default) EasyBehavior

u6143_ssd1306's People

Contributors

arducam avatar leeaustinadams avatar ljp-while avatar stirhale avatar uctronics avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

u6143_ssd1306's Issues

Ubuntu Support?

I have Ubuntu Server running for Raspberry 4 pi and wanted to use the LCD display from your product. I was wondering if there is a way to get this running without going to Raspberry OS. I plan on using it in my home lab for Kubernetes and other. thanks

Error trying to execute: ssd1306_stats.py

okay I installed raspberry os on another card and tried getting this to work but getting the following error. I did enable the interface option.

> andy@raspberrypi:~/git/U6143_ssd1306-master $ sudo python3 ssd1306_stats.py
> Traceback (most recent call last):
>   File "ssd1306_stats.py", line 18, in <module>
>     i2c = busio.I2C(SCL, SDA)
>   File "/usr/local/lib/python3.7/dist-packages/busio.py", line 31, in __init__
>     self.init(scl, sda, frequency)
>   File "/usr/local/lib/python3.7/dist-packages/busio.py", line 72, in init
>     (scl, sda), i2cPorts
> ValueError: No Hardware I2C on (scl,sda)=(3, 2)
> Valid I2C ports: ((1, 3, 2), (0, 1, 0))
> andy@raspberrypi:~/git/U6143_ssd1306-master $ 
> 

Power Button Behavior

Is there any way to create a script to make the power button perform a soft shutdown instead of an immediate halt?

LED display on Fedora Pi4 systems

Does anyone know of a way to get the LED display to work on a non-Raspbian OS? I have 2 Pi4's with the aarch64 version of Fedora 35, booting from a 128GB USB stick. The instructions in the README don't seem to work for non-Raspbian OS's.

Power Button does not function

Power button does not disconnect power. Button stays red. I do note the small LED on the top of the hat changes from on / off with the pressing of the button. I have swapped buttons, cables, and hats and all are the same. Button does not disconnect power.

Multiple Disks and Custom Info

I don't know C very well but have enough scripting experience to see what is basically happening.

I have multiple disks. I just copied the sd card diskspace function in ssd1306_i2c.c,
I renamed it LCD_DisplayVarMemory, and changed the target to /var.

/VAR Drive Block Of Code

void LCD_DisplayVarMemory(void)
{
char usedsize_GB[10]={0};
char totalsize_GB[10]={0};
unsigned int MemSize=0;
unsigned int size=0;
struct statfs diskInfo;
statfs("/var",&diskInfo);
OLED_ClearLint(2,4);
OLED_DrawPartBMP(0,2,128,4,BMP,2);
unsigned long long blocksize = diskInfo.f_bsize;// The number of bytes per block
unsigned long long totalsize = blocksize*diskInfo.f_blocks;//Total number of bytes
MemSize=(unsigned int)(totalsize>>30);
snprintf(totalsize_GB,7,"%d",MemSize);
if(MemSize>0&&MemSize<10)
{
OLED_ShowString(106,3,totalsize_GB,8);
}
else if(MemSize>=10&&MemSize<100)
{
OLED_ShowString(98,3,totalsize_GB,8);
}
else
{
OLED_ShowString(90,3,totalsize_GB,8);
}

unsigned long long freesize = blocksize*diskInfo.f_bfree; //Now let's figure out how much space we have left
size=freesize>>30;
size=MemSize-size;
snprintf(usedsize_GB,7,"%d",size);
if(size>0&&size<10)
{
OLED_ShowString(65,3,usedsize_GB,8);
}
else if(size>=10&&size<100)
{
OLED_ShowString(58,3,usedsize_GB,8);
}
else
{
OLED_ShowString(55,3,usedsize_GB,8);
}
}

I also had to add a few lines to LCD_Display like so:

original code

case 2:
LCD_DisplaySdMemory();
break;

new code added after case 2 break;

case 3:
LCD_DisplayVarMemory();
break;

fixing the rotation to view the new drive info

I also had to change display.c line 29 from if(symbol==3) to if(symbol==4) for the new drive to be used in the rotation. Adding a third drive (or anything else) will have to change it to ==5

It seems to work fine, my only issue is the label for it.
The label shows a little card and says "disk"

I would like to change the label from "disk" to "var" for the var drive and I also have another drive to add that holds backups and would like that one to have the label set to "backups" or even just "BACK' or something.

For the life of me I cannot find where to set this label.
Any help with icons and labels by chance?

Anything I may have missed?

I noticed in ssd1306_i2c.h on line 36 there is "void LCD_DisplaySdMemory(void);"
Do I need to do the same for my extra drives/info? "void LCD_DisplayVarMemory(void);"

Other things I would like to add (any help would be greatly appreciated)

add hostname into the rotation
add the ubuntu release version
add kernel version
add number of packages needed updating/upgrading from apt

Thanks a bunch!

Troubleshooting OLED power

Hello - I've got one Raspberry Pi installed and I'm not getting power to the OLED display. Everything else is working nicely. I've tried two of the supplied cables.

I've not yet tried moving the pi to another slot since I had to do a bit of finessing to get it into the one it's in.

Any further suggestions for troubleshooting?

Disk shows 0/ 0GB

program is not picking up my disk usage, its on 2 different pis, any ideas?

How is the BMP.h chars coded?

Does anyone know how the unsigned chars in the BMP.h file are coded/have a table of values? I'm trying to add additional arrays for different views.

Ubuntu install - fatal error: wiringPiI2C.h: No such file or directory

After getting raspi-config installed and I2C interface enabled and verify. I was following the instructions and during the make process I received the following:

ssd1306_i2c.c:7:10: fatal error: wiringPiI2C.h: No such file or directory 7 | #include <wiringPiI2C.h> | ^~~~~~~~~~~~~~~ compilation terminated. make: *** [<builtin>: ssd1306_i2c.o] Error 1

Should wiringPiI2C.h be part of the code or do I need to add to the directory?

Display Custom Info?

Is there any way to make an option that we can select what is displayed?

Would like where the IP address is displayed to show a name, (one we can add as we see fit)

then have the IP address in the lower section added to the loop of info displayed.

Put the Display to Sleep at Night

Is there a way to edit the cron to put the display to sleep at certain times?

This is an example from the PADD project.

# PiTFT+ SLEEPY TIME
# Turn off the PiTFT+ at midnight
00 00 * * * sh -c 'echo "0" > /sys/class/backlight/soc\:backlight/brightness'
# Turn on the PiTFT+ at 8:00 am
00 08 * * * sh -c 'echo "1" > /sys/class/backlight/soc\:backlight/brightness'

Compatibility with dietpi?

is there any way I can use this on the operating system dietpi? I have turned I2C on and it gives me this error:

rm -rf *.o
rm -rf display
cc    -c -o display.o display.c
cc    -c -o ssd1306_i2c.o ssd1306_i2c.c
ssd1306_i2c.c:7:10: fatal error: wiringPiI2C.h: No such file or directory
 #include <wiringPiI2C.h>
          ^~~~~~~~~~~~~~~
compilation terminated.
make: *** [<builtin>: ssd1306_i2c.o] Error 1

Changing Temp Display and Loop Delay

How do I change the Temp display from Fahrenheit to Celsius, and is it possible to slow down the rate at which it changes between the different info displays. You barely get time to loot a reading and it switches.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.