Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
i2c Bus Snes classic controller
#11
(06-19-2021, 12:35 AM)romario Wrote:
(01-27-2021, 12:29 AM)asegura074 Wrote:
(01-25-2021, 04:24 PM)alexkidd Wrote: I dont have a controller like that to try myself, but i guess you probably have to add an udev rule
maybe they shed some light

http://retrorangepi.download/forum/showt...light=udev
http://retrorangepi.download/forum/showt...light=udev
Thanks ,  i got it working already , one of the  issues was i needed to install some updates but since the image is old the repository need to change the sources.list also i had to look around  some deb files and installed them manually , so the machine can talk to the i2c bus , and also , the driver was for the Raspberrypi and it was set to i2c1 port 1  by default i changed to port 0 i2c0 for the first controller and i2c2 port 2 for the second. Made  2 services in etc/systemd/system  running one for each controller ,and it does have a Rules file but was already set , the main point were the packages python-smbus , libi2c-dev,libi2c0, i2c-tools,  once i got them installed the it let me built the make file and installed the driver  Big Grin
Hi friend could you help me i am trying to do that same thing, but i am facing a lot of errors, first. this is the first one,

Its showing: connection time out

i will attach a picture

or its possible to send your files tks friend

i adapted fromthe Rpi driver  https://github.com/nutki/rpi-nintendo-cl...controller
the diference is the Rpi uses i2c1  so the driver need to be edited to make it work with OPI
-----------------------------------------------------------------------------------------------------------
ok first i have to enable i2c bus in the armbiaEnv.txt
add this line.

overlays=i2c0 i2c2

-------------------------------------------------------
Compile the driver 
once you compiled i edited the service 
nintendo-i2c-controller.service

inside the folder
service/nintendo-i2c-controller.service

and created a second file 

nintendo-i2c-controller2.service

i edited the service for each port  on the ExecStart line  -y 0 for the i2c0 port 0  and  -y 2  for the i2c2 port 2
---------------------------------------------------------------------------------------------------------------------------------------------
[Unit]
Description=Nintendo Classic I2C Controller Service

[Service]
ExecStart=/usr/local/bin/i2c-classic-controller -y 0 
WorkingDirectory=/
StandardOutput=inherit
StandardError=inherit
Restart=always
User=root

[Install]
WantedBy=multi-user.target
----------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------
you should have 2 files like this  one for each port 
nintendo-i2c-controller.service
nintendo-i2c-controller2.service

once i have the 2 files then editd  CMakeLists.txt and add the the line 
install(FILES service/nintendo-i2c-controller2.service DESTINATION /etc/systemd/system)
so the make install can copy the 2 services to the correct destination 

---------------------------------------------------------------------------------------------------------------------------
cmake_minimum_required(VERSION 3.7)
project(rpi-i2c-classic-controller)

add_executable(i2c-classic-controller i2c-classic-controller.c)
set(CMAKE_C_FLAGS "-O3")

install(FILES service/99-nintendo-i2c-controller.rules DESTINATION /etc/udev/rules.d)
install(FILES service/nintendo-i2c-controller.service DESTINATION /etc/systemd/system)
install(FILES service/nintendo-i2c-controller2.service DESTINATION /etc/systemd/system)
install(TARGETS i2c-classic-controller DESTINATION /usr/local/bin)

target_link_libraries(i2c-classic-controller i2c)


---------------------------
and run the  make Install
then activate the services  


sudo systemctl enable nintendo-i2c-controller


sudo systemctl enable nintendo-i2c-controller2
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  How to connect Xbox Series X controller with PC adapter Qbcol 1 847 01-17-2021, 10:58 PM
Last Post: alexkidd
  PS4 BT controller with the Orange Pi PC Plus problem Stroke Papy 0 582 12-09-2020, 01:32 PM
Last Post: Stroke Papy
Big Grin new core of snes xtremox 0 580 08-03-2020, 04:04 AM
Last Post: xtremox
  remote controller razstec 2 1,184 05-14-2020, 09:08 AM
Last Post: razstec
  SNES Emulator Error hyksoss 0 973 12-28-2019, 04:09 AM
Last Post: hyksoss
  Controller works in emulationstation but not in games ebonflame 0 1,280 12-21-2019, 05:10 AM
Last Post: ebonflame
Bug Controller mapping through Emulationstation causes reboot messie 74 35,093 09-28-2019, 04:40 PM
Last Post: Wolfenprey

Forum Jump:


Users browsing this thread: 1 Guest(s)