Welcome to the Athom Community Forum! This is a place to share ideas, ask for help and discuss about Homey in general.

Please read Welcome to the forum to get started.

Newbie development question

Hello and Grüezi, 

I am new to the Homey universe and write with VSCode, my first app, based on your starting guide.

Now I have three fundamental questions:
  • Which port is used for the remote debugger?
  • Does the athome-cli automatically reload the modified JS files?
  • Is there a development guide/tutorial (not the SDK2 doc)?
THX Chris 

Comments

  • lubbertkramerlubbertkramer Moderator, Homey Ambassador
    edited October 9
    cgHome said:
    Hello and Grüezi, 

    I am new to the Homey universe and write with VSCode, my first app, based on your starting guide.

    Now I have three fundamental questions:
    • Which port is used for the remote debugger?
    • Does the athome-cli automatically reload the modified JS files?
    • Is there a development guide/tutorial (not the SDK2 doc)?
    THX Chris 
    Hi and welcome, there are some tutorials here on the forum to be find with the search function but to answer your questions fast:

    Now I have three fundamental questions:
    • Which port is used for the remote debugger?
    No idea, you can see your debug information in the console or use a external library

    • Does the athome-cli automatically reload the modified JS files?
    No, you need to reinstall the app after making changes

    • Is there a development guide/tutorial (not the SDK2 doc)?
    Some on the forum, for the rest all information can be found @ developers.athom.com with the getting started and after that there are some code examples or take a look at the githib of apps from the app store at the recently updated/new apps that are written in SDK 2 
  • cgHomecgHome Member
    edited October 9
    Are you sure ? As I understand it, the apps are based on node.js and you can start it in debug mode by using the command "node --inspect" (see: https://nodejs.org/api/cli.html#cli_inspect_host_port)

    (Sorry because of my bad English, but I translated it all with DeepL. com)
  • MarcoVanDenHoutMarcoVanDenHout Backer - Geek Edition
    The way I work, I open a console (terminal) on my Mac (similar to cmd.exe on Windows), cd to my apps local path, then run athom project --run and it will check, compile, upload and run the app on my Homey. The macOS console then becomes the console for the app, e.g. console.log("this text shows up on my Mac's terminal");
    I use the Atom editor to edit the files and GitHub Desktop to sync with my repository, but of course you can use Visual Studio or any other (text) editor.
  • cgHomecgHome Member
    @MarcoVanDenHout: THX for the info, I also use a Mac

    One problem solved, a new problem found !! :s !!

    I could start the app (node.js) in debug-mode with:

    (app.js)
    // Start Node.js debugger
    process. kill (process. pid,' SIGUSR1');

    But now, I can't connect to the vs-code debugger (ECONNREFUSED) and I can't find anything in the portscan. 

    My question now, are incoming messages blocked by a firewall etc. and if so, how can I enable this port?   




  • JeroenVollenbrockJeroenVollenbrock Moderator, Backer - Geek Edition, Athom
    Hi, the sending a SIGUSR1 enables the debugger, but binds it to the loopback interface. This makes it impossible to connect to it from your computer. Instead, you can use the new inspector api. just add `require('inspector').open(9229, '0.0.0.0', true);` to the top of your app.js, go to `chrome://inspect`, select `configure` and add `yourlocalhomeyip:9229`, or use the vs-code debugger.
  • cgHomecgHome Member
    @JeroenVollenbrock:  Great, it works !! :D !! VIELEN DANK ....
Sign In or Register to comment.