Recent

Author Topic: SMBios Error Trying to create SMBios  (Read 552 times)

kevin.black

  • Full Member
  • ***
  • Posts: 122
SMBios Error Trying to create SMBios
« on: May 09, 2019, 01:38:44 am »
Hi,

Running this on a Parallels VM, Mojave with Lazarus 2.0.0RC3 and the latest (2016?) version of SMBios:

Firstly let me state, I thought SMBIOS was for both Windows and OSX/Linux. If it's only Windows, then therein lies the issue. The lazarus port of SMBIOS states inter alia:
  • Supports RAD Studio 10 Seattle, RAD Studio 10.1 Berlin, RAD Studio 10.2 Tokyo
  • Compatible with FPC 2.4.0+
  • Supports Windows, Linux
I thought it was me, this line creates the ensuing error message (this from the provided sample, my code is essentially the same):

Code: Pascal  [Select]
  1. procedure GetPtrocessorInfo;
  2. Var
  3.   SMBios             : TSMBios;
  4.   LProcessorInfo     : TProcessorInformation;
  5.   LSRAMTypes         : TCacheSRAMTypes;
  6. begin
  7.   SMBios:=TSMBios.Create;      <<<<<<<------THIS IS THE LINE THAT GENERATES THE ERROR

And the error (again from executing the actual sample code provided):

Quote
EOSError:System error, (OS Code 2):     
No such file or directory

I thought this might have been me, note I tried the Actual Sample Code provided and get the same error. I have set the permissions on the app folder to 777, ie/ read/write/execute everyone. Is there some file? that I need to create in some folder somewhere?

Any ideas?

Kevin
« Last Edit: May 09, 2019, 01:45:27 am by kevin.black »

Cyrax

  • Hero Member
  • *****
  • Posts: 727
Re: SMBios Error Trying to create SMBios
« Reply #1 on: May 09, 2019, 06:36:26 am »
From where did you get this SMBIOS package?

kevin.black

  • Full Member
  • ***
  • Posts: 122
Re: SMBios Error Trying to create SMBios
« Reply #2 on: May 09, 2019, 07:47:51 am »
@Cyrax,

From GITHUB here:

    https://github.com/RRUZ/tsmbios

Is there some other place I should get it from? Or if there is another package ( don't see any versions in packages or the OPM, I could be looking at the wrong name)?

Kevin

Cyrax

  • Hero Member
  • *****
  • Posts: 727
Re: SMBios Error Trying to create SMBios
« Reply #3 on: May 09, 2019, 08:00:55 am »
Are you trying to run the sample code under Linux, Windows or MacOS?

avra

  • Hero Member
  • *****
  • Posts: 1530
    • Additional info
Re: SMBios Error Trying to create SMBios
« Reply #4 on: May 09, 2019, 08:23:10 am »
ct2laz - Conversion between Lazarus and CodeTyphon
bithelpers - Bit manipulation for standard types
pasettimino - Siemens S7 PLC lib

kevin.black

  • Full Member
  • ***
  • Posts: 122
Re: SMBios Error Trying to create SMBios
« Reply #5 on: May 10, 2019, 12:55:42 am »
EDIT: Apologies, was the wrong quoted text.

Quote from: cyrax
Are you trying to run the sample code under Linux, Windows or MacOS?

As noted in my Question, on a parallels VM under Mojave (so macOS 14.4).

Cheers,
Kevin
« Last Edit: May 10, 2019, 06:02:09 am by kevin.black »

kevin.black

  • Full Member
  • ***
  • Posts: 122
Re: SMBios Error Trying to create SMBios
« Reply #6 on: May 10, 2019, 12:56:45 am »
Do you get the same error with https://bitbucket.org/avra/ct4laz/downloads/px_tsmbios.zip ?

Not sure, let me get back ASAP. Thanks for the heads-up

Cheers,
Kevin

kevin.black

  • Full Member
  • ***
  • Posts: 122
Re: SMBios Error Trying to create SMBios
« Reply #7 on: May 13, 2019, 06:48:14 am »
@Avra,

Do you get the same error with https://bitbucket.org/avra/ct4laz/downloads/px_tsmbios.zip ?

Not sure, let me get back ASAP. Thanks for the heads-up

The link has samples only and those samples  that are require a package called pl_tsmbios. Note the ZIP file does not contain the package pl_tsmbios. The zip file only contains the examples (so the build immediately fails with a missing package).

I assume this was supposed to contain a different version/package of TSMBios? Is that corrects?

EDIT: OK, I see what's happening, the pl_TSMBIOS is the older TSMBIOS from the Pilot Logic/Code Typhon days circa 2013. When I get on the web and navigate to pl_tsmbios it points me to the GitHub page I referenced previously. The pl_TMSBIOS unit I think is the previous and older version. Regardless, the current version has the issues detailed above.

And it doesn't matter which of the examples I try (well haven't tried all, but have tried several), I get the same error:

Quote
Lindeman:Table 22 Battery Information kevin$ ./BatteryInfo
EOSError:System error, (OS Code 2):
No such file or directory
Press Enter to exit

Anyone have any idea which file or directory TSMBios is looking for. Is it because it is not compatible with, say, Mojave (which may have moved some files around)??


Thanks,
Kevin
« Last Edit: May 13, 2019, 08:51:03 am by kevin.black »

avra

  • Hero Member
  • *****
  • Posts: 1530
    • Additional info
Re: SMBios Error Trying to create SMBios
« Reply #8 on: May 13, 2019, 01:10:12 pm »
@Avra,

Do you get the same error with https://bitbucket.org/avra/ct4laz/downloads/px_tsmbios.zip ?

Not sure, let me get back ASAP. Thanks for the heads-up

The link has samples only and those samples  that are require a package called pl_tsmbios. Note the ZIP file does not contain the package pl_tsmbios. The zip file only contains the examples (so the build immediately fails with a missing package).
There was a scripting error resulting in a missing package. It is corrected now if you still want to try it. I have witnessed many times fixes and/or new platforms support made by PilotLogic, so out of the head I thought that maybe it could be the case once more and worth to check. I am sorry if it was not the case.
ct2laz - Conversion between Lazarus and CodeTyphon
bithelpers - Bit manipulation for standard types
pasettimino - Siemens S7 PLC lib

marcov

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 7071
Re: SMBios Error Trying to create SMBios
« Reply #9 on: May 13, 2019, 01:18:37 pm »
Anyone have any idea which file or directory TSMBios is looking for. Is it because it is not compatible with, say, Mojave (which may have moved some files around)??

Probably it decodes linux specific files in /proc/ where linux stores systeminfo. This is usually not compatible with other *nix.

kevin.black

  • Full Member
  • ***
  • Posts: 122
Re: SMBios Error Trying to create SMBios
« Reply #10 on: May 14, 2019, 01:43:50 am »
@Avra,

I am sorry if it was not the case.

Oh, no problems, I just appreciate the fact that you take the time to try to help me :D

@Marcov

Anyone have any idea which file or directory TSMBios is looking for. Is it because it is not compatible with, say, Mojave (which may have moved some files around)??

Probably it decodes linux specific files in /proc/ where linux stores systeminfo. This is usually not compatible with other *nix.

What's the word I'm looking for, oh yeah 'damn' (well that's the polite one anyway).

Should I ask here or post another question?

         Does anyone know how I can (generically or specifically) get the CPUSerialNumber (on a macOS system), I am converting code that uses it to generate a license file?

That was the only reason I was using TSMBios.

Thanks,
Kevin.....

avra

  • Hero Member
  • *****
  • Posts: 1530
    • Additional info
Re: SMBios Error Trying to create SMBios
« Reply #11 on: May 14, 2019, 10:18:20 am »
Does anyone know how I can (generically or specifically) get the CPUSerialNumber (on a macOS system), I am converting code that uses it to generate a license file?

That was the only reason I was using TSMBios.
Well, I thought that OnGuard might work on OSX, but unfortunately it doesn't according to this package installation matrix:
https://www.pilotlogic.com/sitejoom/index.php/wiki?id=198

However, there is a way to get Mac's serial number from command line, which you might need to work on a little to incorporate into your application:
http://osxdaily.com/2011/04/25/get-mac-serial-number-command-line/
ct2laz - Conversion between Lazarus and CodeTyphon
bithelpers - Bit manipulation for standard types
pasettimino - Siemens S7 PLC lib

kevin.black

  • Full Member
  • ***
  • Posts: 122
Re: SMBios Error Trying to create SMBios
« Reply #12 on: May 15, 2019, 04:03:12 am »
@Avra,

Hey, thanks, I will certainly follow up your link. Having said that, a bit of a rethink to get round the issue:

For what I want, I can probably generate a GUID or simply use the Dropbox ID which is provided and is unique and get a similar effect:) The only problem may be that the server side code (for which I cannot control (at the moment) requires two additional fields (the machine name - I can fudge that with any old name) and the CPUSerial. If it is expecting a CPU Serial in a particular format and within certain bounds (ie. something like 56660000000 to 999923333000) then I'd need to make sure it's of that form. AND if it is checking for uniqueness (I don't know why, but it might), I'd need to generate a random number within the bounds.

Regardless, thanks for your response, I am sure I can use the details elsewhere even if I don't need it here and now.

And thanks to those others that have responded.

Kevin