Please do not post a support request without first reading and following the advice in https://retropie.org.uk/forum/topic/3/read-this-first

ControlBlock shuts down Pi immediately after startup - Unable to access ControlBlock config file



  • I have rPi3B+ with original power source and a recently ordered ControlBlock without a power switch connected. I wired one joystick and 9 buttons, 7 to switch 1-7 and two buttons to start and coin. I have a clean install of Retropie and Stretch from the premade image on this site, and only wifi, keyboard and locales configured.

    I installed the ControlBlock driver as outlined here: (https://github.com/petrockblog/ControlBlockService2#uninstalling-the-service-andor-the-binary).

    I did the prerequisites steps and then I used the quick install script. It ended with [SUCCES] for both the ControlBlock driver and service and saying that I can find the config file at /etc/controlblockconfig.cfg. The problem is , when trying to access the .cgf i get "permission denied" and with sudo I get this:

    /etc/controlblockconfig.cfg: 4: /etc/controlblockconfig.cfg: Syntax error_ "(" unexpected (expecting "]").

    What does this mean? How can I access the config?

    If I connect the ControlBlock PCB and start the system up it immediately calls the shutdown. I'm thinking I should change the power switch function in the cfg to false, from the default true, but now I can't access it. I tried the the power source in both the Pi and ControlBlock separately, in the Pi it starts up and shuts down right afterwards, if I put it in the ControlBlock nothing happens. There is no instructions on how to connect the power and I wouldn't dare to put power sources in both the Pi and ControlBlock at the same time without knowing if that's the way to go..

    Any ideas on what to do next?



  • Still waiting for reply from petrockblog. In the meantime I flashed the SD card again and installed everything again, just to make sure nothing went corrupt the last time. The problem persists:

    /etc/controlblockconfig.cfg: 4: /etc/controlblockconfig.cfg: Syntax error_ "(" unexpected (expecting "]").

    What does this mean? How can I access the config?

    Can someone with linux skills please comment on what I might be wrong? I don't understand the syntax error message and want to make sure I'm not making some stupid n00b mistake. Big thank you for any help!



  • @m2306 It might help if you post the contents of your configuration file (/etc/controlblock.cfg), it seems it has the wrong syntax. Did you modify that file after installation ?



  • @mitu thank you for your reply. I did only configure keyboard (apple iso) as controller in retropie at first boot of system. Then wifi and locales according to my geographical location. Then the exact steps to install controlblock driver in the link provided in the first post. As I said I cannot/don’t know how to access the cfg. How can I see/post it’s contents when I cant open it?



  • @m2306 sudo nano /etc/controlblock.cfg

    But I'm wondering why the default install fails...



  • @m2306 sudo nano /etc/controlblock.cfg

    Worked. Thank you. The file looks like:

    {
    "controlblocks" : [
    {
    "enabled" : true,
    "adress" : {
    "SJ2" : 0,
    "SJ2" : 0
    },
    "gamepadtype" : "arcade",
    "onlyOneGamepad" : false,
    "powerswitchOn" : true
    },
    {
    "enabled" : false,
    "adress" : {
    "SJ1" : 1,
    "SJ2" : 0
    },
    "gamepadtype" : "arcade",
    "onlyOneGamepad" : false
    }
    ]
    }

    (I typed it all up. I'd be happy if you could point me to a guide how to add those sleek looking pastes of these files with black background that people seem to use)

    Later today I'm going to try changing onlyOneGamepad to true and powerswitchOn to false and see what happens.

    But, I still can't understand the syntax error message, there is no "(" sign in the whole document, except for in the instructions but the are all preceded by //.


  • Global Moderator

    You are right. If no power switch is connected, you need to set powerswitchOn to “false” in the config file. That will stop the immediate shutdown after boot.



  • @petrockblog Thank you. Any thoughts on the syntax error message? It came up after a clean install and again after doing a new install..


  • Global Moderator

    You need to open the config file with the command

    sudo nano /etc/controlblock.cfg
    

    This command ...

    • ... uses "sudo" to use administrator privileges. Otherwise you would not be allowed to edit that file,
    • ... uses the command line text editor "nano",
    • ... provides as argument to nano the text file to be opened.

    If you call sudo /etc/controlblockconfig.cfg you try to execute whatever is inside that cfg file. And that, in turn, leads to an error.

    Does this clear things up?

    By the way, you can mark code snippets with this syntax:

    ```
    CODE HERE
    ```



  • @petrockblog

    I guessed as much, just me beeing a linux n00b. Thanks and sorry for wasting your time. Still, this could have been prevented with clearer instructions. It went fine with installing the software though, nice and easy to copy the commands, all clear there. Just small things like this one that you who know command line better maybe don’t realize that others don’t get.. Thanks again.


 

Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.

Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.