Thank you for your donation!


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


Solved: RaspDAC OLED & Power management w/Moode 6.7.1
#1
[Updated] Post modified to capture resolution.

With huge thanks to @chano22000 for helping me through this. The ultimate problem was that I'd wired the OLED incorrectly which was interfering with the functionality of every script I was trying to apply!

I thought the PIN mapping (from the bottom) went...

   22   3
   21   2    
   20   1

..not (as it should be)

   6  5
   4  3
   2  1
 __________________________________________________________________________

Hi everyone, I wonder if I could seek your assistance regarding the excellent tutorial by rikardo1979 (here)? 

I have the RaspDAC enclosure pictured below along with the following components;
  • AUDIOPHONICS I-Sabre ES9038Q2M DAC
  • AUDIOPHONICS PI-SPC II power supply
  • Winstar WEH001602A HD44780 OLED
[Image: IMG_0622-1-1024x574.png.5e43205777f4d12d...1cad0b.png]

With the latest 6.7.1 Moode software installed and then following the instructions, I see the RaspDAC boot....and then immediately shut down. In looking at the boot log this appears to be because it sees GPIO17 = "low".

Audiophonics Shutdown script starting...
Asserting pins :
ShutDown       : GPIO17=in, Low
BootOK.        : GPIO22=out, High
ShutDown order received, Raspberry pi will no enter standby mode..

I believe I have wired the board correctly. I have double-checked the pin mappings and they appear to be correct.

The 3 wire connection for GPIO4, 17 and 22 is also appears to be correct too.

Do you have any idea what I may have done wrong?! The only thing I can think of now is that the script referenced in the tutorial isn't quite right for the PI-SPC II, or this version of Moode.

Any information grateful received!
Reply
#2
Hi ajmuir,

I just purchased a similar Raspdac from Audiophonics (https://www.audiophonics.fr/en/network-a...13100.html) but without display and I installed the relevant scripts for the PI-SPC II board (including softreboot and a better way for handling the powerbutton for shutting down). I can mail them to you wish with a light tutorial I wrote to redo it when installing Moode 7 (hopefully in a near future !)

Regards.
Reply
#3
Wow, yes please chano2200! It would be great to give that a go. I’ve not seen the OLED work yet because it doesn’t get that far in the boot process, so hopefully that portion of the historic tutorial is correct.

If you can PM me your notes, or post them here so that other folks can review in the future - that would be terrific, thank you so much.
Reply
#4
Hi again,

Your boot log refers to the execution of the following Audiophonics script (sds.sh) launched when boot is finished. You should check with a tester that the power button is the right one (contact when depressed) and well wired.

Regards.


Code:
echo "Audiophonics Shutdown script starting..."
echo "Asserting pins : "
echo "ShutDown : GPIO17=in, Low"
echo "BootOK   : GPIO22=out, High"
echo "SoftSD   : GPIO04=out, Low"

gpio -g mode 04 out
gpio -g write 04 0
gpio -g mode 17 in
gpio -g write 17 0
gpio -g mode 22 out
gpio -g write 22 1

while [ 1 ]; do
  if [ "$(gpio -g read 17)" = "1" ]; then
        echo "ShutDown order received, RaspBerry pi will now enter in standby mode..."
        sudo shutdown -h -P now
        break
  fi
  /bin/sleep 0.25
done

exit 0
Reply
#5
Photo 
Hi @chano22000  and @ajmuir .
I found your messages about power management problem. This is exactly the same problem I have and I guest if you could help me to fix it.

My setup includes:
AUDIOPHONICS I-Sabre ES9038Q2M DAC
AUDIOPHONICS PI-SPC II power supply
RPI 4
MOODE 6.7.1

I followed the instructions from https://github.com/audiophonics/Raspberr...management but RPI shutdown during startup process. At this point, as I cannot access to RPI, I have to re-flash a new image to SDCARD and start again from scratch. 

Please could you tell me what I'm doing wrong?. I'm sure that all files and cabling matched Audiophonics instructions with no errors (double checked)

Any info/idea would be really appreciated

Thanks a lot in advance for your help

Regards
Juan
Reply
#6
(12-28-2020, 07:25 PM)JuanJB Wrote: Hi @chano22000  and @ajmuir .
I found your messages about power management problem. This is exactly the same problem I have and I guest if you could help me to fix it.

My setup includes:
AUDIOPHONICS I-Sabre ES9038Q2M DAC
AUDIOPHONICS PI-SPC II power supply
RPI 4
MOODE 6.7.1

I followed the instructions from https://github.com/audiophonics/Raspberr...management but RPI shutdown during startup process. At this point, as I cannot access to RPI, I have to re-flash a new image to SDCARD and start again from scratch. 

Please could you tell me what I'm doing wrong?. I'm sure that all files and cabling matched Audiophonics instructions with no errors (double checked)

Any info/idea would be really appreciated

Thanks a lot in advance for your help

Regards
Juan


More info found. 
I think there are wiringPi problems:

INITIAL SITUATION
-----------------
pi@moode:/usr/bin $ ./gpio readall
Oops - unable to determine board type... model: 17

pi@moode:/usr/bin $ gpio -v
gpio version: 2.50
Copyright © 2012-2018 Gordon Henderson
This is free software with ABSOLUTELY NO WARRANTY.
For details type: gpio -warranty

Raspberry Pi Details:
  Type: Unknown17, Revision: 04, Memory: 0MB, Maker: Sony
  * Device tree is enabled.
  *--> Raspberry Pi 4 Model B Rev 1.4
  * This Raspberry Pi supports user-level GPIO access.
  
ACTIONS (taken from http://wiringpi.com/wiringpi-updated-to-...rry-pi-4b/):
-------------------------------------------------------------------------------------------
1- Upgrade WiringPi to 2.52 version (it is the last one and there not will be any other as it has been deprecated)

pi@moode:/usr/bin $ cd /tmp
pi@moode:/tmp $ wget https://project-downloads.drogon.net/wir...latest.deb
pi@moode:/tmp $ sudo dpkg -i wiringpi-latest.deb

AFTER UPGRADE:
--------------
pi@moode:/home/pi $ cd /usr/bin
pi@moode:/usr/bin $ ./gpio readall
 +-----+-----+---------+------+---+---Pi 4B--+---+------+---------+-----+-----+
 | BCM | wPi |   Name  | Mode | V | Physical | V | Mode | Name    | wPi | BCM |
 +-----+-----+---------+------+---+----++----+---+------+---------+-----+-----+
 |     |     |    3.3v |      |   |  1 || 2  |   |      | 5v      |     |     |
 |   2 |   8 |   SDA.1 | ALT3 | 1 |  3 || 4  |   |      | 5v      |     |     |
 |   3 |   9 |   SCL.1 | ALT3 | 1 |  5 || 6  |   |      | 0v      |     |     |
 |   4 |   7 | GPIO. 7 | ALT3 | 1 |  7 || 8  | 1 | ALT3 | TxD     | 15  | 14  |
 |     |     |      0v |      |   |  9 || 10 | 1 | ALT3 | RxD     | 16  | 15  |
 |  17 |   0 | GPIO. 0 | ALT3 | 1 | 11 || 12 | 1 | ALT3 | GPIO. 1 | 1   | 18  |
 |  27 |   2 | GPIO. 2 | ALT3 | 1 | 13 || 14 |   |      | 0v      |     |     |
 |  22 |   3 | GPIO. 3 | ALT3 | 1 | 15 || 16 | 1 | ALT3 | GPIO. 4 | 4   | 23  |
 |     |     |    3.3v |      |   | 17 || 18 | 1 | ALT3 | GPIO. 5 | 5   | 24  |
 |  10 |  12 |    MOSI | ALT3 | 1 | 19 || 20 |   |      | 0v      |     |     |
 |   9 |  13 |    MISO | ALT3 | 1 | 21 || 22 | 1 | ALT3 | GPIO. 6 | 6   | 25  |
 |  11 |  14 |    SCLK | ALT3 | 1 | 23 || 24 | 1 | ALT3 | CE0     | 10  | 8   |
 |     |     |      0v |      |   | 25 || 26 | 1 | ALT3 | CE1     | 11  | 7   |
 |   0 |  30 |   SDA.0 | ALT3 | 1 | 27 || 28 | 1 | ALT3 | SCL.0   | 31  | 1   |
 |   5 |  21 | GPIO.21 | ALT3 | 1 | 29 || 30 |   |      | 0v      |     |     |
 |   6 |  22 | GPIO.22 | ALT3 | 1 | 31 || 32 | 1 | ALT3 | GPIO.26 | 26  | 12  |
 |  13 |  23 | GPIO.23 | ALT3 | 1 | 33 || 34 |   |      | 0v      |     |     |
 |  19 |  24 | GPIO.24 | ALT3 | 1 | 35 || 36 | 1 | ALT3 | GPIO.27 | 27  | 16  |
 |  26 |  25 | GPIO.25 | ALT3 | 1 | 37 || 38 | 1 | ALT3 | GPIO.28 | 28  | 20  |
 |     |     |      0v |      |   | 39 || 40 | 1 | ALT3 | GPIO.29 | 29  | 21  |
 +-----+-----+---------+------+---+----++----+---+------+---------+-----+-----+
 | BCM | wPi |   Name  | Mode | V | Physical | V | Mode | Name    | wPi | BCM |
 +-----+-----+---------+------+---+---Pi 4B--+---+------+---------+-----+-----+

pi@moode:/usr/bin $ gpio -v
gpio version: 2.50
Copyright © 2012-2018 Gordon Henderson
This is free software with ABSOLUTELY NO WARRANTY.
For details type: gpio -warranty

Raspberry Pi Details:
  Type: Unknown17, Revision: 04, Memory: 0MB, Maker: Sony
  * Device tree is enabled.
  *--> Raspberry Pi 4 Model B Rev 1.4
  * This Raspberry Pi supports user-level GPIO access.

NOTE THAT wiringPi version is still 2.50 (Not 2.52 as it should be). Readall now works but gpio -v info is not correct. I have found several entries in internet about this problem but after upgrading wiringPi, the output of gpio -v command reveals version 2.52 and board type is detected correctly.

ANYWAY the gpio commands don't work. See examples:

pi@moode:/usr/bin $ ./gpio -g mode 04 out
pi@moode:/usr/bin $ ./gpio -g write 04 0
pi@moode:/usr/bin $ ./gpio -g read 04
1
pi@moode:/usr/bin $ ./gpio -g mode 17 in
pi@moode:/usr/bin $ ./gpio -g write 17 0
pi@moode:/usr/bin $ ./gpio -g read 17
1

As you can see GPIOS 04 and 17 have been set to "0" but the are still "1"

If you run /home/pi/sds.sh from a linux terminal, the RPI inmediatelly shuts-down (because GPIO 17 =1)
That's why, when I use the script form power management, the RPI shuts-down at boot time.

Regards
Juan
Reply
#7
WiringPi is no longer being maintained and IIRC the final 2.52 update did not completely fix the API for the 4B and the updated sources were never posted.
http://wiringpi.com/wiringpi-updated-to-...rry-pi-4b/
https://git.drogon.net
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#8
Hi @Tim Curtis ,
Thanks for your reply.
You are right but the SPC-II board from audiophonics uses gpio tool to manage certain GPIOs for shutdown, software shutdown, and boot OK signals. If I understood well, gpio tool comes with wiringpi. Command gpio readall only works when wiring pi is upgraded to 2.52 version, although gpio commands don't work anyway. I think that the installation on RPI4 (al least the revision I have) is not very clean. Something is wrong there. For example, gpio -v command outputs an unknow board type for my RPI4. I will try to investigate a little bit more
I'm interested in MoOde Audio for many reasons but one of the most important is the nice integration with Audiophonics I-Sabre ESS9038 Q2M DAC board.
In the meantime I have e-mail Audiophonics, hoping to help to solve the problem.

Regards
Juan
Reply
#9
They prolly need to provide code based on a different GPIO library, one that works with RPI4.

After WiringPi was ended we switched to using the Python based RPi.GPIO lib for our GPIO button handler and Python based rotary encoder features.
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#10
In fact I'm exploring this line just now. The code is simple so it should be easy to translate it using Phyton based GPIO library.
Reply


Forum Jump: