Use same license.
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 ?
Similar Threads:
Use same license.
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
Can you send me code example that I can run to see this problem?
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.
Thanks,Code:dispatch_async(dispatch_get_main_queue(), ^{ int running = (IsRunning() || IsRunningExt()); if(!running) { Run(false); } });
Ben
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.
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.
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.
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.
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).
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.
Try running with debugger.
If TNG detects running debugger then license is not correctly validated.