Freeplaytech Forum
Slim L2R2 dual analog 4ADC add-on issue - Printable Version

+- Freeplaytech Forum (https://forum.freeplaytech.com)
+-- Forum: Freeplay Zero / Freeplay CM3 / Game Pie Advance (https://forum.freeplaytech.com/forumdisplay.php?fid=24)
+--- Forum: Freeplay Zero/CM3 (AKA GPA) Software (https://forum.freeplaytech.com/forumdisplay.php?fid=26)
+--- Thread: Slim L2R2 dual analog 4ADC add-on issue (/showthread.php?tid=5292)



Slim L2R2 dual analog 4ADC add-on issue - tsouders - 01-04-2022

Just a warning, I am new to using retropie and to the forum. Sorry in advance if this issue has already been posted and resolved.

I recently assembled a CM3 with the L2R2 dual analog 4ADC add-on board. Everything went smooth until I got to the end and started setting up the software. I set up SSH and Putty on my computer to type in the necessary commands that were listed towards the end of the document linked below. I ran into fatal errors over and over again after typing the commands as shown. I'm using the most current CM3 image (Freeplay_CM3_20051201img.gz). Does anyone have any suggestions? I'd really appreciate the help.

https://docs.google.com/document/d/13ztk8Kr4_ORlY7lxX8KTQxo5e22cAsnQaAz2oZtT_ok/edit


RE: Slim L2R2 dual analog 4ADC add-on issue - Flavor - 01-04-2022

Can you post a copy/paste of the errors you saw (or maybe even a photo of the screen)?


RE: Slim L2R2 dual analog 4ADC add-on issue - tsouders - 01-04-2022

(01-04-2022, 08:06 AM)Flavor Wrote: Can you post a copy/paste of the errors you saw (or maybe even a photo of the screen)?

I attached an image of the error after install and the .txt of my putty session. Appreciate the help!


RE: Slim L2R2 dual analog 4ADC add-on issue - Flavor - 01-06-2022

The main issue is shown here in your log.

Your kernel headers for kernel 4.14.98-v7+ cannot be found at
/lib/modules/4.14.98-v7+/build or /lib/modules/4.14.98-v7+/source.

This suggests that you're running kernel 4.14.98-v7+ but the headers are not present.  BUT, the log also shows that the kernel headers were installed, so they're likely from a different kernel.

So, there's a Raspberry Pi thread that says this is the fix.


Code:
sudo umount /boot
sudo mount /dev/mmcblk0p1 /boot
sudo apt install --reinstall raspberrypi-bootloader
sudo reboot

But I don't know if that'll help or not.  You'd likely have to re-run the ./install.sh from the mk_arcade code after doing that.

What's the output you get from this?  On mine, it lists a version for the kernel and the headers.  They're an exact match.  Are they on yours?

Code:
dpkg-query -l raspberrypi-kernel*



RE: Slim L2R2 dual analog 4ADC add-on issue - tsouders - 01-07-2022

(01-06-2022, 04:46 AM)Flavor Wrote: The main issue is shown here in your log.

Your kernel headers for kernel 4.14.98-v7+ cannot be found at
/lib/modules/4.14.98-v7+/build or /lib/modules/4.14.98-v7+/source.

This suggests that you're running kernel 4.14.98-v7+ but the headers are not present.  BUT, the log also shows that the kernel headers were installed, so they're likely from a different kernel.

So, there's a Raspberry Pi thread that says this is the fix.


Code:
sudo umount /boot
sudo mount /dev/mmcblk0p1 /boot
sudo apt install --reinstall raspberrypi-bootloader
sudo reboot

But I don't know if that'll help or not.  You'd likely have to re-run the ./install.sh from the mk_arcade code after doing that.

What's the output you get from this?  On mine, it lists a version for the kernel and the headers.  They're an exact match.  Are they on yours?

Code:
dpkg-query -l raspberrypi-kernel*

Sorry for the delayed response. I just ran the codes above (see attached image). It looks like the kernal and headers match. I ran the ./install/sh for mk_arcade afterwards but still ran into the same issue with "/lib/modules/4.14.98-v7+/build or /lib/modules/4.14.98-v7+/source."


RE: Slim L2R2 dual analog 4ADC add-on issue - Flavor - 01-08-2022

Hmm.   I don't know why the operating system is in this situation.
 
That output definitely shows some problems.

The "sudo apt install --reinstall raspberrypi-bootloader" command didn't work. 

For one thing, I think you might want to run
Quote:sudo apt update
first.

I honestly really don't know, but I wonder if this command would fix that dependency in your error.
Quote:sudo apt install --reinstall libraspberrypi0 raspberrypi-bootloader


AND, before you do install the bootloader, I think you have to make sure that /boot is writeable.  Yours might be, so this may not be necessary.  

This will show if it's already "rw" (read/write).  Maybe post the output of this (after a reboot).
Quote:mount |grep boot

If it isn't, you might do this before the sudo apt install --reinstall command
Code:
mount -o remount, rw /boot

There's also the 'rpi-update' command that might work. I'm not sure how that plays with the apt version of the update. Maybe see https://www.reddit.com/r/raspberry_pi/comments/69fo54/what_is_the_relationship_between_rpiupdate_and/


https://forums.raspberrypi.com/viewtopic.php?t=307418 (where the guy seemed to have a similar problem and never fixed it)


RE: Slim L2R2 dual analog 4ADC add-on issue - Flavor - 01-08-2022

It also occurred to me that you may be able to install the entire kernel source, if you wanted to.

I guess you'd do

Quote:sudo apt install rpi-source
and then run

Quote:rpi-source
That's pretty large overkill, though.


RE: Slim L2R2 dual analog 4ADC add-on issue - Flavor - 01-08-2022

I looked a bit more into this, and I think rpi-source may be exactly what you need.

From https://github.com/RPi-Distro/rpi-source
"rpi-source is helpful if you use rpi-update kernels or want to build an in-kernel module."

So, after you run 'rpi-source' you should have the correct kernel headers in /lib/modules/4.14.98-v7+/ and you could build the driver.


RE: Slim L2R2 dual analog 4ADC add-on issue - Flavor - 01-11-2022

It doesn't seem like this is moving forward very easily.  I'm suspecting that there was some operating system update that went awry.

I would suggest trying to start fresh with a new SD card image.  If you have another SD card, that would be even better, since you can go back to the previous one if you needed to.

Take a look here: https://www.freeplaytech.com/support/setup/

Go to the "Freeplay Zero/CM3 SD Image Files" link and grab the latest image.  At the moment, I think that's "Freeplay_CM3-and-Zero2_Test_21110201.img.gz"  (Really, I think you can grab any of the CM3 images).  Burn that to an SD card and make sure it's all working with the normal buttons and all that.

Then go to the "Freeplay CM3 Boxy Pixel “Slim” L2R2 Dual Analog 4ADC Add-On Install" link which opens up a Google document and scroll down to the "Software Setup" section.

The first part of the software setup has you grab the latest driver code and build it.  If you grabbed the latest CM3 image, then you don't really need to grab the latest mk_arcade_joystick_rpi driver.  This part is here to ensure that the document matches the driver, which is very important if people are putting an add-on board into a system that has been running for a while.  The drivers could be out of date, then, but it should be the latest driver that's on the latest SD image at the moment.

So, actually just skip down to this part and run these commands.


Quote:cd /home/pi/Freeplay/mk_arcade_joystick_rpi
make config


See how that goes for you.


RE: Slim L2R2 dual analog 4ADC add-on issue - abd333 - 01-22-2022

(01-11-2022, 02:39 AM)Flavor Wrote: It doesn't seem like this is moving forward very easily.  I'm suspecting that there was some operating system update that went awry.

I would suggest trying to start fresh with a new SD card image.  If you have another SD card, that would be even better, since you can go back to the previous one if you needed to.

Take a look here: https://www.freeplaytech.com/support/setup/

Go to the "Freeplay Zero/CM3 SD Image Files" link and grab the latest image.  At the moment, I think that's "Freeplay_CM3-and-Zero2_Test_21110201.img.gz"  (Really, I think you can grab any of the CM3 images).  Burn that to an SD card and make sure it's all working with the normal buttons and all that.

Then go to the "Freeplay CM3 Boxy Pixel “Slim” L2R2 Dual Analog 4ADC Add-On Install" link which opens up a Google document and scroll down to the "Software Setup" section.

The first part of the software setup has you grab the latest driver code and build it.  If you grabbed the latest CM3 image, then you don't really need to grab the latest mk_arcade_joystick_rpi driver.  This part is here to ensure that the document matches the driver, which is very important if people are putting an add-on board into a system that has been running for a while.  The drivers could be out of date, then, but it should be the latest driver that's on the latest SD image at the moment.

So, actually just skip down to this part and run these commands.


Quote:cd /home/pi/Freeplay/mk_arcade_joystick_rpi
make config


See how that goes for you.

Ran into this issue and this fixed it for me:

1. Fresh install of IMAGE=Freeplay_CM3_20051201

2. SSH and do: `cd ~/Freeplay/mk_arcade_joystick_rpi/; make config`. This SUCCEEDS -- device recognizes all buttons including L2+R2. Here is relevant stdout snippet:

[L2] button bind on pin 43
, reversed logic
[R2] button bind on pin 42
, reversed logic
After system reboots, L2+R2 buttons are not recognized in EmulationStation controller config or Retroarch input config -- after reading snippet it occured to me this is to be expected due to "reverse logic". 

3. There was mention of this issue in another thread so i edited `/etc/modprobe.d/mk_arcade_joystick.conf` to flip signs: -43 -> 43 , -42 -> 42  to give me a file like:

options mk_arcade_joystick_rpi map=4 hkmode=1 gpio=4,17,6,5,19,26,16,18,23,24,15,14,-20,43,42,-1,-1,-1,-1,-1,-1

4. After a reboot, L2+R2 buttons are recognized in ES controller config (interestingly, they weren't recognized in Retroarch until i performed another reboot after setting controller config in ES)

5. Success! L2+R2 buttons now correctly configured [Image: smile.gif]