Is this possible? Reboot T2 on system resume

GPC2 script programming for Titan Two. Code examples, questions, requests.

Is this possible? Reboot T2 on system resume

Postby pablosscripts » Sun Mar 04, 2018 12:56 am

When I resume my PS4 from hibernation, my T2 never works. It might be the fact that I'm also using a XIM, but I'm not sure.

What I would like is the ability to reboot my T2 when it detects that it's coming out of hibernation. Is this possible?
Setup: XIM Apex, T2, K780 keyboard, G Pro Wireless mouse, SteelSeries 4HD pad, DXRacer armrest, LucidSound LS30 headset, Netduma router, Ubiquiti UniFi AP LR

My R6 script: https://youtu.be/x-9NtxyySVM
User avatar
pablosscripts
Brigadier General
Brigadier General
 
Posts: 1976
Joined: Tue Nov 24, 2015 6:27 am

Re: Is this possible? Reboot T2 on system resume

Postby J2Kbr » Mon Mar 05, 2018 1:03 pm

You are correct. after console power cycle XIM4 needs to be replugged.

You can press and hold both buttons on the Titan Two to force reset without need to remove the connected cables.

Or, have a script in any slot to force reset the port where XIM4 is connected with the port_usb_poweroff and port_usb_poweron functions:

https://www.consoletuner.com/wiki/index ... sb_poweron
https://www.consoletuner.com/wiki/index ... b_poweroff
ConsoleTuner Support Team
User avatar
J2Kbr
General of the Army
General of the Army
 
Posts: 20323
Joined: Tue Mar 18, 2014 1:39 pm

Re: Is this possible? Reboot T2 on system resume

Postby pablosscripts » Mon Mar 05, 2018 9:17 pm

Awesome!!! I can't wait to implement this. Thanks!

If I put this in my init, do I need to add a delay?

E.g.

Code: Select all
init {
 
combo_run(reboot);
 
}
 
combo reboot {
 
port_usb_poweroff(PORT_USB_B);
wait(40);
port_usb_poweron(PORT_USB_B);
 
}


Or can I just stick it all in the init? What would you recommend for this to work optimally?
Setup: XIM Apex, T2, K780 keyboard, G Pro Wireless mouse, SteelSeries 4HD pad, DXRacer armrest, LucidSound LS30 headset, Netduma router, Ubiquiti UniFi AP LR

My R6 script: https://youtu.be/x-9NtxyySVM
User avatar
pablosscripts
Brigadier General
Brigadier General
 
Posts: 1976
Joined: Tue Nov 24, 2015 6:27 am

Re: Is this possible? Reboot T2 on system resume

Postby UK_Wildcats » Wed Mar 07, 2018 12:20 am

Very interesting stuff here.

Looking around the documentation, I saw the 6 below port code names. It would be great if you clearly defined them. Below is an example and what I believe that they represent.

1 PORT_USB_A (Input A)
2 PORT_USB_B (Input B)
0 PORT_USB_C (Output)
3 PORT_USB_D (PROG)
4 PORT_BT_A (Input A bluetooth)
5 PORT_BT_B (Input B bluetooth)

Are these correct?
User avatar
UK_Wildcats
Brigadier General
Brigadier General
 
Posts: 2243
Joined: Thu Jan 08, 2015 6:53 pm

Re: Is this possible? Reboot T2 on system resume

Postby J2Kbr » Wed Mar 07, 2018 12:08 pm

pablosscripts wrote:If I put this in my init, do I need to add a delay?

the delay is needed, set it to 250 to give enough time for XIM4 completely turnoff.

pablosscripts wrote:Or can I just stick it all in the init? What would you recommend for this to work optimally?

yep, you can have it on init section of all your scripts. :smile0517:
ConsoleTuner Support Team
User avatar
J2Kbr
General of the Army
General of the Army
 
Posts: 20323
Joined: Tue Mar 18, 2014 1:39 pm

Re: Is this possible? Reboot T2 on system resume

Postby J2Kbr » Wed Mar 07, 2018 12:09 pm

UK_Wildcats_Fans wrote:1 PORT_USB_A (Input A)
2 PORT_USB_B (Input B)
0 PORT_USB_C (Output)
3 PORT_USB_D (PROG)
4 PORT_BT_A (Input A bluetooth)
5 PORT_BT_B (Input B bluetooth)

Are these correct?

yes, this is correct. :smile0517: For PORT_USB_C and PORT_USB_D the USB power off only works when having OTG adapter plugged.
ConsoleTuner Support Team
User avatar
J2Kbr
General of the Army
General of the Army
 
Posts: 20323
Joined: Tue Mar 18, 2014 1:39 pm

Re: Is this possible? Reboot T2 on system resume

Postby pablosscripts » Fri Mar 09, 2018 10:52 am

It just occurred to me this won't work for me. My T2 is always on and never reboots when I wake my PS4 from hibernation.

The only thing I can use is the Output - when my PS4 comes out of hibernation the output LED turns on. Is it possible to use this instead?
Setup: XIM Apex, T2, K780 keyboard, G Pro Wireless mouse, SteelSeries 4HD pad, DXRacer armrest, LucidSound LS30 headset, Netduma router, Ubiquiti UniFi AP LR

My R6 script: https://youtu.be/x-9NtxyySVM
User avatar
pablosscripts
Brigadier General
Brigadier General
 
Posts: 1976
Joined: Tue Nov 24, 2015 6:27 am

Re: Is this possible? Reboot T2 on system resume

Postby pablosscripts » Tue Mar 13, 2018 7:48 am

J2Kbr would you mind explaining how this works in relation to my issue?

https://github.com/J2Kbr/TitanTwo/issues/90

Just trying to find the best solution here.
Setup: XIM Apex, T2, K780 keyboard, G Pro Wireless mouse, SteelSeries 4HD pad, DXRacer armrest, LucidSound LS30 headset, Netduma router, Ubiquiti UniFi AP LR

My R6 script: https://youtu.be/x-9NtxyySVM
User avatar
pablosscripts
Brigadier General
Brigadier General
 
Posts: 1976
Joined: Tue Nov 24, 2015 6:27 am

Re: Is this possible? Reboot T2 on system resume

Postby J2Kbr » Tue Mar 13, 2018 7:20 pm

Please test if this code resets XIM4 upon console reboot. (assuming XIM4 is on Input-B)

Code: Select all
bool console_reset;
 
main {
    if(port_status(PORT_USB_C, NULL, NULL) & DIR_OUTPUT) {
        if(console_reset) {
            console_reset = FALSE;
            combo_run(XIM4Reboot);
        }
    } else console_reset = TRUE;
 
 
}
 
combo XIM4Reboot {
    port_usb_poweroff(PORT_USB_B);
    wait(250);
    port_usb_poweron(PORT_USB_B);
}
 
ConsoleTuner Support Team
User avatar
J2Kbr
General of the Army
General of the Army
 
Posts: 20323
Joined: Tue Mar 18, 2014 1:39 pm


Return to GPC2 Script Programming

Who is online

Users browsing this forum: Baidu [Spider] and 55 guests