585,888 active members*
4,336 visitors online*
Register for free
Login
IndustryArena Forum > Machine Controllers Software and Solutions > PlanetCNC > [ License ] : Problem with license when using the API
Results 1 to 12 of 12
  1. #1

    [ License ] : Problem with license when using the API

    Hi,

    When I bought the MK3DRV board, I also bought a license.
    All work fine when I only use the PlanetCNC software.
    But I developp a software from the API. And when I used my software or the C# demo, I have an error message within few minutes to say that license is missing or incorrect.

    Could I use the same license file in the both case : Planet CNC software in standalone / my own software ?

  2. #2
    Join Date
    Mar 2017
    Posts
    1310

    Re: [ License ] : Problem with license when using the API

    Use same license.

  3. #3
    Join Date
    Dec 2021
    Posts
    16

    Re: [ License ] : Problem with license when using the API

    I have the same problem on macOS (Catalina, 10.15.7). I tried importing the same license file that works when I launch the app normally, but it doesn't work. In the License List, "(AUTH)" appears after the name of the license name and serial number when I launch the UI via the API.
    I'm counting on getting the API to work and would really appreciate any help.
    SW: 2021.12.08
    HW: 2021.11.15

  4. #4
    Join Date
    Mar 2017
    Posts
    1310

    Re: [ License ] : Problem with license when using the API

    Can you send me code example that I can run to see this problem?

  5. #5
    Join Date
    Dec 2021
    Posts
    16

    Re: [ License ] : Problem with license when using the API

    This is it in a nutshell. I make sure the PlanetCNCMacOS app is not running when my code runs. I have tried just calling the API on the alread-running app, which at least offers the benefit of a valid license, but I was unable to control any of the axes in that case. By calling Run() from the API (as shown below), I can move the axes, but I can't home them, because the invalid license message appears after a single axis is homed and the homing process stops. Also, the license message periodically appears, blocking the UI until it is dismissed.

    If you need me to, I could put together a minimal Xcode project to demonstrate the problem.

    Code:
    dispatch_async(dispatch_get_main_queue(), ^{
    	int running = (IsRunning() || IsRunningExt());
    	if(!running)
    	{
    		Run(false);
    	}
    });
    Thanks,

    Ben

  6. #6
    Join Date
    Dec 2021
    Posts
    16

    Re: [ License ] : Problem with license when using the API

    I admit that I'm not sure what the recommended procedure is for using the API on macOS.
    The API zip archive does not include libraries for Mac, so I added the libraries from PlanetCNCMacOS.app (libPlanetCNCLibMacOS.dylib and libPlanetCNCCoreMacOS.dylib) into my Xcode project, along with the header files from API/Demo_C.
    If embed the libraries in my app, the TNG software is unable to access my custom profile, which I need it to do. If I don't embed the libraries and have my app reference the libraries in PlanetCNCMacOS.app, which is installed in /Applications/PlanetCNC on my Mac, my custom profile is loaded correctly but the TNG software reports a missing or invalid license file (even thought it's accessing the same file it normally does).
    I first encountered these issues with version 2021.08.26, but they persist in the latest version 2021.12.08.

  7. #7
    Join Date
    Dec 2021
    Posts
    16

    Re: [ License ] : Problem with license when using the API

    I have built a minimal Xcode project to demonstrate the license issue, but now I get this error:
    "There is a problem accessing the settings file."
    And, the TNG software won't even connect to the controller hardware when this happens. I'm trying to figure out what's different that would yield such a different result.
    Interestingly, my profile's Description shows up in the title bar of the TNG window, which indicates that it has, in fact, read my profile.

  8. #8
    Join Date
    Dec 2021
    Posts
    16

    Re: [ License ] : Problem with license when using the API

    I have been using API/Demo_C# to understand better how to make use of the API and that's been a helpful reference even though I am using Objective-C. If I could just have the license validation issue solved, I would be in great shape.

  9. #9
    Join Date
    Dec 2021
    Posts
    16

    Re: [ License ] : Problem with license when using the API

    Minimal Xcode project update: If I remove the App Sandbox, which Xcode 12 automatically added in the target's Signing and Capabilities tab, then there's no longer a problem accessing the settings file or communicating with the machine. I can start the homing routine, but after homing the first (Z) axis, I still get the "License is missing or not valid!" message. I also disabled Hardened Runtime, but that didn't solve it, either. If I just run the PlanetCNCMacOS app directly (clicking the icon in the Dock), the license file is recognized as valid.

  10. #10
    Join Date
    Dec 2021
    Posts
    16

    Re: [ License ] : Problem with license when using the API

    Here is a minimal Xcode 12 project for duplicating the problem on macOS Catalina (10.15).
    This project assumes that PlanetCNCMacOS.app is installed in /Applications/PlanetCNC/ (the directory can be changed in the Run Script Build Phase of the Xcode project).
    For linking, it also expects the libraries, libPlanetCNCLibMacOS.dylib and libPlanetCNCCoreMacOS.dylib, to be found in the PlanetCNCTest directory (at the same level as the other code files). I removed the libraries, to keep the zip file small enough to include here (and because they're already present in PlanetCNCMacOS.app and can be copied from there).

  11. #11
    Join Date
    Dec 2021
    Posts
    16

    Re: [ License ] : Problem with license when using the API

    Success!
    All I have to do is not run my app in the debugger and the license is correctly recognized. I'm not sure why that is, but it's good enough for me, for now. Hopefully, the Xcode project I posted will be of some use to someone else looking to get started with the API on macOS.

  12. #12
    Join Date
    Mar 2017
    Posts
    1310

    Re: [ License ] : Problem with license when using the API

    Try running with debugger.
    If TNG detects running debugger then license is not correctly validated.

Similar Threads

  1. TNG License problem
    By DenTarr in forum PlanetCNC
    Replies: 2
    Last Post: 08-13-2019, 08:39 PM
  2. PROBLEM - Netowork License validation failing
    By vincentguerrero in forum MadCAM
    Replies: 4
    Last Post: 10-17-2018, 02:36 PM
  3. license edgecam
    By cncmachine57 in forum EdgeCam
    Replies: 1
    Last Post: 02-25-2014, 08:05 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •