Recalbox Forum

    • Register
    • Login
    • Search
    • Recent
    • Tags
    • recalbox.com
    • Gitlab repository
    • Documentation
    • Discord

    Solved API Restful

    Recalbox General
    api restful
    4
    19
    6672
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • DjLeChuck
      DjLeChuck last edited by

      Hi,

      I'm trying to use the API of recalbox from a local server but I'm stucked.

      I have set the option system.api.enabled = 1 and reboot the Pi but I can't do any curl request from my local server (curl http://192.168.0.18:1337/ -> curl: (7) Failed to connect to 192.168.0.18 port 1337: Connexion refusée.

      Can I see some logs on the Pi?
      The developer environment is only needed if we want to modify the API and not used it, right?

      ping @MikaXII

      1 Reply Last reply Reply Quote 0
      • Substring
        Substring last edited by

        I tried it 3 months ago, was working fine. Try 127.0.0.1eventually

        Former dev - Please reply with @substring so that i am notified when you answer me
        Ex dev - Merci de me répondre en utilisant @substring pour que je sois notifé

        1 Reply Last reply Reply Quote 0
        • DjLeChuck
          DjLeChuck last edited by

          What I want it's use the API through a local server, not the Pi itself. 🙂

          I tried the command on the Pi but same thing (with local and network IP).

          1 Reply Last reply Reply Quote 0
          • Substring
            Substring last edited by

            I'll try lter today and tell you how it goes

            Former dev - Please reply with @substring so that i am notified when you answer me
            Ex dev - Merci de me répondre en utilisant @substring pour que je sois notifé

            1 Reply Last reply Reply Quote 0
            • Substring
              Substring last edited by

              Looks like the start of the recalbox-api is crashing ... I'll fill in a bug

              Former dev - Please reply with @substring so that i am notified when you answer me
              Ex dev - Merci de me répondre en utilisant @substring pour que je sois notifé

              1 Reply Last reply Reply Quote 0
              • DjLeChuck
                DjLeChuck last edited by

                Ok thank you! We close this thread?

                1 Reply Last reply Reply Quote 0
                • Substring
                  Substring last edited by Substring

                  @DjLeChuck no, seems like there is a fix ongoing that I'd like you to test. Can you edit /etc/init.d/S95api and replace PM2_HOME to /var/.pm2 , reboot and retry the curl ?

                  Former dev - Please reply with @substring so that i am notified when you answer me
                  Ex dev - Merci de me répondre en utilisant @substring pour que je sois notifé

                  1 Reply Last reply Reply Quote 1
                  • DjLeChuck
                    DjLeChuck last edited by

                    @subs : Sorry for the delay, I was mounting my bartop 😄 I can not edit the file, he his readonly. I can do something like that example for the config.txt file ? mount -o remount, rw /boot

                    1 Reply Last reply Reply Quote 0
                    • Substring
                      Substring last edited by

                      Just replace /boot by / and you can edit+save it

                      Former dev - Please reply with @substring so that i am notified when you answer me
                      Ex dev - Merci de me répondre en utilisant @substring pour que je sois notifé

                      1 Reply Last reply Reply Quote 0
                      • DjLeChuck
                        DjLeChuck last edited by

                        @subs : It work's! Perfect thank you. \o/

                        1 Reply Last reply Reply Quote 0
                        • Substring
                          Substring last edited by

                          Thanks for finding a bug ^^will be solved in the next beta

                          Former dev - Please reply with @substring so that i am notified when you answer me
                          Ex dev - Merci de me répondre en utilisant @substring pour que je sois notifé

                          1 Reply Last reply Reply Quote 0
                          • DjLeChuck
                            DjLeChuck last edited by DjLeChuck

                            Thank you for allowing me to use the API on the Pi!

                            P.S. : @subs Comment je marque un topic en résolu ? ^^'
                            EDIT : Bon bah trouvé !

                            1 Reply Last reply Reply Quote 0
                            • lePioo
                              lePioo last edited by

                              Hey, sorry but three years later I have the exact same problem.
                              Should I follow the steps described above ?
                              Or these have been included and my problem is from another source?

                              Ps: Same as DjLeChuck, I've set system.api.enabled = 1 , reboot the Pi and every curl requests failed to connect on local server or Pi itself with local and network addresses

                              1 Reply Last reply Reply Quote 0
                              • MikaXII
                                MikaXII Staff last edited by

                                @lepioo said in API Restful:

                                ow the steps described above ?
                                Or these have been included and my problem is from another source?
                                Ps: Same as DjLeChuck, I've set system.api.enabled = 1 , reboot the Pi and every curl requests failed to connect on local server or Pi itself with local and network addresses

                                Currently the api doesn't work anymore and DjLeChuck doesn't give a sign of life.
                                So we planned to rewrite an api and manager officially maintened by the core team.
                                But currently release first 😛

                                0_1474376961917_FF8_pampa-mikaXII.gif
                                mika@recalbox.com

                                1 Reply Last reply Reply Quote 0
                                • lePioo
                                  lePioo last edited by

                                  I wanna cry... I was preparing a recalbox second screen using this API.
                                  I got some dev skills, maybe if you lead me in the good direction I can help coding the new API? (I have no idea where to begin).

                                  MikaXII 1 Reply Last reply Reply Quote 0
                                  • MikaXII
                                    MikaXII Staff @lePioo last edited by

                                    @lepioo In fact I've not begin the dev yet but the main goals is :
                                    backend api in Rust or golang (I prefer golang) with a less of external lib. There are a lot of lib native for golang.
                                    And a frontend (it will use the api) writen in VueJs or angular 🙂

                                    0_1474376961917_FF8_pampa-mikaXII.gif
                                    mika@recalbox.com

                                    lePioo 1 Reply Last reply Reply Quote 0
                                    • lePioo
                                      lePioo @MikaXII last edited by

                                      @mikaxii I'll look into Golang for the backend but I could help much more with the frontend since I'm used to nodeJS React (no Angular for me ^^).
                                      Thanks

                                      MikaXII 1 Reply Last reply Reply Quote 0
                                      • MikaXII
                                        MikaXII Staff @lePioo last edited by

                                        @lepioo Haha I hate react but every one his preference 😉

                                        But the goals its the core team have the capabilities to maintained themself the manager/api, because there are already 2 versions of manager and one api not maintained anymore by their creators 😞

                                        0_1474376961917_FF8_pampa-mikaXII.gif
                                        mika@recalbox.com

                                        lePioo 1 Reply Last reply Reply Quote 0
                                        • lePioo
                                          lePioo @MikaXII last edited by

                                          @mikaxii Yes I understand, I'll try to make it for my own purpose and I'll let the sources opened anyway.
                                          The API is pretty much important for bartop using (demo mode, easy save/load, etc)

                                          1 Reply Last reply Reply Quote 0
                                          • First post
                                            Last post

                                          Want to support us ?

                                          78
                                          Online

                                          98.6k
                                          Users

                                          28.1k
                                          Topics

                                          187.0k
                                          Posts

                                          Copyright © 2021 recalbox.com