FeathersMcGraw
Posts: 8
Joined: Thu Sep 24, 2020 9:10 pm

Argon One case with IR receiver and LIRC

Thu Sep 24, 2020 11:04 pm

Hi,

Barely a neophyte RPi user here, so please be gentle. I'm not sure if I'm posting in the
right spot. I suppose one can think of the Argon One case as sort of acting like a HAT.

I recently purchased a pair of 8 GB Raspberry Pi 4 B boards and a pair of Argon One cases.
After some testing of the Argon One circuit board with a multimeter, I was able to determine
that the IR receiver pad provided by the Argon One case is connected to GPIO 23 (physical
pin 16) and appears to provide a 10k Ohm pull up resistor. The supply voltage for the IR
receiver is 3.3 Volts. The Argon One appears to also accomodate an IR transmitter but I
did not examine that facility.

I purchased a couple of Vishay TSOP 38238 IR receivers and soldered one in place. After
the first success, I did the same to the second Argon One case, also successful. Other IR
receivers are likely to work provided that they are 3.3 Volt compatible, are active low, have a
carrier frequency close to what your remotes use (often 38 kHz, sometimes 36 kHz), and
have a compatible three conductor layout.

I added "dtoverlay=gpio-ir,gpio_pin=23" to /boot/config.txt (or /boot/userconfig.txt of Volumio).
Then installed the lirc package.

In /etc/lirc/lirc_options.conf, I changed "driver =" from "devinput" to "default" and left "device ="
as "auto" but was also successful changing it to "/dev/lirc0". After a reboot, the mode2 utility
was able to detect pressed buttons on a variety of IR remote controls.

The two IR remotes I was primarily interested in are those that came with an Oppo HA-1
headphone DAC/amp and another that came with a miniDSP SHD streamer/DSP/DAC. I was
unable to find examples of lircd.conf parameters for either, so proceeded to discover working
parameters and codes with irrecord.

I was unable to use irrecord in its default mode, so had to use its -f raw mode and then
convert with a subsequent invocation with the -a argument. The results for the the two IR
remotes are as follows.

# /etc/lirc/lircd.conf.d/miniDSP.lircd.conf
begin remote
name miniDSP
bits 32
flags SPACE_ENC|CONST_LENGTH
eps 30
aeps 100
header 9004 4453
one 564 1671
zero 564 563
ptrail 564
repeat 9004 2226
gap 107837
toggle_bit_mask 0x0
frequency 38000

begin codes
KEY_POWER 0xAC5302FD
KEY_MUTE 0xAC5330CF
KEY_VOLUMEDOWN 0xAC53906F
KEY_VOLUMEUP 0xAC5350AF
KEY_PREVIOUS 0xAC53827D
KEY_PLAYPAUSE 0xAC53C23D
KEY_NEXT 0xAC5342BD
Dirac 0xAC53609F
Source 0xAC53708F
Preset_1 0xAC53807F
Preset_2 0xAC5340BF
Preset_3 0xAC53A05F
Preset_4 0xAC5300FF
end codes
end remote

# /etc/lirc/lircd.conf.d/Oppo_RC-HA1.lircd.conf
begin remote
name Oppo_RC-HA1
bits 32
flags SPACE_ENC|CONST_LENGTH
eps 30
aeps 100
header 9005 4459
one 587 1638
zero 587 524
ptrail 583
repeat 9005 2228
gap 108435
toggle_bit_mask 0x0
frequency 38000

begin codes
KEY_POWER 0x46B958A7
KEY_MUTE 0x46B9C23D
KEY_VOLUMEDOWN 0x46B9E817
KEY_VOLUMEUP 0x46B9C837
KEY_PREVIOUS 0x46B92AD5
KEY_PLAYPAUSE 0x46B928D7
KEY_NEXT 0x46B90AF5
Coax 0x46B94CB3
Opti 0x46B9EC13
AES_EBU 0x46B9CC33
USB 0x46B90CF3
BT 0x46B9AC53
Mobile 0x46B98C73
RCA 0x46B96C93
XLR 0x46B92CD3
Dimmer 0x46B9FA05
end codes
end remote

For Volumio control, my /etc/lirc/lircrc file looks like the following.

# /etc/lirc/lircrc
begin
prog = irexec
button = KEY_NEXT
config = /usr/local/bin/volumio next
end

begin
prog = irexec
button = KEY_PLAYPAUSE
config = /usr/local/bin/volumio toggle
end

begin
prog = irexec
button = KEY_PREVIOUS
config = /usr/local/bin/volumio previous
end

I appologize for the lack of indentation. In this forum, I have yet to figure out how to
preserve indentation or attach files other than image files.

Thanks
Feathers

Edited: Added repeat timing to both the Oppo and miniDSP lircd.conf stanzas.

zaroz
Posts: 4
Joined: Wed Nov 18, 2020 4:38 am

Re: Argon One case with IR receiver and LIRC

Thu Jan 14, 2021 8:03 am

Just a quick question about the Argon ONE's IR setup: Can it Power ON the pi? What I mean is, if it is plugged in to power, but the pi is powered off, can you use an IR remote to turn on the Pi, similar to the RemotePi board?

BMS Doug
Posts: 4422
Joined: Thu Mar 27, 2014 2:42 pm
Location: London, UK

Re: Argon One case with IR receiver and LIRC

Thu Jan 14, 2021 8:24 am

FeathersMcGraw wrote:
Thu Sep 24, 2020 11:04 pm

I apologize for the lack of indentation. In this forum, I have yet to figure out how to
preserve indentation or attach files other than image files.
the trick is to use Code tags around your code.
FeathersMcGraw wrote:
Thu Sep 24, 2020 11:04 pm
I was unable to use irrecord in its default mode, so had to use its -f raw mode and then
convert with a subsequent invocation with the -a argument. The results for the the two IR
remotes are as follows.

Code: Select all

#  /etc/lirc/lircd.conf.d/miniDSP.lircd.conf
begin remote
  name  miniDSP
  bits           32
  flags SPACE_ENC|CONST_LENGTH
  eps            30
  aeps          100
  header       9004  4453
  one           564  1671
  zero          564   563
  ptrail        564
  repeat       9004  2226
  gap          107837
  toggle_bit_mask 0x0
  frequency    38000

      begin codes
          KEY_POWER                  0xAC5302FD
          KEY_MUTE                     0xAC5330CF
          KEY_VOLUMEDOWN    0xAC53906F
          KEY_VOLUMEUP           0xAC5350AF
          KEY_PREVIOUS             0xAC53827D
          KEY_PLAYPAUSE          0xAC53C23D
          KEY_NEXT                      0xAC5342BD
          Dirac                                0xAC53609F
          Source                             0xAC53708F
          Preset_1                          0xAC53807F
          Preset_2                          0xAC5340BF
          Preset_3                          0xAC53A05F
          Preset_4                          0xAC5300FF
      end codes
end remote

Code: Select all

#  /etc/lirc/lircd.conf.d/Oppo_RC-HA1.lircd.conf
begin remote
  name  Oppo_RC-HA1
  bits           32
  flags SPACE_ENC|CONST_LENGTH
  eps            30
  aeps          100
  header       9005  4459
  one           587  1638
  zero          587   524
  ptrail        583
  repeat       9005  2228
  gap          108435
  toggle_bit_mask 0x0
  frequency    38000

      begin codes
          KEY_POWER                  0x46B958A7
          KEY_MUTE                     0x46B9C23D
          KEY_VOLUMEDOWN    0x46B9E817
          KEY_VOLUMEUP           0x46B9C837
          KEY_PREVIOUS             0x46B92AD5
          KEY_PLAYPAUSE          0x46B928D7
          KEY_NEXT                      0x46B90AF5
          Coax                                0x46B94CB3
          Opti                                  0x46B9EC13
          AES_EBU                         0x46B9CC33
          USB                                  0x46B90CF3
          BT                                     0x46B9AC53
          Mobile                              0x46B98C73
          RCA                                  0x46B96C93
          XLR                                   0x46B92CD3
          Dimmer                            0x46B9FA05
      end codes
end remote
For Volumio control, my /etc/lirc/lircrc file looks like the following.

Code: Select all

# /etc/lirc/lircrc
begin
  prog = irexec
  button = KEY_NEXT
  config = /usr/local/bin/volumio next
end

begin
  prog = irexec
  button = KEY_PLAYPAUSE
  config = /usr/local/bin/volumio toggle
end

begin
  prog = irexec
  button = KEY_PREVIOUS
  config = /usr/local/bin/volumio previous
end

Thanks
Feathers

Very informative FeathersMcGraw, thank you for sharing this. I might add a IR receiver to my Argon one case in the future.
zaroz wrote:
Thu Jan 14, 2021 8:03 am
Just a quick question about the Argon ONE's IR setup: Can it Power ON the pi? What I mean is, if it is plugged in to power, but the pi is powered off, can you use an IR remote to turn on the Pi, similar to the RemotePi board?
No, FeathersMcGraw has made it clear that the IR remote is connected to the Pi GPIO 23, not the case.
FeathersMcGraw wrote:
Thu Sep 24, 2020 11:04 pm

After some testing of the Argon One circuit board with a multimeter, I was able to determine
that the IR receiver pad provided by the Argon One case is connected to GPIO 23 (physical
pin 16) and appears to provide a 10k Ohm pull up resistor.
Doug.
Building Management Systems Engineer.

FeathersMcGraw
Posts: 8
Joined: Thu Sep 24, 2020 9:10 pm

Re: Argon One case with IR receiver and LIRC

Thu Jan 21, 2021 2:47 am

Hi,

I received my third Argon One a couple of days ago. It is the Argon One M.2 and
thus has the version two (V2) lid. My success described above is with the version
one case.

I think they changed something in the circuit. Something more than simply adding
an IR receiver to the circuits already present on the version one lid. I have been
trying to get LIRC working unsuccessfully on the V2 lid. The method described
in my previous post doesn't seem to work with the V2 lid, nor does the new
argonone-ir script provided by Argon40.

The argonone-ir command is bash script that calls another Python script that errors
out. I've been reading their scrips but am still scratching my head. Wish they hadn't
messed with the elegant simplicity of the V1 lid.

A statement on SeedStudio seems to imply that the new V2 lid includes an ability
to turn on and off the Raspberry Pi via IR remote. Off wouldn't be much of a trick as
one can always map a key to some shutdown command within the irexec script.
An ability to turn on, however, sounds like the power circuit and IR receiver are
somehow tied together in a way that the V1 lid did not.

Anyhow, kind of stuck at the moment. For now, I put the M.2 bottom on one of
the V1 lids. Trim/discard is not working for the ASM1153E USB to SATA bridge.
Might try a newer Asmedia firmware version, as per discussions elsewhere.

Tried a DeskPi Pro ($85 USD) and new 2.5 inch 2TB Samsung EVO 860 SATA
SSD ($200 USD). Didn't like the DeskPi Pro. So bought a new M.2 2TB Samsung
860 EVO SSD ($270 USD) and the Argon One M.2 case ($45 USD) and Argon power
supply ($13 USD).

I'll probably salvage a few parts off of the DeskPi Pro and toss the balance into the
garbage. The 2.5 inch 2TB SATA SSD can be repurposed to one of my x86 computers
but wasn't really needed. Might buy another V1 lid (another $25 USD lost) and put my
third Vishay TSOP 38238 IR receiver into it and toss the V2 lid into the back of a closet
(in case a solution to the V2 LIRC problem is eventually found).

This is getting expensive. In retrospect, I wish I had stuck with x86 hardware.

Cheers
Feathers

BMS Doug
Posts: 4422
Joined: Thu Mar 27, 2014 2:42 pm
Location: London, UK

Re: Argon One case with IR receiver and LIRC

Thu Jan 21, 2021 7:23 am

FeathersMcGraw wrote:
Thu Jan 21, 2021 2:47 am
A statement on SeedStudio seems to imply that the new V2 lid includes an ability
to turn on and off the Raspberry Pi via IR remote. Off wouldn't be much of a trick as
one can always map a key to some shutdown command within the irexec script.
The only way to achieve power ON would be to map the IR remote to their case microcontroller, it already handled the fan and power scripts, presumably adding IR receive as well shouldn't be too tricky (but they may have had to use a better microcontroller).
Its worth asking in DarkElven's ArgonOne thread, they have done a lot of work on reverse engineering the case.

viewtopic.php?f=29&t=275713&p=1800887#p1800887
Doug.
Building Management Systems Engineer.

DarkElvenAngel
Posts: 1416
Joined: Tue Mar 20, 2018 9:53 pm

Re: Argon One case with IR receiver and LIRC

Thu Jan 21, 2021 3:20 pm

Thanks BMS Doug,

I haven't looked to closely into this IR part of the things however. And I don't have a V.2 to poke around at. Having said that I did look up what I could find and it says you need a proprietary remote. Now I'm wondering if you might have to hardware hack for the remote receiver and bodge in a connection to the GPIO? If you have this case and a multimeter set it to continuity mode and check if there is a direct connection to the GPIO header.

I found the remote on there website https://www.argon40.com/argon-ir-remote ... cases.html it looks like they are processing the remote signals in the microcontroller I need to look at the new scripts and I'll let you know what I find out.
Thanks BMS Doug,

I haven't looked to closely into this IR part of the things however. And I don't have a V.2 to poke around at. Having said that I did look up what I could find and it says you need a proprietary remote. Now I'm wondering if you might have to hardware hack for the remote receiver and bodge in a connection to the GPIO? If you have this case and a multimeter set it to continuity mode and check if there is a direct connection to the GPIO header.

I found the remote on there website https://www.argon40.com/argon-ir-remote ... cases.html it looks like they are processing the remote signals in the microcontroller I need to look at the new scripts and I'll let you know what I find out.

Edit I found the code for argonone-ir

Code: Select all

#!/bin/bash

CHECKPLATFORM="Raspbian"
# Check if Ubuntu, otherwise Raspbian
grep -q -F 'Ubuntu' /etc/os-release &> /dev/null
if [ $? -eq 0 ]
then
	CHECKPLATFORM="Ubuntu"
fi

echo "--------------------------------"
echo "Argon One IR Configuration Tool"
echo "--------------------------------"
echo "WARNING: This only supports NEC"
echo "         protocol only."
echo -n "Press Y to continue:"
read -n 1 confirm
echo

if [ "$confirm" = "y" ]
then
	confirm="Y"
fi

if [ "$confirm" != "Y" ]
then
	echo "Cancelled"
	exit
fi
echo "Thank you."

get_number () {
	read curnumber
	if [ -z "$curnumber" ]
	then
		echo "-2"
		return
	elif [[ $curnumber =~ ^[+-]?[0-9]+$ ]]
	then
		if [ $curnumber -lt 0 ]
		then
			echo "-1"
			return
		elif [ $curnumber -gt 100 ]
		then
			echo "-1"
			return
		fi	
		echo $curnumber
		return
	fi
	echo "-1"
	return
}

irexecrcfile=/etc/lirc/irexec.lircrc
irexecshfile=/usr/bin/argonirexec
irdecodefile=/usr/bin/argonirdecoder
remotemode=""
needinstallation=0

loopflag=1
while [ $loopflag -eq 1 ]
do
	echo
	echo "Select remote control to configure:"
	echo "  1. Configure Remote ON/OFF Button"
	if [ "$CHECKPLATFORM" = "Raspbian" ]
	then
		echo "  2. Configure Other Remote Buttons"
		if [ ! -f "$irexecshfile" ]
		then
			echo "  3. Cancel"
			echo -n "Enter Number (1-3):"

			newmode=$( get_number )
			if [[ $newmode -ge 1 && $newmode -le 3 ]]
			then
				loopflag=0
				if [ $newmode -eq 3 ]
				then
					newmode=4
				fi
			fi

		else
			echo "  3. Uninstall Other Remote Buttons"
			echo "  4. Cancel"
			echo -n "Enter Number (1-4):"
			newmode=$( get_number )
			if [[ $newmode -ge 1 && $newmode -le 4 ]]
			then
				loopflag=0
			fi
		fi
	else
		echo "  2. Cancel"
		echo -n "Enter Number (1-2):"

		newmode=$( get_number )
		if [[ $newmode -ge 1 && $newmode -le 2 ]]
		then
			loopflag=0
			if [ $newmode -eq 2 ]
			then
				newmode=4
			fi
		fi
	fi
done


echo
if [ $newmode -eq 3 ]
then
	irtmpconfigfile=/dev/shm/argonirconfig.txt
	sudo systemctl stop irexec.service
	sudo systemctl disable irexec.service
	sudo pip3 uninstall lirc -y
	sudo apt-get -y remove lirc
	sudo rm $irexecshfile
	sudo rm $irdecodefile

	sudo cat /boot/config.txt | grep -v 'dtoverlay=gpio-ir,gpio_pin=23' > $irtmpconfigfile
	cat $irtmpconfigfile | sudo tee /boot/config.txt 1> /dev/null
	sudo rm $irtmpconfigfile

	echo "Uninstall Completed"
	echo "Please reboot for changes to take effect"
	exit
elif [ $newmode -eq 1 ]
then
	loopflag=1
	while [ $loopflag -eq 1 ]
	do
		echo
		echo "Select remote control to configure:"
		echo "  1. Use Argon Remote ON/OFF Button"
		echo "  2. Use Custom Remote ON/OFF Button"
		echo "  3. Cancel"
		echo -n "Enter Number (1-3):"
		newmode=$( get_number )
		if [[ $newmode -ge 1 && $newmode -le 4 ]]
		then
			loopflag=0
		fi
	done

	if [ $newmode -eq 3 ]
	then
		echo "Cancelled"
		exit
	elif [ $newmode -eq 1 ]
	then
		remotemode="resetpower"
	elif [ $newmode -eq 2 ]
	then
		remotemode="power"
	fi
elif [ $newmode -eq 2 ]
then
	echo "--------------------------------"
	echo "Argon One IR Configuration Tool"
	echo "--------------------------------"
	echo "WARNING: This will install LIRC"
	echo "         and related libraries."
	echo -n "Press Y to agree:"
	read -n 1 confirm
	echo

	if [ "$confirm" = "y" ]
	then
		confirm="Y"
	fi

	if [ "$confirm" != "Y" ]
	then
		echo "Cancelled"
		exit
	fi
	echo "Thank you."


	needinstallation=1
	loopflag=1
	while [ $loopflag -eq 1 ]
	do
		echo
		echo "Select remote control to configure:"
		echo "  1. Use Argon Remote Buttons"
		echo "  2. Use Custom Remote Buttons"
		echo "  3. Cancel"
		echo -n "Enter Number (1-3):"
		newmode=$( get_number )
		if [[ $newmode -ge 1 && $newmode -le 4 ]]
		then
			loopflag=0
		fi
	done

	if [ $newmode -eq 3 ]
	then
		echo "Cancelled"
		exit
	elif [ $newmode -eq 1 ]
	then
		remotemode="default"
	elif [ $newmode -eq 2 ]
	then
		remotemode="custom"
	fi
else
	echo "Cancelled"
	exit
fi

needrestart=0
if [ $needinstallation -eq 1 ]
then
	if [ ! -f "$irexecshfile" ]
	then
		needrestart=1
		sudo apt-get -y update
		sudo apt-get -y install lirc

		sudo pip3 install lirc

		echo "dtoverlay=gpio-ir,gpio_pin=23" | sudo tee -a /boot/config.txt 1> /dev/null

		sudo /usr/share/lirc/lirc-old2new

		sudo systemctl daemon-reload
		sudo systemctl enable irexec.service
		sudo systemctl start irexec.service

		echo "" | sudo tee $irexecrcfile 1> /dev/null
		for keyname in UP DOWN LEFT RIGHT BACK PLAYPAUSE MENU HOME OK MUTE VOLUMEUP VOLUMEDOWN
		do
			echo 'begin' | sudo tee -a $irexecrcfile 1> /dev/null
			echo '	remote=argon' | sudo tee -a $irexecrcfile 1> /dev/null
			echo '	prog=irexec' | sudo tee -a $irexecrcfile 1> /dev/null
			echo '	button=KEY_'$keyname | sudo tee -a $irexecrcfile 1> /dev/null
			echo '	config='$irexecshfile' "'$keyname'"' | sudo tee -a $irexecrcfile 1> /dev/null
			echo 'end' | sudo tee -a $irexecrcfile 1> /dev/null
		done


		echo "#!/bin/bash" | sudo tee $irexecshfile 1> /dev/null

		echo '' | sudo tee -a $irexecshfile 1> /dev/null
		echo 'if [ -z "$1" ]' | sudo tee -a $irexecshfile 1> /dev/null
		echo 'then' | sudo tee -a $irexecshfile 1> /dev/null
		echo '        exit' | sudo tee -a $irexecshfile 1> /dev/null
		echo 'fi' | sudo tee -a $irexecshfile 1> /dev/null

		echo '' | sudo tee -a $irexecshfile 1> /dev/null

		echo '# Handlers for different key codes' | sudo tee -a $irexecshfile 1> /dev/null
		echo '# Key codes: UP DOWN LEFT RIGHT BACK PLAYPAUSE MENU HOME OK MUTE VOLUMEUP VOLUMEDOWN' | sudo tee -a $irexecshfile 1> /dev/null
		echo '' | sudo tee -a $irexecshfile 1> /dev/null

		echo 'amixerdevice=$(/usr/bin/amixer scontrols | sed -n "s/^.*'"'\(.*\)'"'.*$/\1/p")' | sudo tee -a $irexecshfile 1> /dev/null
		echo 'if [ $1 == "VOLUMEUP" ]' | sudo tee -a $irexecshfile 1> /dev/null
		echo 'then' | sudo tee -a $irexecshfile 1> /dev/null
		echo '        /usr/bin/amixer set $amixerdevice -- $[$(/usr/bin/amixer get $amixerdevice|grep -o [0-9]*%|sed '"'s/%//'"')+5]%' | sudo tee -a $irexecshfile 1> /dev/null
		echo 'elif [ $1 == "VOLUMEDOWN" ]' | sudo tee -a $irexecshfile 1> /dev/null
		echo 'then' | sudo tee -a $irexecshfile 1> /dev/null
		echo '        /usr/bin/amixer set $amixerdevice -- $[$(/usr/bin/amixer get $amixerdevice|grep -o [0-9]*%|sed '"'s/%//'"')-5]%' | sudo tee -a $irexecshfile 1> /dev/null
		echo 'elif [ $1 == "MUTE" ]' | sudo tee -a $irexecshfile 1> /dev/null
		echo 'then' | sudo tee -a $irexecshfile 1> /dev/null
		echo '        /usr/bin/amixer set $amixerdevice toggle' | sudo tee -a $irexecshfile 1> /dev/null
		echo 'fi' | sudo tee -a $irexecshfile 1> /dev/null

		echo '' | sudo tee -a $irexecshfile 1> /dev/null

		sudo chmod 755 $irexecshfile
	fi	
fi

if [ ! -f "$irdecodefile" ]
then
	sudo wget https://download.argon40.com/argonone-irdecoder.py -O $irdecodefile --quiet
fi

sudo python3 $irdecodefile $remotemode

echo
echo "Thank you."
if [ $needrestart -eq 1 ]
then
	echo "Changes should take after reboot."
elif [ $needinstallation -eq 1 ]
then
	sudo systemctl restart lircd.service
	sudo systemctl restart irexec.service
fi


DarkElvenAngel
Posts: 1416
Joined: Tue Mar 20, 2018 9:53 pm

Re: Argon One case with IR receiver and LIRC

Thu Jan 21, 2021 3:56 pm

Reading through the script and what it's doing it looks like the receiver is still connected to GPIO 23. Not having a unit to look at this is about all I can do, I can throw some guesses at you and help more if I can.

If the case has a IR receiver already installed it's carrier frequency should be 38.222kHz as per the NEC protocol. You need to check what your remote is using.

I hope all this is helpful to you and you can solve your issue.

FeathersMcGraw
Posts: 8
Joined: Thu Sep 24, 2020 9:10 pm

Re: Argon One case with IR receiver and LIRC

Fri Jan 22, 2021 12:54 am

Hi,

I read through both the argonone-ir and argonone-decoder.py scripts. Yes, it looks like the V2 case continues
to use GPIO 23, just as does the V1 case. However, something is different. I suspect that BMS Doug is correct
and the IR receiver is somehow connected to the V2 case's microcontroller.

Back in September, I had used a multimeter to test the continuity between the three IR receiver solder pads
provided by the V1 case and the GPIO pins. The IR data in pad had zero Ohms of resistance between itself
and GPIO 23. The IR data pad also had 10k Ohms resistance between itself and the + voltage supply pad
for the IR receiver. My guess is that the 10k Ohms was the result of a pull up resistor. Before adding the
IR receiver, I checked this with the case PCB and RPi4 connected to each other and powered up. The GPIO
23 pin was normally high at 3.3V. The Vishay TSOP 38238 IR receiver I installed intermittently pulses the
data pin low when receiving IR signals.

I noticed in the argonone-irdecode.py script that it initializes GPIO 23 as pull down. That's different. It also
seems to initiate some I2C communication to the case's microcontroller, though perhaps only in the context
of actively manipulating the power state. The /etc/lirc/lircd.conf.d/argon.lircd.conf content looks much the
same as the lircd.conf files I created for the remotes I'm using, though with different button codes and slightly
different timing parameters.

All the remotes I'm interested in using are compatible with the 38 kHz Vishay TSOP 38238 IR receiver (among
others). I think they are all using the NEC protocol. I tried about a half dozen remotes from around the house,
including a couple of Samsung TV remotes, a pair of Marantz and Denon AV receiver remotes. Every remote I
tried worked with the V1 case and TSOP 38238 IR receiver. I didn't map the keys of all of these remotes, as
doing so is time consuming and I was just experimenting. All of these same remotes and their lircd.conf files
work perfectly with the IR receiver built into my Intel NUC8i7HVK PC and Clevo P177 laptop running LIRC
running in Linux. So, the V1 case with an added IR receiver is very much compatible with LIRC alone.

I have no interest the "proprietary" IR transmitter sold by Argon40. Though, I'm not opposed to buying one just
to play with. The application I have for these RPi4's and cases is to run my choice of audio streaming software
using the IR transmitters of my choice, with me in control of the resulting actions as embodied within an
/etc/lirc/irexec.lircrc file of my creation. If the V2 case is too constraining, I'll get another V1 case. Though,
I suspect the production of V1 cases will end.

It does occur to me that perhaps my example of a V2 case is defective. Or, perhaps, there is a prerequisite of
performing a bit of initialization, via a few I2C calls for example. I say this because the argonone-irdecode.py
script seems to read the pulses directly from GPIO 23. Which suggests that the IR receiver drives GPIO 23,
either directly or indirectly.

If anyone out there has a V2 case and is willing to perform the following experiment, I'd be grateful. The
experiment would be to install Raspberry Pi OS then do the following.

Add "dtoverlay=gpio-ir,gpio_pin=23" to /boot/config.txt and reboot. Then execute the following.

sudo apt update
sudo apt upgrade
sync; telinit 6

sudo apt install lirc
sudo systemctl stop lircd
sudo systemctl disable lircd
sudo mode2 --driver default -d /dev/lirc0

Then point a few different IR remote transmitters at the V2 case and let us know if mode2 produces any
output when IR remote keys are pressed. Mine does not. The V1 cases with the added TSOP 38238 IR
receiver does produce a litany of mode2 output for all the remote IR transmitters I've tried. The V2 case
is silent. If yours produces output, it suggest mine is defective.

Thanks
Feathers

FeathersMcGraw
Posts: 8
Joined: Thu Sep 24, 2020 9:10 pm

Re: Argon One case with IR receiver and LIRC

Sun Jan 24, 2021 1:47 am

Hi,

As per your recommendation, I did a bit of testing of the V2 circuit board
with a multimeter. Yes, the signal pin of the VS1838b IR receiver is
connected to GPIO 23, zero Ohms. Similarly, as one would expect, the
ground pin of the VS1838b has zero Ohms of resistance to each of the
GPIO ground pins.

The resistance between the signal pin of the VS1838b and the Vcc voltage
supply pin is 9.15k Ohms. The resistance between the Vcc and ground pins
is 2k Ohms. Resistance between the signal and ground pins of the VS1838b
is 9.15k + 2k = 11.15k Ohms.

I saw something similar in the Argon One V1 circuit but with slightly
different resistances. They were 10k Ohms from signal to Vcc and 670 Ohms
from Vcc to ground. The result for signal to ground resistance was the
expected 10k + 670 = 10.6k Ohms.

The pin sequence between the VS1838b and the Vishay TSOP38238 IR receivers
are the same. From the VS1838b data sheet, though not in English, it
appears to prescribe a pull up resistor of about 10k Ohms and intermittently
shunts the signal pin to ground when receiving an IR signal.

I'm thinking about removing the VS1838b and replacing it with the extra
TSOP38238 I have on hand. If I do, I'll report the results here. I
suppose its possible that the Vcc voltage supply doesn't go high until
the Argon One V2 PCB's microcontroller commands it to do so. I will
test that tomorrow before doing any soldering. If the Vcc supply pin
doesn't go high on its own, there's not much point in proceeding.

On another note. I did some work with the bottom plate of the Argon
One M.2 (where the M.2 SATA SSD and its Asmedia ASM1153E USB3 to SATA
bridge reside). With the stock ASM1153E firmware, I could not USB
boot the Raspberry Pi 4B. The drive was usable and did report that it
was UASP compatible, but would not perform discard/trim.

Following instructions found on this forum, I installed firmware
version 141126_A1_EE_82 and was then able to USB boot the Pi. As
before the ASM1153E firmware update, the UAS transfer mode was intact.

After partitioning and NTFS formatting in Windows 10 (only for purpose of
testing), trim was working with no fiddling required. Linux (on both x86_64
and Arm) required the udev rule below before trim/discard would work.

"cat /etc/udev/rules.d/01-unmap-trim.rules" yields the following:

ACTION=="add|change", ATTRS{idVendor}=="174c", ATTRS{idProduct}=="55aa", SUBSYSTEM=="scsi_disk", ATTR{provisioning_mode}="unmap"

Connected to my Intel NUC8i7HVK running Fedora 32, I was witnessing a
sustained ~395 Mbytes/sec sequential write speed while transferring a
few hundred GB of data. So, pretty happy with that performance.

I am finding that a couple of the newer "stable" versions of the
RPi 4B EEPROM firmware seem to have regressed in that they are unable
to USB boot. This is true of the Argon One M.2 ASM1153E USB to
SATA bridge and a couple of different USB thumbdrives that I tried.
Reverting to the September 3, 2020 RPi 4B EEPROM version re-enables
USB boot.

Thanks
Feathers

DarkElvenAngel
Posts: 1416
Joined: Tue Mar 20, 2018 9:53 pm

Re: Argon One case with IR receiver and LIRC

Sun Jan 24, 2021 3:11 pm

Quote FeathersMcGraw
by FeathersMcGraw » Sat Jan 23, 2021 8:47 pm

Hi,

As per your recommendation, I did a bit of testing of the V2 circuit board
with a multimeter. Yes, the signal pin of the VS1838b IR receiver is
connected to GPIO 23, zero Ohms. Similarly, as one would expect, the
ground pin of the VS1838b has zero Ohms of resistance to each of the
GPIO ground pins.

The resistance between the signal pin of the VS1838b and the Vcc voltage
supply pin is 9.15k Ohms. The resistance between the Vcc and ground pins
is 2k Ohms. Resistance between the signal and ground pins of the VS1838b
is 9.15k + 2k = 11.15k Ohms.

I saw something similar in the Argon One V1 circuit but with slightly
different resistances. They were 10k Ohms from signal to Vcc and 670 Ohms
from Vcc to ground. The result for signal to ground resistance was the
expected 10k + 670 = 10.6k Ohms.

The pin sequence between the VS1838b and the Vishay TSOP38238 IR receivers
are the same. From the VS1838b data sheet, though not in English, it
appears to prescribe a pull up resistor of about 10k Ohms and intermittently
shunts the signal pin to ground when receiving an IR signal.

I'm thinking about removing the VS1838b and replacing it with the extra
TSOP38238 I have on hand. If I do, I'll report the results here. I
suppose its possible that the Vcc voltage supply doesn't go high until
the Argon One V2 PCB's microcontroller commands it to do so. I will
test that tomorrow before doing any soldering. If the Vcc supply pin
doesn't go high on its own, there's not much point in proceeding.
So the part is pin compatible that's good. A good idea to also check the supply voltage and when it's enable. To my thinking the receiver should always be powered on in the V2 as it can be used to power on the case. You might read odd resistances do to the signal pin being routed to the microcontroller as well as the GPIO header. If you don't want that function you could cut that trace. They use a black solder mask make it hard to see things. It seems like the intention was that the V1 and V2 would work the same with regards to the IR remote with the exception that V2 would have an extra feature of being able to turn on and off via remote.

FeathersMcGraw
Posts: 8
Joined: Thu Sep 24, 2020 9:10 pm

Re: Argon One case with IR receiver and LIRC

Tue Jan 26, 2021 10:15 pm

Hi,

Just a quick update. I tested the Vcc IR receiver voltage supply pad
of both the V1 and V2 cases. Both are hot at about 3.15V when the AC
to DC power supply is plugged into the USB C power port of the cases.
Similarly, GPIO 23 goes high to the same 3.15V, as one would expect
due to the pull up resistor. This is with the OS not running and
the red LED on the RPi 4 extinguished. So, the IR receiver is powered
at all times for both the V1 and V2 cases.

I did swap out the the VS1838b IR receiver for the last Vishay TSOP38238
I had on hand. The first test with mode2 after the swap looked like
all was fixed. Each press of a button on two different IR transmitters
produced a long alternating sequence of "pulse xxxx" and "space yyyy"
output. However, subsequent testing became sporadic. Frequently with
little to no pulse and space output and eventual "timeout zzzz"
statements. I tried with both fresh installs of Raspberry Pi OS and
fresh installs plus argon1.sh piped into bash. Also tried with
power removed for several seconds between each attempt.

I also tried swapping two different RPi 4's into each case. The
symptoms remained with the V2 case and both RPi 4's worked well with
LIRC in the V1 case.

With the V2 PCB removed, I noted that the processor is a Nuvoton
N76E003AT20. I suspect that the two of you are correct in that the
IR receiver is connected to both GPIO 23 and one of the pins of the
N76E003AT20. I cannot confirm this though, as it is difficult to
see where the traces of the circuit board run.

I've been trying to purchase another V1 case but am having difficulty.
The Argon40.com store won't let me put even quantity one into my
shopping cart. Amazon has some that show pictures of the V1 case
but I'm afraid that they'll ship me a V2 case, believing they're
doing me some kind of favor. I see no provision when ordering to
articulate that I only want the V1 case.

I sent Argon40 customer support an email. If their response proves
useful, I'll report here.

If anyone is playing with the IR receiver capability of the V2 case,
whether successful or not, please post your experience.

Thanks
Feathers

BMS Doug
Posts: 4422
Joined: Thu Mar 27, 2014 2:42 pm
Location: London, UK

Re: Argon One case with IR receiver and LIRC

Wed Jan 27, 2021 10:40 am

Are you in the UK Feathers?

I think I have an unopened V1 case at home (not the m.2 but its only the lid that you are interested in) and would happily swap it for a V2 lid. (duplicate Christmas present)

I'd rather have the full sized HDMI ports and can tolerate the absence of a working IR Receiver.

If you are UK based we can exchange e-mail addresses and discuss an exchange (don't post your e-mail address though, spammers would find it).
Doug.
Building Management Systems Engineer.

FeathersMcGraw
Posts: 8
Joined: Thu Sep 24, 2020 9:10 pm

Re: Argon One case with IR receiver and LIRC

Fri Jan 29, 2021 1:07 am

Hi Doug,

Thanks for the offer. I'm in the US, near Dallas Texas.

I did send an email to customer support at Argon40.
They did provide a preliminary response and said that
they would look further into the topic.

The CS representative stated that their IR implementation
should not prevent other IR remotes from working. I kind
of believe them but am at a loss as to why I'm having
trouble.

The reason I'm inclined to believe them is that the IR
receiver's signal pin is directly connected to GPIO 23.
Also, the lircd.conf file their script builds for the Argon40
branded IR remote that they will soon be selling looks
very similar to the lircd.conf files for a great many other
IR remotes. Albeit, with modestly different timing
parameters and unique key button codes.

I very much suspect that you and Dark are correct in that
the V2 case also connects the IR receiver signal pin to
one of the pins on the N76E003AT20 controller. I suspect
the N76E003AT20 is somehow interfering with the signal.

Part of me wants to stick with this because it is possible
that a solution will be found. It may be a simple matter
of the Argon40 scripts maturing some more.

I'm willing to purchase the Argon40 remote. I don't intend
to use it for other than experimentation. There's the
possibility that once a solution is found, one can drop
additional lircd.conf files into the /etc/lirc/lircd.conf.d/
directory and have those IR remotes recognized also.
The response from Argon40 CS seemed to imply that
this was the case but perhaps my optimism is reading
between the lines.

That would actually be a very nice solution. Those who
like the power on via IR remote feature can have that
feature. Those who want to program otherwise unused
IR remote keys for remotes that come with connected
equipment can also use those remotes, assuming they
are NEC protocol and 38 kHz compatible.

Anyhow, I'm kind of putting this on a back burner for
now. My plan is to see if Argon40 pursues this further
and also would like to hear whether others with the V2
case are having any luck with the included IR receiver.

Thanks
Feathers

FeathersMcGraw
Posts: 8
Joined: Thu Sep 24, 2020 9:10 pm

Re: Argon One case with IR receiver and LIRC

Sun Feb 21, 2021 11:42 pm

Hi,

I'm happy to report that I am having a good experience
with the IR capability of the V2 Argon One case. I
apologize for having taken so long to circle back around
to this project.

I Picked up this project again today with a fresh start.
I installed the latest 32-bit Raspberry Pi OS on the SD
card, performed an apt update & upgrade, and then
installed the argon1.sh scripts.

The /usr/bin/argonone-ir script enabled me to map a key
on the IR remote transmitter of my choosing to the power
on/off function successfully. It also assisted me in
creating a working /etc/lirc/lircd.conf.d/argon.lircd.conf
file with the volume up and down key codes.

I had already mapped all of the keys on this remote and
a few others. The argon.lircd.conf file created by the
argonone-ir script showed good agreement with the prior
key codes and timing parameters obtained for this same
IR remote transmitter.

The resulting irexec.lircrc and argon.lircd.conf files
were not completely suitable for my needs. However, they
do serve as a good beginning for subsequent LIRC
customization.

I am curious as to whether the V1 Argon One cases are
also able to power on with an IR remote of your choosing.
I will try that experiment next, perhaps as early as
tomorrow and will report here.

Cheers
Feathers

FeathersMcGraw
Posts: 8
Joined: Thu Sep 24, 2020 9:10 pm

Re: Argon One case with IR receiver and LIRC

Mon Feb 22, 2021 10:31 pm

I tested one of my V1 Argon One cases with the installed TSOP 38238
IR receiver. The power on with IR remote feature does not appear to
work with the V1 cases. Apparently, the power on with IR remote is
among the new features engineered into the V2 cases.

In all other respects, the LIRC functionality of both V1 and V2 cases
works as expected. For a V1 case, one can always configure irexec
to issue a shutdown command upon receiving a particular IR key code.

For the V2 case, I was successful programing the case to power on
with two different IR remote transmitters (one from Oppo and the
other from miniDSP). As one would expect, only one remote can be
programmed to power on the V2 case at any given moment. The
argonone-ir script makes it pretty easy to later change your mind as
to which IR remote and key you wish to use for the power on/off
function.

Anyhow, I'm pretty satisfied with both the V1 and V2 Argon One
cases. I think the code provided by Argon40 had to mature a little
bit but appears to be working well now. If you have the V1 case,
you will have to add the IR receiver and live without an IR power
on feature, but is the same or similar to a V2 case in other LIRC
respects.

Thanks
Feathers

BMS Doug
Posts: 4422
Joined: Thu Mar 27, 2014 2:42 pm
Location: London, UK

Re: Argon One case with IR receiver and LIRC

Mon Feb 22, 2021 10:54 pm

Im glad you got it working.
Doug.
Building Management Systems Engineer.

Return to “HATs and other add-ons”