Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The MIN Registration number and permit number will be pickup fetched by Ehors based on POS Stations' MAC Addresses.

And the MAC address is from the computer's network interface hardware ID. This means if you have the network interface changed/repaired, you'll get a new MAC address of for the computer.

Due to web browsers aren't allowed to read the MAC address from the computer directly, we need an interface in between to read the MAC address and send it back to the WINX system.

E-HORS Archived WAMP software → https://www.ehors.com/downloads/laragon-wamp.exe

Kindly advise NOT to use RANDOM MAC Address:
Image Added

Requirement:

  • Computer with Windows Operating System
  • Can install WAMP (Windows Apache Management Protocol)

...

  1. Download "Laragon" from this LINK or our fixed archived HERE


  2. Execute the installer downloaded, first option ONLY chose "Run Laragon when Windows Starts", rest uncheck.
  3. Once installation is complete, it should start Larafon in your "Taskbar"
  4. Double-click to open the interface, if the service started, chose "Stop", we'll need to do some quick configuration to Laragon


  5. One-Stop, select the gear icon on the top right of the windows to configure the Laragon
  6. In "General" you should have the setting as follow, except for the "Document Root" and "Data Directory", rest should follow as highlighted
  7. Under Service & Ports, make sure have following service also. Important is the Apache port with "8888"
  8. Mail Catcher and Mail Sender shall disable as we do not need such service as follow:
  9. Once configured, just save by closing this "Preferences" window with the "x" icon on the top right.
    Then you shall "Start All"
  10. If all is correct, you should have this in the Laragon window.
  11. Now we'll put an a "getmac.php" file into the "Root" Directory. Open the WWW root directory by clicking the "Root" Icons
  12. Image Modified

  13. It will open your directory root folder windows and should only have 1 file called "index.php"

  14. Right-click in the opened windows explorer and create a new "text" file in the folder as follows

  15. Highlight the whole file name when creating a new text file as follows, including the file extension

  16. Give it the name "getmac.php", and click away to save the file name

  17. Now right-click on the file name "getmac.php" and edit with notepad.exe

  18. Once you have the file open, copy the following code into the "getmac.php"

    Code Block
    languagephp
    linenumberstrue
    <?php
    header('Access-Control-Allow-Origin: *');
    $Result = array("STATUS" => "", "MAC_ADDR" => "");
    function ReadMacAddressWinCommand()
    {
        global $Result;
        if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
            $GetMacResult = exec('getmac /fo csv /nh | findstr /V /R /C:"disconnected"') or die("UNABLE_EXEC_GETMAC_CMD");
            if ($GetMacResult != "") {
                // First see if can explode out \n and or \r\n
                $ConnectionResults = explode("\n", $GetMacResult);
                // ONLY USe first connection;
                $ActiveConnectionFirst = $ConnectionResults[0];
                // Get Only MAC Address;
                $ConnectionInfo = explode(",", $ActiveConnectionFirst);
                // MAC ADDRESS TAKE OUT "
                $ActiveMacAddress = str_replace('"', '', $ConnectionInfo[0]);
                //
                if ($ActiveMacAddress != "") {
                    $Result["STATUS"] = "OK";
                    $Result["MAC_ADDR"] = $ActiveMacAddress;
                }
            } else {
                $Result["STATUS"] = "CANNOT_GET_MAC_ADDRESS";
            }
        } else {
            $Result["STATUS"] = "NOTN_WIN_SYSTEM";
        }
    }
    if (isset($_REQUEST["CMD"]) && $_REQUEST["CMD"] == "GETMAC") {
        // First test read a fixed txt file
        $FixMacAddressFile = "./StationMacAddress.txt";
        $MacAddressFile = fopen($FixMacAddressFile, "r");
        if ($MacAddressFile) {
            $MacAddressFixed = rtrim(fread($MacAddressFile, filesize($FixMacAddressFile)));
            fclose($MacAddressFile);
            if (preg_match('/^(?:(?:[0-9a-f]{2}[\:]{1}){5}|(?:[0-9a-f]{2}[-]{1}){5}|(?:[0-9a-f]{2}){5})[0-9a-f]{2}$/i', $MacAddressFixed) == 1) {
                $Result["STATUS"] = "OK";
                $Result["MAC_ADDR"] = $MacAddressFixed;
            } else {
                ReadMacAddressWinCommand();
            }
        } else {
            ReadMacAddressWinCommand();
        }
    }
    echo json_encode($Result);
  19. Save the file
  20. Now create another file called "StationMacAddress.txt", using the method in point 13
  21. Click away to save the file name
  22. Open the file "StationMacAddress.txt" with notepad.exe as point 16
  23. Put in your mac address of the POS station as registered in MIN into the file (Example), make sure no "new line" after the mac address
  24. Save this text file.
  25. Save it and that all, you can "test" it by calling from browser: localhost:8888/getmac.php?CMD=GETMAC and should have the following screen.

...

  • For IT personnel test and checking, if the MAC address is correctly pickup fetch by WINX system, you can find the "MACADDRESS" variable from browser debugger:


Double-check the following programs before using the POS terminals. You should see MIN & PTU details and the MAC Address

Image Added

Image Added

Image Added