Thank you for your donation!


Cloudsmith graciously provides open-source package management and distribution for our project.


Instruction Guide Winstar OLED 16x2 HD44780
#1
Simple guide how to install python program to show playback information on Winstar OLED 16x2 HD44780


Part 1 :
Install the libs for the OLED and PWR management

Code:
sudo apt-get install python-setuptools
sudo easy_install pip
sudo pip install moment && sudo pip install pylms && sudo pip install python-mpd2
sudo apt-get install wiringpi


Part 2 :
Download scripts for moOde

Code:
git clone https://github.com/audiophonics/MoodAudio-RaspDAC-Script


Part 3 :
Make the scripts executable:

Code:
chmod 755 /home/pi/MoodAudio-RaspDAC-Script/*.sh


Part 4 :
Open the rc.local file:

Code:
sudo nano /etc/rc.local


Part 5 :
Add this two lines before the exit 0:

Code:
/home/pi/MoodAudio-RaspDAC-Script/sds.sh &
(sleep 20; sudo python /home/pi/MoodAudio-RaspDAC-Script/RaspDacDisplay.py) &


OPTIONAL

Edit MoodAudio-RaspDAC-Script

Code:
sudo nano /home/pi/MoodAudio-RaspDAC-Script/RaspDacDisplay.py


Adjust this setting to localise the time display to your region

Code:
TIMEZONE="Europe/London"
TIME24HOUR=True



To slow down text scrolling locate 
 
Code:
# Smooth animation
          if time.time() - prev_time < .08:
                  time.sleep(.08-(time.time()-prev_time))


I like it at this speed
 
Code:
 # Smooth animation
          if time.time() - prev_time < .20:
                  time.sleep(.20-(time.time()-prev_time))



[Image: z9uM3y.jpg]
<marquee behavior="alternate" scrolldelay=150
~~~~>>>Please always follow rules and read before you post<<<~~~~

</marquee>
Reply
#2
Well done rikardo1979. Oled displays are much better than LCD because of the high contrast they offer. Since I am using the same python script, I will advise that if using only the display and not using the audiophonics power management, one should delete the power management files in the "/home/pi/MoodAudio-RaspDAC-Script" directory. Use the "rm" command to delete sds.sh, softshutdown.sh, softreboot.sh.
Remy
Reply
#3
I Ricardo, well done! Mainly for the setup instructions that in other similar "packages" are a little bit confused (at least for me, not being definitely a Linux expert.. :-)
I started in the past days to study the similar "Raspdac_Display" packages that's based on the "pages" concept (only the main loop changes, getting information to be shown in the display from the "pages.py" file.
The most important doubt for me, is the GPIO mapping. If I take the original Winstar_GraphicOLED.py file, at the beginning there's a map of the wiring (identical to several ones that can be seen on the web), but in the code immediately after, the 4 GPIO for DB4-DB5-DB6-DB7 are different.

For Winstar WEG1xxxxxx OLED displays, I've wired it up as follows:
# OLED PN | FUNCT | GPIO | RP1 pin | Audiophonics pin
# 4 RS 25 22 26
# 5 R/W 18 12 N/A (tied to GND)
# 6 E 24 18 24
# 11 D4 23 16 22
# 12 D5 17 11 18
# 13 D6 21 13 16
# 14 D7 22 15 10
# 15 CS1 9 21 N/A
# 16 CS2 1 5 N/A
#

while this is the code:

# Pin Mappings V3
OLED_DB4=25
OLED_DB5=24
OLED_DB6=23
OLED_DB7=27
OLED_RS=7
OLED_E=8

I don't have a Sabre DAC, I'm using an HifiBerry PRO+ DAC, on which I soldered a 20x2 female connector to replicate the RPI GPIO.
I suppose that I have to use the wiring indicates in the table above, using the GPIO (logical) and RPI (physical) mapping.

Am I wrong?

thanks
Andrea
Reply
#4
(05-03-2018, 06:58 AM)mancio61 Wrote: I Ricardo, well done! Mainly for the setup instructions that in other similar "packages" are a little bit confused (at least for me, not being definitely a Linux expert.. :-)
I started in the past days to study the similar "Raspdac_Display" packages that's based on the "pages" concept (only the main loop changes, getting information to be shown in the display from the "pages.py" file.
The most important doubt for me, is the GPIO mapping. If I take the original Winstar_GraphicOLED.py file, at the beginning there's a map of the wiring (identical to several ones that can be seen on the web), but in the code immediately after, the 4 GPIO for DB4-DB5-DB6-DB7 are different.

For Winstar WEG1xxxxxx OLED displays, I've wired it up as follows:
#   OLED PN    | FUNCT    | GPIO    | RP1 pin | Audiophonics pin
#       4            RS             25          22       26
#       5            R/W           18          12       N/A (tied to GND)
#       6            E              24           18       24
#        11         D4            23           16       22
#       12          D5            17           11       18
#       13          D6            21           13       16
#       14          D7            22           15       10
#       15          CS1            9           21       N/A
#       16          CS2            1         5       N/A
#

while this is the code:

# Pin Mappings V3
OLED_DB4=25
OLED_DB5=24
OLED_DB6=23
OLED_DB7=27
OLED_RS=7
OLED_E=8

I don't have a Sabre DAC, I'm using an HifiBerry PRO+ DAC, on which I soldered a 20x2 female connector to replicate the RPI GPIO.
I suppose that I have to use the wiring indicates in the table above, using the GPIO (logical) and RPI (physical) mapping.

Am I wrong?

thanks
Andrea

The wiring depends on the type of display you use. It does not matter what DAC you using
<marquee behavior="alternate" scrolldelay=150
~~~~>>>Please always follow rules and read before you post<<<~~~~

</marquee>
Reply
#5
I will use a Winstar OLED 16x2 WEH001602A :
https://www.winstar.com.tw/it/products/o...1602a.html
Reply
#6
(05-03-2018, 10:54 AM)mancio61 Wrote: I will use a Winstar OLED 16x2 WEH001602A :
https://www.winstar.com.tw/it/products/o...1602a.html

Looks its a same display as one which come with RaspDAC kit so same wiring and driver is going to be used.
Also same settings in python programs
<marquee behavior="alternate" scrolldelay=150
~~~~>>>Please always follow rules and read before you post<<<~~~~

</marquee>
Reply
#7
Yes, I'm sure that it's te same and the the RaspDAC code fit well. My question is about that code. You can see a difference between what's written in the comment block above ( the one with te five columns...) and the piece of code where the OLEDxxx constants are set .


Example:

In the comment block, the function RS (Pin 4 on the OLED display), seems to be wired to GPIO 25 (physical pin 22) on the RPI
# OLED PN | FUNCT | GPIO | RP1 pin | Audiophonics pin
# 4 RS 25 22 26

In the code instead, it's written OLED_RS=7, and then, later in the code, ... GPIO.Setup(OLED_RS, GPIO.OUT, initial=GPIO:LOW)

So.. .which one is the correct pin to connect?
Reply
#8
(05-03-2018, 12:31 PM)mancio61 Wrote: Yes, I'm sure that it's te same and the the RaspDAC code fit well. My question is about that code. You can see a difference between what's written in the comment block above ( the one with te five columns...) and the piece of code where the OLEDxxx constants are set .


Example:

In the comment block, the function RS (Pin 4 on the OLED display), seems to be wired to GPIO 25 (physical pin 22) on the RPI
#   OLED PN    | FUNCT    | GPIO    | RP1 pin | Audiophonics pin
#       4            RS             25          22       26

In the code instead, it's written OLED_RS=7, and then, later in the code, ... GPIO.Setup(OLED_RS, GPIO.OUT, initial=GPIO:LOW)

So.. .which one is the correct pin to connect?

Please read 
http://forum.audiophonics.fr/viewtopic.php?f=4&t=1492
[Image: file.php?id=218]
http://forum.audiophonics.fr/viewtopic.p...8e9bf0e4b8
<marquee behavior="alternate" scrolldelay=150
~~~~>>>Please always follow rules and read before you post<<<~~~~

</marquee>
Reply
#9
Yes, I've already red it... but , seeing the schema below, it seems that I have to modify the code consequently

---OLED Display---| |---Raspberry Pi---|
| Pin Description | | Pin Description |
1 Vss (GND) <----> 6 GND
2 VDD (+5.0V) <----> 2 +5.0V
3 nc
4 RS <------------> 26 GPIO 7
5 R/W <------------> 6 GND
6 E <------------> 24 GPIO8
7 DB0
8 DB1
9 DB2
10 DB3
11 DB4 <------------> 22 GPIO25
12 DB5 <------------> 18 GPIO24
13 DB6 <------------> 16 GPIO23
14 DB7 <------------> 10 GPIO15

So...
OLED_DB4=25
OLED_DB5=24
OLED_DB6=23
OLED_DB7=15 (in the original code is 27 !!!)
OLED_RS=7
OLED_E=8

Correct?
Reply
#10
(05-03-2018, 12:56 PM)mancio61 Wrote: Yes, I've already red it... but , seeing the schema below, it seems that I have to modify the code consequently

---OLED Display---|      |---Raspberry Pi---|
| Pin  Description |      | Pin  Description |
  1   Vss (GND)    <---->   6   GND
  2   VDD (+5.0V)  <---->   2   +5.0V
  3   nc
  4   RS   <------------>  26   GPIO 7
  5   R/W  <------------>  6   GND
  6   E    <------------>  24   GPIO8
  7   DB0
  8   DB1
  9   DB2
 10   DB3
 11   DB4  <------------>  22   GPIO25
 12   DB5  <------------>  18   GPIO24
 13   DB6  <------------>  16   GPIO23
 14   DB7  <------------>  10   GPIO15

So...
OLED_DB4=25
OLED_DB5=24
OLED_DB6=23
OLED_DB7=15 (in the original code is 27 !!!)
OLED_RS=7
OLED_E=8

Correct?

If you use and install their scripts all is already done. You have to do nothing
<marquee behavior="alternate" scrolldelay=150
~~~~>>>Please always follow rules and read before you post<<<~~~~

</marquee>
Reply


Forum Jump: