This is the forum archive of Homey. For more information about Homey, visit the Official Homey website.

The Homey Community has been moved to https://community.athom.com.

This forum is now read-only for archive purposes.

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 Member
    edited October 2017
    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 2017
    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)
  • 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.
  • @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?   




  • 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.
  • @JeroenVollenbrock:  Great, it works !! :D !! VIELEN DANK ....
Sign In or Register to comment.